-- 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