summaryrefslogtreecommitdiff
path: root/src/fileselect.S
diff options
context:
space:
mode:
authorTreeki <treeki@gmail.com>2012-09-16 20:13:29 +0200
committerTreeki <treeki@gmail.com>2012-09-16 20:13:29 +0200
commit7cccf6fd2715cd1fae9745ae2b15c077a97e4e2f (patch)
treec79a81d147511fcad842e8f1a64d9c0e58828ebb /src/fileselect.S
parentbe31f99777d00238151df5851042a9e896d24f74 (diff)
parenteb4b6edcbef13c80b0051abe9dc89c93e7a960d0 (diff)
downloadkamek-7cccf6fd2715cd1fae9745ae2b15c077a97e4e2f.tar.gz
kamek-7cccf6fd2715cd1fae9745ae2b15c077a97e4e2f.zip
Merge branch 'file-select' into level-select
Diffstat (limited to '')
-rw-r--r--src/fileselect.S183
1 files changed, 183 insertions, 0 deletions
diff --git a/src/fileselect.S b/src/fileselect.S
new file mode 100644
index 0000000..faa6f48
--- /dev/null
+++ b/src/fileselect.S
@@ -0,0 +1,183 @@
+.set sp,1
+.set rtoc,2
+
+.text
+.extern OSReport
+
+.extern enableNonLoopAnim__Q23m2d13EmbedLayout_cFib
+.global FSShowCD, FSHideCD
+FSShowCD:
+ addi r3, r3, 0x74
+ li r4, 0x2A
+ b enableNonLoopAnim__Q23m2d13EmbedLayout_cFib
+
+FSHideCD:
+ addi r3, r3, 0x74
+ li r4, 0x2B
+ b enableNonLoopAnim__Q23m2d13EmbedLayout_cFib
+
+.global FSShowCD_OpenWait
+FSShowCD_OpenWait:
+ addi r3, r31, 0x74
+ li r4, 0x2A
+ bl enableNonLoopAnim__Q23m2d13EmbedLayout_cFib
+ lwz r0, 0x14(r1)
+ lwz r31, 0xC(r1)
+ mtlr r0
+ addi r1, r1, 0x10
+ blr
+
+#.global FSHideCD_IWOSAEW
+#FSHideCD_IWOSAEW:
+# addi r3, r31, 0x74
+# li r4, 0x2B
+# bl enableNonLoopAnim__Q23m2d13EmbedLayout_cFib
+# lwz r0, 0x14(r1)
+# lwz r31, 0xC(r1)
+# mtlr r0
+# addi r1, r1, 0x10
+# blr
+
+.global DFNiceTitle
+DFNiceTitle:
+ mr r3, r4
+ lis r4, DFTitle@h
+ ori r4, r4, DFTitle@l
+ lwz r6, 0xE44(r30)
+ addi r6, r6, '1'
+ sth r6, 0xA(r4)
+ li r5, 0
+ li r6, 6
+ lwz r12, 0(r3)
+ lwz r12, 0x80(r12)
+ mtctr r12
+ bctr
+
+.extern NewerWorldNames
+.global DFNiceWorldName
+DFNiceWorldName:
+ stwu r1, -0x10(r1)
+ mflr r0
+ stw r0, 0x14(r1)
+ stw r20, 0xC(r1)
+ mr r20, r4
+
+ # get Newer map number
+ lbz r6, 0x6FC(r31)
+ slwi r6, r6, 4
+ lis r7, NewerWorldNames@h
+ ori r7, r7, NewerWorldNames@l
+ lwzx r4, r7, r6
+ li r5, 0
+
+ mr r3, r20
+ lwz r12, 0(r3)
+ lwz r12, 0x7C(r12)
+ mtctr r12
+ bctrl
+
+ lwz r20, 0xC(r1)
+ lwz r0, 0x14(r1)
+ mtlr r0
+ addi r1, r1, 0x10
+ blr
+
+.global FSDebugStates
+FSDebugStates:
+ stwu r1, -0x10(r1)
+ mflr r0
+ stw r0, 0x14(r1)
+ stw r31, 0xC(r1)
+ stw r30, 0x8(r1)
+ mr r31, r3
+ mr r30, r4
+
+ lis r3, FSStateDebugStr@h
+ ori r3, r3, FSStateDebugStr@l
+ crclr 4*cr1+eq
+ lwz r4, 4(r4)
+ bl OSReport
+
+ mr r3, r31
+ mr r4, r30
+ lwzu r12, 0x18(r3)
+ lwz r12, 0x18(r12)
+ mtctr r12
+ bctrl
+
+ lwz r31, 0xC(r1)
+ lwz r30, 0x8(r1)
+ lwz r0, 0x14(r1)
+ mtlr r0
+ addi r1, r1, 0x10
+ blr
+
+.align 4
+
+.data
+FSStateDebugStr: .string "State: %s\n"
+
+.global FSDummyBrlanName, FSDummyGroup, FSDummyPane
+FSDummyBrlanName: .string "fileSelectBase_18_DummyAnim.brlan"
+FSDummyGroup: .string "DummyGroup"
+FSDummyPane: .string "DummyPane"
+
+.global A00_window
+A00_window: .string "A00_window"
+.global ShowEraseCopy, HideEraseCopy
+ShowEraseCopy: .string "fileSelectBase_18_ShowEraseCopy.brlan"
+HideEraseCopy: .string "fileSelectBase_18_HideEraseCopy.brlan"
+.global N_posFile1_00
+N_posFile1_00: .string "N_posFile1_00"
+.global CDHolderGroup
+CDHolderGroup: .string "CDHolderGroup"
+
+.align 4
+DFTitle:
+.short 'F','i','l','e',' ','X'
+
+NameYI: .string "Yoshi's Island"
+NameDesert: .string "Rubble Ruins"
+NameSewer: .string "Soggy Sewers"
+NameMountain: .string "Mushroom Peaks"
+NameJapan: .string "Sakura Village"
+NameFF: .string "FreezeFlame Valley"
+NameVolcano: .string "FreezeFlame Volcano"
+NameGhost: .string "Pumpkin Boneyard"
+NameSkyM: .string "Sky Mountain"
+NameSky: .string "Starry Skies"
+NameKoopa: .string "Koopa Planet"
+NameCore: .string "Koopa Core"
+NameGoldwood: .string "Goldwood Forest"
+NameCaverns: .string "Crystal Caves"
+NameBomb: .string "Bombard Cliffs"
+NameMiniMega: .string "Mini-Mega Island"
+NameSkyCity: .string "Sky City"
+NameBonus: .string "Bonus Land"
+
+# [05:59:00] <Tempus> W1 GW W2 MM W3 W4 W5 CC W6 BC W7 SC W8 KC W9
+.align 4
+# Struct definition: World, Level, IsSecret, Name
+.long -1,-1,0,NameYI
+.long 1,6,1,NameGoldwood
+.long 1,38,0,NameDesert
+.long 2,1,0,NameSewer
+.long 2,15,0,NameDesert
+.long 2,9,1,NameMiniMega
+.long 2,38,0,NameMountain
+.long 3,38,0,NameJapan
+.long 4,38,0,NameFF
+.long 5,6,0,NameVolcano
+.long 5,8,0,NameFF
+.long 5,10,0,NameFF
+.long 5,9,1,NameCaverns
+.long 5,38,0,NameGhost
+.long 6,8,0,NameBomb
+.long 6,38,0,NameSkyM
+.long 7,3,0,NameSky
+.long 7,4,1,NameSkyCity
+.long 7,38,0,NameKoopa
+.long 8,25,0,NameCore
+.long 8,26,0,NameBonus
+.long 0,0,0,0
+