Skip to content

Fix horizontal offset in high-resolution offset-by-tile mode - #386

Merged
Screwtapello merged 1 commit into
bsnes-emu:masterfrom
Morilli:fix-hires-offset-by-tile
May 23, 2026
Merged

Screwtapello merged 1 commit into
bsnes-emu:masterfrom
Morilli:fix-hires-offset-by-tile

Conversation

@Morilli

@Morilli Morilli commented May 22, 2026

Copy link
Copy Markdown
Contributor

The intuition behind this fix is that if we're in hires mode (bg mode 5 or 6), the background's hoffset needs to be doubled. In ppu-fast, I've just added an additional left-shift to double this value and in the accurate ppu we just do one less shift right (alternatively, we could left-shift both io.hoffset and characterIndex individually).

In ppu-fast, I've applied an additional fix to the "column - 1" logic by replacing 8 with 1 << tileWidth, which is the same for 8x8 tiles and doubled (16) for 16x[8/16] tiles. This seems to be visually accurate based on the opt-big-map6.sfc testrom provided in the original issue.

I believe this is a problem exclusive to bg mode 6 because that's the only hires+offset-by-tile mode.

@Screwtapello
Screwtapello merged commit 7d5aa1e into bsnes-emu:master May 23, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Mode 6 emulation is inaccurate (horizontal scrolling not applied correctly)

2 participants