plasma: hide the cursor before anything draws
The firmware parks a cursor artifact wherever text last ended, and nothing ever turned it off - the native games did, once at startup (ESC G 0, L4PLASMA.CPP), which is why the cabinet never showed it. Seen on the bench as a stray block sitting in the Descent 3 nameplate. ShowGreetingAsync now sends cursor-hidden as its first act on every plasma open, before the clear and greeting, so every path that follows - greeting, feedback text, bitmap rows - draws on a cursorless panel. PlasmaDisplay gains the CursorAsync wrapper for the ESC G command the command builder already had. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
@@ -25,6 +25,15 @@ public sealed class PlasmaDisplay
|
||||
public Task ClearAsync(CancellationToken ct = default) =>
|
||||
WriteLockedAsync(new[] { PlasmaCommands.Clear() }, ct);
|
||||
|
||||
/// <summary>
|
||||
/// Set the cursor mode (<c>ESC G n</c>): 0 hidden, 1 steady, 3 flashing.
|
||||
/// The native games send <c>ESC G 0</c> once at startup
|
||||
/// (<c>L4PLASMA.CPP</c>) — without it the firmware's cursor artifact sits
|
||||
/// wherever text last ended.
|
||||
/// </summary>
|
||||
public Task CursorAsync(byte mode, CancellationToken ct = default) =>
|
||||
WriteLockedAsync(new[] { PlasmaCommands.Cursor(mode) }, ct);
|
||||
|
||||
public Task CursorHomeAsync(CancellationToken ct = default) =>
|
||||
WriteLockedAsync(new[] { PlasmaCommands.CursorHome() }, ct);
|
||||
|
||||
|
||||
@@ -337,6 +337,11 @@ public sealed class RioCoordinator : IDisposable
|
||||
{
|
||||
try
|
||||
{
|
||||
// Hide the cursor before anything draws, as the native games did
|
||||
// once at startup (ESC G 0, L4PLASMA.CPP): the firmware otherwise
|
||||
// leaves its cursor artifact wherever text last ended, which reads
|
||||
// as a stray block parked in the nameplate.
|
||||
await plasma.CursorAsync(0).ConfigureAwait(false);
|
||||
await plasma.ClearAsync().ConfigureAwait(false);
|
||||
if (!string.IsNullOrWhiteSpace(greeting))
|
||||
await plasma.PosTextAsync(greeting!).ConfigureAwait(false); // (0,0) = auto-center
|
||||
|
||||
Reference in New Issue
Block a user