local cpu=manager.machine.devices[":maincpu"]; local dbg=manager.machine.debugger; local fr=0; local seen=0 local lf=io.open(os.getenv("POUT"),"w") emu.register_frame_done(function() fr=fr+1 if fr==tonumber(os.getenv("WSTART") or "1200") then for a in string.gmatch(os.getenv("BPS_AT"),"%x+") do cpu.debug:bpset(tonumber(a,16),os.getenv("BPCOND") or "1",'printf "B pc=%x d3=%x d7=%x forced=%x selv=%x ret=%x",pc,d3,d7,w@ffe3f0,w@ffe3f2,d@(sp) ; go') end end if fr>tonumber(os.getenv("WSTART") or "1200") and dbg.execution_state~="run" then dbg.execution_state="run" end local log=dbg.consolelog; for k=seen+1,#log do local l=log[k]; if l:match("^B ") then lf:write(fr," ",l,"\n"); lf:flush() end end; seen=#log end)