Author Topic: How to Fix Save File (Checksum)?  (Read 8583 times)

antd

  • *
  • Posts: 49
    • View Profile
How to Fix Save File (Checksum)?
« on: 2012-11-18 22:42:31 »
I want to corrupt a save file and then be able to load it (PSX version).

I have successfully corrupted a save file. However, I cannot load it because it says 'file ruined'.

I have read that it is possible, by changing the 'window colour' values, to fix the checksum and load a corrupted save file.
I've also found that the window colour can change when attempting to load a corrupted save file....

Does anyone here know how to do this? Or how I can find out which 'window colour' settings to use to fix the file?

Thanks! :D
« Last Edit: 2012-11-18 23:23:28 by antd »

Vgr

  • Global moderator
  • *
  • Posts: 2163
  • If it quacks like a duck, it must be a duck
    • View Profile
Re: How to Fix Save File (Checksum)?
« Reply #1 on: 2012-11-19 01:51:30 »
Stop breaking FF7!

More seriously, I have heard of something similar before, so it probably isn't impossible. But I don't know if it's possible.

sithlord48

  • *
  • Posts: 1635
  • Dark Lord of the Savegame
    • View Profile
    • Blackchocobo
Re: How to Fix Save File (Checksum)?
« Reply #2 on: 2012-11-19 04:23:21 »
I want to corrupt a save file and then be able to load it (PSX version).

I have successfully corrupted a save file. However, I cannot load it because it says 'file ruined'.

I have read that it is possible, by changing the 'window colour' values, to fix the checksum and load a corrupted save file.
I've also found that the window colour can change when attempting to load a corrupted save file....

Does anyone here know how to do this? Or how I can find out which 'window colour' settings to use to fix the file?

Thanks! :D

open the file in Black Chocobo and save it , it should fix your checksum.

or you would like to see code for how to make the checksum

Code: [Select]
int FF7Save::ff7__checksum( void* qw )
{
   int i = 0, t, d;
   long r = 0xFFFF, len = 4336;
   long pbit = 0x8000;
   char* b=(char*)qw;

   while( len-- ) {
      t = b[i++];
      r ^= t << 8;
      for(d=0;d<8;d++) {
         if( r & pbit )
            r = ( r << 1 ) ^ 0x1021;
         else
            r <<= 1;
      }
      r &= ( 1 << 16 ) - 1;
   }
   return (r^0xFFFF)&0xFFFF;
}

Vgr

  • Global moderator
  • *
  • Posts: 2163
  • If it quacks like a duck, it must be a duck
    • View Profile
Re: How to Fix Save File (Checksum)?
« Reply #3 on: 2012-11-19 21:37:36 »
Just saying, a TAS disallows any use of external tools such as a save editor or even memory editor. Everything has to be redoable. Inside the emulator. That's probablu why he asks.

antd

  • *
  • Posts: 49
    • View Profile
Re: How to Fix Save File (Checksum)?
« Reply #4 on: 2012-11-19 21:54:43 »
I see!

Another question:
Currently the save mechanism saves the FieldID (2bytes) in 1 frame.

Are there any thoughts on how to get this to save in 2 frames? (1 byte in one frame, the other byte in the next frame)

If it can be done in 2 frames, instead of 1, I will be able to skip most of the game by manipulating the FieldID via a corrupt save.

nfitc1

  • *
  • Posts: 3011
  • I just don't know what went wrong.
    • View Profile
    • WM/PrC Blog
Re: How to Fix Save File (Checksum)?
« Reply #5 on: 2012-11-19 21:59:26 »
It's probably impossible in a frame-advancing emulator. It would require millisecond timing to do such a thing even in real-time. Even so, each 'frame' isn't considered fully processed until all the background processing is finished too.

sithlord48

  • *
  • Posts: 1635
  • Dark Lord of the Savegame
    • View Profile
    • Blackchocobo
Re: How to Fix Save File (Checksum)?
« Reply #6 on: 2012-11-20 01:52:23 »
Just saying, a TAS disallows any use of external tools such as a save editor or even memory editor. Everything has to be redoable. Inside the emulator. That's probablu why he asks.

1. what is a TAS ?
2. where do you see this in his post?

nfitc1

  • *
  • Posts: 3011
  • I just don't know what went wrong.
    • View Profile
    • WM/PrC Blog
Re: How to Fix Save File (Checksum)?
« Reply #7 on: 2012-11-20 13:53:14 »
1. what is a TAS ?

Tool-Aided Speedrun/Superrun. Basically playing a game frame-by-frame and being able to save/load whenever to play a game from beginning to end as fast as possible. There's a website devoted to them.

2. where do you see this in his post?

It's not, but in the aforementioned website he's listed as the author of one of the more anticipated runs. FFVII hasn't been done, but FFVIII and FFIX have. The only pre-PS2 FF not done is 2. I'm sure that would be easy enough to do.

antd

  • *
  • Posts: 49
    • View Profile
Re: How to Fix Save File (Checksum)?
« Reply #8 on: 2012-11-20 16:50:00 »
It's probably impossible in a frame-advancing emulator. It would require millisecond timing to do such a thing even in real-time. Even so, each 'frame' isn't considered fully processed until all the background processing is finished too.
A snes emulator was modified to allow "mid-frame resets". Essentially it allowed the author of the glitched chrono trigger run to do what I'm trying to do in ffvii.

But it seems there is almost no chance of this being implemented in the current psx tas emulator.

Oh well!  :-X

nfitc1

  • *
  • Posts: 3011
  • I just don't know what went wrong.
    • View Profile
    • WM/PrC Blog
Re: How to Fix Save File (Checksum)?
« Reply #9 on: 2012-11-20 18:15:09 »
A snes emulator was modified to allow "mid-frame resets". Essentially it allowed the author of the glitched chrono trigger run to do what I'm trying to do in ffvii.

Wouldn't the playback have to happen on the same type of modified emulator? I thought the recorded commands were stored by frame. I'm not much of an authority on emulators either way.

No one believes that I had a hand in the existence of TASes anyway.  :cry:

antd

  • *
  • Posts: 49
    • View Profile
Re: How to Fix Save File (Checksum)?
« Reply #10 on: 2012-11-20 20:13:48 »
Wouldn't the playback have to happen on the same type of modified emulator? I thought the recorded commands were stored by frame. I'm not much of an authority on emulators either way.

No one believes that I had a hand in the existence of TASes anyway.  :cry:
Yup. Playback requires that specific emulator build.