change cursor drawing to be time based#85
Open
stevesims wants to merge 1 commit intobreakintoprogram:mainfrom
Open
change cursor drawing to be time based#85stevesims wants to merge 1 commit intobreakintoprogram:mainfrom
stevesims wants to merge 1 commit intobreakintoprogram:mainfrom
Conversation
fixes an issue for the emulator where the cursor rapidly flashed as it runs on hardware faster than an ESP32
stevesims
commented
Sep 5, 2023
Comment on lines
-157
to
-158
| bool cursorVisible = false; | ||
| bool cursorState = false; |
Contributor
Author
There was a problem hiding this comment.
the naming of these variables was rather confusing
cursorState is actually an indicator as to whether or not we should be drawing the cursor.
cursorVisible was a flag that got set to true once every 65536 times thru the loop, and on that singular loop iteration it would invert the cursorState.
the time-based approach effectively renames cursorState to drawCursor
| bool logicalCoords = true; // Use BBC BASIC logical coordinates | ||
| double logicalScaleX; // Scaling factor for logical coordinates | ||
| double logicalScaleY; | ||
| int count = 0; // Generic counter, incremented every iteration of loop |
Contributor
Author
There was a problem hiding this comment.
this counter was only used for flashing the cursor. as that code has been changed to be time-based it can go
Owner
|
Hi @stevesims I've got some ideas on how to do this better, so will hold onto this, just in case my ideas don't bear fruit. |
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.
fixes an issue for the emulator where the cursor rapidly flashed as it runs on hardware faster than an ESP32