Short script that I wrote to find lag frames in Tonma Arcade. Needs to be manually stopped and started once in a while, for mysterious reasons.
memory.usememorydomain("v30 : ram : 0xA0000-0xA3FFF")
local function main()
event.onframestart(function()
lag1 = memory.readbyte(0x23E0)
end)
event.onframeend(function()
lag2 = memory.readbyte(0x23E0)
end)
if lag1 == lag2 then
emu.setislagged()
tastudio.setlag(emu.framecount(), true)
emu.setlagcount(emu.lagcount()+1)
end
end
while true do
main();
emu.frameadvance()
end