Migrated to supSMSGecko 0.1.0a5; fixed bugs

This commit is contained in:
sup39 2023-07-16 10:29:04 +09:00
parent 421dc6591e
commit 18f008c224
No known key found for this signature in database
GPG key ID: 14D2E0D21140D260
13 changed files with 70 additions and 60 deletions

View file

@ -2,6 +2,9 @@
Gecko codes for Super Mario Sunshine made by sup39.
## Prerequisite for compiling the codes
- Python
- Python >= 3.8
- [devkitPro](https://github.com/devkitPro/installer/releases)
- [supSMSGecko](https://github.com/sup39/supSMSGecko)
- [supSMSGecko](https://github.com/sup39/supSMSGecko) >= 0.1.0a5
```
pip install -U "supSMSGecko>=0.1.0a5"
```

View file

@ -2,7 +2,7 @@ from supSMSGecko import make_xml, symbols, Button as B
def main(g, ver):
S = symbols[ver]
addr_inst = 0x26 + S['TMarDirector::direct']
addr_inst = 0x26 + S['TMarDirector_direct']
addr_input = S['mPadStatus']
# code
g.write16(addr_inst, 600)

View file

@ -7,28 +7,28 @@
<version>0.2.0</version>
<date>Apr 28, 2022</date>
<description lang="en-US">
When you pressed the buttons configured in [#Button Config](#config) simultaneously,
you can restart the current area without selecting "Exit Area" in pause menu.
Note that the restart function behaves differently than pressing Y or Z with "Level Select".
This code only supports restarting 1 area only.
For example, you can restart outside a secret stage or inside a secret stage individually,
but you can NOT restart a combination of outside+inside a secret stage.
When you pressed the buttons configured in [#Button Config](#config) simultaneously,
you can restart the current area without selecting "Exit Area" in pause menu.
Note that the restart function behaves differently than pressing Y or Z with "Level Select".
This code only supports restarting 1 area only.
For example, you can restart outside a secret stage or inside a secret stage individually,
but you can NOT restart a combination of outside+inside a secret stage.
::: warning
You can NOT restart after destroying the last platform in Bowser fight at the moment.
:::
::: warning
You can NOT restart after destroying the last platform in Bowser fight at the moment.
:::
</description>
<description lang="ja-JP">
[#ボタン設定](#config)で設定したボタンを同時に押すと、ポーズメニューから「コースから出る」を選択せずに所在のエリアをやり直すことができます。ただし、Level SelectのYとZのやり直し機能と異なり、エリアごとのやり直ししかできないので注意してください。例えば、ヒミツ外部のみ、ヒミツ内部のみといった一つのエリアのやり直しはできますが、ヒミツ外部+ヒミツ内部といった組み合わせのやり直しはできません。
[#ボタン設定](#config)で設定したボタンを同時に押すと、ポーズメニューから「コースから出る」を選択せずに所在のエリアをやり直すことができます。ただし、Level SelectのYとZのやり直し機能と異なり、エリアごとのやり直ししかできないので注意してください。例えば、ヒミツ外部のみ、ヒミツ内部のみといった一つのエリアのやり直しはできますが、ヒミツ外部+ヒミツ内部といった組み合わせのやり直しはできません。
::: warning
現時点ではクッパ戦で最後の足場を破壊するとやり直しできません。
:::
::: warning
現時点ではクッパ戦で最後の足場を破壊するとやり直しできません。
:::
</description>
<source version="GMSJ01">
C20EAFA0 0000000A
3C608040 A0A30D50
28050801 40A20038
28050208 40A20038
3C60817F 38A00001
98A300B3 98A30100
3C60803E 84A3600E
@ -41,7 +41,7 @@
<source version="GMSE01">
C22979E4 0000000A
3C608040 A0A34454
28050801 40A20038
28050208 40A20038
3C60817F 38A00001
98A300B3 98A30100
3C60803F 84A3970E
@ -54,7 +54,7 @@
<source version="GMSP01">
C228F87C 0000000A
3C608040 A0A3BBF4
28050801 40A20038
28050208 40A20038
3C60817F 38A00001
98A300B3 98A30100
3C60803E 84A310CE
@ -67,7 +67,7 @@
<source version="GMSJ0A">
C227768C 0000000A
3C60803F A0A35428
28050801 40A20038
28050208 40A20038
3C60817F 38A00001
98A300B3 98A30100
3C60803E 84A3A8EE

View file

@ -1,11 +1,12 @@
.set aArea, 14 + gpApplication
.set aBL, 1160 + TMarDirector_updateGameMode
.set $button, 0x208
.L_C2:
# check input
lis r3, mPadStatus@ha
lhz r5, mPadStatus@l(r3)
cmplwi r5, 0x801
cmplwi r5, $button
bne+ .L_done
# reset QFT
lis r3, 0x817F

View file

@ -7,22 +7,22 @@
<version>0.2.0</version>
<date>Apr 28, 2022</date>
<description lang="en-US">
When you pressed the buttons configured in [#Button Config](#config) simultaneously,
you can restart the current area without selecting "Exit Area" in pause menu.
Note that the restart function behaves differently than pressing Y or Z with "Level Select".
This code only supports restarting 1 area only.
For example, you can restart outside a secret stage or inside a secret stage individually,
but you can NOT restart a combination of outside+inside a secret stage.
When you pressed the buttons configured in [#Button Config](#config) simultaneously,
you can restart the current area without selecting "Exit Area" in pause menu.
Note that the restart function behaves differently than pressing Y or Z with "Level Select".
This code only supports restarting 1 area only.
For example, you can restart outside a secret stage or inside a secret stage individually,
but you can NOT restart a combination of outside+inside a secret stage.
::: warning
You can NOT restart after destroying the last platform in Bowser fight at the moment.
:::
::: warning
You can NOT restart after destroying the last platform in Bowser fight at the moment.
:::
</description>
<description lang="ja-JP">
[#ボタン設定](#config)で設定したボタンを同時に押すと、ポーズメニューから「コースから出る」を選択せずに所在のエリアをやり直すことができます。ただし、Level SelectのYとZのやり直し機能と異なり、エリアごとのやり直ししかできないので注意してください。例えば、ヒミツ外部のみ、ヒミツ内部のみといった一つのエリアのやり直しはできますが、ヒミツ外部+ヒミツ内部といった組み合わせのやり直しはできません。
[#ボタン設定](#config)で設定したボタンを同時に押すと、ポーズメニューから「コースから出る」を選択せずに所在のエリアをやり直すことができます。ただし、Level SelectのYとZのやり直し機能と異なり、エリアごとのやり直ししかできないので注意してください。例えば、ヒミツ外部のみ、ヒミツ内部のみといった一つのエリアのやり直しはできますが、ヒミツ外部+ヒミツ内部といった組み合わせのやり直しはできません。
::: warning
現時点ではクッパ戦で最後の足場を破壊するとやり直しできません。
:::
::: warning
現時点ではクッパ戦で最後の足場を破壊するとやり直しできません。
:::
</description>
</code>

View file

@ -2,6 +2,6 @@ from supSMSGecko import make_xml, symbols
def main(g, ver):
S = symbols[ver]
g.C2(48+S['TMarDirector::updateGameMode'], 'code.s')
g.C2(48+S['TMarDirector_updateGameMode'], 'code.s')
make_xml(main)

View file

@ -36,9 +36,9 @@
7D8803A6 4E800020
60000000 00000000
C21945AC 00000009
3C608040 A0630D50
54600436 2C000800
4082002C 54630EFD
3C808040 A0840D50
54800436 2C000800
4082002C 54840EFD
41820024 806D98B8
806303F0 93E300F0
7FE3FB78 81830000
@ -59,9 +59,9 @@
7D8803A6 4E800020
60000000 00000000
C21BC5C4 00000009
3C608040 A0634454
54600436 2C000800
4082002C 54630EFD
3C808040 A0844454
54800436 2C000800
4082002C 54840EFD
41820024 806D9F28
806303F0 93E300F0
7FE3FB78 81830000
@ -82,9 +82,9 @@
7D8803A6 4E800020
60000000 00000000
C21B447C 00000009
3C608040 A063BBF4
54600436 2C000800
4082002C 54630EFD
3C808040 A084BBF4
54800436 2C000800
4082002C 54840EFD
41820024 806D9E50
806303F0 93E300F0
7FE3FB78 81830000
@ -105,9 +105,9 @@
7D8803A6 4E800020
60000000 00000000
C219C34C 00000009
3C60803F A0635428
54600436 2C000800
4082002C 54630EFD
3C80803F A0845428
54800436 2C000800
4082002C 54840EFD
41820024 806D9DE8
806303F0 93E300F0
7FE3FB78 81830000

View file

@ -1,6 +1,6 @@
/** Kill the Yoshi egg and spawn Yoshi immediately. */
.set rInput, 3
.set rInput, 4
.TEggYoshi.control.killEgg:
## check input

View file

@ -2,7 +2,7 @@ from supSMSGecko import make_xml, symbols
def main(g, ver):
S = symbols[ver]
g.C2(0x44 + S['TMario::checkCollision'], 'checkYoshi.s')
g.C2(0x1c + S['TEggYoshi::control'], 'killEgg.s')
g.C2(0x44 + S['TMario_checkCollision'], 'checkYoshi.s')
g.C2(0x1c + S['TEggYoshi_control'], 'killEgg.s')
make_xml(main)

View file

@ -53,7 +53,7 @@
C2299990 0000000A
899A0064 2C0C0001
40A20040 819A0074
818C0094 816C02BC
818C0094 816C02B8
2C0B0003 41A1002C
41A00018 3D80803F
818C9734 39600000
@ -63,7 +63,7 @@
B01A004C 00000000
C229904C 00000004
807F0074 80630094
806302BC 2C830000
806302B8 2C830000
70000061 4C423102
60000000 00000000
28404455 00000024
@ -76,7 +76,7 @@
C2291828 0000000A
899A0064 2C0C0001
40A20040 819A0074
818C0094 816C02BC
818C0094 816C08DC
2C0B0003 41A1002C
41A00018 3D80803E
818C10F4 39600000
@ -86,7 +86,7 @@
B01A004C 00000000
C2290EE4 00000004
807F0074 80630094
806302BC 2C830000
806308DC 2C830000
70000061 4C423102
60000000 00000000
283FBBF5 00000024

View file

@ -7,7 +7,7 @@
## skip only if gpMarDirector->tgcConsole2->consoleStr->state? == 0
lwz r3, 0x74(r31)
lwz r3, 0x94(r3)
lwz r3, 0x2BC(r3)
lwz r3, .offState(r3)
cmpwi cr1, r3, 0
## orig
andi. r0, r0, 0x61

View file

@ -16,7 +16,7 @@
### r12 = consoleStr
lwz r12, 0x94(r12)
### r12 = state?
lwz r11, 0x2BC(r12)
lwz r11, .offState(r12)
cmpwi r11, 3
## return if state > 3
bgt+ .L.orig

View file

@ -2,12 +2,18 @@ from supSMSGecko import make_xml, symbols, Button as B
def main(g, ver):
S = symbols[ver]
a_fast_forward = 0x158 + S['TMarDirector::direct']
a_auto_press = 0x1cc + S['TMarDirector::changeState']
a_fast_forward = 0x158 + S['TMarDirector_direct']
a_auto_press = 0x1cc + S['TMarDirector_changeState']
asm = '.set .offState, %d'%{
'GMSJ01': 0x2BC,
'GMSJ0A': 0x2BC,
'GMSE01': 0x2B8,
'GMSP01': 0x8DC,
}[ver]
## enable
g.if16(S['mPadStatus'], '==', B.R | B.DU)
g.C2(a_fast_forward, 'fast-forward.s')
g.C2(a_auto_press, 'auto-press.s')
g.C2(a_fast_forward, 'fast-forward.s', extra_as_input=asm)
g.C2(a_auto_press, 'auto-press.s', extra_as_input=asm)
## disable (restore original instructions)
g.if16(S['mPadStatus'], '==', B.R | B.DD, endif=True)
g.write32(a_fast_forward, 0xB01A004C) # sth r0, 0x4C(r26)