Created
September 21, 2018 04:40
-
-
Save taotao54321/90de4d48324c7a9e00dedbbb5e4237cd to your computer and use it in GitHub Desktop.
ドクターマリオ (FC) 処理量表示luaスクリプト (FCEUX用)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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