From eca119e9990e3f10e03212cfe6726c0b69d4d75f Mon Sep 17 00:00:00 2001 From: Treeki Date: Fri, 25 Jan 2013 23:56:44 +0100 Subject: hopefully this sorts out the clean save issue once and for all --- src/fileselect.S | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/src/fileselect.S b/src/fileselect.S index a853e76..20acc3e 100644 --- a/src/fileselect.S +++ b/src/fileselect.S @@ -266,12 +266,15 @@ DSFICopyLoop: .extern SaveFileInstance .extern SaveFileBuffer .extern GetBlock__8SaveFileFi +.extern UpdateSavefileChecksums .global FixUpExistingSavefile FixUpExistingSavefile: stwu r1, -0x10(r1) mflr r0 stw r0, 0x14(r1) stw r31, 0xC(r1) + stw r30, 8(r1) + mr r30, r3 li r31, 0 fixupNextBlock: @@ -287,6 +290,7 @@ fixupNextBlock: bl DefaultSavefileInfo dontFixThisOne: + # this is the one whose checksum is checked lis r3, SaveFileBuffer@h ori r3, r3, SaveFileBuffer@l addi r3, r3, 0x6A0 @@ -302,6 +306,18 @@ dontFixThisOne2: cmpwi r31, 6 blt fixupNextBlock + lis r3, SaveFileBuffer@h + ori r3, r3, SaveFileBuffer@l + subi r3, r3, 0x20 + bl UpdateSavefileChecksums + + lis r3, SaveFileInstance@h + ori r3, r3, SaveFileInstance@l + lwz r3, 0(r3) + bl UpdateSavefileChecksums + + mr r3, r30 + lwz r30, 8(r1) lwz r31, 0xC(r1) lwz r0, 0x14(r1) mtlr r0 @@ -309,8 +325,8 @@ dontFixThisOne2: blr -#.section .ctors,4 -#.long FixUpExistingSavefile +.section .ctors,4 +.long FixUpExistingSavefile .data FSStateDebugStr: .string "State: %s\n" -- cgit v1.2.3