local dbg = manager.machine.debugger local cpu = manager.machine.devices[":maincpu"] dbg.visible_cpu = cpu io_log = io.open("io.log", "w") frames = 0 io_space = cpu.spaces["io"] io_tap = io_space:install_write_tap(0x00, 0xff, "iolog", function(offset, data, mask) io_log:write(string.format("%d %02X %04X %04X\n", frames, offset, data, mask)) end) if 0 > 0 then dbg:command('trace trace.log,maincpu,noloop,{tracelog "AW=%04X BW=%04X CW=%04X DW=%04X SP=%04X PS=%04X DS0=%04X SS=%04X PSW=%04X ",AW,BW,CW,DW,SP,PS,DS0,SS,PSW}') end dbg:command('go') notifier = emu.add_machine_frame_notifier(function() frames = frames + 1 if frames == 0 then dbg:command('trace off,maincpu') end if frames == 300 then manager.machine.video:snapshot() io_log:close() print(string.format("FRAMES %d TIME %.6f", frames, manager.machine.time:as_double())) manager.machine:exit() end end)