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.

Beginners > How to save more than 64K in SRAM of gba flash cart?

#68737 - KeithE - Thu Jan 26, 2006 4:42 pm

Many flash cartridges have more than 64K of SRAM, but all the instructions I've seen for writing to SRAM say to use addresses between 0x0E000000 and 0x0E00FFFF.

How do you access the rest of the SRAM? Do you just write to the next address sequentially from 0x0E00FFFF until reaching the limit of the cartridge? So, if the cartridge has 128K of SRAM, can you keep writing until address 0x0E01FFFE?

I'm specifically interested in how to do this for the EFA-LINKER and the X-ROM cartridges. Is it different for each cartridge type?

I'm trying to use the GBA to log some data, so I'd like to be able to use all the SRAM that is available.

Thanks.

Keith

#68741 - keldon - Thu Jan 26, 2006 5:02 pm

Check out "Bank Switching (devices bigger than 64K only)" in:
http://nocash.emubase.de/gbatek.htm#backupflashrom

#68747 - KeithE - Thu Jan 26, 2006 5:49 pm

Thank you. I think that makes sense to me. This is how I interpret it:

1) write 0xAA to address 0x0E005555
2) write 0x55 to address 0x0E002AAA
3) write 0xB0 to address 0x0E005555
4) write 0 or 1 to address 0x0E000000

Did I get it right? It seems too simple.

After I have switched to bank 1, I'll be able to write to the second 64K of SRAM using addresses 0x0E000000 through 0x0E00FFFF?

I do know not to use the first or last byte of SRAM.

#68754 - Dwedit - Thu Jan 26, 2006 6:16 pm

None of the information in gbatek applies to bankswitching the SRAM pages on flash cartridges. The method described in your post will just write bytes to sram 4 times.

It is specific to each flash cartridge.

Check the pogoshell source code, or somewhere else on this forum for the answer.
_________________
"We are merely sprites that dance at the beck and call of our button pressing overlord."

#68843 - chishm - Fri Jan 27, 2006 1:43 am

Your other option is to save to it as though it is a 128kB flash save cartridge. This will work for flash carts that have hardware support for flash saves, but not for once that need the program to be patched.
_________________
http://chishm.drunkencoders.com
http://dldi.drunkencoders.com