Skip to content

Instantly share code, notes, and snippets.

@taotao54321
Created September 21, 2018 04:40
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 taotao54321/90de4d48324c7a9e00dedbbb5e4237cd to your computer and use it in GitHub Desktop.
Save taotao54321/90de4d48324c7a9e00dedbbb5e4237cd to your computer and use it in GitHub Desktop.
ドクターマリオ (FC) 処理量表示luaスクリプト (FCEUX用)
local cycle_start = nil
local cycle_end = nil
local function main()
memory.registerexec(0xB65B, function()
cycle_start = debugger.getcyclescount()
end)
memory.registerexec(0xB65E, function()
cycle_end = debugger.getcyclescount()
end)
emu.registerbefore(function()
cycle_start = nil
cycle_end = nil
end)
emu.registerafter(function()
if cycle_start ~= nil and cycle_end ~= nil then
local duration = cycle_end - cycle_start
gui.text(8, 8, string.format("Sound: %d", duration))
end
end)
end
main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment