Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for VRC2B Famicom Carts #998

Merged
merged 1 commit into from
Jul 27, 2024
Merged

Fix for VRC2B Famicom Carts #998

merged 1 commit into from
Jul 27, 2024

Conversation

andy-miles
Copy link
Contributor

@andy-miles andy-miles commented Jul 26, 2024

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):

Saving to NES/ROM/Contra/481/...
[*******************]
CRC32... 6F0B8DB7 -> Not found

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

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
@sanni sanni merged commit 7c9a1b6 into sanni:master Jul 27, 2024
5 checks passed
@andy-miles andy-miles deleted the custom branch November 28, 2024 16:19
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.

2 participants