From 4aa41a2b88639247d52011421cb02a8074e68074 Mon Sep 17 00:00:00 2001 From: nn <53490794+nn357@users.noreply.github.com> Date: Wed, 18 Mar 2026 04:59:20 +0900 Subject: [PATCH 1/4] acid chozo plm loading irq interrupt fix. --- patches/ips/door_irq_fix.ips | Bin 0 -> 39 bytes patches/rom_map/Bank 84.txt | 3 ++- patches/rom_map/vanilla_hooks.txt | 2 ++ patches/src/door_irq_fix.asm | 25 +++++++++++++++++++++++++ rust/maprando/src/patch.rs | 1 + 5 files changed, 30 insertions(+), 1 deletion(-) create mode 100644 patches/ips/door_irq_fix.ips create mode 100644 patches/src/door_irq_fix.asm diff --git a/patches/ips/door_irq_fix.ips b/patches/ips/door_irq_fix.ips new file mode 100644 index 0000000000000000000000000000000000000000..ff2e5069065ca2e98a47bc565b42352139116167 GIT binary patch literal 39 tcmWG=3~}~gV*bOxtgzq<6N@B}UiyWpWB~(L#R4XVgowHAG6}B!ZUEZ)3vd7c literal 0 HcmV?d00001 diff --git a/patches/rom_map/Bank 84.txt b/patches/rom_map/Bank 84.txt index 934cc1b76..c9e8da019 100644 --- a/patches/rom_map/Bank 84.txt +++ b/patches/rom_map/Bank 84.txt @@ -7,7 +7,8 @@ $F300 - $F380: escape_items.asm $F380 - $F480: escape.asm $F480 - $F490: etank_refill_full.asm $F490 - $F4A0: reserve_hud.asm -$F4A0 - $F500: [FREE] +$F4A0 - $F4AA: door_irq_fix.asm +$F4AA - $F500: [FREE] $F500 - $F580: itemsounds.asm $F580 - $F590: mb_left_entrance.asm $F590 - $F5A0: horizontal_door_fix.asm diff --git a/patches/rom_map/vanilla_hooks.txt b/patches/rom_map/vanilla_hooks.txt index f406e1ba1..b1da20ca3 100644 --- a/patches/rom_map/vanilla_hooks.txt +++ b/patches/rom_map/vanilla_hooks.txt @@ -389,6 +389,8 @@ $83aae3 - mb_left_entrance.asm [BANK 84] $84fcd8 - beam_doors.asm +$8483fc - door_irq_fix.asm +$848419 - door_irq_fix.asm $848cb4 - energy_station_reserves.asm $84ae38 - energy_station_reserves.asm $84b285 - energy_station_reserves.asm diff --git a/patches/src/door_irq_fix.asm b/patches/src/door_irq_fix.asm new file mode 100644 index 000000000..76a08b8f6 --- /dev/null +++ b/patches/src/door_irq_fix.asm @@ -0,0 +1,25 @@ +;;; $83D7: Spawn hard-coded PLM ;;; +; certain maprando conditions can cause the hw door math to be interrupted by IRQ. +; this code wraps the doormath section with a disable irq. + +lorom + +org $8483fc ; ldy #$0002 +jsr disable_irq + +org $848419 ; $84:8419 ; sta $1c87,x +jsr enable_irq + + +org $84F4A0 +disable_irq: + sei + ldy #$0002 + rts + +enable_irq: + cli + sta $1c87,x + rts + +assert pc() <= $84F500 ; 84F4AA \ No newline at end of file diff --git a/rust/maprando/src/patch.rs b/rust/maprando/src/patch.rs index 24f200475..183765b15 100644 --- a/rust/maprando/src/patch.rs +++ b/rust/maprando/src/patch.rs @@ -476,6 +476,7 @@ impl Patcher<'_> { "transition_reveal", "wall_doors", "self_check", + "door_irq_fix", ]; if self.settings.other_settings.ultra_low_qol { From 763ffcbda7813850451ea200cd97803f360384ab Mon Sep 17 00:00:00 2001 From: nn <53490794+nn357@users.noreply.github.com> Date: Wed, 18 Mar 2026 05:06:02 +0900 Subject: [PATCH 2/4] use jmp instead of jsr --- patches/ips/door_irq_fix.ips | Bin 39 -> 43 bytes patches/src/door_irq_fix.asm | 8 ++++---- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/patches/ips/door_irq_fix.ips b/patches/ips/door_irq_fix.ips index ff2e5069065ca2e98a47bc565b42352139116167..e2510fe075c8c5915a359f03c4c328d4cd0ed845 100644 GIT binary patch literal 43 xcmWG=3~}~gV*bOx?6cqt6N@B}UjButWB~(T#R4V Date: Thu, 19 Mar 2026 00:01:06 +0900 Subject: [PATCH 3/4] remove hooks to external code. routine is now self contained by removing duplicate code. Co-Authored-By: jeboo --- patches/ips/door_irq_fix.ips | Bin 43 -> 159 bytes patches/rom_map/Bank 84.txt | 3 +- patches/rom_map/vanilla_hooks.txt | 2 - patches/src/door_irq_fix.asm | 89 +++++++++++++++++++++++++----- 4 files changed, 75 insertions(+), 19 deletions(-) diff --git a/patches/ips/door_irq_fix.ips b/patches/ips/door_irq_fix.ips index e2510fe075c8c5915a359f03c4c328d4cd0ed845..e4eba309001a97ab33f305339e18320a74337cda 100644 GIT binary patch literal 159 zcmWG=3~}~gV!qBWsXOYH_v!_H3_HzbKJa&R2z+16CXva)(9CAhQ1nP)F^9+M-3yo) zDmJtAGC8eX%HGTDw1AOeGut5r&HoG%xnfRS5p&yR7BB;aX0L*2^oO^Zi%4Pf1Wp=Mom-)lMAn~he Jb+)U&8vy=zJJ0|C literal 43 xcmWG=3~}~gV*bOx?6cqt6N@B}UjButWB~(T#R4V Date: Wed, 18 Mar 2026 20:08:02 -0600 Subject: [PATCH 4/4] apply sei/cli in escape.asm variant of PLM spawn --- patches/ips/escape.ips | Bin 1811 -> 1813 bytes patches/src/escape.asm | 2 ++ 2 files changed, 2 insertions(+) diff --git a/patches/ips/escape.ips b/patches/ips/escape.ips index cd5644e359d807a7ee894ed51c7bd4c7b7a3061b..14c924830ebb49d02888895c5b7b475a84748af9 100644 GIT binary patch delta 22 ecmbQtH