Flicker with GRAPH_put_char

Jestin

New Member
Jan 25, 2020
11
8
3
I'm trying to figure out a way to eliminate or reduce flicker when rendering moving text to the screen via the kernal's GRAPH_put_char subroutine. I'm animating the text by drawing the characters twice; once that draws the character the color of the background to erase the previous, and then one that draws the character with the foreground color in the updated position. For single characters, this works well:

short_string.gif

However, for longer strings, it seems like the character drawing routine takes too much time, and I get really bad flicker:

long_string.gif

I'm sure this is exacerbated because I'm drawing the text twice, but I've also tried erasing the previous text by drawing a rectangle with GRAPH_draw_rect, and also by setting a window around the previous text with GRAPH_set_window and then calling GRAPH_clear. Neither produced results that were any better.

I'm new to any sort of retro development, so I'm unaware of some of the tricks that may have been employed in the past. On more modern systems, I've always used double buffering to get rid of any flicker, but I'm unsure how I'd set that up on the Commander X16.

If anyone has any tips, tricks, or suggestions for me to try, I'd appreciate it. Thanks.
 

JustinBaldock

New Member
Jan 2, 2020
12
6
3
How does it look when you overwrite the original text with white text. Just thinking that writing white text would be less expensive then clearing the screen?
There are layers but I've not looked at those yet.
 

BruceMcF

Active Member
May 19, 2019
205
63
28
Seems like scrolling the window up, or composing the text onto sprites and moving the sprites down would be techniques to avoid that flickering.
 
  • Like
Reactions: Jestin
May 22, 2019
592
300
63
You should be able to simulate double buffering by switching graphics layers. Show layer 1 and render onto layer 0. Then flip. However, I'm not 100% sure the API supports that, yet.

If you can't figure out how to set the layers by flipping VERA registers, you might open an issue on the ROMs Git.
 
  • Like
Reactions: Jestin

Jestin

New Member
Jan 25, 2020
11
8
3
How does it look when you overwrite the original text with white text. Just thinking that writing white text would be less expensive then clearing the screen?
There are layers but I've not looked at those yet.
These screen caps are of me doing just that. Sorry if I didn't explain it properly.