jevsnes.git / third-party / c / patches / 0001-follow-targets-on-intra-room-stairs.patch
0001-follow-targets-on-intra-room-stairs.patch18 lines · 1.1 KB · raw
1diff --git a/third-party/c/zbanks-alttp/alttp.c b/third-party/c/zbanks-alttp/alttp.c
2index 10b912af..f879479d 100644
3--- a/third-party/c/zbanks-alttp/alttp.c
4+++ b/third-party/c/zbanks-alttp/alttp.c
5@@ -75,7 +75,12 @@ ap_tick(uint32_t frame, uint16_t * joypad) {
6     //INFO("Module: %#x; Submodule: %#x; %d", module_index, submodule_index, frame);
7     switch (module_index) {
8     case 0x07:
9-        if (submodule_index == 0x0E || sub_submodule_index != 0x00) {
10+        // Carried patch (jev): the intra-room stairs, submodules 0x08 and
11+        // 0x10, count their own steps in $B0, so $B0 != 0 there is not a
12+        // load. Returning here skipped the stairs case below, the targets
13+        // Link climbed past were never consumed, and at the top the bot
14+        // walked back down. See third-party/c/patches/.
15+        if (submodule_index == 0x0E || (sub_submodule_index != 0x00 && submodule_index != 0x08 && submodule_index != 0x10)) {
16             // Inter-room transition; load in progress if sub_submodule_index != 0
17             INFO("main: %#x; sub: %#x; subsub: %#x %u", module_index, submodule_index, sub_submodule_index, frame);
18             return;