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 > #**SAVING**# Can someone help me on this topic please?

#47235 - solarwind__ - Wed Jul 06, 2005 6:11 pm

i have a basic understanding on gba development and i have made a good solid rom. It is basically a sprite that can only move around a given area, the boundary. It also uses a background and the user input, the user controlls the ball.

Basically i want to learn how to save. I want to save a value to a battery file and i want to recall it.

That is all i want to do for now and i will build on that and learn later. If anyone has any code they could paste or any links that they could paste, I would greatly appreciate. Or even better, if ther is a tutorial on saving, that would be a great help.

Thanks in advance!!!
_________________
#solarwind

#47240 - Dwedit - Wed Jul 06, 2005 6:51 pm

GBA SRAM is at E000000-E00FFFF. Have fun!

char* sram=(char*)0xE000000;
_________________
"We are merely sprites that dance at the beck and call of our button pressing overlord."

#47255 - MrD - Wed Jul 06, 2005 8:57 pm

Head towards tepples' GBA Dev FAQ, he's got a routine and info in there that'll be of great use to you!

For my game, all the save data is placed into a large struct, which is then copied bytewise into the 0xE000000 area by a variation on tepples'/sgeos bytecpy() function. For loading, an empty struct is created and is filled with it's SRAM counterpart by the bytecpy().

Make sure you only access the SRAM with variables of u8 size!
_________________
Not active on this forum. For Lemmings DS help see its website.