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.

Hardware > SRAM access

#52091 - ZeroX - Fri Aug 26, 2005 2:36 pm

Hi there...

I wanted to ask if anyone knows how to access the SRAM in a GBA cart. I need to know the steps. I do know that you need set the wait state to 8 clocks, then you can directly read 8 bits a time from 0x0E000000.

But im having trouble, i get a whole row of 0xFF. I use ASM. Does anybody have any pointers for me?

I am using this knowledge to implement it in my XBOO XP software, so that xboo cable users can download their cart SRAM from their GBA as backup. When the battery dies out on you, its really disappointing.

In addition, if someone can explain how to access and write to other types of save devices (like EEPROM and FLASH memory), i would be gratefull. This is because i dont own a cart that use these methods of saving data.

#52104 - tepples - Fri Aug 26, 2005 6:20 pm

Are you sure that the cart that you're testing with uses SRAM? A lot of the official Game Paks use flash or EEPROM instead, and I'm guessing that some third-party flash carts lock the SRAM by default to protect savegames from inadvertent modification by other games on the same cart. Do you have F-Zero?
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.

#52118 - ZeroX - Fri Aug 26, 2005 10:43 pm

Yeah, im pretty sure it is SRAM, cause i've changed the battery twice already. No, i dont have F-Zero.

How is the SRAM protected? Or is the SRAM located at a different location?

#52130 - tepples - Sat Aug 27, 2005 1:22 am

With modern GBA flash carts, the SRAM can be bankswitched using registers on the ASIC. I'm guessing that some flash carts' ASICs also allow to disconnect the SRAM from the bus entirely.
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.

#52135 - chishm - Sat Aug 27, 2005 2:28 am

I have already written a program that does this using Xboo Communicator. Check out http://chishm.drunkencoders.com/SendSave for the program and source. It does all save types that I can access, including SRAM, EEPROM and Flash. The routines are modified versions of code people have posted to these boards in the past. I hope it helps.

Last edited by chishm on Mon Mar 20, 2006 3:36 am; edited 2 times in total

#52138 - ZeroX - Sat Aug 27, 2005 4:47 am

How is it that i have missed this? I thought nobody has come up with such a program. Hmm, i must be an idiot.
***Looks at little brother who had a peaceful expression on his face, then kicks him. The cute little brother then transforms into a monkey like god, then beats the crap out of the writer. After a painful and near death experience, the author continues to write***

I'll take a look into the source, and make readjustments to mine where neccesary. I hope i can understand it. I use goldroad to compile my program, intergrate it into my client as an array, then send it to the GBA, then receive the data from the GBA.

You dont mind me scanning your source right?

Cheers.

#54325 - chishm - Sun Sep 18, 2005 9:39 am

ZeroX wrote:
You dont mind me scanning your source right?

Sorry, I forgot to reply. Yes you can scan (or use) my source. It is all completely open source, as the source itself should say.