-- code22_final.lua -- clean evidence capture for CODE22_REPORT.md -- -- Prints, in order: the memory test's loaded args, the walking-bit read vs -- expected, the walking-bit failure exit, the DRAM refresh-counter compare, -- the memory test's return value, and L3FA7C050's final return. -- -- CFF_FRAMES=300 vt1200 ... -autoboot_script harness/mame/code22_final.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 local function bp(addr, fmt, regs) dbg:command(string.format('bpset %s,,{ printf "%s\\n", %s ; g }', addr, fmt, regs)) end bp("3f201990", "ARGS a13=%08X a7=%08X a3=%08X a4=%08X", "a13, a7, a3, a4") bp("3f201c20", "WALK-CMP read=%08X expected=%08X", "a11, a8") bp("3f201c80", "WALK-FAIL a12=%08X a8=%08X a11=%08X", "a12, a8, a11") bp("3f201ed0", "REFCNT-CMP a0=%08X a6=%08X", "a0, a6") bp("3fa7dda0", "MEMTEST-RET a8=%08X", "a8") bp("3fa7de30", "C050-RET-0x100 a8=%08X", "a8") print("breakpoints armed") local maxframes = tonumber(os.getenv("CFF_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-cff") dbg.visible_cpu = cpu dbg.execution_state = 'run'