Romhacking.net

Romhacking => Newcomer's Board => Topic started by: matt! on November 03, 2015, 07:39:12 pm

Title: Adding saving of specific memory address (hi score) to a simple DS game?
Post by: matt! on November 03, 2015, 07:39:12 pm
Game is MaBoShi (DS download game from Wii version, I have the ROM)

Previously (18 months ago) discussed I had isolated some variables through cheat finder in DeSmuME:
http://www.romhacking.net/forum/index.php?topic=17865.0

I've read these two topics about the same goal on NES and GB:
http://www.romhacking.net/forum/index.php/topic,20630.0.html
http://www.romhacking.net/forum/index.php?topic=17979.0

Any pointers or quick wins how, on DS, I can save a specific memory address any time it changes?

Thanks!
Title: Re: Adding saving of specific memory address (hi score) to a simple DS game?
Post by: FAST6191 on November 03, 2015, 09:11:59 pm
Much of what was said for the GB at least still applies here, however I can not say I have had to consider this for the DS before (I might have had I done some save hacking but I kind of missed out there, and then the ARM7 swap dodged it when it came back the second time).

Anyway you want a way to copy a score value to save memory, and load it back. If it was normal memory it would be fine but save memory I would instead suggest you only save when existing to menu or something (there is a reason why turning off a game without exiting might not save data, and at the same time the save is relatively slow and you tend not to want to be constantly writing it anyway). In many DS games there will probably be a part of the binary that handles saves but if this started life as download play then such functionality might well have been excised from the code and you will have to go to hardware. The same guy that is responsible for a lot of the pandocs for the GB/GBC is also responsible for the GBA and DS ( http://problemkaputt.de/gbatek.htm#gbacartbackupids in this case being the thing you want).

But yeah find a point at which you can add some code, change the ROM to think it is a save using ROM (if only to be nice to flash carts and emulators), at said points add a function that reads from or writes to the save memory -- it should only be a few instructions.
Title: Re: Adding saving of specific memory address (hi score) to a simple DS game?
Post by: VicVergil on November 06, 2015, 11:29:32 am
I remember about a special version of Desmume (something 2 years ago) which locates all unchanging RAM addresses in a given game.
Title: Re: Adding saving of specific memory address (hi score) to a simple DS game?
Post by: FAST6191 on November 06, 2015, 12:49:35 pm
The desmume build can be found https://gbatemp.net/threads/unofficial-desmume-build-unused-memory-finder-tool.349332/
Title: Re: Adding saving of specific memory address (hi score) to a simple DS game?
Post by: matt! on November 06, 2015, 03:16:19 pm
Great, thanks!