diff options
author | Colin Noga <Tempus@chronometry.ca> | 2012-09-27 22:59:41 -0500 |
---|---|---|
committer | Colin Noga <Tempus@chronometry.ca> | 2012-09-27 22:59:41 -0500 |
commit | 64f38f642113ac4bd5b1d96e76c9ae97965bc416 (patch) | |
tree | 99d9bbf4d577ae2d8a79fcb5f7101df1b57398fe /src/fileselect.S | |
parent | f9afbf1109b30bbc6011e81109b7e11961a4361a (diff) | |
parent | b3c37e5a9ef81250d6554fcbb8089154b4940c9f (diff) | |
download | kamek-64f38f642113ac4bd5b1d96e76c9ae97965bc416.tar.gz kamek-64f38f642113ac4bd5b1d96e76c9ae97965bc416.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 | 88 |
1 files changed, 68 insertions, 20 deletions
diff --git a/src/fileselect.S b/src/fileselect.S index 9f7f396..6ee1c39 100644 --- a/src/fileselect.S +++ b/src/fileselect.S @@ -54,8 +54,7 @@ DFNiceTitle: bctr .extern findTextBoxByName__Q23m2d17EmbedLayoutBase_cCFPCc -.extern NewerWorldNames -.extern NewerWorldCount +.extern findPictureByName__Q23m2d17EmbedLayoutBase_cCFPCc .extern InsertIntIntoTextBox1 .global DFNiceWorldName DFNiceWorldName: @@ -71,22 +70,21 @@ DFNiceWorldName: stw r25, 0x14(r1) mr r20, r4 - # get Newer map number - lbz r6, 0x6FC(r31) - lis r8, NewerWorldCount@h - ori r8, r8, NewerWorldCount@l - lwz r8, 0(r8) - cmpw r6, r8 - bge invalidThing - slwi r6, r6, 2 - lis r7, NewerWorldNames@h - ori r7, r7, NewerWorldNames@l - lwzx r4, r7, r6 - b gotName -invalidThing: - lis r4, InvalidWorld@h - ori r4, r4, InvalidWorld@l -gotName: + # Savefile is in r31 + # World Name field is in r20 + + lis r4, ConvertedWorldName@h + ori r4, r4, ConvertedWorldName@l + mr r3, r4 + mr r5, r31 + li r6, 36 + mtctr r6 +convWNameLoop: + lbz r6, 0x6FC(r5) + sth r6, 0(r3) + addi r3, r3, 2 + addi r5, r5, 1 + bdnz convWNameLoop mr r3, r20 li r5, 0 @@ -95,6 +93,24 @@ gotName: mtctr r12 bctrl + # now set the colours + # Text colours: 0x720, hint colours: 0x728 + lwz r3, 0x720(r31) + stw r3, 0xDC(r20) + lwz r3, 0x724(r31) + stw r3, 0xE0(r20) + + addi r3, r30, 0x74 + lis r4, Picture_00@h + ori r4, r4, Picture_00@l + bl findPictureByName__Q23m2d17EmbedLayoutBase_cCFPCc + lwz r4, 0x728(r31) + stw r4, 0xD8(r3) + stw r4, 0xDC(r3) + lwz r4, 0x72C(r31) + stw r4, 0xE0(r3) + stw r4, 0xE4(r3) + # While we're at it, take care of some other things # r21 shall hold our star coin count; r22 shall hold our exit count # r23 shall hold the level pointer @@ -231,6 +247,22 @@ FSDebugStates: addi r1, r1, 0x10 blr +.global DefaultSavefileInfo +DefaultSavefileInfo: + addi r4, r3, 0x6FC + lis r5, DefaultSavefileInfoData@h + ori r5, r5, DefaultSavefileInfoData@l + lis r6, DefaultSavefileInfoDataEnd@h + ori r6, r6, DefaultSavefileInfoDataEnd@l +DSFICopyLoop: + lwz r7, 0(r5) + stw r7, 0(r4) + addi r4, r4, 4 + addi r5, r5, 4 + cmpw r5, r6 + blt DSFICopyLoop + blr + .align 4 .data @@ -255,10 +287,26 @@ NormalExitStr: .string "<Normal> %d-%d\n" SecretExitStr: .string "<Secret> %d-%d\n" StarCoinCount: .string "StarCoinCount" ExitCount: .string "ExitCount" +Picture_00: .string "Picture_00" .align 4 DFTitle: .short 'F','i','l','e',' ','X',0 -InvalidWorld: -.short '<','I','n','v','a','l','i','d',' ','W','o','r','l','d','>',0 +ConvertedWorldName: +.short 0,0,0,0,0,0,0,0,0,0,0,0 # 12 +.short 0,0,0,0,0,0,0,0,0,0,0,0 # 12 +.short 0,0,0,0,0,0,0,0,0,0,0,0 # 12 +.align 4 +DefaultSavefileInfoData: +.string "Yoshi's Island" #15 +.byte 0,0,0,0,0,0,0,0,0,0,0 # 11 +.byte 0,0,0,0,0,0,0,0,0,0 # 10 +.long 0xFFFF99FF,0x1FB423FF +.long 0x173714FF,0x3C9135FF +.long 0xFFFF99FF,0x1FB423FF +.short 0x75,0x2E,0xB +.byte 0,0 + +DefaultSavefileInfoDataEnd: +.long 0 |