SSF Hook Backup
Sept 4, 2012 10:01:07 GMT
Post by sorinev on Sept 4, 2012 10:01:07 GMT
I've been writing a savefile editor for my favorite Saturn game and in trying to completely decipher the contents of the file (about 80% done), I've run across something I can't figure out.
When the hook backup library option is checked, SSF creates individual, unpadded files separately for each game. When it is not checked, it does what other emulators do and just writes the savefiles packed into binary files that represent internal memory and external memory. Presumably, exactly as a real Saturn would do.
My problem comes with how the date is represented between the two methods - hook backup vs "real". In the real method, the value representing the date (4 bytes) is the number of minutes elapsed since January 1st, 1980, in big endian format, as you would expect. I've tried this several times at different intervals with several different games and it's consistent.
When hook backup is enabled, it spits the date out as something that I can't figure out. I've tried forwards, backwards, little endian, big endian, and other things, but I can't figure it out. When saving the game in intervals of only a few minutes, only the upper half of the first byte (out of 4) changes, but this didn't really help. So for example, 3D 04 49 10 changing to 6D 04 49 10.
Do you guys know how SSF is recording the date into the file with hook backup enabled? It's still 4 bytes, like the real method, but I can't figure it.
When the hook backup library option is checked, SSF creates individual, unpadded files separately for each game. When it is not checked, it does what other emulators do and just writes the savefiles packed into binary files that represent internal memory and external memory. Presumably, exactly as a real Saturn would do.
My problem comes with how the date is represented between the two methods - hook backup vs "real". In the real method, the value representing the date (4 bytes) is the number of minutes elapsed since January 1st, 1980, in big endian format, as you would expect. I've tried this several times at different intervals with several different games and it's consistent.
When hook backup is enabled, it spits the date out as something that I can't figure out. I've tried forwards, backwards, little endian, big endian, and other things, but I can't figure it out. When saving the game in intervals of only a few minutes, only the upper half of the first byte (out of 4) changes, but this didn't really help. So for example, 3D 04 49 10 changing to 6D 04 49 10.
Do you guys know how SSF is recording the date into the file with hook backup enabled? It's still 4 bytes, like the real method, but I can't figure it.