News: 11 March 2016 - Forum Rules
Current Moderators - DarkSol, KingMike, MathOnNapkins, Azkadellia, Danke

Author Topic: Adding saving of specific memory address (hi score) to a simple DS game?  (Read 1474 times)

matt!

  • Full Member
  • ***
  • Posts: 142
  • JUS4QIX
    • View Profile
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!

FAST6191

  • Hero Member
  • *****
  • Posts: 3052
    • View Profile
Re: Adding saving of specific memory address (hi score) to a simple DS game?
« Reply #1 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.

VicVergil

  • Hero Member
  • *****
  • Posts: 727
    • View Profile
Re: Adding saving of specific memory address (hi score) to a simple DS game?
« Reply #2 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.

FAST6191

  • Hero Member
  • *****
  • Posts: 3052
    • View Profile

matt!

  • Full Member
  • ***
  • Posts: 142
  • JUS4QIX
    • View Profile
Re: Adding saving of specific memory address (hi score) to a simple DS game?
« Reply #4 on: November 06, 2015, 03:16:19 pm »
Great, thanks!