-- hp_int.lua -- is the DUART IRQ reaching the CPU? local machine = manager.machine local cpu = machine.devices[':maincpu'] local dbg = machine.debugger local prog = cpu.spaces['program'] 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\\n", pc, a7, a9, a11 ; g }', addr, msg)) end bp("0f60", "INT1-TRAMPOLINE") bp("0f30", "INT2-TRAMPOLINE") bp("3fa92f40", "INT1-HANDLER") bp("3fa78d90", "DUART-ISR") bp("3fa79c00", "ISR-THRA") bp("3fa7b6e0", "DUART-ISR2") local rd = function(a) return prog:read_u16(a) end local last = {} local keys = { INTPEND=0xc0000120, INTENB=0xc0000110, D1ISR=0x06400050 } local n = 0 emu.register_frame_done(function() n = n + 1 for k,a in pairs(keys) do local v = rd(a) if last[k] ~= v then print(string.format("f%4d %s -> %04X", n, k, v)); last[k]=v end end if n >= tonumber(os.getenv("HP_FRAMES") or "700") then print("done "..n); machine:exit() end end, "vt1200-hp-int") dbg.visible_cpu = cpu dbg.execution_state = 'run'