Use memory callback during startup.
This commit is contained in:
parent
b378d8f519
commit
9f1cade7e4
1 changed files with 8 additions and 2 deletions
|
@ -273,8 +273,14 @@ function me.deregisterFrameCallback()
|
|||
emu.removeEventCallback(frameCallback, emu.eventType.inputPolled)
|
||||
end
|
||||
|
||||
local startupCallback = nil
|
||||
local lastTime = -1
|
||||
local function breakHandle()
|
||||
if startupCallback ~= nil then
|
||||
emu.removeMemoryCallback(startupCallback, emu.memCallbackType.cpuExec, 0x0000, 0xffff)
|
||||
startupCallback = nil
|
||||
end
|
||||
|
||||
local pc = emu.getState().cpu.pc
|
||||
print(string.format("PC: %04x", pc))
|
||||
|
||||
|
@ -325,7 +331,7 @@ function me.start(host, port, waitForConnection)
|
|||
|
||||
emu.addEventCallback(breakHandle, emu.eventType.codeBreak)
|
||||
|
||||
breakHandle()
|
||||
startupCallback = emu.addMemoryCallback(breakHandle, emu.memCallbackType.cpuExec, 0x0000, 0xffff)
|
||||
end
|
||||
|
||||
return me
|
||||
|
|
Loading…
Add table
Reference in a new issue