local started, stopped = false, false local dsp_tag local function info() local out = io.open("devices.txt", "w") for tag, dev in pairs(manager.machine.devices) do if tag:find("qsound") then out:write(tag, " ", dev.shortname, "\n") if dev.shortname == "dsp16a" then dsp_tag = tag for name, entry in pairs(dev.state) do out:write(" ", name, "\n") end end end end out:close() end keep_frame = emu.add_machine_frame_notifier(function() local now = manager.machine.time:as_double() local dbg = manager.machine.debugger if not dsp_tag then info() end if not started and dsp_tag and now >= 1.0 then started = true dbg.visible_cpu = manager.machine.devices[dsp_tag] dbg:command('trace dsp.trace,' .. dsp_tag .. ',noloop,{tracelog "%04X: pt=%04X pr=%04X pi=%04X i=%03X r=%04X,%04X,%04X,%04X rb=%04X re=%04X j=%04X k=%04X x=%04X y=%08X p=%08X a0=%09X a1=%09X c=%02X,%02X,%02X auc=%02X psw=%04X t=%d\n",pc,pt,pr,pi,i,r0,r1,r2,r3,rb,re,j,k,x,y,p,a0,a1,c0,c1,c2,auc,psw,totalcycles}') elseif started and not stopped and now >= 1.0166666666666666 then stopped = true dbg:command('trace off,' .. dsp_tag) end end)