PRG RAM battery backup and SOROM

This is an archive of a topic from NESdev BBS, taken in mid-October 2019 before a server upgrade.
View original topic
PRG RAM battery backup and SOROM
by on (#81045)
I'm rewriting MMC1 emulation and I don't understand well one thing. I tried Genghis Khan which is a SOROM (http://bootgod.dyndns.org:7777/profile.php?id=919) and according to the wiki only the last PRG RAM chip is packed battery, so why if I make a save during the game, reset and try to load data, the game tell me that no data saved? I've also tried Romance of the Three Kingdoms and there are the some problem (tried with nestopia and nintendulator). Maybe are the first PRG Ram chip to be battery packed?

by on (#81056)
No, it's the last chip, I've found the problem an now data are saved and loaded correctly. Sorry for the disturbance.

by on (#81059)
You could explain the mistake you made to help others that may make the same one.

by on (#81060)
Of course. In my emu the problem was theat i don't have implemented correct what the wiki explain well:

Code:
SOROM, SUROM and SXROM
CHR bank 0 (internal, $A000-$BFFF)

4bit0
-----
PSSxC
||| |
||| +- Select 4 KB CHR RAM bank at PPU $0000 (ignored in 8 KB mode)
|++--- Select 8 KB PRG RAM bank
+----- Select 256 KB PRG ROM bank

The SOROM board only implement the upper S bit, while the SUROM board only implements the P bit.

Once properly emulated the switch of 8 KB PRG RAM bank everything work properly.