Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| let window_active = | ||
| self.lcdc.window_display_enable() && self.ly >= self.wy && self.wx <= 166; | ||
| let window_x_origin = self.wx.wrapping_sub(7); |
There was a problem hiding this comment.
Handle WX<7 without wrapping window start
The window X origin is computed with self.wx.wrapping_sub(7) and later compared to x as u8, so any WX value below 7 wraps to 0xF9–0xFF and the using_window check never fires. On real hardware WX−7 can be negative, allowing the window to appear from the left edge when WX is 0–6 (common for HUDs). With the current unsigned wrap the window is completely disabled for those values, so games that place the window at the left edge will render nothing.
Useful? React with 👍 / 👎.
| sprites.push(( | ||
| x as u8, | ||
| y as u8, | ||
| tile, | ||
| SpriteAttrs { |
There was a problem hiding this comment.
Preserve negative sprite X positions
Sprite X positions are calculated as data[base + 1] as i16 - 8 but are immediately cast to u8 when pushed into line_sprites. For sprites whose X is less than 8 (partially off the left edge), this cast wraps negative coordinates to 0xF8+, and the later comparison (x as i16) < (*sprite_x as i16) causes the sprite to be skipped for every screen X. As a result, sprites near the left border never render even though the hardware draws their visible portion.
Useful? React with 👍 / 👎.
Summary
Testing
Codex Task