From 58b9dcda2f31bca6f5574460e4bd2c7c2025c5dc Mon Sep 17 00:00:00 2001 From: Cyd Date: Wed, 15 Jul 2026 14:01:41 -0500 Subject: [PATCH] emu_main: fix __init__ split by the intdiv-hook edit (self.heap was unreachable) Co-Authored-By: Claude Opus 4.8 --- emulator/firmware-decomp/emu_main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/emulator/firmware-decomp/emu_main.py b/emulator/firmware-decomp/emu_main.py index adb8d8f..fb8f06a 100644 --- a/emulator/firmware-decomp/emu_main.py +++ b/emulator/firmware-decomp/emu_main.py @@ -103,6 +103,7 @@ class MainRunner: if m['putchar']: self.hooks[m['putchar']] = self.h_console if m['chain']: self.hooks[m['chain']] = self.h_chainfix if m.get('intdiv'): self.hooks[m['intdiv']] = self.h_intdiv + self.heap = [0x08010000, 0x0c010000] # bump allocator over the DRAM banks def h_intdiv(self, cpu): # Runtime integer divide (r22 = r22/r23, result via ftrunc+fxfr): the @@ -116,7 +117,6 @@ class MainRunner: cpu.wr(22, q & 0xffffffff) cpu.pc = cpu.rd(1) return True - self.heap = [0x08010000, 0x0c010000] # bump allocator over the DRAM banks # ---- hook helpers: emulate a called function returning ---- def h_ret(self, cpu, ret=None):