Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local cumsum = 0
- local prev_counter = 0
- local tic = 0
- local flag_color = "yellow"
- local counter_color = "yellow"
- while true do
- pad=joypad.get(1);
- --print(pad)
- counter = mainmemory.read_s8(0x001F9D)
- flag = mainmemory.read_s8(0x001F9B)
- if pad.X then
- prev_counter = counter
- tic = counter
- cumsum = 0
- end
- if prev_counter > counter then
- cumsum = cumsum + 256
- end
- for i = 3, 16, 1 do
- gui.drawText(18*(i-3), 0, string.format("%02X", 0x90+i),"white", null, 12, "Courier New")
- gui.drawText(18*(i-3), 12, string.format("%02X", mainmemory.read_u8(0x001F90+i)), "yellow", null, 12, "Courier New")
- end
- gui.drawText(0, 24, "Count: ", counter_color, null, 12, "Courier New")
- if counter < 0 then
- counter_color = "red"
- else
- counter_color = "yellow"
- end
- gui.drawText(45, 24, counter, counter_color, null, 12, "Courier New")
- gui.drawText(0, 36, "Flag: ", flag_color, null, 12, "Courier New")
- if flag == 0 then
- flag_color = "red"
- else
- flag_color = "yellow"
- end
- gui.drawText(45, 36, flag, flag_color, null, 12, "Courier New")
- gui.drawText(0, 48, "Last: " .. cumsum + counter - tic, "white", null, 12, "Courier New")
- prev_counter = counter
- emu.frameadvance()
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement