mirror of
https://github.com/irmen/prog8.git
synced 2024-12-25 23:29:55 +00:00
2b8f613a00
Also improved error for invalid directive.
36 lines
821 B
Lua
36 lines
821 B
Lua
; Emulator debug interface. (reflecting the Commander X16 emudbg library module)
|
|
; Docs: https://github.com/X16Community/x16-emulator#emulator-io-registers
|
|
|
|
%import textio
|
|
|
|
emudbg {
|
|
%option ignore_unused
|
|
|
|
sub is_emulator() -> bool {
|
|
; Test for emulator presence.
|
|
return true ; VM is always 'emulator'
|
|
}
|
|
|
|
sub console_write(str message) {
|
|
txt.print("[EMUDBG: ")
|
|
txt.print(message)
|
|
txt.chrout(']')
|
|
}
|
|
|
|
sub console_chrout(ubyte char) {
|
|
txt.chrout(char)
|
|
}
|
|
|
|
sub console_value1(ubyte value) {
|
|
txt.print("[EMUDBG debug 1: ")
|
|
txt.print_uwhex(value, true)
|
|
txt.print("]\n")
|
|
}
|
|
|
|
sub console_value2(ubyte value) {
|
|
txt.print("[EMUDBG debug 2: ")
|
|
txt.print_uwhex(value, true)
|
|
txt.print("]\n")
|
|
}
|
|
}
|