mirror of
https://git.k-space.ee/arti/vt1200.git
synced 2026-10-31 12:05:05 +02:00
36 lines
1.2 KiB
Lua
36 lines
1.2 KiB
Lua
-- Is the TMS34010 display controller enabled, and what does the firmware have
|
|
-- in the display registers? The video renderer (and therefore the driver's
|
|
-- scanline/frame dump) only runs when DPYCTL bit 15 is set.
|
|
--
|
|
-- DPY_FRAMES=600 <mame> vt1200 ... -autoboot_script harness/mame/dpyctl.lua
|
|
|
|
local machine = manager.machine
|
|
local cpu = machine.devices[':maincpu']
|
|
local dbg = machine.debugger
|
|
local prog = cpu.spaces['program']
|
|
|
|
local maxframes = tonumber(os.getenv("DPY_FRAMES") or "600")
|
|
local every = tonumber(os.getenv("DPY_EVERY") or "50")
|
|
local n = 0
|
|
local seen_enabled = false
|
|
|
|
local function rd(a) return prog:read_u16(a) end
|
|
|
|
emu.register_frame_done(function()
|
|
n = n + 1
|
|
local dpyctl = rd(0xc0000080)
|
|
if (dpyctl & 0x8000) ~= 0 then seen_enabled = true end
|
|
if n % every == 0 then
|
|
print(string.format(
|
|
"frame %5d DPYCTL=%04X%s CONTROL=%04X DPYSTRT=%04X DPYINT=%04X DPYTAP=%04X DPYADR=%04X",
|
|
n, dpyctl, (dpyctl & 0x8000) ~= 0 and " <ENABLED>" or "",
|
|
rd(0xc00000b0), rd(0xc0000090), rd(0xc00000a0), rd(0xc00001b0), rd(0xc00001e0)))
|
|
end
|
|
if n >= maxframes then
|
|
print("display enabled at any point: " .. tostring(seen_enabled))
|
|
machine:exit()
|
|
end
|
|
end, "vt1200-dpyctl")
|
|
|
|
dbg.execution_state = 'run'
|