cpu = manager.machine.devices[":z80"] log = io.open("io.log", "w") local function now() return manager.machine.time:as_double() end wtap = cpu.spaces["io"]:install_write_tap(0x00, 0xff, "outs", function(offset, data, mask) log:write(string.format("O %02X %02X %.9f\n", offset, data, now())) end) rtap = cpu.spaces["io"]:install_read_tap(0x00, 0xff, "ins", function(offset, data, mask) log:write(string.format("I %02X %02X %.9f\n", offset, data, now())) end) notifier = emu.add_machine_frame_notifier(function() local t = now() if t >= 3.0 then manager.machine.video:snapshot() log:close() manager.machine:exit() end end)