-- console_frames.lua -- the firmware console transcript WITH frame numbers. -- -- Break on the printer entry 0x3FDE00C0 (a9 = message bit pointer) and on the -- error-report dispatcher and the level-1 runner, so the transcript is -- interleaved with the control-flow milestones. Output goes to MAME's -- debug.log (run with -debuglog); stdout only carries frame summaries. -- -- CF_FRAMES= budget (default 20000) -- -- vt1200 ... -debug -debugger none -debuglog \ -- -autoboot_script harness/mame/console_frames.lua -autoboot_delay 0 local machine = manager.machine local dbg = machine.debugger local cpu = machine.devices[':maincpu'] if not dbg then print("ERROR: debugger not enabled; pass -debug") machine:exit() return end FRAME = 0 dbg:command('bpset 3fde00c0,,{ printf "P fr=%d a9=%08X\\n", FRAME, a9 ; g }') dbg:command('bpset 3fdf72d0,,{ printf "RUNNER-ENTRY fr=%d a3=%08X\\n", FRAME, a3 ; g }') dbg:command('bpset 3f204400,,{ printf "L1-CALL fr=%d\\n", FRAME ; g }') dbg:command('bpset 3f204440,,{ printf "L1-GATE fr=%d a8=%08X\\n", FRAME, a8 ; g }') dbg:command('bpset 3f204460,,{ printf "L1-ZERO-LOOPBACK fr=%d\\n", FRAME ; g }') dbg:command('bpset 3f208060,,{ printf "LED-RESTART fr=%d a10=%08X\\n", FRAME, a10 ; g }') dbg:command('bpset 3f208660,,{ printf "LED-BLINK fr=%d a10=%08X\\n", FRAME, a10 ; g }') dbg:command('bpset 3fde9d70,,{ printf "ERR-HOSTPORT fr=%d\\n", FRAME ; g }') dbg:command('bpset 3fdf0630,,{ printf "ERR-DISPATCH fr=%d a8=%08X a10=%08X\\n", FRAME, a8, a10 ; g }') local maxframes = tonumber(os.getenv("CF_FRAMES") or "20000") emu.register_frame_done(function() FRAME = FRAME + 1 if FRAME % 2000 == 0 then print(string.format("frame %d PC=%08X", FRAME, cpu.state['PC'].value)) end if FRAME >= maxframes then print("done (" .. FRAME .. " frames)") machine:exit() end end, "vt1200-cf") dbg.visible_cpu = cpu dbg.execution_state = 'run'