1
0
Fork 0

add InstantShineSelect

This commit is contained in:
sup39 2022-10-14 18:48:16 +09:00
parent d85deb34bc
commit 85a88d5e7c
3 changed files with 103 additions and 0 deletions

View file

@ -0,0 +1,19 @@
$ Instant Shine Select (2022/10/14) [sup39]
C20EC424 00000011
3CA08040 80A50D80
28050801 40A20074
3C60817F 38A00001
98A300B3 98A30100
3CA0803E 8D85600E
3C60803B 386340E8
7C6360AE 38030001
5400EFFE 7C630214
5463442E 606300FF
B0650004 806D97D0
38000000 900300DC
7FE3FB78 3D80800F
398CAB40 7D8803A6
4E800021 3B800009
3D80800F 398CCB28
7D8803A6 4E800020
2800000C 00000000

View file

@ -0,0 +1,3 @@
$$ = 0;
$C2$.Mar.changeState = 32 + TMarDirector.changeState;
.Mar.changeState.applied = 1828 + TMarDirector.changeState;

81
src/InstantShineSelect.s Normal file
View file

@ -0,0 +1,81 @@
.set btn, 0x801
.Mar.changeState:
## read button input: [M]*1 [C]*1 [btn]*2
lis r5, JUTGamePad.mPadButton@ha
lwz r5, JUTGamePad.mPadButton@l(r5)
cmplwi r5, btn
bne+ .Mar.changeState.notActivated
## reset QFT
lis r3, 0x817F
li r5, 0x1
stb r5, 0xB3(r3)
stb r5, 0x100(r3)
## set next area
lis r5, gpApplication+0xE@ha
## r12=curArea, r5=&curArea
lbzu r12, gpApplication+0xE@l(r5)
lis r3, System.shineStageTable@ha
la r3, System.shineStageTable@l(r3)
lbzx r3, r3, r12
## +1 for >=7
addi r0, r3, 1
rlwinm r0, r0, 32-3, 0x1
add r3, r3, r0
## <<8 as area, ep=0xff
rlwinm r3, r3, 8, 0x10, 0x17
ori r3, r3, 0xff
## r3=shineArea, r5+4=&nextArea
sth r3, 4(r5)
## reset coin counter
lwz r3, TFlagManager.smInstance$r13(r13)
li r0, 0
stw r0, 0xDC(r3)
## moveStage
mr r3, r31
lis r12, TMarDirector.moveStage@ha
la r12, TMarDirector.moveStage@l(r12)
mtlr r12
blrl
li r28, 9 # nextState = LevelTransition
lis r12, .Mar.changeState.applied@ha
la r12, .Mar.changeState.applied@l(r12)
mtlr r12
blr
.Mar.changeState.notActivated:
cmplwi r0, 0xc
#.TMarDirector.updateGameMode:
## check input
# lis r3, aInput@ha
# lhz r5, aInput@l(r3)
# cmplwi r5, btn
# bne+ .L_done
## reset QFT
# lis r3, 0x817F
# li r5, 0x1
# stb r5, 0xB3(r3)
# stb r5, 0x100(r3)
## set next area
# lis r5, aArea@ha
# ## r12=curArea, r5=&curArea
# lbzu r12, aArea@l(r5)
# lis r3, System.shineStageTable@ha
# la r3, System.shineStageTable@l(r3)
# lbzx r3, r3, r12
# rlwinm r3, r3, 8, 0x10, 0x17 # <<8
# ori r3, r3, 0xff
# ## r3=shineArea, r5+4=&nextArea
# stw r3, 4(r5)
## set curArea to 0x40 to force reset coin counter
# li r3, 0x40
# stw r3, 0(r5)
## b moveStage
# lis r3, aBL@h
# ori r3, r3, aBL@l
# mtlr r3
# blr
#.L_done:
## original instruction
# cmpwi r0, 0x2