cpu = manager.machine.devices[":maincpu"] space = cpu.spaces["io"] log = io.open("io.log", "w") n = 0 function rec(dir, offset, data, mask) n = n + 1 if n <= 2000000 then log:write(string.format("%.9f %05X %s %04X %04X %04X\n", manager.machine.time:as_double(), cpu.state["CURPC"].value, dir, offset, data & 0xffff, mask & 0xffff)) end end wtap = space:install_write_tap(0x0000, 0xffff, "w", function(offset, data, mask) rec("W", offset, data, mask) end) rtap = space:install_read_tap(0x0000, 0xffff, "r", function(offset, data, mask) rec("R", offset, data, mask) end) frames = 0 sub = emu.add_machine_frame_notifier(function() frames = frames + 1 if frames == 1800 then log:close() manager.machine.video:snapshot() print("ACCESSES " .. n .. " TIME " .. manager.machine.time:as_double()) manager.machine:exit() end end)