VGA / Monitor Flickering
hbk723
Posts: 2
I'm pretty new to this, I've been programming for a long time but have very little experience with microcontrollers. I'm trying to modify the vga_512x384_bitmap demo program. It already has a function called "plot" that sets a pixel, I wrote another similar one creatively named "unplot" to turn off a pixel. Both of these are working just fine, but I get a tremendous amount of flicker when trying to animate something across the screen. Is anyone using any kind of double buffering? Or maybe is it possible to hold off on sending updates to the screen until all the data is written?
The "sprite" I'm trying to move is just a 3x3 or 5x5 square. My first thought was to unplot every pixel then plot every pixel in the new location but this looks horrible. Then I went on to unplotting only the pixels that don't need to be plotted and plot only the new pixels. This looks ok if I'm sliding the sprite in only one direction. If I try to move the sprite diagonally, I can't seem to get the flicker close to acceptable.
Also, of all the smileys in the world, how often does one need a smurf one?
The "sprite" I'm trying to move is just a 3x3 or 5x5 square. My first thought was to unplot every pixel then plot every pixel in the new location but this looks horrible. Then I went on to unplotting only the pixels that don't need to be plotted and plot only the new pixels. This looks ok if I'm sliding the sprite in only one direction. If I try to move the sprite diagonally, I can't seem to get the flicker close to acceptable.
Also, of all the smileys in the world, how often does one need a smurf one?
Comments
Object being is you need to have the 'new' data in place before (not during) a screen draw.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Propeller + Hardware - extra bits for the bit bucket =· 1 Coffeeless KaosKidd
·
repeat
wait for SyncPtr to be non-zero
draw
set SyncPtr to 0
And just hoping that draw executes fast enough?