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:
@@ -103,6 +103,7 @@ class MainRunner:
|
|||||||
if m['putchar']: self.hooks[m['putchar']] = self.h_console
|
if m['putchar']: self.hooks[m['putchar']] = self.h_console
|
||||||
if m['chain']: self.hooks[m['chain']] = self.h_chainfix
|
if m['chain']: self.hooks[m['chain']] = self.h_chainfix
|
||||||
if m.get('intdiv'): self.hooks[m['intdiv']] = self.h_intdiv
|
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):
|
def h_intdiv(self, cpu):
|
||||||
# Runtime integer divide (r22 = r22/r23, result via ftrunc+fxfr): the
|
# Runtime integer divide (r22 = r22/r23, result via ftrunc+fxfr): the
|
||||||
@@ -116,7 +117,6 @@ class MainRunner:
|
|||||||
cpu.wr(22, q & 0xffffffff)
|
cpu.wr(22, q & 0xffffffff)
|
||||||
cpu.pc = cpu.rd(1)
|
cpu.pc = cpu.rd(1)
|
||||||
return True
|
return True
|
||||||
self.heap = [0x08010000, 0x0c010000] # bump allocator over the DRAM banks
|
|
||||||
|
|
||||||
# ---- hook helpers: emulate a called function returning ----
|
# ---- hook helpers: emulate a called function returning ----
|
||||||
def h_ret(self, cpu, ret=None):
|
def h_ret(self, cpu, ret=None):
|
||||||
|
|||||||
Reference in New Issue
Block a user