Fix MEM2 in the memory viewer in physical mode #9912
Merged
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.
Previously, looking at MEM2 in the physical mode (at 10000000) would show all zeros. However, the search feature would match the actual data. This happened because ReadU8 and WriteU8 did not account for the accessor's base offset (though search did). I'm somewhat surprised it didn't just crash in this case.
Note that effective mode (where MEM2 is at 90000000) worked properly before in most cases. The one exception I know of is with the FIFO player, where nothing seems to be mapped at 90000000; this is probably because fifologs don't store BATs. However, graphics-related logic all operates on physical addresses, so I'm not going to worry about that for now.
This change should have no impact on emulation, only on the memory viewer.