Files
Fiskbit 6203e2e3e9 NES: Improve CHR-NVRAM support. (#158)
* NES: Improve CHR-NVRAM support.

Right now, Mesen uses the NES 2.0 CHR-NVRAM field simply to enable battery saves for the volatile CHR-RAM type, so it only cares if it's zero or nonzero. This means that a game using CHR-NVRAM needs to specify volatile CHR-RAM to get the CHR-NVRAM it's actually requesting. Mesen also doesn't currently distinguish between CHR-RAM types in any way; there is a single CHR-RAM memory type and so it's not capable of saving just some of CHR-RAM. The only contemporary game that uses CHR-NVRAM, RacerMate Challenge II, has both types.

This change makes Mesen sum the two CHR-RAM types and save all of the data. This is still not correct, as it doesn't make sense to specify both types of CHR-RAM for any mapper other than mapper 168, but it will at least allow correctly-specified headers to work. It also allows RacerMate Challenge II to get the full 64 KiB of CHR-RAM (normally 32 KiB of each type) that it requests when using NES 2.0 ROMs, and it now saves however much of this is CHR-NVRAM (either the 2nd half or all of it).

This change also makes the log window print the CHR-NVRAM size as "CHR save RAM" if nonzero.

* Make it always print CHR save RAM size for NES 2.0.
2026-06-03 00:04:27 -07:00
..
2024-01-30 16:40:20 +09:00
2022-09-08 21:29:52 -04:00