Fix CC flags display order in Processor State debugger window - #567
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.