Viewing Issue Advanced Details
ID Category [?] Severity [?] Reproducibility Date Submitted Last Update
06001 Crash/Freeze Minor Always Jul 28, 2015, 02:44 Dec 5, 2022, 05:26
Tester rainwarrior View Status Public Platform
Assigned To rainwarrior Resolution Fixed OS Windows Vista/7/8 (64-bit)
Status [?] Resolved Driver
Version 0.163 Fixed in Version 0.201 Build
Fixed in Git Commit Github Pull Request #
Summary MESS-specific 06001: nes: iNES Mapper 31 crashes with ROM size other than 1MB
Description The mapper 31 implementation will crash if the ROM size is not 1MB.

512k test ROM: https://dl.dropboxusercontent.com/u/883356/pico.nes
1MB test ROM: http://rainwarrior.ca/projects/nes/2a03puritans.nes

For 512k, the high bit of the 8-bit bank selectors should be irrelevant. Banks 0x7F and 0xFF should select the same bank. 256k and smaller ROMs using this mapper may eventually appear (always a power of 2). I can produce test ROMs of any desired size if necessary.

The relevant file is: mame/src/emu/bus/nes/2a03pur.c

Suggested implementation:

1. Add a bitwise AND mask to the register writes. Line 101: m_reg[offset & 7] = data & mask;
2. Set the appropriate bits for mask during device_start() function based on ROM size at load time.
Steps To Reproduce 1. Open 512k test ROM (pico.nes)
2. Observe immediate crash due to out of bounds memory access.

(After making change, should also verify that 1MB test rom, 2a03puritans.nes still works.)
Additional Information
Github Commit
Flags
Regression Version
Affected Sets / Systems nes
Attached Files
 
Relationships
There are no relationship linked to this issue.
Notes
4
User avatar
No.11902
rainwarrior
Tester
Jul 28, 2015, 02:47
If needed, a specification of the mapper is available at: http://wiki.nesdev.com/w/index.php/INES_Mapper_031
User avatar
No.11921
Tafoid
Administrator
Jul 31, 2015, 15:42
Confirmed using linked test roms.
User avatar
No.11942
rainwarrior
Tester
Aug 5, 2015, 19:36
I've created test ROMs for all possible sizes:
http://rainwarrior.ca/projects/nes/31_test_16.nes
http://rainwarrior.ca/projects/nes/31_test_32.nes
http://rainwarrior.ca/projects/nes/31_test_64.nes
http://rainwarrior.ca/projects/nes/31_test_128.nes
http://rainwarrior.ca/projects/nes/31_test_256.nes
http://rainwarrior.ca/projects/nes/31_test_512.nes
http://rainwarrior.ca/projects/nes/31_test_1024.nes
User avatar
No.15342
Osso
Moderator
Aug 24, 2018, 12:30
Fixed by Brad Smith (rainwarrior): https://github.com/mamedev/mame/commit/af9a224f5906cbfbf253612f7f05b5740154bfac