-- code22_fail.lua -- -- L3FA7C050 returns code 0x100 (-> VIDEO MEMORY-22) when the memory test -- L3F2018B0 returns nonzero. Find which failure branch inside L3F2018B0 is -- taken by breaking on each of its error exits. -- -- CF_FRAMES=300 vt1200 ... -autoboot_script harness/mame/code22_fail.lua 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 -- address -> literal label (embedded in the printf, no %s) local targets = { { "3f201c80", "WALKING-BIT-MISMATCH" }, { "3f207080", "HANDLER-3F207080-a2eqa0" }, { "3f2064c0", "HANDLER-3F2064C0-a2nea0" }, { "3f2070c0", "HANDLER-3F2070C0-REFCNT-eq" }, { "3f207050", "HANDLER-3F207050-a1eqa0" }, { "3f207180", "HANDLER-3F207180-a2nea0-2" }, { "3f206910", "HANDLER-3F206910-a1nea0" }, { "3f207200", "HANDLER-3F207200-walkerr" }, { "3f2073d0", "HANDLER-3F2073D0-spne0" }, { "3fa7de30", "L3FA7C050-RET-0x100" }, } for _, t in ipairs(targets) do dbg:command(string.format( 'bpset %s,,{ printf "%s pc=%%08X a8=%%08X a9=%%08X a11=%%08X\\n", pc, a8, a9, a11 ; g }', t[1], t[2])) end print("breakpoints armed: " .. #targets) local maxframes = tonumber(os.getenv("CF_FRAMES") or "300") local n = 0 emu.register_frame_done(function() n = n + 1 if n >= maxframes then print("done (" .. n .. " frames)") machine:exit() end end, "vt1200-cf") dbg.visible_cpu = cpu dbg.execution_state = 'run'