Skip to content

Draw the mode header once when initializing a non-WGN mode - #3

Closed
xmutantson wants to merge 1 commit into
ARSFI:masterfrom
xmutantson:fix/duplicate-mode-header
Closed

xmutantson wants to merge 1 commit into
ARSFI:masterfrom
xmutantson:fix/duplicate-mode-header

Conversation

@xmutantson

Copy link
Copy Markdown

Symptom: after the simulator initializes with a mode other than WGN selected (seen with MPG), the front panel shows the mode and S:N header lines twice - four header rows instead of two. The Lvl and CF lines below are unaffected. The duplicate clears on the next mode or parameter redraw, so it is cosmetic, but it recurs.

Root cause: in the mode-screen refresh in loop(), the WGN branch condition is (intMode == 0) || (! blnInitialized) - any uninitialized state selects the WGN branch regardless of the actual mode. When initializing into MPG (or MPM/MPD), that branch prints the mode + S:N pair, and the mode-specific branch then prints the same pair again. There is no screen clear or cursor reset between the two branches, so the second copy lands two text rows lower instead of overwriting.

Fix: select the WGN branch on the mode alone. Initialization of a non-WGN mode falls through to its own branch and draws the header exactly once; WGN behavior is unchanged (its own initialization path still runs identically).

One line changed; no functional/DSP behavior affected - display only.

When the mode screen initializes with a mode other than WGN selected, the
WGN branch also runs because its condition treats any uninitialized state
as WGN. Both branches then print the mode and S:N lines, and since there
is no screen clear or cursor reset between them the second copy lands two
text rows lower, leaving a duplicated header on the panel until the next
full redraw.

Select the WGN branch on the mode alone. Initialization of a non-WGN mode
falls through to its own branch and the header is drawn exactly once; WGN
behavior is unchanged.
@xmutantson

Copy link
Copy Markdown
Author

Superseded by the consolidated correctness PR #5, which retains this duplicate-header cleanup and combines it with the required serial-control, state-reporting, maintenance, testing, and build-attestation changes.

@xmutantson xmutantson closed this Sep 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant