diff --git a/harness/mame/pal_mono_frame600.png b/harness/mame/pal_mono_frame600.png new file mode 100644 index 0000000..d8a992c Binary files /dev/null and b/harness/mame/pal_mono_frame600.png differ diff --git a/harness/mame/palverify.lua b/harness/mame/palverify.lua new file mode 100644 index 0000000..e5bbcc6 --- /dev/null +++ b/harness/mame/palverify.lua @@ -0,0 +1,30 @@ +-- palverify.lua -- take a real MAME screenshot (video manager -> palette applied) +-- at a chosen frame. Unlike dump_frame()'s PPM (straight from bitmap pens), a +-- screen:snapshot() renders through the palette, so it is the correct instrument +-- for checking the mono colour ramp. +-- +-- PAL_FRAME= PAL_OUT= ... -autoboot_script palverify.lua + +local machine = manager.machine +local dbg = machine.debugger +local screens = machine.screens + +local at = tonumber(os.getenv("PAL_FRAME") or "600") +local out = os.getenv("PAL_OUT") or "/home/arti/code/k-space/vt1200/harness/mame/pal_snap.png" + +local screen = nil +for tag, s in pairs(screens) do screen = s; break end +if not screen then print("ERROR: no screen device"); machine:exit(); return end + +local n = 0 +emu.register_frame_done(function() + n = n + 1 + if n == at then + local err = screen:snapshot(out) + print(string.format("SNAP frame=%d -> %s err=%s", n, out, tostring(err))) + machine:exit() + end + if n > at + 5 then machine:exit() end +end, "vt1200-palverify") + +if dbg then dbg.execution_state = 'run' end diff --git a/harness/mame/vt1200.cpp b/harness/mame/vt1200.cpp index 430f6ef..46ee53c 100644 --- a/harness/mame/vt1200.cpp +++ b/harness/mame/vt1200.cpp @@ -1196,7 +1196,10 @@ void vt1200_state::vt1200(machine_config &config) // 256 entries so the TMS34010 renderer can encode multi-bit pixels; the // terminal's real output stage is a later question. - PALETTE(config, m_palette).set_entries(256); + // Explicit monochrome ramp: pen 0 = black, pen 1 = white. render_active_line() + // writes only pens 0/1, so with no init delegate the on-screen colour was + // whatever MAME's default palette held (reported: red). Two entries suffice. + PALETTE(config, m_palette, palette_device::MONOCHROME).set_entries(2); // The two Signetics SCN2681 DUARTs (same family as the Motorola MC68681: // 2681 = RD/WR strobes, 68681 = R/W + DTACK + interrupt vector). The