Repository navigation
Fix horizontal offset in high-resolution offset-by-tile mode - #386
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The intuition behind this fix is that if we're in hires mode (bg mode 5 or 6), the background's
hoffsetneeds 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 bothio.hoffsetandcharacterIndexindividually).In ppu-fast, I've applied an additional fix to the "column - 1" logic by replacing
8with1 << tileWidth, which is the same for 8x8 tiles and doubled (16) for 16x[8/16] tiles. This seems to be visually accurate based on theopt-big-map6.sfctestrom 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.