local cpu = manager.machine.devices[":maincpu"] local space = cpu.spaces["program"] emu.register_frame_done(function() if space:read_u8(0x2280) == 0xA5 then local out = {} for i = 0, 63 do out[#out + 1] = string.format("%02x", space:read_u8(0x2200 + i)) end local f = io.open("result.txt", "w"); f:write(table.concat(out)); f:close() manager.machine:exit() end end)