• Welcome to SCdev.org. Please log in.

Welcome to the new SCdev forums!

persisting SRAM on homebrew

Started by sg, August 07, 2006, 02:50:54 AM

Previous topic - Next topic

sg

I am doing some homebrew dev for the ds and want to persist the high scores / progress so that when I power off, I don't lose it.

I am using ratx's Magic Homebrew Patcher which works great to get the game working on real h/w, but I can't seem to run it through the supercard software to patch it for game saves...get some access violation error.

Anyone know how I can do this?  I am using PA Lib's SRAM Save features:
http://www.palib.info/Doc/PAlibDoc%20Eng/group___saves.html

Thanks in advance!
umiguchi

ratx

Only the supercard miniSD has a battery backed SRAM I'm afraid. I think you'd be better off adding FAT support and writing the hi score data direct to CF/SD.

Scor

Or use the sram save option and tell everyone with a supercard to save the sram when they are done.

sg

Only the supercard miniSD has a battery backed SRAM I'm afraid. I think you'd be better off adding FAT support and writing the hi score data direct to CF/SD.
I don't think I need a battery to do this...it works fine for GBA games - puts the data in the .sav file right....also works for other DS games like DS Academy - using the .sav file.

QuoteOr use the sram save option and tell everyone with a supercard to save the sram when they are done.
This is what I want to do, but can't get it to work....
When I try to patch my game with the supercard software to get the .sav file - I get the access violation error.

EDIT - ok - so If I just copy/rename some other games .sav file and then when my game is over, restart my DS and manually save works...is there no way to patch a hombrew game to do this automatically?
umiguchi

ratx

>I don't think I need a battery to do this...

No you're right but without using FAT access to write to SD/CF how are you going to save the scores otherwise? your thread title after all is "persisting SRAM" ;)

> is there no way to patch a hombrew game to do this automatically?

No not at present, you have to implement the saving yourself for DS homebrew...  ( or use SRAM )

sg

Thanks for the advice guys - using the trick where you restart the ds and manually saving seems to work ok...

I know when I was developing for GBA, and patched my game with the supercard software it would work great if I used HAMlib for my development.  It allowed me to do saves and real time saves - but if I just used devkitarm - it didn't work.....

I wish it was this simple for DS homebrew...I am using PA Lib, as many people are - perhaps a the supercard software can be updated to patch PAlib projects??

I have no idea how its done, so ...its just my wish!
umiguchi

MrD

Don't do anything: just use SRAM.

I find SRAM to be the most compatible solution across all flash carts and cards for saving small amounts of data. There should be no flashcart or card that doesn't have some way of storing persistent SRAM data over multiple power-ons.

If folks don't understand that their particular hardware doesn't have persistent SRAM, then they should read up about what they're using! :P