diff --git a/patches/ips/vanilla_bugfixes.ips b/patches/ips/vanilla_bugfixes.ips index 3a5f27689..9a82fef23 100644 Binary files a/patches/ips/vanilla_bugfixes.ips and b/patches/ips/vanilla_bugfixes.ips differ 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