-
Notifications
You must be signed in to change notification settings - Fork 6
Script Debugger
Felix can run lua scripts accompanied with *.lnx, *.lyx or *.o file with additional .lua suffix (i.e. test.o should have test.o.lua file). It must define some variables and can use some predefined ones.
CPU registers that can read
CPU registers that can be read or written
When used from callback while emulator is running it acts as array of emulated RAM, ROM, Mikey registers and Suzy registers respectively. Can be read and written.
Can be used during initial script run to register callbacks to trap read (r
), write (w
) and execute (x
) of memory location given as array index. Prototype of trap function is
function trap( value, address )
return value
end
- Read trap is called after reading
value
from memory locationaddress
and before loading it to CPU - Write trap is called when CPU is about to writing
value
to memory locationaddress
- Execute trap is called after reading opcode
value
from memory locationaddress
and before fetching it by CPU
Return value from trap function is obligatory and is either fed to CPU or written to destination, so value
must be returned if trap function wish not to modify execution.
Turns tracing on from current instruction
Turns tracing off including current instruction
Writes to log only instruction that triggered current callback
Writes to log next count instructions from the instruction that triggered current callback
Breaks execution
log = "trace.log";
ram.x[0x200] = function( value )
traceOn();
return value;
end
function invert( value )
return 255 - value;
end
for i = 0xa0,0xbf,1 do
mikey.w[i] = invert;
end