News:

11 March 2016 - Forum Rules

Main Menu

SNES SRM Checksums

Started by Sinthet, December 28, 2011, 10:42:26 AM

Previous topic - Next topic

Sinthet

So, I haven't really been into ROMhacking for awhile. To get back into the swing of things, I decided to map out the SRM of Final Fantasy V. I've managed to map out quite a bit of it, but its useless unless I can calculate the correct checksums.

So, Does anyone know which one is needed for the SNES? They are stored as a 2-byte number, so my guess is some flavor or other of crc16. My question is, which one? There are several according to wikipedia.

Extra-Super-Special bonus points if someone knows a program that will calculate it for me, that runs under Linux.

(I know it'll still take some playing around to find exactly what data it uses for the checksum, but I don't want to be using an incorrect version, because then I'll never find it!).

Thanks for your help guys!

KingMike

SRAM checksums are usually game-specific.
Unless someone has already figured it out and posted the formula, you'd need to be able to trace the ASM code.
"My watch says 30 chickens" Google, 2018

Sinthet

Ah... I've seen a couple of guides that specifically mention using the checksum 16 option in Hex Workshop, so I assumed it was ubiquitous. I was hoping not to have to dig through ASM code, but oh well.

Do you have any suggestions/recommendations for SNES debuggers? I'm probably going to go try to get Bsnes working, but if there's better ones that aren't available for Linux I can always use WINE or a virtual machine.

Thanks!

KingMike

I use a tracer. Mostly I use Geiger/EvilPeer's SNES9X tracers. Turn on tracing just before the game reads the save files (such as right before opening the save/load screen) then turn it on after it becomes visible.
Then there should be a giant file with the logged code in the ROM's directory.
You'd need to look for where the game reads the SRAM (SRAM begins at address $70:000).
"My watch says 30 chickens" Google, 2018

Hiei-

A sram editor of Final Fantasy V already have high chances to exist, no?

At least, there are some save states editor (http://www.erick.guillen.com.mx/FFV_SS_Editor.htm) which might get you the same possibilites, then you just have to save the game with the in-game save method.

Except if you want to understand the way the srm works to do a srm editor for example, then my method won't be of any use.

Sinthet

I don't think it exists, at least I couldn't find one with a couple of Google Searches. I'm also not particularly interested in actually editing stuff. I got into computers by doing some basic ROMhacking a long time ago, and recently it sparked my interest again. Mapping out FFV's SRAM and (hopefully) figuring out the checksum thing is my way of getting reacquainted, while also putting some new info out there.

@KingMike
Thanks, I can't get Bsnes to work no matter how hard I try (I've compiled multiple versions, no error messages, just refuses to start, I think its a problem with my laptop's configuration rather than bsnes). Amazingly, Geiger's Snes9x works almost flawlessly (and at full-speed!) despite being run non-natively.


samurai goroh

Quote from: Hiei- on December 29, 2011, 06:44:26 PM
A sram editor of Final Fantasy V already have high chances to exist, no?

At least, there are some save states editor (http://www.erick.guillen.com.mx/FFV_SS_Editor.htm) which might get you the same possibilities, then you just have to save the game with the in-game save method.

Except if you want to understand the way the srm works to do a srm editor for example, then my method won't be of any use.
I would like to see more documents (or tools) for Final Fantasy V, as is one of my favorite RPG games.
BTW, the page you link (and the tool :P) is mine :)

I'm not sure if someone at slickness forum might help you out (never heard of anyone mentioning a thing about the SRAM), but at least they would be glad to see more people interested on hacking this game :)
I'm the best in the universe, remember that [F-zero X]

Sinthet

Thanks for the link, I'll look around there.

I'm hoping I'll be able to reverse engineer the checksum algorithm without too much trouble, I'm fairly comfortable with x86 ASM, so hopefully it'll be more of a question of syntax moreso than anything else.

MottZilla

#8
Unfortunately I couldn't find the source code for my Final Fantasy 4 Wonderswan SRAM editor. CRC probably is not used. It is likely a 16bit checksum which may be byte or word related. The easiest way to determine is to just save two files in a row if it keeps track of the # of saves. This way all the data should be the same except that one field. You can compare the resulting data and use various checksum generators on them to quickly see if its just an 8bit checksum or 16bit. It might be slightly different just depending on their exact code so you might have to write something yourself. Too bad I don't have the source around since they may use the same method.

Edit:
I checked for you. It's a 16-bit checksum with carry. It's a function at $C2/F588. Holds the checksums in the upper part of SRAM too. Shouldn't be too hard to figure out generating your own checksums to modify data freely. Just change the data, $600 bytes, generate the 16bit LSB Adding Checksum with Carry, write it in the Checksum Storage at 1FF0,X.


January 19, 2012, 06:06:39 PM - (Auto Merged - Double Posts are not allowed before 7 days.)

I compiled my notes into a document. Hopefully it will help you with whatever you are doing. http://www.romhacking.net/documents/627/