mirror of
https://github.com/st3fan/ewm.git
synced 2024-06-04 02:29:28 +00:00
Update cpu_test.lua
This commit is contained in:
parent
a4324737d5
commit
ab4c8e025e
|
@ -1,31 +1,13 @@
|
||||||
-- EWM Meets Lua
|
|
||||||
|
|
||||||
local function myerrhandler(err)
|
cpu:onBeforeExecuteInstruction(0x60, function(cpu, opcode, operand)
|
||||||
print(err)
|
end)
|
||||||
print(debug.traceback())
|
|
||||||
return false
|
|
||||||
end
|
|
||||||
|
|
||||||
-- TODO How do we do this in C?
|
cpu:onBeforeExecuteInstruction(0x20, function(cpu, opcode, operand)
|
||||||
xpcall(function()
|
end)
|
||||||
-- Add some random intercepts to measure the performance impact
|
|
||||||
|
|
||||||
local cpu = require 'cpu'
|
cpu:onAfterExecuteInstruction(0x60, function(cpu, opcode, operand)
|
||||||
|
end)
|
||||||
|
|
||||||
cpu.onBeforeExecuteInstruction(0x60, function(state, opcode, operand)
|
cpu:onAfterExecuteInstruction(0x20, function(cpu, opcode, operand)
|
||||||
--print(string.format('Before RTS from 0x%.4x', state.pc))
|
end)
|
||||||
end)
|
|
||||||
|
|
||||||
cpu.onBeforeExecuteInstruction(0x20, function(state, opcode, operand)
|
|
||||||
--print(string.format('Before JSR from 0x%.4x', state.pc))
|
|
||||||
end)
|
|
||||||
|
|
||||||
cpu.onAfterExecuteInstruction(0x60, function(state, opcode, operand)
|
|
||||||
--print(string.format('After RTS from 0x%.4x', state.pc))
|
|
||||||
end)
|
|
||||||
|
|
||||||
cpu.onAfterExecuteInstruction(0x20, function(state, opcode, operand)
|
|
||||||
--print(string.format('After JSR from 0x%.4x', state.pc))
|
|
||||||
end)
|
|
||||||
|
|
||||||
end , myerrhandler)
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user