Skip to content

Instantly share code, notes, and snippets.

@pocokhc
Created September 21, 2018 09:47
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 pocokhc/354aacd6070392a5ebf85d59c316fd2e to your computer and use it in GitHub Desktop.
Save pocokhc/354aacd6070392a5ebf85d59c316fd2e to your computer and use it in GitHub Desktop.
--[[
TaoTao氏作成の
---
ドクターマリオ (FC) 処理量表示luaスクリプト (FCEUX用)
https://gist.github.com/taotao54321/90de4d48324c7a9e00dedbbb5e4237cd
---
をBizHawk版にしたものです。
NES core を "NesCore"にしないと動きません。
(QuickNes is not support)
--]]
local cycle_start = nil
local cycle_end = nil
event.onmemoryexecute(function()
cycle_start = emu.totalexecutedcycles()
end,0xB65B)
event.onmemoryexecute(function()
cycle_end = emu.totalexecutedcycles()
end,0xB65E)
local function main()
cycle_start = nil
cycle_end = nil
emu.frameadvance()
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
while true do
main()
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment