Skip to content

Fix CC flags display order in Processor State debugger window - #567

Merged
ejaquay merged 1 commit into
VCCE:mainfrom
fstiffo:main
May 23, 2026
Merged

Fix CC flags display order in Processor State debugger window#567
ejaquay merged 1 commit into
VCCE:mainfrom
fstiffo:main

Conversation

@fstiffo

@fstiffo fstiffo commented May 16, 2026

Copy link
Copy Markdown
Contributor

Bug: Processor State window displays CC flags in wrong order. The loop iterates from bit 0 to bit 7 but the UI labels run E F H I N Z V C (bit 7 to bit 0), causing every flag to display in the wrong column.

Fix: Reverse the loop iteration from n = 7 down to n = 0.

Verified: MAME displays correct CC flags for the same code; VCC displayed them all shifted, confirmed by cross-referencing emulation results with memory-based flag tests.

The loop iterating over the CC register bits was incrementing from
bit 0 to bit 7, but the UI labels display flags in the order
E F H I N Z V C (bit 7 down to bit 0), causing every flag to be
shown in the wrong column.

Changed loop to iterate from n=7 down to n=0 so that bit 7 (E flag)
is drawn at the leftmost position, matching the UI labels correctly.

Verified: MAME shows correct CC flag values for the same test code.
VCC was showing N in the I column, Z in the H column, etc.
Cross-confirmed by testing flag state via memory reads in assembly,
proving the emulation itself was correct and only the display was wrong.
@ejaquay
ejaquay merged commit 72a1432 into VCCE:main May 23, 2026
1 check passed
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.

2 participants