gbadev.org forum archive

This is a read-only mirror of the content originally found on forum.gbadev.org (now offline), salvaged from Wayback machine copies. A new forum can be found here.

DS development > DS Cart to SRAM?

#115655 - thegamefreak0134 - Thu Jan 18, 2007 6:02 am

I recently modified my version of MarioKart DS (I will send you a picture of my original cart if you don't believe I ripped the ROM myself) so that I could play the offline tracks online. This is all fine and good, but apparently the patch I used to do so pointed the save area to the SRAM on the flashcart, which prevents me from using my records and things from the original cart. Is there a program that can take the entire save area of a DS cart and, provided there is enough SRAM to accomidate, copy that save area to the SRAM of the flashcart?

If not, can someone run me through the basics of accessing both areas of memory from DS code on the flashcart so that I can do this myself? Thanks! By the way, I do not have a FAT filesystem compatible adapter, just a regular old flashcart...

-thegamefreak
_________________
What if the hokey-pokey really is what it's all about?

[url=http:/www.darknovagames.com/index.php?action=recruit&clanid=1]Support Zeta on DarkNova![/url]

#115664 - josath - Thu Jan 18, 2007 7:21 am

There have been many posts about this already, (transfering DS save games) try searching a bit. However I don't know if it's possible without a libfat-supported device. Also there's the problem of SRAM size -- SRAM is 64KB, Mario Kart's save is (IIRC) 512KB.

#115669 - Firon - Thu Jan 18, 2007 8:13 am

Modern flashcarts with SRAM have 2mbit of SRAM for DS mode. NDS games don't seem to use more than that.

#115672 - josath - Thu Jan 18, 2007 8:55 am

The problem will be if you want to use some homebrew, or do it yourself, to transfer to/from SRAM. You will only be able to access 64KB unless you know the magic bankswitching commands.

#115745 - thegamefreak0134 - Thu Jan 18, 2007 10:32 pm

Well gee, how hard could it really be? Isn't it just a register that you increment to switch to the next bank? I assume the DS has something similar as well. My problem is, I don't know how to actually access the SRAM from DS code, I keep getting no results on read or write at all. I should really search for a tutorial...

Oh well. Time to fire up the old homebrew spirit again...

-thegamefreak
_________________
What if the hokey-pokey really is what it's all about?

[url=http:/www.darknovagames.com/index.php?action=recruit&clanid=1]Support Zeta on DarkNova![/url]

#115748 - josath - Thu Jan 18, 2007 10:43 pm

The bankswitching register is propritary, and different, for every flashcart. a few are known, but I think most are not.

To access the first 64KB of sram, just read & write (in 8bit chunks only) from 'SRAM'. You may need to use one of the sysSetCardOwner() commands, (at the bottom of nds/memory.h) to set if you are accessing from arm7 or arm9.