#16111 - DarkPhantom - Sun Feb 08, 2004 6:05 pm
When you go to flash a ROM image, The EZ Flash Advance flasher program auto detects the size of the SRAM (from just the ROM image) for all commerical gamepaks and some of the non-commerical games paks I've seen. My own programs, always come up "0k" for the SRAM size (which I have to set manually before flashing). Every resource I've found on writing to SRAM (or EEPROM or whatever else) doesn't mention how a gamepak specifies whats size/type of SRAM chip is has. This information doesn't seem to be stored in the GamePak header either. Anybody know?
#16114 - tepples - Sun Feb 08, 2004 7:49 pm
I'm guessing based on what I've read that commercial GBA games contain "magic cookie" strings from the official libraries. These strings roughly correspond to what save type the cart's PCB contains. Some other consoles' binary image formats (such as .nes) have headers outside the ROM space that define save type and other cart features.
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.
#16115 - torne - Sun Feb 08, 2004 8:34 pm
There are indeed magic strings that specify which save type and library is in use, and that is what is detected by most (all?) flashing software. The strings are listed on the advanced search page on PIRACY-DOT-COM, amongst many other places; they come from the Nintendo backup library which is distributed with the SDK.
#16116 - torne - Sun Feb 08, 2004 8:35 pm
Oh, also; the strings are not in any kind of header or fixed location, they're just somewhere in the image, wherever the backup library got linked. AFAIK the strings are only there for version identification purposes at N and at the developer.
#16117 - dagamer34 - Sun Feb 08, 2004 9:06 pm
So how would we go about putting one of these string into a binary? Or is it just one of those official dev kit things we are going to have to live without?
_________________
Little kids and Playstation 2's don't mix. :(
#16121 - torne - Mon Feb 09, 2004 1:15 am
Look up what a vaguely appropriate string is (try SRAM_V113) and just literally paste that string into your ROM, anywhere at all. Just make a const char array with it in, and it should be detected. Don't use a flash or eeprom one, obviously, as the linker software will probably try to patch your rom.
I've never actually tried this, but that's how my save patch utility detects different versions of the N backup library. =)
#16122 - DarkPhantom - Mon Feb 09, 2004 1:42 am
So, does anybody know where we can get a listing of what those strings are because I've looked through a couple of ROMS (and the EZ Flash Executable) and I can't find anything that looks like that.
#16127 - torne - Mon Feb 09, 2004 10:16 am
Pocketheaven's search page has all the save strings used in commercial roms listed, but it should work with the one I just said (there's no difference between the SRAM save libs as far as the flash util is concerned).
#16150 - dagamer34 - Mon Feb 09, 2004 11:14 pm
I have tried it and it doesn't seem to be working. Maybe its something else?
_________________
Little kids and Playstation 2's don't mix. :(
#16154 - DarkPhantom - Tue Feb 10, 2004 12:01 am
What is the url for PIRACY-DOT-COM? I tried www.piracy.com and I don't think that is what you are talking about. I can find a search link on that page.
_________________
"head straight for your goal by any means
there is a door that you've never opened
there is a window with a view you've never seen
get there no matter how long it takes"
-Theme of Shadow, Sonic Adventure 2
#16157 - torne - Tue Feb 10, 2004 12:08 am
dagamer34 wrote: |
I have tried it and it doesn't seem to be working. Maybe its something else? |
Don't know. All the save patching utils I've seen the code for use just the string; the flash util may be looking for something else. There's no other characteristic bytes, afaik, other than the actual code for the save library itself; but I could be wrong. If I find anything out I'll let you know.
DarkPhantom: PIRACY-DOT-COM's main page is now just an index of the sites they host as they have 'closed'; the page I was referring to is the release list, which used to be the front page. Sorry for not being more specific.
#16161 - dagamer34 - Tue Feb 10, 2004 12:39 am
Finally got it to work. Declare it somewhere in your code exactly like this:
const char* saveType = "SRAM_V113";
_________________
Little kids and Playstation 2's don't mix. :(
#16163 - torne - Tue Feb 10, 2004 12:45 am
Aah, cool. That saves me having to try anything. =)
#16164 - dagamer34 - Tue Feb 10, 2004 12:49 am
Good!
While we are on the topic of save types, what is the difference between all the versions??
Like i see SRAM_V113, whats the difference from SRAM_F_V100 and all the other SRAMs?
Seems like a lot.
_________________
Little kids and Playstation 2's don't mix. :(
#16165 - torne - Tue Feb 10, 2004 1:02 am
As far as any homebrew code or flash linker is concerned, nothing at all. SRAM games do not need to be patched on any cart and thus need no special processing.
The differences: Commercial games developed using the official Nintendo SDK are not allowed to use direct access to savegame memory. This is so that N can change the way the save hardware works if neccecary, and games that are still under development don't have to spend developer effort on updating the code. Instead, the N backup library takes care of it for you, providing a standard API for SRAM, a standard API for Flash, and a standard API for EEPROM (the usage patterns for the three are different enough to make cramming them into a single interface undesireable). The backup library is, like all code that's actively developed, released in new versions from time to time, thus giving you different version numbers. Of all the save types listed on ph, which corresponds approximately to all the versions currently in use by commercial games, the only significant differences is the type of memory and the save size. AFAIK there is no difference between SRAM and SRAM_F (their version ranges are discontiguous which suggests that it was simply renamed).