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.
Here's my fix for reading VRC2B Famicom Carts (Mapper 23) on HW5. The symptoms were reading incorrect CHR data on VRC2B carts resulting in consistently bad dumps with the wrong CRC32. If you think there is a better way to fix the issue, please feel free to reject. I know that this fixes the specific issue for myself with minimal risk of impacting other mapper types.
Example log with a bad dump of Contra (J):
Instead of bank switching on a single bank and reading 1024 bytes at a time, this update switches 8 banks at a time and reads 8 KiB per iteration. The hypothesis is that the timing between bank switching and reading 1024 bytes at a time is insufficient for the mapper while reading in batches of 8 KiB allows for enough time for the data to be switched and accessible.
This change fixes the ability to dump the following VRC2B Famicom cartridges:
B27B8CF4 -> Contra (Japan).nes
49123146 -> Getsu Fuuma Den (Japan).nes
AC9895CC -> Dragon Scroll - Yomigaerishi Maryuu (Japan).nes
Also verified a VRC4E Famicom Cartridge:
C1FBF659 -> Akumajou Special - Boku Dracula-kun (Japan).nes