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 %d\\n",pc,sr,d0,a7,totalcycles}') dbg:command('wpset 0,1000000,w,1,{logerror "W %X %X %X %d\\n",wpaddr,wpsize,wpdata,totalcycles; g}') dbg:command("go") count = 0 notifier = emu.add_machine_frame_notifier(function() count = count + 1 if count == 40 then manager.machine.video:snapshot() manager.machine:exit() end end)