Skip to content

Instantly share code, notes, and snippets.

@dagit
Last active January 4, 2018 02:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dagit/a71145262e268ccf051a06d2c5a21a1e to your computer and use it in GitHub Desktop.
Save dagit/a71145262e268ccf051a06d2c5a21a1e to your computer and use it in GitHub Desktop.
local function print_nmi()
-- 10: give it a few frames to warm up, why not?
if emu.framecount() == 10 then
-- TODO: use gui.text(0, 0, foo) instead of print(foo)
print("" .. (memory.readbyteunsigned(0xfffa) + memory.readbyteunsigned(0xfffb)*256))
end
end
emu.registerbefore(print_nmi)
-- load it with:
-- fceux --loadlua print_nmi.lua rom.zip
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment