From 421dc6591e98c2c69ef4114006961ac324097db8 Mon Sep 17 00:00:00 2001
From: sup39 <sms@sup39.dev>
Date: Sat, 15 Jul 2023 00:50:35 +0900
Subject: [PATCH] init

Added the following codes
- Fast Forward
- Instant Restart
- Spawn Yoshi
- Stage Intro Skip
---
 .gitignore                          |   1 +
 README.md                           |   7 ++
 codes/FastForward/@code.xml         |  64 +++++++++++++++
 codes/FastForward/info.xml          |  32 ++++++++
 codes/FastForward/make.py           |  15 ++++
 codes/InstantRestart/@code.xml      |  80 +++++++++++++++++++
 codes/InstantRestart/code.s         |  30 +++++++
 codes/InstantRestart/info.xml       |  28 +++++++
 codes/InstantRestart/make.py        |   7 ++
 codes/SpawnYoshi/@code.xml          | 118 +++++++++++++++++++++++++++
 codes/SpawnYoshi/checkYoshi.s       |  37 +++++++++
 codes/SpawnYoshi/info.xml           |  26 ++++++
 codes/SpawnYoshi/killEgg.s          |  28 +++++++
 codes/SpawnYoshi/make.py            |   8 ++
 codes/StageIntroSkip/@code.xml      | 120 ++++++++++++++++++++++++++++
 codes/StageIntroSkip/auto-press.s   |  17 ++++
 codes/StageIntroSkip/fast-forward.s |  41 ++++++++++
 codes/StageIntroSkip/info.xml       |  28 +++++++
 codes/StageIntroSkip/make.py        |  17 ++++
 19 files changed, 704 insertions(+)
 create mode 100644 .gitignore
 create mode 100644 README.md
 create mode 100644 codes/FastForward/@code.xml
 create mode 100644 codes/FastForward/info.xml
 create mode 100644 codes/FastForward/make.py
 create mode 100644 codes/InstantRestart/@code.xml
 create mode 100644 codes/InstantRestart/code.s
 create mode 100644 codes/InstantRestart/info.xml
 create mode 100644 codes/InstantRestart/make.py
 create mode 100644 codes/SpawnYoshi/@code.xml
 create mode 100644 codes/SpawnYoshi/checkYoshi.s
 create mode 100644 codes/SpawnYoshi/info.xml
 create mode 100644 codes/SpawnYoshi/killEgg.s
 create mode 100644 codes/SpawnYoshi/make.py
 create mode 100644 codes/StageIntroSkip/@code.xml
 create mode 100644 codes/StageIntroSkip/auto-press.s
 create mode 100644 codes/StageIntroSkip/fast-forward.s
 create mode 100644 codes/StageIntroSkip/info.xml
 create mode 100644 codes/StageIntroSkip/make.py

diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..21d0b89
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1 @@
+.venv/
diff --git a/README.md b/README.md
new file mode 100644
index 0000000..2cd0bfb
--- /dev/null
+++ b/README.md
@@ -0,0 +1,7 @@
+# supSMS-GeckoCode
+Gecko codes for Super Mario Sunshine made by sup39.
+
+## Prerequisite for compiling the codes
+- Python
+- [devkitPro](https://github.com/devkitPro/installer/releases)
+- [supSMSGecko](https://github.com/sup39/supSMSGecko)
diff --git a/codes/FastForward/@code.xml b/codes/FastForward/@code.xml
new file mode 100644
index 0000000..1f534a4
--- /dev/null
+++ b/codes/FastForward/@code.xml
@@ -0,0 +1,64 @@
+    <code>
+        <category>misc</category>
+        <title lang="en-US">Fast Forward</title>
+        <title lang="ja-JP">早送り</title>
+        <author>sup39(サポミク)</author>
+        <version>0.1</version>
+        <date>Apr 25, 2022</date>
+        <description lang="en-US">
+            Fast forward the game when the following button combination is pressed.
+
+            |  Combination  |  Result |
+            |---------------|------|
+            |B + D-Pad Left | Fast forward 4x |
+            |B + D-Pad Right| Fast forward 8x (lag may occur) |
+
+            ::: warning
+            SGT will be inaccurate with this code.
+            :::
+        </description>
+        <description lang="ja-JP">
+            次のボタンを押している間にゲームを早送りします。
+
+            |  ボタン  |  効果 |
+            |--------------|------|
+            |B + 十字キー左|4倍速|
+            |B + 十字キー右|8倍速(ラグが発生する可能性があります)|
+
+            ::: warning
+            このコードを使うとシャインゲットタイマーのタイムがずれます。  
+            :::
+        </description>
+        <source version="GMSJ01">
+            020ECDE2 00000258
+            28400D50 00000201
+            020ECDE2 00000960
+            28400D51 00000202
+            020ECDE2 000012C0
+            E0000000 00000000
+        </source>
+        <source version="GMSE01">
+            0229985E 00000258
+            28404454 00000201
+            0229985E 00000960
+            28404455 00000202
+            0229985E 000012C0
+            E0000000 00000000
+        </source>
+        <source version="GMSP01">
+            022916F6 00000258
+            283FBBF4 00000201
+            022916F6 00000960
+            283FBBF5 00000202
+            022916F6 000012C0
+            E0000000 00000000
+        </source>
+        <source version="GMSJ0A">
+            0227950E 00000258
+            283F5428 00000201
+            0227950E 00000960
+            283F5429 00000202
+            0227950E 000012C0
+            E0000000 00000000
+        </source>
+    </code>
diff --git a/codes/FastForward/info.xml b/codes/FastForward/info.xml
new file mode 100644
index 0000000..4fc13e1
--- /dev/null
+++ b/codes/FastForward/info.xml
@@ -0,0 +1,32 @@
+    <code>
+        <category>misc</category>
+        <title lang="en-US">Fast Forward</title>
+        <title lang="ja-JP">早送り</title>
+        <author>sup39(サポミク)</author>
+        <version>0.1</version>
+        <date>Apr 25, 2022</date>
+        <description lang="en-US">
+            Fast forward the game when the following button combination is pressed.
+
+            |  Combination  |  Result |
+            |---------------|------|
+            |B + D-Pad Left | Fast forward 4x |
+            |B + D-Pad Right| Fast forward 8x (lag may occur) |
+
+            ::: warning
+            SGT will be inaccurate with this code.
+            :::
+        </description>
+        <description lang="ja-JP">
+            次のボタンを押している間にゲームを早送りします。
+
+            |  ボタン  |  効果 |
+            |--------------|------|
+            |B + 十字キー左|4倍速|
+            |B + 十字キー右|8倍速(ラグが発生する可能性があります)|
+
+            ::: warning
+            このコードを使うとシャインゲットタイマーのタイムがずれます。  
+            :::
+        </description>
+    </code>
diff --git a/codes/FastForward/make.py b/codes/FastForward/make.py
new file mode 100644
index 0000000..7b326e4
--- /dev/null
+++ b/codes/FastForward/make.py
@@ -0,0 +1,15 @@
+from supSMSGecko import make_xml, symbols, Button as B
+
+def main(g, ver):
+  S = symbols[ver]
+  addr_inst = 0x26 + S['TMarDirector::direct']
+  addr_input = S['mPadStatus']
+  # code
+  g.write16(addr_inst, 600)
+  g.if16(addr_input, '==', B.B | B.DL)
+  g.write16(addr_inst, 2400)
+  g.if16(addr_input, '==', B.B | B.DR, endif=True)
+  g.write16(addr_inst, 4800)
+  g.endif()
+
+make_xml(main)
diff --git a/codes/InstantRestart/@code.xml b/codes/InstantRestart/@code.xml
new file mode 100644
index 0000000..a5ed3c7
--- /dev/null
+++ b/codes/InstantRestart/@code.xml
@@ -0,0 +1,80 @@
+    <code>
+        <id>InstantRestart</id>
+        <category>qol</category>
+        <title lang="en-US">Instant Restart</title>
+        <title lang="ja-JP">ポーズせずにやり直し</title>
+        <author>sup39(サポミク)</author>
+        <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.
+
+          ::: 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のやり直し機能と異なり、エリアごとのやり直ししかできないので注意してください。例えば、ヒミツ外部のみ、ヒミツ内部のみといった一つのエリアのやり直しはできますが、ヒミツ外部+ヒミツ内部といった組み合わせのやり直しはできません。
+
+          ::: warning
+          現時点ではクッパ戦で最後の足場を破壊するとやり直しできません。
+          :::
+        </description>
+        <source version="GMSJ01">
+            C20EAFA0 0000000A
+            3C608040 A0A30D50
+            28050801 40A20038
+            3C60817F 38A00001
+            98A300B3 98A30100
+            3C60803E 84A3600E
+            90A30004 38A00040
+            90A30000 3C60800E
+            6063B3F8 7C6803A6
+            4E800020 2C000002
+            60000000 00000000
+        </source>
+        <source version="GMSE01">
+            C22979E4 0000000A
+            3C608040 A0A34454
+            28050801 40A20038
+            3C60817F 38A00001
+            98A300B3 98A30100
+            3C60803F 84A3970E
+            90A30004 38A00040
+            90A30000 3C608029
+            60637E3C 7C6803A6
+            4E800020 2C000002
+            60000000 00000000
+        </source>
+        <source version="GMSP01">
+            C228F87C 0000000A
+            3C608040 A0A3BBF4
+            28050801 40A20038
+            3C60817F 38A00001
+            98A300B3 98A30100
+            3C60803E 84A310CE
+            90A30004 38A00040
+            90A30000 3C608028
+            6063FCD4 7C6803A6
+            4E800020 2C000002
+            60000000 00000000
+        </source>
+        <source version="GMSJ0A">
+            C227768C 0000000A
+            3C60803F A0A35428
+            28050801 40A20038
+            3C60817F 38A00001
+            98A300B3 98A30100
+            3C60803E 84A3A8EE
+            90A30004 38A00040
+            90A30000 3C608027
+            60637AE4 7C6803A6
+            4E800020 2C000002
+            60000000 00000000
+        </source>
+    </code>
diff --git a/codes/InstantRestart/code.s b/codes/InstantRestart/code.s
new file mode 100644
index 0000000..5f70bcc
--- /dev/null
+++ b/codes/InstantRestart/code.s
@@ -0,0 +1,30 @@
+.set aArea,  14 + gpApplication
+.set aBL,    1160 + TMarDirector_updateGameMode
+
+.L_C2:
+# check input
+  lis       r3, mPadStatus@ha
+  lhz       r5, mPadStatus@l(r3)
+  cmplwi    r5, 0x801
+  bne+      .L_done
+# reset QFT
+  lis       r3, 0x817F
+  li        r5, 0x1
+  stb       r5, 0xB3(r3)
+  stb       r5, 0x100(r3)
+# set next area
+  lis       r3, aArea@ha
+  lwzu      r5, aArea@l(r3)
+  stw       r5, 4(r3)
+# set curArea to 0x40 to force reset coin counter
+  li        r5, 0x40
+  stw       r5, 0(r3)
+# b moveStage
+  lis       r3, aBL@h
+  ori       r3, r3, aBL@l
+  mtlr      r3
+  blr
+
+# original instruction
+.L_done:
+  cmpwi     r0, 0x2
diff --git a/codes/InstantRestart/info.xml b/codes/InstantRestart/info.xml
new file mode 100644
index 0000000..8f68cae
--- /dev/null
+++ b/codes/InstantRestart/info.xml
@@ -0,0 +1,28 @@
+    <code>
+        <id>InstantRestart</id>
+        <category>qol</category>
+        <title lang="en-US">Instant Restart</title>
+        <title lang="ja-JP">ポーズせずにやり直し</title>
+        <author>sup39(サポミク)</author>
+        <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.
+
+          ::: 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のやり直し機能と異なり、エリアごとのやり直ししかできないので注意してください。例えば、ヒミツ外部のみ、ヒミツ内部のみといった一つのエリアのやり直しはできますが、ヒミツ外部+ヒミツ内部といった組み合わせのやり直しはできません。
+
+          ::: warning
+          現時点ではクッパ戦で最後の足場を破壊するとやり直しできません。
+          :::
+        </description>
+    </code>
diff --git a/codes/InstantRestart/make.py b/codes/InstantRestart/make.py
new file mode 100644
index 0000000..866c5ff
--- /dev/null
+++ b/codes/InstantRestart/make.py
@@ -0,0 +1,7 @@
+from supSMSGecko import make_xml, symbols
+
+def main(g, ver):
+  S = symbols[ver]
+  g.C2(48+S['TMarDirector::updateGameMode'], 'code.s')
+
+make_xml(main)
diff --git a/codes/SpawnYoshi/@code.xml b/codes/SpawnYoshi/@code.xml
new file mode 100644
index 0000000..d5d349f
--- /dev/null
+++ b/codes/SpawnYoshi/@code.xml
@@ -0,0 +1,118 @@
+    <code>
+        <category>misc</category>
+        <title lang="en-US">Spawn Yoshi</title>
+        <title lang="ja-JP">どこでもヨッシー</title>
+        <author>sup39(サポミク)</author>
+        <version>0.1</version>
+        <date>Oct 14, 2022</date>
+        <description lang="en-US">
+            Spawn and ride on Yoshi
+            |  Combination  |  Yoshi's Color  |
+            |---------------|------|
+            |Y + D-Pad Left |Orange|
+            |Y + D-Pad Right|Purple|
+            |Y + D-Pad Down |Pink  |
+            |Y + D-Pad Up   |Green |
+        </description>
+        <description lang="ja-JP">
+            次のボタンでどこでもヨッシーに乗れます。
+            |  ボタン  |  ヨッシーの色 |
+            |--------------|------|
+            |Y + 十字キー左|オレンジ|
+            |Y + 十字キー右|紫|
+            |Y + 十字キー下|ピンク|
+            |Y + 十字キー上|緑|
+        </description>
+        <source version="GMSJ01">
+            C21604C4 0000000A
+            807F03F0 3C808040
+            A0840D50 54800436
+            2C000800 40820034
+            54840EFD 4182002C
+            3C006300 5C0027BE
+            980300D0 80030008
+            9003000C 807F03F0
+            3D808016 618C0640
+            7D8803A6 4E800020
+            60000000 00000000
+            C21945AC 00000009
+            3C608040 A0630D50
+            54600436 2C000800
+            4082002C 54630EFD
+            41820024 806D98B8
+            806303F0 93E300F0
+            7FE3FB78 81830000
+            818C0104 7D8803A6
+            4E800021 A01F00FC
+            60000000 00000000
+        </source>
+        <source version="GMSE01">
+            C228102C 0000000A
+            807F03F0 3C808040
+            A0844454 54800436
+            2C000800 40820034
+            54840EFD 4182002C
+            3C006300 5C0027BE
+            980300D0 80030008
+            9003000C 807F03F0
+            3D808028 618C11A8
+            7D8803A6 4E800020
+            60000000 00000000
+            C21BC5C4 00000009
+            3C608040 A0634454
+            54600436 2C000800
+            4082002C 54630EFD
+            41820024 806D9F28
+            806303F0 93E300F0
+            7FE3FB78 81830000
+            818C0104 7D8803A6
+            4E800021 A01F00FC
+            60000000 00000000
+        </source>
+        <source version="GMSP01">
+            C2278DB8 0000000A
+            807F03F0 3C808040
+            A084BBF4 54800436
+            2C000800 40820034
+            54840EFD 4182002C
+            3C006300 5C0027BE
+            980300D0 80030008
+            9003000C 807F03F0
+            3D808027 618C8F34
+            7D8803A6 4E800020
+            60000000 00000000
+            C21B447C 00000009
+            3C608040 A063BBF4
+            54600436 2C000800
+            4082002C 54630EFD
+            41820024 806D9E50
+            806303F0 93E300F0
+            7FE3FB78 81830000
+            818C0104 7D8803A6
+            4E800021 A01F00FC
+            60000000 00000000
+        </source>
+        <source version="GMSJ0A">
+            C2260D7C 0000000A
+            807F03F0 3C80803F
+            A0845428 54800436
+            2C000800 40820034
+            54840EFD 4182002C
+            3C006300 5C0027BE
+            980300D0 80030008
+            9003000C 807F03F0
+            3D808026 618C0EF8
+            7D8803A6 4E800020
+            60000000 00000000
+            C219C34C 00000009
+            3C60803F A0635428
+            54600436 2C000800
+            4082002C 54630EFD
+            41820024 806D9DE8
+            806303F0 93E300F0
+            7FE3FB78 81830000
+            818C0104 7D8803A6
+            4E800021 A01F00FC
+            60000000 00000000
+        </source>
+    </code>
diff --git a/codes/SpawnYoshi/checkYoshi.s b/codes/SpawnYoshi/checkYoshi.s
new file mode 100644
index 0000000..2868779
--- /dev/null
+++ b/codes/SpawnYoshi/checkYoshi.s
@@ -0,0 +1,37 @@
+/** Trick the game as if Mario meets the condition to ride on Yoshi. */
+
+.set rYoshi, 3
+.set rInput, 4
+.set $RideYoshi, 0x1C0 + TMario_checkCollision
+
+.TMario.checkCollision.checkYoshi:
+  lwz rYoshi, 0x3f0(r31)
+
+## check input
+  lis rInput, mPadStatus@ha
+  lhz rInput, mPadStatus@l(rInput)
+### Y
+  rlwinm r0, rInput, 0, 0xFFF0
+  cmpwi r0, 0x0800
+  bne .checkYoshi.inactived
+### D-Pad
+  rlwinm. rInput, rInput, 1, 30-3, 30
+  beq .checkYoshi.inactived
+
+## color
+  lis r0, 0x6300
+  rlwnm r0, r0, rInput, 0x3
+  stb r0, 0xD0(rYoshi)
+## juice
+  lwz r0, 8(rYoshi)
+  stw r0, 0xC(rYoshi)
+
+## goto ride Yoshi
+.checkYoshi.done:
+  lwz r3, 0x3f0(r31)
+  lis r12, $RideYoshi@h
+  ori r12, r12, $RideYoshi@l
+  mtlr r12
+  blr
+
+.checkYoshi.inactived:
diff --git a/codes/SpawnYoshi/info.xml b/codes/SpawnYoshi/info.xml
new file mode 100644
index 0000000..8a5e180
--- /dev/null
+++ b/codes/SpawnYoshi/info.xml
@@ -0,0 +1,26 @@
+    <code>
+        <category>misc</category>
+        <title lang="en-US">Spawn Yoshi</title>
+        <title lang="ja-JP">どこでもヨッシー</title>
+        <author>sup39(サポミク)</author>
+        <version>0.1</version>
+        <date>Oct 14, 2022</date>
+        <description lang="en-US">
+            Spawn and ride on Yoshi
+            |  Combination  |  Yoshi's Color  |
+            |---------------|------|
+            |Y + D-Pad Left |Orange|
+            |Y + D-Pad Right|Purple|
+            |Y + D-Pad Down |Pink  |
+            |Y + D-Pad Up   |Green |
+        </description>
+        <description lang="ja-JP">
+            次のボタンでどこでもヨッシーに乗れます。
+            |  ボタン  |  ヨッシーの色 |
+            |--------------|------|
+            |Y + 十字キー左|オレンジ|
+            |Y + 十字キー右|紫|
+            |Y + 十字キー下|ピンク|
+            |Y + 十字キー上|緑|
+        </description>
+    </code>
diff --git a/codes/SpawnYoshi/killEgg.s b/codes/SpawnYoshi/killEgg.s
new file mode 100644
index 0000000..d8cd71b
--- /dev/null
+++ b/codes/SpawnYoshi/killEgg.s
@@ -0,0 +1,28 @@
+/** Kill the Yoshi egg and spawn Yoshi immediately. */
+
+.set rInput, 3
+
+.TEggYoshi.control.killEgg:
+## check input
+  lis rInput, mPadStatus@ha
+  lhz rInput, mPadStatus@l(rInput)
+### Y
+  rlwinm r0, rInput, 0, 0xFFF0
+  cmpwi r0, 0x0800
+  bne .killEgg.done
+### D-Pad
+  rlwinm. rInput, rInput, 1, 30-3, 30
+  beq .killEgg.done
+## set pointer
+  lwz r3, gpMarioOriginal$r13(r13)
+  lwz r3, 0x3f0(r3)
+  stw r31, 0xf0(r3)
+## egg.makeObjDead()
+  mr r3, r31
+  lwz r12, 0(r3) # egg.vtable
+  lwz r12, 0x104(r12) # &makeObjDead()
+  mtlr r12
+  blrl
+
+.killEgg.done:
+  lhz r0, 0xfc(r31)
diff --git a/codes/SpawnYoshi/make.py b/codes/SpawnYoshi/make.py
new file mode 100644
index 0000000..bae7601
--- /dev/null
+++ b/codes/SpawnYoshi/make.py
@@ -0,0 +1,8 @@
+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')
+
+make_xml(main)
diff --git a/codes/StageIntroSkip/@code.xml b/codes/StageIntroSkip/@code.xml
new file mode 100644
index 0000000..183b44d
--- /dev/null
+++ b/codes/StageIntroSkip/@code.xml
@@ -0,0 +1,120 @@
+    <code>
+        <category>misc</category>
+        <title lang="en-US">Stage Intro Skip</title>
+        <title lang="ja-JP">デモムービースキップ</title>
+        <author>sup39(サポミク)</author>
+        <version>0.1</version>
+        <date>Jul 27, 2022</date>
+        <description lang="en-US">
+            Fast forward the stage intro movie.
+
+            ::: warning
+            SGT will be inaccurate with this code.  
+            :::
+
+            - Press `R + D-Pad Up` to enable
+            - Press `R + D-Pad Down` to disable
+        </description>
+        <description lang="ja-JP">
+            ステージに入った時のデモムービーを早送りします。
+
+            ::: warning
+            このコードを有効にするとシャインゲットタイマーのタイムがずれます。
+            :::
+
+            - `R + 十字キー上`でコードを有効にします
+            - `R + 十字キー下`でコードを無効にします
+        </description>
+        <source version="GMSJ01">
+            28400D50 00000028
+            C20ECF14 0000000A
+            899A0064 2C0C0001
+            40A20040 819A0074
+            818C0094 816C02BC
+            2C0B0003 41A1002C
+            41A00018 3D80803E
+            818C6034 39600000
+            916C0018 48000014
+            3863000F 907A0054
+            3B800000 48000008
+            B01A004C 00000000
+            C20EC5D0 00000004
+            807F0074 80630094
+            806302BC 2C830000
+            70000061 4C423102
+            60000000 00000000
+            28400D51 00000024
+            040ECF14 B01A004C
+            040EC5D0 70000061
+            E0000000 00000000
+        </source>
+        <source version="GMSE01">
+            28404454 00000028
+            C2299990 0000000A
+            899A0064 2C0C0001
+            40A20040 819A0074
+            818C0094 816C02BC
+            2C0B0003 41A1002C
+            41A00018 3D80803F
+            818C9734 39600000
+            916C0018 48000014
+            3863000F 907A0054
+            3B800000 48000008
+            B01A004C 00000000
+            C229904C 00000004
+            807F0074 80630094
+            806302BC 2C830000
+            70000061 4C423102
+            60000000 00000000
+            28404455 00000024
+            04299990 B01A004C
+            0429904C 70000061
+            E0000000 00000000
+        </source>
+        <source version="GMSP01">
+            283FBBF4 00000028
+            C2291828 0000000A
+            899A0064 2C0C0001
+            40A20040 819A0074
+            818C0094 816C02BC
+            2C0B0003 41A1002C
+            41A00018 3D80803E
+            818C10F4 39600000
+            916C0018 48000014
+            3863000F 907A0054
+            3B800000 48000008
+            B01A004C 00000000
+            C2290EE4 00000004
+            807F0074 80630094
+            806302BC 2C830000
+            70000061 4C423102
+            60000000 00000000
+            283FBBF5 00000024
+            04291828 B01A004C
+            04290EE4 70000061
+            E0000000 00000000
+        </source>
+        <source version="GMSJ0A">
+            283F5428 00000028
+            C2279640 0000000A
+            899A0064 2C0C0001
+            40A20040 819A0074
+            818C0094 816C02BC
+            2C0B0003 41A1002C
+            41A00018 3D80803E
+            818CA914 39600000
+            916C0018 48000014
+            3863000F 907A0054
+            3B800000 48000008
+            B01A004C 00000000
+            C2278CFC 00000004
+            807F0074 80630094
+            806302BC 2C830000
+            70000061 4C423102
+            60000000 00000000
+            283F5429 00000024
+            04279640 B01A004C
+            04278CFC 70000061
+            E0000000 00000000
+        </source>
+    </code>
diff --git a/codes/StageIntroSkip/auto-press.s b/codes/StageIntroSkip/auto-press.s
new file mode 100644
index 0000000..f49a977
--- /dev/null
+++ b/codes/StageIntroSkip/auto-press.s
@@ -0,0 +1,17 @@
+/**
+ * @TMarDirector::changeState()
+ * Simulate A/B press to end the intro cutscene ASAP
+ */
+
+.startCloseWipe:
+## skip only if gpMarDirector->tgcConsole2->consoleStr->state? == 0
+  lwz r3, 0x74(r31)
+  lwz r3, 0x94(r3)
+  lwz r3, 0x2BC(r3)
+  cmpwi cr1, r3, 0
+## orig
+  andi. r0, r0, 0x61
+## clear eq bit to proceed to run TConsoleStr::startCloseWipe() when cr1.eq is set
+### cr0.eq = cr0.eq and ~cr1.eq
+  crandc eq, eq, 4*cr1+eq
+.L.end:
diff --git a/codes/StageIntroSkip/fast-forward.s b/codes/StageIntroSkip/fast-forward.s
new file mode 100644
index 0000000..0003f80
--- /dev/null
+++ b/codes/StageIntroSkip/fast-forward.s
@@ -0,0 +1,41 @@
+/**
+ * @TMarDirector::direct()
+ * Fast foward until tgcConsole2's state == 2
+ */
+# r26 = gpMarDirector
+
+.onLastQF:
+## return unless gpMarDirector->gameState == 1
+  lbz r12, 0x64(r26)
+  cmpwi r12, 1
+  bne+ .L.orig
+.L.gameState1:
+## check gpMarDirector->tgcConsole2->consoleStr->state?
+### r12 = tgcConsole2
+  lwz r12, 0x74(r26)
+### r12 = consoleStr
+  lwz r12, 0x94(r12)
+### r12 = state?
+  lwz r11, 0x2BC(r12)
+  cmpwi r11, 3
+## return if state > 3
+  bgt+ .L.orig
+## skip if state < 3
+  blt+ .L.skip
+## set gpApplication.TSMSFader.color = 0 if state == 3??
+  lis r12, gpApplication+0x34@ha
+  lwz r12, gpApplication+0x34@l(r12)
+  li r11, 0
+  stw r11, 0x18(r12)
+  b .L.orig
+.L.skip:
+## skip setting last QF flag and proceed next 4 QF
+### qfSync = 20-5
+  addi r3, r3, 15
+  stw r3, 0x54(r26)
+## r28 = iQF = 0
+  li r28, 0
+  b .L.end
+.L.orig:
+  sth r0, 0x4C(r26)
+.L.end:
diff --git a/codes/StageIntroSkip/info.xml b/codes/StageIntroSkip/info.xml
new file mode 100644
index 0000000..be4c896
--- /dev/null
+++ b/codes/StageIntroSkip/info.xml
@@ -0,0 +1,28 @@
+    <code>
+        <category>misc</category>
+        <title lang="en-US">Stage Intro Skip</title>
+        <title lang="ja-JP">デモムービースキップ</title>
+        <author>sup39(サポミク)</author>
+        <version>0.1</version>
+        <date>Jul 27, 2022</date>
+        <description lang="en-US">
+            Fast forward the stage intro movie.
+
+            ::: warning
+            SGT will be inaccurate with this code.  
+            :::
+
+            - Press `R + D-Pad Up` to enable
+            - Press `R + D-Pad Down` to disable
+        </description>
+        <description lang="ja-JP">
+            ステージに入った時のデモムービーを早送りします。
+
+            ::: warning
+            このコードを有効にするとシャインゲットタイマーのタイムがずれます。
+            :::
+
+            - `R + 十字キー上`でコードを有効にします
+            - `R + 十字キー下`でコードを無効にします
+        </description>
+    </code>
diff --git a/codes/StageIntroSkip/make.py b/codes/StageIntroSkip/make.py
new file mode 100644
index 0000000..64aac09
--- /dev/null
+++ b/codes/StageIntroSkip/make.py
@@ -0,0 +1,17 @@
+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']
+  ## 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')
+  ## disable (restore original instructions)
+  g.if16(S['mPadStatus'], '==', B.R | B.DD, endif=True)
+  g.write32(a_fast_forward, 0xB01A004C) # sth r0, 0x4C(r26)
+  g.write32(a_auto_press, 0x70000061) # andi. r0, r0, 0x61
+  g.endif()
+
+make_xml(main)