summaryrefslogtreecommitdiff
path: root/src/fileselect.S
diff options
context:
space:
mode:
authorTreeki <treeki@gmail.com>2012-09-27 04:40:34 +0200
committerTreeki <treeki@gmail.com>2012-09-27 04:40:34 +0200
commit411c5a8e210b5cbca330a5438e2406dbe1ffecab (patch)
treee3df3b98058dc979b759080504f52cd88e68d2b4 /src/fileselect.S
parent014f3668eb47b1576bdc182b1db00417f9938cf1 (diff)
downloadkamek-411c5a8e210b5cbca330a5438e2406dbe1ffecab.tar.gz
kamek-411c5a8e210b5cbca330a5438e2406dbe1ffecab.zip
made world changes work, and HUD colourising and other fun things
Diffstat (limited to 'src/fileselect.S')
-rw-r--r--src/fileselect.S59
1 files changed, 39 insertions, 20 deletions
diff --git a/src/fileselect.S b/src/fileselect.S
index 9f7f396..16a1047 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
@@ -255,10 +271,13 @@ 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