jevsnes.git / third-party / c / patches / 0008-text-box-gets-a-in-any-state.patch
0008-text-box-gets-a-in-any-state.patch18 lines · 917 B · raw
1diff --git a/third-party/c/zbanks-alttp/alttp.c b/third-party/c/zbanks-alttp/alttp.c
2--- a/third-party/c/zbanks-alttp/alttp.c
3+++ b/third-party/c/zbanks-alttp/alttp.c
4@@ -135,6 +135,14 @@
5     } else if (*ap_ram.link_state != LINK_STATE_GROUND
6             && *ap_ram.link_state != LINK_STATE_FALLING_HOLE) {
7         INFO("Link state: %#x", *ap_ram.link_state);
8+        // Carried patch (jev): a text box open while Link is in some other
9+        // state still needs A - the planner, which mashes it
10+        // (ap_task_evaluate), only runs on the ground. After Sahasrahla
11+        // gives the boots, the A that closes his text starts a dash
12+        // (state 0x11, kPlayerState_StartDash), and the box stayed open.
13+        if (module_index == 0x0E && submodule_index != 0x01) {
14+            JOYPAD_MASH(A, 0x01);
15+        }
16     } else {
17         if (!JOYPAD_TEST(Y)) {
18             ap_plan_evaluate(joypad);