-- hp_probe.lua -- breakpoints on the level-1 host-port test's decision points. -- -- HP_FRAMES=700 vt1200 ... -autoboot_script harness/mame/hp_probe.lua -- Output goes to debug.log (debugger console), not stdout. local machine = manager.machine local cpu = machine.devices[':maincpu'] local dbg = machine.debugger if not dbg then print("ERROR: no debugger"); machine:exit(); return end local function bp(addr, msg) dbg:command(string.format('bpset %s,,{ printf "%s pc=%%08X a7=%%08X a9=%%08X a11=%%08X a13=%%08X\\n", pc, a7, a9, a11, a13 ; g }', addr, msg)) end bp("3fa6e4b0", "ENTER-L3FA6E4B0") bp("3fa753d0", "ENTER-RXCHECK") bp("3fa767e0", "ENTER-XMITPASS") bp("3fa76890", "XMIT-SKIPCHK") bp("3fa761e0", "SRA-CHECK") bp("3fa76390", "RHRA-CMP") bp("3fa76300", "PATTERN") bp("3fa76320", "MASK") bp("3fa75bb0", "MR1-WRITE") bp("3fa75cd0", "MR2-WRITE") bp("3fa75dd0", "RXCHECK-COUNT") bp("3fa75d70", "RXCHECK-CRA5") bp("3fa76a40", "XMIT-SET-AA") bp("3fa772d0", "XMIT-SET-COUNT4") print("probe armed") local n = 0 local maxframes = tonumber(os.getenv("HP_FRAMES") or "700") emu.register_frame_done(function() n = n + 1 if n >= maxframes then print("done " .. n); machine:exit() end end, "vt1200-hp-probe") dbg.visible_cpu = cpu dbg.execution_state = 'run'