space = manager.machine.devices[":maincpu"].spaces["program"] log = io.open("io.log", "w") vram, high = 0, 0 reg_tap = space:install_write_tap(0x0010, 0x007f, "regs", function(offset, data, mask) log:write(string.format("%.6f W %04X %02X\n", manager.machine.time:as_double(), offset, data)) end) vram_tap = space:install_write_tap(0xa000, 0xdfff, "vram", function(offset, data, mask) vram = vram + 1 end) high_tap = space:install_write_tap(0xe000, 0xffff, "high", function(offset, data, mask) high = high + 1 end) frames = 0 sub = emu.add_machine_frame_notifier(function() frames = frames + 1 if frames == 300 then log:write(string.format("VRAMWRITES %d\nHIGHWRITES %d\n", vram, high)) log:close() manager.machine.video:snapshot() print("DONE " .. frames) manager.machine:exit() end end)