local dbg = manager.machine.debugger dbg.visible_cpu = manager.machine.devices[":sub"] dbg:command('trace S.trace,:sub,noloop,{logerror "S %X %X %X %X %d\\n",pc,a,x,p,totalcycles}') dbg:command("go") count = 0 notifier = emu.add_machine_frame_notifier(function() count = count + 1 if count == 3 then manager.machine.video:snapshot() manager.machine:exit() end end)