(10 hours ago)Pete Wrote: Well re-engineered and liking the results. Very low CPU output, especially with the added idle feature. Not too happy with the loss of cursor flashing when idle, but that's about the only negative. One the big plus side, besides my computer no longer catching on fire, the different method allowed me more optimization. I cut out nearly 20% of the code in total.
https://qb64phoenix.com/forum/showthread...5#pid32125
Pete
Aye. If you're not updating the display then you can't see those changes with flashing cursor (or even flashing text). The only way around, if you have to have that flashing cursor/text, is to update the display each cycle.
It'll cost you a little more CPU processing, but sometimes that's the price you have to pay to update things. One possible fix, which would still minimize CPU usage, would be to add a timer to your code to call _DISPLAY every so often, no matter what.
Code: (Select All)
DO
...do all your stuff
_Limit 60
force_update = (force_update + 1) MOD 2
If force_update = 0 AND act = 0 THEN
'call the screen redraw routine if you didn't call it earlier this cycle
_DISPLAY 'every other pass, make certain you update the display
END IF
LOOP
You still skip *some* of your unnecessary screen updates, but you should also always hit that 30FPS update for the cursor/text blinking. It's kinda a hybrid method for manually implementing a type of _AutoDisplay, but honestly, if those were a major concern for me, I think I'd just update each pass and not worry about the CPU savings unless things were just completely out of control without that static screen skipping updates.