-- hp_disp.lua -- what code value actually reaches the HOST PORT handler? -- Dispatcher reads the status code from bit 0x16F0 (CODE22_REPORT). HOST PORT -- handler = 3FDE9D70. Also log the host-port caller's 0x400 return site. 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, body) dbg:command('bpset ' .. addr .. ',,{ ' .. body .. ' ; g }') end bp("3fde9d70", 'printf "HOSTPORT-HANDLER code=%08X\\n", d@16F0') bp("3fa84fb0", 'printf "CALL-L3FA6E4B0\\n"') bp("3fa84fe0", 'printf "AFTER-CALL a8=%08X\\n", a8') bp("3fa853a0", 'printf "CALLER-ERR-RET a8=%08X a11=%08X\\n", a8, a11') bp("3fa853d0", 'printf "CALLER-OK-PATH code=%08X\\n", d@16F0') bp("3fdf0630", 'printf "DISPATCH-READ code=%08X\\n", d@16F0') local n = 0 emu.register_frame_done(function() n = n + 1 if n >= tonumber(os.getenv("HP_FRAMES") or "700") then print("done "..n); machine:exit() end end, "vt1200-hp-disp") dbg.visible_cpu = cpu dbg.execution_state = 'run'