diff --git a/InstantLevelSelectExtra/@code.xml b/InstantLevelSelectExtra/@code.xml
index 6ac531c..aa8974c 100644
--- a/InstantLevelSelectExtra/@code.xml
+++ b/InstantLevelSelectExtra/@code.xml
@@ -3,7 +3,7 @@
Instant Level Select Extra
レベル選択EX
sup39(サポミク)
- 1.2.1
+ 1.3
Feb 25, 2024
::: warning
@@ -69,7 +69,7 @@
4. これで好きなだけハニスキを練習できます。他のエリアに入ろうとする時に自動的にやり直すので、手動でやり直す必要がありません。必要であれば`十字キー上`でやり直すこともできます。
diff --git a/InstantLevelSelectExtra/info.xml b/InstantLevelSelectExtra/info.xml
index 31551ae..ac3525e 100644
--- a/InstantLevelSelectExtra/info.xml
+++ b/InstantLevelSelectExtra/info.xml
@@ -3,7 +3,7 @@
Instant Level Select Extra
レベル選択EX
sup39(サポミク)
- 1.2.1
+ 1.3
Feb 25, 2024
::: warning
diff --git a/InstantLevelSelectExtra/make.py b/InstantLevelSelectExtra/make.py
index 2bf99a8..7a286e8 100644
--- a/InstantLevelSelectExtra/make.py
+++ b/InstantLevelSelectExtra/make.py
@@ -4,12 +4,10 @@ def main(g, ver):
S = symbols[ver]
# Instant Level Select main function
- g.C2(0x220 + S['TApplication_gameLoop'], 'src/main.s', extra_as_input=[
- '.set $LevelSelect.area, 0x817F0028',
- '.set $LevelSelect.epFlag, 0x817F002A',
- '.set $LevelSelect.AreaLock, 0x817F002B',
- # TODO conflict with Level Select
- '.set $restartNActivated, 0x817F0007',
+ g.C2(0x220 + S['TApplication_gameLoop'], 'src/main.s', extra_ld_input=[
+ '$LevelSelect.area = 0x817F0028;',
+ '$LevelSelect.epFlag = 0x817F002A;',
+ '$LevelSelect.AreaLock = 0x817F002B;',
]);
make_xml(main)
diff --git a/InstantLevelSelectExtra/src/main.s b/InstantLevelSelectExtra/src/main.s
index ff1cb57..b41a14e 100644
--- a/InstantLevelSelectExtra/src/main.s
+++ b/InstantLevelSelectExtra/src/main.s
@@ -11,8 +11,6 @@
.set rApp, 31 # gpApplication
.set rNextGameMode, 29
.set crAreaLock, 7
-.set crMarDirector, 6
-.set crWarping, 5
.set $btnLevelSelect, 0x8 # D_UP
.set $btnShineSelect, 0x4 # D_DOWN
@@ -20,10 +18,12 @@
lis \reg, \val@h
ori \reg, \reg, \val@l
.endm
-.macro call addr
- li32 r12, \addr
- bl call
-.endm
+#.macro call addr
+# li32 r12, \addr
+# mtlr r12
+# blrl r12
+# #bl call
+#.endm
.L.prepare:
## prepare registers
@@ -69,12 +69,10 @@
.L.checkPaused:
### r12 = *gpMarDirector
lwz r12, gpMarDirector$r13(r13)
- cmplwi crMarDirector, r12, 0
- beq crMarDirector, .L.checkPaused.done
+ cmplwi r12, 0
+ beq .L.checkPaused.done
### r12 = gpMarDirector->gameMode
lbz r12, 0x64(r12)
-### crWarping(eq) = gpMarDirector->gameMode == 9
- cmpwi crWarping, r12, 9
### if gameMode == 5 or 10
li r0, 0x21 # (LSB 0, 5 == 1)
rlwnm. r0, r0, r12, 31-10, 31-10 # LSB 10
@@ -148,9 +146,9 @@
.long 0x12234070
.long 0x23467001
-call:
- mtctr r12
- bctr
+#call:
+# mtctr r12
+# bctr
.L.LevelSelect:
mflr rD
@@ -235,23 +233,9 @@ handleSpecial:
b .L.loadStage
handleRestartN:
-## skip if restartN already activated
- lbz r0, $restartNActivated@l(r817F)
- cmpwi r0, 0
- bne handleRestartN.alreadyActivated
-handleRestartN.activate:
## set curArea = prevArea
lhz r0, 0xA(rApp)
sth r0, 0xE(rApp)
-## set restartNActivated flag (NOTE: nextGameMode > 0)
- stb rNextGameMode, $restartNActivated@l(r817F)
-## done
- b handleRestartN.done
-handleRestartN.alreadyActivated:
-## load rAns from nextArea
- lhz rAns, 0x12(rApp)
-handleRestartN.done:
-
handleRestartZ:
## load curMap, ep
lbz rAnsEp, 0xDF(rFM)
@@ -351,49 +335,29 @@ handlePlaza:
rlwinm r0, r0, 0, 31, 29
sth r0, 0xe2(rMGP)
-
## set nextGameMode if gpMarDirector == NULL
- bne crMarDirector, .L.setFader
### nextGameMode = nextArea == (shine select) ? 8 : 5
## ep==0xFF ? 3 : 0 (Note: all valid ep id < 0x40)
rlwinm rNextGameMode, rAns, 32-6, 0x3
addi rNextGameMode, rNextGameMode, 5
- b .L.setFader.done
.L.setFader:
-## skip setting fader if warping
- beq crWarping, .L.setFader.done
-## TMarDirector::moveStage(gpMarDirector)
- lwz r3, gpMarDirector$r13(r13)
- call TMarDirector_moveStage
-## TSMSFader::setFadeStatus(main::gpApplication.fader, FadedOut(0))
- addi r3, rApp, 0x34
- li r4, 0
- call TSMSFader_setFadeStatus
-## gpMarDirector->faderType = 0xf
- li r0, 0xf
- lwz r3, gpMarDirector$r13(r13)
- stw r0, 0xe4(r3)
-## TMarDirector::currentStateFinalize(gpMarDirector, 9);
- li r4, 9
- call TMarDirector_currentStateFinalize
-## TMarDirector::nextStateInitialize(gpMarDirectorthis, 9);
- lwz r3, gpMarDirector$r13(r13)
- li r4, 9
- call TMarDirector_nextStateInitialize
-## gpMarDirector->gameMode = 9
- lwz r3, gpMarDirector$r13(r13)
- li r0, 9
- stb r0, 0x64(r3)
-.L.setFader.done:
+## TSMSFader::setFadeStatus(gpApplication.fader, FadedOut(=0))
+ lwz r12, 0x34(rApp)
+### this->status = FadedOut(0);
+ li r0, 0
+ stw r0, 0x20(r12)
+### this->color->a = 0xff; (overwritten afterward)
+### (this->wipeRequest).type = 0x12;
+ li r0, 0x12
+ stw r0, 0x24(r12)
+## TSMSFader::setColor(gpApplication.fader, color=0xff)
+### this->color = rAns == 0x09FF ? 0xd2d2d2ff : 0xff
+ li r0, 0xff
+ cmplwi rAns, 0x09FF
+ bne+ .L.setFader.color.apply
+ li32 r0, 0xd2d2d2ff
+.L.setFader.color.apply:
+ stw r0, 0x18(r12)
.L.done:
-
-## reset restartNActivated flag if game mode changes (>1)
-.L.resetActivatedFlag:
- cmpwi rNextGameMode, 1
- ble .L.resetActivatedFlag.done
-### activated flag = 0
- lis r12, 0x817f
- stb r12, $restartNActivated@l(r12) # 0x00
-.L.resetActivatedFlag.done: