+  RHDN Forum Archive
|-+  Romhacking
| |-+  ROM Hacking Discussion
| | |-+  Adding SRAM to a NES ROM...
Pages: [1]
Author Topic: Adding SRAM to a NES ROM...  (Read 2 times)
Vanya
Guest
« on: October 31, 2008, 01:51:21 am »

... what would it take and what would I need to know to do it?

Would I have to be using a certain mapper to be able to use saves?

I'm asking for my MM5 hack. There are may asking for this feature and I'd like to deliver. =)
KingMike
Guest
« Reply #1 on: October 31, 2008, 08:15:37 am »

You can add it to most mappers.
Gideon Zhi
Guest
« Reply #2 on: October 31, 2008, 08:47:30 am »

Recoding the game to do something WITH the sram is another story. Enabling it, I think, is generally pretty simple.
Disch
Guest
« Reply #3 on: October 31, 2008, 10:09:11 am »

MM5 already uses mapper 4 - which can use SRAM just fine, assuming you turn it on.

Read:  Basic asm knowledge required

1)  Turn on the "battery backed" bit in the header (bit 1 of offset 0x00006).  This is what tells the emulator to create the .sav file for this game.

2)  Assuming MM5 doesn't already do it, Enable PRG-RAM by writing $80 to $A001 sometime at game startup -- like in the Reset code (read:  not offset 0xA001 -- I'm talking about an in-code asm change)

3)  Write the data you want saved anywhere to RAM at $6000-7FFF that isn't already being used by the game

4)  When loading a game, simply read the data from $6000-7FFF just as you would normally
KingMike
Guest
« Reply #4 on: October 31, 2008, 03:00:47 pm »

Of course, the tricky thing would be figuring out where the data from the passwords goes into RAM.
(luckily I think all the Mega Man password schemes have been cracked. So that's a bit less work, but you'd probably still need to work out the binary representation.)
Vanya
Guest
« Reply #5 on: November 01, 2008, 04:09:58 pm »

That sounds a lot easier than I thought it would be. Thanks a lot for the info, guys! ^_^

Having multiple files would just be a matter of coding the game to read/write to certain areas in $6000 - 7FFF, right?

Disch
Guest
« Reply #6 on: November 01, 2008, 04:47:28 pm »

yup.
Vanya
Guest
« Reply #7 on: November 01, 2008, 07:45:13 pm »

Excellent!  Grin
Pages: [1]  


Powered by SMF 1.1.4 | SMF © 2006-2007, Simple Machines LLC