mirror of
https://git.k-space.ee/arti/vt1200.git
synced 2026-10-30 12:03:54 +02:00
Root cause of the missing THRA write (HOST PORT test): the level-1 host-port
test's transmit is ISR-driven, and the DUART interrupt was never wired to the
CPU. The firmware installs RAM trampolines in the fixed vector table (INT1
vector 0xffffffc0 -> stub at bit 0x0f60 = JA 0x3FA92F40, which calls the DUART
ISR L3FA78D90 with (2, 0x270860, 0x6400000)). Counters: INTENB reaches 0x0006
(INT1|INT2) at the test, so interrupts are enabled.
vt1200.cpp: wire m_duart1/m_duart2 irq_cb() to CPU external interrupt 1/2
(duart1_irq_w/duart2_irq_w), gated on VT1200_DUART. Result: THRA writes go
from 0 to 20 per run; the test's SRA-overrun and RHRA-pattern checks now pass.
MAME tree (mc68681.cpp/.h), two datasheet-backed corrections with revert notes:
1. TxRDY was asserted mid-character ("not until the end of start bit time");
the datasheet asserts it at the THR->TSR transfer. Corrected.
2. The overrun error was latched when the overrunning character *completed*
(rx_fifo_push); the datasheet latches it "upon receipt of the start bit of
the new (overrunning) character". Corrected via duart_channel::rx_w().
This clears every check in the RXCHECK sub-test (flags 1 -> 0).
Acceptance is NOT met: cap.lua still prints 'LEVEL1/2 ERROR -> HOST PORT - 15'.
The next failure is the preceding L3FA71BC0 (DUART baud/timer) sub-test
returning 6; its flag-set sites were breakpointed and never fired. Regression
holds (no VT1200_* env -> PC=3FDCE400 samples=199). Details, numbers and the
datasheet audit: harness/mame/DUART_REPORT.md sections FINAL FINDINGS / UPDATE.
33 lines
1.1 KiB
Lua
33 lines
1.1 KiB
Lua
local machine = manager.machine
|
|
local cpu = machine.devices[':maincpu']
|
|
local dbg = machine.debugger
|
|
local prog = cpu.spaces['program']
|
|
if not dbg then machine:exit(); return end
|
|
local function w(a) return prog:read_u16(a) end
|
|
local function l(a) return prog:read_u32(a) end
|
|
local function dump(label, base, n)
|
|
local t = {}
|
|
for i=0,n-1 do t[#t+1] = string.format("%04X", w(base + i*16)) end
|
|
print(label .. " @ " .. string.format("%08X", base) .. ": " .. table.concat(t, " "))
|
|
end
|
|
print(string.format("VEC INT1=%08X INT2=%08X HI=%08X DI=%08X RESET=%08X",
|
|
l(0xffffffc0), l(0xffffffa0), l(0xfffffec0), l(0xfffffea0), l(0xffffffe0)))
|
|
local n=0
|
|
emu.register_frame_done(function()
|
|
n=n+1
|
|
if n==476 or n==482 then
|
|
print("---- frame "..n)
|
|
dump("RAM0f60", 0x0f60, 12)
|
|
dump("RAM0d80", 0x0d80, 12)
|
|
dump("TBL1d0", 0x2701d0, 8)
|
|
dump("TBL270", 0x270270, 8)
|
|
dump("TBL2f0", 0x2702f0, 8)
|
|
dump("TBL350", 0x270350, 8)
|
|
dump("TBL3b0", 0x2703b0, 8)
|
|
dump("TBL3f0", 0x2703f0, 8)
|
|
dump("STRUCT+0x0", 0x270890, 0x40)
|
|
end
|
|
if n>=485 then machine:exit() end
|
|
end, "vt1200-hp-dump")
|
|
dbg.execution_state='run'
|