plasma window: initialize the display area (junk shown until the callsigns)
The desktop plasma marquee showed heap garbage from boot until the gauge renderer first drew the callsigns. Root cause [T0]: PixelMap8(w,h) allocates its pixel bytes UNCLEARED (GRAPH2D.cpp `new Byte[w*h]`, no memset) and Video8BitBuffered never clears them either -- only changedLine[] is zeroed. The real pod never showed it: the serial PlasmaDisplay transfers only CHANGED lines, so the garbage never left the buffer and the hardware marquee sat at its power-on blank. PlasmaWindow::Update however blits the WHOLE buffer every frame, exposing the junk for the window-up-to-first-draw gap (seconds on slower rigs). Fix: PlasmaWindow ctor memsets the pixelBuffer to index 0 (the near-black background) -- the window comes up blank like the hardware did. Glass-layer only; the serial pod path is untouched. Verified: glass boot shows a clean marquee from the first visible frame. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -54,6 +54,22 @@ PlasmaWindow::PlasmaWindow():
|
||||
}
|
||||
blitBuffer = new unsigned long[plasmaWidth * plasmaHeight];
|
||||
memset(blitBuffer, 0, plasmaWidth * plasmaHeight * sizeof(unsigned long));
|
||||
|
||||
//
|
||||
// INITIALIZE THE DISPLAY AREA (2026-08-10). PixelMap8(w,h) allocates its
|
||||
// pixel bytes UNCLEARED (GRAPH2D.cpp: `new Byte[w*h]`, no memset), so the
|
||||
// 128x32 plasma buffer starts as heap garbage. The real pod never showed
|
||||
// it: the serial PlasmaDisplay transfers only CHANGED lines (changedLine[]
|
||||
// is zeroed by the base ctor), so the garbage never left the buffer and
|
||||
// the hardware marquee sat at its power-on blank. This desktop window
|
||||
// blits the WHOLE buffer every frame, so the junk was visible from boot
|
||||
// until the gauge renderer first drew the callsigns. Clear to index 0
|
||||
// (the near-black background) -- the window comes up blank like the
|
||||
// hardware did.
|
||||
//
|
||||
if (pixelBuffer != NULL && pixelBuffer->Data.MapPointer != NULL)
|
||||
memset(pixelBuffer->Data.MapPointer, 0, plasmaWidth * plasmaHeight);
|
||||
|
||||
DEBUG_STREAM << "[plasmawin] desktop plasma display up (scale x"
|
||||
<< scale << ")\n" << std::flush;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user