I've been curious about how games with battery holds its saved data, becasue the bytes that are here can be valid as well than invalid.
I've traced some code into FF1, FF2 and FF3. FF1 has only one save slot, and it does just check two variables, if the first one is $55 and the segond one $aa the save is considered as "valid" (I think this is a good vay to handle it, because data in a new RAM chip is often $ff and $00, so $aa and $55 are logically the two value that have the smallest chanes to be there randomly in a ram chip when you power it up).
FF2 and FF3 seems to do it a bit more tricky way. I noted in FF2 that $6000-$62ff handles the current data, $6300-$65ff the first slot, $6600-$68ff the segond slot, $6900-$6bff the third one and eventually $6c00-$6eff the fourth one. The programm does add all the value of a whole slot together, then add 1, and the data seems to be valid only if the result of all this is zero. Seems very crazy isn't it ? Then, if this control has been successfull, another value (like $5a) is checked into the slot.
FF3 does this, but in the other order, so it fist check the value of $5a into the slot, then it does that crazy "mega-addition".
Why would this "mega-addition" be needed ? Does anyone have comment/suggetions about it ? I'll be in need to handle that someday for my Ecological Evolution project.
I've traced some code into FF1, FF2 and FF3. FF1 has only one save slot, and it does just check two variables, if the first one is $55 and the segond one $aa the save is considered as "valid" (I think this is a good vay to handle it, because data in a new RAM chip is often $ff and $00, so $aa and $55 are logically the two value that have the smallest chanes to be there randomly in a ram chip when you power it up).
FF2 and FF3 seems to do it a bit more tricky way. I noted in FF2 that $6000-$62ff handles the current data, $6300-$65ff the first slot, $6600-$68ff the segond slot, $6900-$6bff the third one and eventually $6c00-$6eff the fourth one. The programm does add all the value of a whole slot together, then add 1, and the data seems to be valid only if the result of all this is zero. Seems very crazy isn't it ? Then, if this control has been successfull, another value (like $5a) is checked into the slot.
FF3 does this, but in the other order, so it fist check the value of $5a into the slot, then it does that crazy "mega-addition".
Why would this "mega-addition" be needed ? Does anyone have comment/suggetions about it ? I'll be in need to handle that someday for my Ecological Evolution project.