local dbg = manager.machine.debugger dbg.visible_cpu = manager.machine.devices[":maincpu"] dbg:command('trace S.trace,:maincpu,noloop,{logerror "S %X %X %X %X %X %X %X %X %X %d %d\\n",pc,a,b,c,d,e,h,l,sp,totalcycles,beamy}') dbg:command('wpiset 0,8,w,1,{logerror "OUT %X %X %d %d\\n",wpaddr,wpdata,totalcycles,beamy; g}') dbg:command("go") count = 0 notifier = emu.add_machine_frame_notifier(function() count = count + 1 if count == 30 then manager.machine.video:snapshot() manager.machine:exit() end end)