diff options
author | Colin Noga <Tempus@chronometry.ca> | 2012-10-03 12:55:15 -0500 |
---|---|---|
committer | Colin Noga <Tempus@chronometry.ca> | 2012-10-03 12:55:15 -0500 |
commit | 34efbdba59b460a2f565c25a5ff20efb8d1077a0 (patch) | |
tree | c1729468fd611f9523e3a2bf492363e34c2fb879 /src/fileselect.S | |
parent | c1365802c73376609e53b97440ae037b14f6324f (diff) | |
parent | 21d8492ded507f8f09bc28919b8d351b86fa0dd0 (diff) | |
download | kamek-34efbdba59b460a2f565c25a5ff20efb8d1077a0.tar.gz kamek-34efbdba59b460a2f565c25a5ff20efb8d1077a0.zip |
Merge branch 'level-select' of ssh://treeki.rustedlogic.net:30000/Kamek into level-select
Diffstat (limited to 'src/fileselect.S')
-rw-r--r-- | src/fileselect.S | 53 |
1 files changed, 51 insertions, 2 deletions
diff --git a/src/fileselect.S b/src/fileselect.S index 8e9249e..a10a474 100644 --- a/src/fileselect.S +++ b/src/fileselect.S @@ -263,7 +263,54 @@ DSFICopyLoop: blt DSFICopyLoop blr -.align 4 +.extern SaveFileInstance +.extern SaveFileBuffer +.extern GetBlock__8SaveFileFi +.global FixUpExistingSavefile +FixUpExistingSavefile: + stwu r1, -0x10(r1) + mflr r0 + stw r0, 0x14(r1) + stw r31, 0xC(r1) + + li r31, 0 +fixupNextBlock: + lis r3, SaveFileInstance@h + ori r3, r3, SaveFileInstance@l + lwz r3, 0(r3) + mr r4, r31 + bl GetBlock__8SaveFileFi + + lbz r4, 2(r3) + clrlwi. r4, r4, 31 + beq dontFixThisOne + bl DefaultSavefileInfo +dontFixThisOne: + + lis r3, SaveFileBuffer@h + ori r3, r3, SaveFileBuffer@l + addi r3, r3, 0x6A0 + mulli r4, r31, 0x980 + add r3, r3, r4 + lbz r4, 2(r3) + clrlwi. r4, r4, 31 + beq dontFixThisOne2 + bl DefaultSavefileInfo +dontFixThisOne2: + + addi r31, r31, 1 + cmpwi r31, 6 + blt fixupNextBlock + + lwz r31, 0xC(r1) + lwz r0, 0x14(r1) + mtlr r0 + addi r1, r1, 0x10 + blr + + +#.section .ctors,4 +#.long FixUpExistingSavefile .data FSStateDebugStr: .string "State: %s\n" @@ -305,8 +352,10 @@ DefaultSavefileInfoData: .long 0xFFFF99FF,0x1FB423FF .long 0x173714FF,0x3C9135FF .long 0xFFFF99FF,0x1FB423FF -.short 0x75,0x2E,0xB +.short 0x75 +.byte 0x2E,0xB .byte 0,1 +.byte 0,0 DefaultSavefileInfoDataEnd: .long 0 |