Skip to content

change cursor drawing to be time based#85

Open
stevesims wants to merge 1 commit intobreakintoprogram:mainfrom
stevesims:time-based-cursor-upstream
Open

change cursor drawing to be time based#85
stevesims wants to merge 1 commit intobreakintoprogram:mainfrom
stevesims:time-based-cursor-upstream

Conversation

@stevesims
Copy link
Contributor

fixes an issue for the emulator where the cursor rapidly flashed as it runs on hardware faster than an ESP32

fixes an issue for the emulator where the cursor rapidly flashed as it runs on hardware faster than an ESP32
Comment on lines -157 to -158
bool cursorVisible = false;
bool cursorState = false;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this counter was only used for flashing the cursor. as that code has been changed to be time-based it can go

@breakintoprogram breakintoprogram added the enhancement New feature or request label Sep 12, 2023
@breakintoprogram
Copy link
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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

2 participants