Fix load16bit boundary check when reading across RAM/mapper boundary#554
Merged
Fix load16bit boundary check when reading across RAM/mapper boundary#554
Conversation
The load16bit method had an off-by-one boundary check (addr < 0x1fff instead of addr < 0x2000) that caused incorrect behavior when reading a 16-bit value where the low byte is in RAM ($1FFF) and the high byte is in PPU register space ($2000). Also fix the same bug in JMP indirect (case 12) addressing mode. Both are now fixed by routing each byte through load(), which correctly handles RAM, PPU registers, APU, and cartridge addresses. Fixes #285 Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
f15dc12 to
67ff70c
Compare
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.
Summary
load16bit()that caused incorrect behavior when reading 16-bit values across the RAM/mapper boundary at $2000loadDirect()load()for proper PPU register handlingTesting
Fixes #285