summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTreeki <treeki@gmail.com>2013-01-25 23:56:44 +0100
committerTreeki <treeki@gmail.com>2013-01-25 23:56:44 +0100
commiteca119e9990e3f10e03212cfe6726c0b69d4d75f (patch)
tree8ec3de78c07172faefedf835c32d9a123c5f4af1 /src
parented317da2d37c1f6b91068c02190d4eb75dfb1453 (diff)
downloadkamek-eca119e9990e3f10e03212cfe6726c0b69d4d75f.tar.gz
kamek-eca119e9990e3f10e03212cfe6726c0b69d4d75f.zip
hopefully this sorts out the clean save issue once and for all
Diffstat (limited to 'src')
-rw-r--r--src/fileselect.S20
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"