PD4 display test: cycle diagnostic patterns, not just all-on

The real display's power-on test (JP1 jumper 5, firmware $B888) runs through
several drawing sequences — a solid fill, a border+grid, more — each held
briefly, to expose dead dots and addressing faults; it isn't just full on/off.

Both vPLASMA and the replica firmware now cycle 5 representative patterns:
solid, border+grid, horizontal stripes, vertical stripes, checkerboard.
- VPlasmaDevice.ShowTestPattern(int) + TestPatternCount; the app cycles them
  on a 1.2s timer while jumper 5 is installed.
- PlasmaDisplay::showTestPattern(int) + TEST_PATTERN_COUNT (shared logic); the
  Matrix Portal sketch's DOWN button toggles the cycling test.

(The firmware's exact byte patterns live in the display's native scan-buffer
layout, which we haven't mapped, so these stand in for that sequence rather
than reproducing it byte-for-byte.)

Verified: 29 C# tests pass; the C++ patterns render distinctly on the host.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Cyd
2026-07-16 20:34:33 -05:00
co-authored by Claude Opus 4.8
parent ab36cdd826
commit ebad6ee5fe
6 changed files with 82 additions and 13 deletions
+15 -2
View File
@@ -30,8 +30,10 @@ internal sealed class MainForm : Form
private readonly System.Windows.Forms.Timer _uiTimer = new() { Interval = 500 };
private readonly System.Windows.Forms.Timer _demoTimer = new() { Interval = 2800 };
private readonly System.Windows.Forms.Timer _testTimer = new() { Interval = 1200 };
private int _selfTestPage;
private int _demoScreen;
private int _testPattern;
// ---- config panel controls -------------------------------------------
private readonly ComboBox _portBox = new() { Width = 168, DropDownStyle = ComboBoxStyle.DropDownList };
@@ -118,6 +120,7 @@ internal sealed class MainForm : Form
_jp5.CheckedChanged += (_, _) => ApplyTestPattern();
_jp6.CheckedChanged += (_, _) => ApplyDemo();
_demoTimer.Tick += (_, _) => StepDemo();
_testTimer.Tick += (_, _) => StepTestPattern();
// Default straps: jumper 2 installed = 9600 (the game's rate). Jumper 4
// unstrapped = horizontal (the normal cockpit orientation).
@@ -130,6 +133,7 @@ internal sealed class MainForm : Form
{
_uiTimer.Dispose();
_demoTimer.Dispose();
_testTimer.Dispose();
_service.Dispose();
_pipeService.Dispose();
};
@@ -288,16 +292,25 @@ internal sealed class MainForm : Form
{
if (_jp5.Checked)
{
_device.ShowTestPattern();
PrependLog("Jumper 5 installed — panel test pattern (all dots lit)");
PrependLog("Jumper 5 installed — panel test (cycling diagnostic patterns)");
_testPattern = 0;
_device.ShowTestPattern(0);
_testTimer.Start();
}
else
{
_testTimer.Stop();
_device.Reset();
PrependLog("Jumper 5 removed — test pattern cleared");
}
}
private void StepTestPattern()
{
_testPattern = (_testPattern + 1) % VPlasmaDevice.TestPatternCount;
_device.ShowTestPattern(_testPattern);
}
private void ApplyDemo()
{
if (_jp6.Checked)