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 > Differences between saving to EEPROM and SRAM

#156837 - mca - Wed May 14, 2008 5:18 pm

Hi,

in my app I want to make highscores and profiles saveable.

In the FAQ and one (outdated) tutorial I read the explanation of hte byte-wise memcopy to SRAM .

In the examples from libnds reading/writing with the commands 'cardReadEeprom/cardWriteEeprom'.

What is the difference between the Eeprom and the SRAM?

My goal is to have an 'myappname.sav' file on my sdhc card (inserted in the M3DS Real) to store hiscore and profile data.

Should it be the SRAM or the Eeprom way (.. or is it even the same thing, I wonder...)

Thanks...
mca

#156838 - Dwedit - Wed May 14, 2008 5:33 pm

You want to use Libfat.
_________________
"We are merely sprites that dance at the beck and call of our button pressing overlord."

#156865 - silent_code - Wed May 14, 2008 10:52 pm

i'm also interested in using eeprom saving! ;^D
_________________
July 5th 08: "Volumetric Shadow Demo" 1.6.0 (final) source released
June 5th 08: "Zombie NDS" WIP released!
It's all on my page, just click WWW below.

#156886 - yellowstar - Thu May 15, 2008 4:45 am

Like Dwedit said, libfat, is best, but for EEPROM, see this old post of mine.(You can ignore the DS-X stuff)

Basicly you have cardWriteEeprom(pos,buffer,(u32)Size,type);
pos is where to start the writing/reading in the EEP, buffer is where the data is coming from/headed to, Size amount to read/write, type is the type of the EEPROM.
Reading is the same except with cardReadEeprom, and that you're reading.

#156890 - silent_code - Thu May 15, 2008 8:46 am

thank you, yellowstar. :^D
_________________
July 5th 08: "Volumetric Shadow Demo" 1.6.0 (final) source released
June 5th 08: "Zombie NDS" WIP released!
It's all on my page, just click WWW below.