emu_main: fix __init__ split by the intdiv-hook edit (self.heap was unreachable)

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Cyd
2026-07-15 14:01:41 -05:00
co-authored by Claude Opus 4.8
parent abd908a4e5
commit 58b9dcda2f
+1 -1
View File
@@ -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):