#171519 - zigg - Tue Nov 24, 2009 2:16 pm
I apologize if this is common knowledge, but I'm not sure where to look.
I'm familiar with the card* routines from libnds that can deal with the saves on DS game cards, but I'm not sure if I can or how to access the saves on GBA game paks.
Any pointers? Thanks!
#171523 - sgeos - Tue Nov 24, 2009 2:43 pm
This is going to depend on the hardware setup of the cart.
SRAM is memory mapped, IIRC.
EEPROM works much differently.
gbatek probably has all of this information.
#171525 - zigg - Tue Nov 24, 2009 3:08 pm
Yeah, there is some info at gbatek, starting here:
http://nocash.emubase.de/gbatek.htm#gbacartbackupsramfram
I'm a little confused though at this section in particular because it refers to running from WRAM, which I don't think is even a DS-mode concept?
Might be showing my ignorance here.
#171527 - zigg - Tue Nov 24, 2009 3:27 pm
SendSave (GBA) has libSave.c, which looks promising as far as existing code goes.
http://chishm.drunkencoders.com/SendSave/index.html
I honestly have no idea if I can expect to run this code in DS mode, though.
#171534 - Dwedit - Tue Nov 24, 2009 7:50 pm
DS uses a different address for the SRAM area. Make sure it's not using the GBA's SRAM address, and you're fine.
Also remember that the SRAM area is 8 bit reads and writes only.
_________________
"We are merely sprites that dance at the beck and call of our button pressing overlord."
#171538 - sgeos - Wed Nov 25, 2009 3:46 am
Let's take a step back. What exactly are you trying to do and why? Presumably you want to read from and write to the save game data of your GBA games?
#171764 - zigg - Tue Dec 22, 2009 3:03 pm
(sorry, I just decided to check back in here, missed your last reply, sgeos)
Yes, that's exactly what I'm looking to do, if possible?not just SRAM but also Flash and EEPROM. If there is any existing DS-mode code to do this, or if it's even possible, I'm not sure where to find it.
I've been meaning to build up some test code to see if the read routines even work?from the looks of things, they might (given the alternative address), the I/O registers appear similar in gbatek, but the memory addresses may have changed.
I've been very busy lately, though, so I haven't had a chance to build any tests.
#171765 - Dwedit - Tue Dec 22, 2009 3:20 pm
If the code for the GBA is using hardcoded addresses, you will need to change the address. No big deal, just change it. If it's using a symbol for the address of SRAM for all accesses of the SRAM area, you don't need to change anything.
_________________
"We are merely sprites that dance at the beck and call of our button pressing overlord."
#171770 - zigg - Tue Dec 22, 2009 3:47 pm
That probably works OK for Flash (changing E000000 to A000000) but I'm not so sure about EEPROM, since it uses addresses at D000000.
Do you have any examples of this working in DS mode I can stare at? Apart from basic SRAM, of course, I'm very confident that will work OK.
#171821 - sgeos - Sun Dec 27, 2009 12:31 am
I guess I would take one of my GBA game and just play around with trying to read and write data. Be prepared to lose the save data. There are databases out there that list the type save game hardware for each cart.