From 3b36f15143bb180b7c6a607034dfa6ee63e5b585 Mon Sep 17 00:00:00 2001 From: sup39 Date: Sun, 28 Aug 2022 21:54:44 +0900 Subject: [PATCH] add SpawnYoshi code --- NTSC-J 1.0/SpawnYoshi.txt | 15 +++++++++++++++ README.md | 7 +++++++ src/SpawnYoshi.s | 30 ++++++++++++++++++++++++++++++ 3 files changed, 52 insertions(+) create mode 100644 NTSC-J 1.0/SpawnYoshi.txt create mode 100644 src/SpawnYoshi.s diff --git a/NTSC-J 1.0/SpawnYoshi.txt b/NTSC-J 1.0/SpawnYoshi.txt new file mode 100644 index 0000000..da3e6ca --- /dev/null +++ b/NTSC-J 1.0/SpawnYoshi.txt @@ -0,0 +1,15 @@ +28400D50 000F0800 +C0000000 0000000C +818D98B8 7D8C6379 +4D820020 806C03F0 +7C631B79 4D820020 +812C03E4 7D294B79 +4182000C 38000000 +98091C84 3CA08040 +A0A50D50 54A50EFD +4D820020 3C006300 +5C002FBE 980300D0 +38000008 98030000 +80030008 9003000C +4E800020 00000000 +E0000000 00000000 diff --git a/README.md b/README.md index 563dd70..ebe26b5 100644 --- a/README.md +++ b/README.md @@ -48,3 +48,10 @@ Ported from JoshuaMK's by [mapping memory among versions](https://github.com/sup39/supSMS-Utils/blob/main/GeckoConverter/convert.ipynb). The function `TBathWaterFlatRenderer::render` is missing in NTSC-J 1.1 and PAL, and therefore the related codes are removed in these two versions. + +### Spawn Yoshi +Press `Y +` the following button to spawn Yoshi with specific color and make Mario ride on Yoshi +- `D-Pad Left`: Orange +- `D-Pad Right`: Purple +- `D-Pad Down`: Pink +- `D-Pad Up`: Green diff --git a/src/SpawnYoshi.s b/src/SpawnYoshi.s new file mode 100644 index 0000000..d550c0d --- /dev/null +++ b/src/SpawnYoshi.s @@ -0,0 +1,30 @@ +.set rMario, 12 +.set rFLUDD, 9 +.set rYoshi, 3 + +lwz rMario, -0x6748(r13) +mr. rMario, rMario +beqlr- + +lwz rYoshi, 0x3F0(rMario) +mr. rYoshi, rYoshi +beqlr- + +lwz rFLUDD, 0x3E4(rMario) +mr. rFLUDD, rFLUDD +beq- .L1 +li r0, 0 +stb r0, 0x1C84(rFLUDD) +.L1: + +lis r5, 0x8040 +lhz r5, 0x0D50(r5) +rlwinm. r5, r5, 1, 30-3, 30 +beqlr- +lis r0, 0x6300 +rlwnm r0, r0, r5, 0x3 +stb r0, 0xD0(rYoshi) +li r0, 8 +stb r0, 0(rYoshi) +lwz r0, 8(rYoshi) +stw r0, 0xC(rYoshi)