From 5780adfcec5c4a3ab0c9d36f708ebd7654de1815 Mon Sep 17 00:00:00 2001 From: nn <53490794+nn357@users.noreply.github.com> Date: Sat, 26 Sep 2026 18:31:50 +0900 Subject: [PATCH 1/2] GT Exit fight mid-palette-change fix. This fix modifies X to add 3 iterations to the loop, it ensures the palette timer is always at 0 for the door transition. It adds 51 cycles and requires no hooks. If you could activate BT without closing the door (currently not possible in MapRando) then the same issue would likely arise, this fixes both. --- patches/ips/vanilla_bugfixes.ips | Bin 328 -> 336 bytes patches/src/vanilla_bugfixes.asm | 16 +++++++++++++++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/patches/ips/vanilla_bugfixes.ips b/patches/ips/vanilla_bugfixes.ips index 3a5f2768900505f31c3fb8ec4e074fc624c15a0e..9a82fef23579fe224e6f7dced4f670bff42ca84d 100644 GIT binary patch delta 18 acmX@Xbb)C?EeB)bLk8wWEQ}LtPXhowDh7A} delta 9 Qcmcb>bb@I@?Znp802Mg|ivR!s diff --git a/patches/src/vanilla_bugfixes.asm b/patches/src/vanilla_bugfixes.asm index 750034770..9083a1e45 100644 --- a/patches/src/vanilla_bugfixes.asm +++ b/patches/src/vanilla_bugfixes.asm @@ -272,4 +272,18 @@ bootstable: dw $0040 ; boots - blue booster dw $0080 ; boots - spark booster -assert pc() <= !bank_82_free_space_end \ No newline at end of file +assert pc() <= !bank_82_free_space_end + +;; GT: Exit fight mid-palette-change fix. + +; The door transition code assumes the palette counter/timer is 0. +; If the GT fight is exited while GT is changing color, the counter +; can be non-zero, causing the transition to start at the wrong timer +; index. If the index is high enough, this can corrupt the graphics +; during the transition. + +; Include the palette counter/timer in the door transition zero-loop +; counter so the transition starts from the correct index. + +org $82e1e1 ; (Game state Ah (door transition - setup) ;;;) + ldx #$0104 From 7425b1fba96234c494f3bb122051fbae7951e8dc Mon Sep 17 00:00:00 2001 From: nn <53490794+nn357@users.noreply.github.com> Date: Sun, 4 Oct 2026 01:52:25 +0900 Subject: [PATCH 2/2] move patch the camera fixes --- patches/ips/vanilla_bugfixes.ips | Bin 336 -> 328 bytes patches/ips/vanilla_camerafixes.ips | Bin 136 -> 144 bytes patches/src/vanilla_bugfixes.asm | 16 +--------------- patches/src/vanilla_camerafixes.asm | 17 ++++++++++++++++- 4 files changed, 17 insertions(+), 16 deletions(-) diff --git a/patches/ips/vanilla_bugfixes.ips b/patches/ips/vanilla_bugfixes.ips index 9a82fef23579fe224e6f7dced4f670bff42ca84d..3a5f2768900505f31c3fb8ec4e074fc624c15a0e 100644 GIT binary patch delta 9 Qcmcb>bb@I@?Znp802Mg|ivR!s delta 18 acmX@Xbb)C?EeB)bLk8wWEQ}LtPXhowDh7A} diff --git a/patches/ips/vanilla_camerafixes.ips b/patches/ips/vanilla_camerafixes.ips index ca084ade541baae482b3bf2ad312c54c06ddbe19..253f22c4022b7e9de5e6d23ccd99064e1d808054 100644 GIT binary patch delta 18 ZcmeBRoWMB2frByeAp`Rw7RHGV9sn?O1o;2} delta 9 QcmbQh*ugl#VWNiz01r9?3;+NC diff --git a/patches/src/vanilla_bugfixes.asm b/patches/src/vanilla_bugfixes.asm index 9083a1e45..750034770 100644 --- a/patches/src/vanilla_bugfixes.asm +++ b/patches/src/vanilla_bugfixes.asm @@ -272,18 +272,4 @@ bootstable: dw $0040 ; boots - blue booster dw $0080 ; boots - spark booster -assert pc() <= !bank_82_free_space_end - -;; GT: Exit fight mid-palette-change fix. - -; The door transition code assumes the palette counter/timer is 0. -; If the GT fight is exited while GT is changing color, the counter -; can be non-zero, causing the transition to start at the wrong timer -; index. If the index is high enough, this can corrupt the graphics -; during the transition. - -; Include the palette counter/timer in the door transition zero-loop -; counter so the transition starts from the correct index. - -org $82e1e1 ; (Game state Ah (door transition - setup) ;;;) - ldx #$0104 +assert pc() <= !bank_82_free_space_end \ No newline at end of file diff --git a/patches/src/vanilla_camerafixes.asm b/patches/src/vanilla_camerafixes.asm index a89c795a1..04e73884b 100644 --- a/patches/src/vanilla_camerafixes.asm +++ b/patches/src/vanilla_camerafixes.asm @@ -102,4 +102,19 @@ assert pc() <= !bank_84_free_space_end ; Fix Bomb Torizo crumbling animation (which can be very messed up if the player earlier visited a room ; that maxed out enemy projectiles) org $86A8FD - ADC $1B23, x ; was: ADC $1B23 \ No newline at end of file + ADC $1B23, x ; was: ADC $1B23 + + +;; GT: Exit fight mid-palette-change fix. + +; The door transition code assumes the palette counter/timer is 0. +; If the GT fight is exited while GT is changing color, the counter +; can be non-zero, causing the transition to start at the wrong timer +; index. If the index is high enough, this can corrupt the graphics +; during the transition. + +; Include the palette counter/timer in the door transition zero-loop +; counter so the transition starts from the correct index. + +org $82e1e1 ; (Game state Ah (door transition - setup) ;;;) + ldx #$0104