I just want to explain how my sram works in this game, in regards to MMC5. But first a brief explanation to how the original Legend of Zelda works.
First, The Legend of Zelda heavily uses $6000-$7FFF for PRG-RAM, since 3 quarters of the $C000-$FFFF rom bank are occupied with DPCM samples.
With The Legend of Link, I use the MMC5 mapper which allows me to have 4 individual SRAM pages, 2000 bytes each.
The MMC5 uses the register $5113, to swap out the SRAM pages. Since my game only uses 3 save files, I only use the first 6000 bytes. (3 SRAM pages of 2000 bytes each)
Now here is how I accomplish creating the additional 2 SRAM pages without crashing the rom (at least on all 3 major PC emulators FCEUX, Nestopia & Nintendulator)
After you exit the title screen, the 1st sram page gets all of the PRG-RAM installed, and various other values. This is how the original Zelda does this. Now, once the SRAM page is finished being stored, the rom is then supposed to initiate the Registration Screen. In my game, I create a sub routine to custom asm, to prepare the creation of the other 2 SRAM pages. What I do, is copy the first byte of the first address of
Page 0 in $5113, and then I swap out
Page 0 to
Page 1, and then I paste the value to the same address in
Page 1, then I swap out
Page 1 and load
Page 2 and then paste the same value to the same address within
Page 2. Then I bring back
Page 0, load the next value from the next address, and I repeat this entire process until all 2000 bytes from
Page 0 have been copied into
Page's 1 & 2.
The end result, is this file i'm linking for all to see.
http://www.filedropper.com/zelda-thelegendoflink You need a hex viewing program to see it. But this file shows 2 carbon copies of the first 2000 bytes, when the registration screen comes on.
$0-$1FFF SRAM Page 0 $5113 mmc5 (File 1)
$2000-$3FFF SRAM Page 1 $5113 mmc5 (File 2)
$4000-$5FFF SRAM Page 2 $5113 mmc5 (File 3)
$6000-$7FFF BLANK. NOT IN USE.
So when on the registration screen after all has been created, you cycle through the files with the D-PAD. When on File 1, that's showing the first 2000 bytes of the SRAM/mmc5's $5113, which is occupying the NES's $6000-$7FFF addresses. When you select File 2, the game swaps out mmc5's $5113's Page 0, to Page 1, which is $2000-$3FFF in the SRAM, and then has that occupying the NES's $6000-$7FFF addresses. When you select File 3, the game swaps out the mmc5's $5113's Page 1, to Page 2, which is $4000-$5FFF in the SRAM, and then has that occupying the NESs $6000-$7FFF addresses.
I've done extensive tests with this on all 3 PC emulators. All 3 emulators store, swap, save, load, everything correctly.
I hope this information helps in regards to real MMC5 hardware.