diff --git a/README.md b/README.md index 2cd0bfb..0b30160 100644 --- a/README.md +++ b/README.md @@ -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" + ``` diff --git a/codes/FastForward/make.py b/codes/FastForward/make.py index 7b326e4..06ca89a 100644 --- a/codes/FastForward/make.py +++ b/codes/FastForward/make.py @@ -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) diff --git a/codes/InstantRestart/@code.xml b/codes/InstantRestart/@code.xml index a5ed3c7..fdbbcff 100644 --- a/codes/InstantRestart/@code.xml +++ b/codes/InstantRestart/@code.xml @@ -7,28 +7,28 @@ 0.2.0 Apr 28, 2022 - 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. + ::: - [#ボタン設定](#config)で設定したボタンを同時に押すと、ポーズメニューから「コースから出る」を選択せずに所在のエリアをやり直すことができます。ただし、Level SelectのYとZのやり直し機能と異なり、エリアごとのやり直ししかできないので注意してください。例えば、ヒミツ外部のみ、ヒミツ内部のみといった一つのエリアのやり直しはできますが、ヒミツ外部+ヒミツ内部といった組み合わせのやり直しはできません。 + [#ボタン設定](#config)で設定したボタンを同時に押すと、ポーズメニューから「コースから出る」を選択せずに所在のエリアをやり直すことができます。ただし、Level SelectのYとZのやり直し機能と異なり、エリアごとのやり直ししかできないので注意してください。例えば、ヒミツ外部のみ、ヒミツ内部のみといった一つのエリアのやり直しはできますが、ヒミツ外部+ヒミツ内部といった組み合わせのやり直しはできません。 - ::: warning - 現時点ではクッパ戦で最後の足場を破壊するとやり直しできません。 - ::: + ::: warning + 現時点ではクッパ戦で最後の足場を破壊するとやり直しできません。 + ::: C20EAFA0 0000000A 3C608040 A0A30D50 - 28050801 40A20038 + 28050208 40A20038 3C60817F 38A00001 98A300B3 98A30100 3C60803E 84A3600E @@ -41,7 +41,7 @@ C22979E4 0000000A 3C608040 A0A34454 - 28050801 40A20038 + 28050208 40A20038 3C60817F 38A00001 98A300B3 98A30100 3C60803F 84A3970E @@ -54,7 +54,7 @@ C228F87C 0000000A 3C608040 A0A3BBF4 - 28050801 40A20038 + 28050208 40A20038 3C60817F 38A00001 98A300B3 98A30100 3C60803E 84A310CE @@ -67,7 +67,7 @@ C227768C 0000000A 3C60803F A0A35428 - 28050801 40A20038 + 28050208 40A20038 3C60817F 38A00001 98A300B3 98A30100 3C60803E 84A3A8EE diff --git a/codes/InstantRestart/code.s b/codes/InstantRestart/code.s index 5f70bcc..a1bb972 100644 --- a/codes/InstantRestart/code.s +++ b/codes/InstantRestart/code.s @@ -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 diff --git a/codes/InstantRestart/info.xml b/codes/InstantRestart/info.xml index 8f68cae..9ed6713 100644 --- a/codes/InstantRestart/info.xml +++ b/codes/InstantRestart/info.xml @@ -7,22 +7,22 @@ 0.2.0 Apr 28, 2022 - 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. + ::: - [#ボタン設定](#config)で設定したボタンを同時に押すと、ポーズメニューから「コースから出る」を選択せずに所在のエリアをやり直すことができます。ただし、Level SelectのYとZのやり直し機能と異なり、エリアごとのやり直ししかできないので注意してください。例えば、ヒミツ外部のみ、ヒミツ内部のみといった一つのエリアのやり直しはできますが、ヒミツ外部+ヒミツ内部といった組み合わせのやり直しはできません。 + [#ボタン設定](#config)で設定したボタンを同時に押すと、ポーズメニューから「コースから出る」を選択せずに所在のエリアをやり直すことができます。ただし、Level SelectのYとZのやり直し機能と異なり、エリアごとのやり直ししかできないので注意してください。例えば、ヒミツ外部のみ、ヒミツ内部のみといった一つのエリアのやり直しはできますが、ヒミツ外部+ヒミツ内部といった組み合わせのやり直しはできません。 - ::: warning - 現時点ではクッパ戦で最後の足場を破壊するとやり直しできません。 - ::: + ::: warning + 現時点ではクッパ戦で最後の足場を破壊するとやり直しできません。 + ::: diff --git a/codes/InstantRestart/make.py b/codes/InstantRestart/make.py index 866c5ff..161bc84 100644 --- a/codes/InstantRestart/make.py +++ b/codes/InstantRestart/make.py @@ -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) diff --git a/codes/SpawnYoshi/@code.xml b/codes/SpawnYoshi/@code.xml index d5d349f..6eac617 100644 --- a/codes/SpawnYoshi/@code.xml +++ b/codes/SpawnYoshi/@code.xml @@ -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 diff --git a/codes/SpawnYoshi/killEgg.s b/codes/SpawnYoshi/killEgg.s index d8cd71b..bf9f68e 100644 --- a/codes/SpawnYoshi/killEgg.s +++ b/codes/SpawnYoshi/killEgg.s @@ -1,6 +1,6 @@ /** Kill the Yoshi egg and spawn Yoshi immediately. */ -.set rInput, 3 +.set rInput, 4 .TEggYoshi.control.killEgg: ## check input diff --git a/codes/SpawnYoshi/make.py b/codes/SpawnYoshi/make.py index bae7601..3017a6f 100644 --- a/codes/SpawnYoshi/make.py +++ b/codes/SpawnYoshi/make.py @@ -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) diff --git a/codes/StageIntroSkip/@code.xml b/codes/StageIntroSkip/@code.xml index 183b44d..a94b270 100644 --- a/codes/StageIntroSkip/@code.xml +++ b/codes/StageIntroSkip/@code.xml @@ -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 diff --git a/codes/StageIntroSkip/auto-press.s b/codes/StageIntroSkip/auto-press.s index f49a977..2eeebde 100644 --- a/codes/StageIntroSkip/auto-press.s +++ b/codes/StageIntroSkip/auto-press.s @@ -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 diff --git a/codes/StageIntroSkip/fast-forward.s b/codes/StageIntroSkip/fast-forward.s index 0003f80..5f5bc18 100644 --- a/codes/StageIntroSkip/fast-forward.s +++ b/codes/StageIntroSkip/fast-forward.s @@ -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 diff --git a/codes/StageIntroSkip/make.py b/codes/StageIntroSkip/make.py index 64aac09..bc6bcc1 100644 --- a/codes/StageIntroSkip/make.py +++ b/codes/StageIntroSkip/make.py @@ -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)