-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathdebug.lua
26 lines (19 loc) · 918 Bytes
/
debug.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
x = 80
y = 64
width = 12 * 8
height = 6 * 8
function drawBoardBounds()
emu.drawRectangle(x, y, width, height, 0x000000FF, false)
tmpX = emu.read(emu.getLabelAddress("TmpX"), emu.memType.Cpu)
tmpY = emu.read(emu.getLabelAddress("TmpY"), emu.memType.Cpu)
emu.drawPixel(tmpX, tmpY, 0x00FF0000)
end
--Register some code (printInfo function) that will be run at the end of each frame
--emu.addEventCallback(drawBoardBounds, emu.eventType.startFrame)
--emu.addMemoryCallback(drawBoardBounds, emu.memCallbackType.cpuExec, 0x8DD9, 0x8E63)
function drawWait()
frames = emu.read(emu.getLabelAddress("sf_Frames"), emu.memType.cpu)
seconds = emu.read(emu.getLabelAddress("sf_Seconds"), emu.memType.cpu)
emu.drawString(10, 10, string.format("%02d:%02d", seconds, frames), 0xFF0000, 0xFF000000)
end
emu.addMemoryCallback(drawWait, emu.memCallbackType.cpuExec, emu.getLabelAddress("scene_frameCode"))