diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/fileselect.S | 20 |
1 files 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" |