Skip to content

Fix menu skipping caused by "Overclock when busy"#6

Draft
iczero wants to merge 2 commits intoeanema:masterfrom
iczero:tiemu-turbo-fix
Draft

Fix menu skipping caused by "Overclock when busy"#6
iczero wants to merge 2 commits intoeanema:masterfrom
iczero:tiemu-turbo-fix

Conversation

@iczero
Copy link

@iczero iczero commented May 16, 2024

When the "overclock when busy" option is enabled with TI-89 family calculators, using the arrow keys in menus will cause skipping. This appears to happen because turbo kicks in too soon, resulting in the arrow keys triggering the calculator's autorepeat. This seems to be fixed simply by waiting 2 frames before starting turbo. Menu scrolling usually seems to complete in a single frame.

Also, thanks for reviving the project.

@iczero iczero force-pushed the tiemu-turbo-fix branch from 0420c12 to fa47b33 Compare May 16, 2024 08:10
@iczero iczero marked this pull request as draft May 16, 2024 08:32
@iczero
Copy link
Author

iczero commented May 16, 2024

Looks like the root cause is not this. Will look further

@iczero
Copy link
Author

iczero commented May 16, 2024

@eanema Do you have any objections to simply removing the screen update thread? As far as I can tell, there is no performance penalty from running screen refresh within the emulation thread. correction: yes there is. Merging the screen thread also seems to reduce flickering and other artifacts. I assume they were originally separate threads since phones 10 years ago were slow.

The root cause of the menu skipping issue is that isBusy is only updated from the screen thread, but the screen thread runs at a constant rate (SCREEN_LOOP_SLEEP) irrespective of whether the emulation thread is turboing. As such, if the emulation thread begins turboing, it won't stop until the screen thread next wakes up, even if the busy status was cleared.

iczero@bc2cf0c

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