local machine = manager.machine local cpu = machine.devices[":maincpu"] frames = 0 limit = 180 if false then local dbg = machine.debugger dbg.visible_cpu = cpu dbg:command('trace cpu.trace,,noloop,{logerror "%X %X %X %X %X %X %d\\n",pc,a,x,y,s,p,totalcycles}') dbg:command('go') end if false then local space = cpu.spaces["program"] rtap = space:install_read_tap(0xC000, 0xC0FF, "a2r", function(offset, data, mask) machine:logerror(string.format("R %X %X\n", offset, data)) end) wtap = space:install_write_tap(0xC000, 0xC0FF, "a2w", function(offset, data, mask) machine:logerror(string.format("W %X %X\n", offset, data)) end) end notifier = emu.add_machine_frame_notifier(function() frames = frames + 1 if frames == limit then if true then machine.video:snapshot() end print(string.format("A2STOP frames=%d", frames)) machine:exit() end end)