SP1 on zx: do I need to sync to the raster?

ZX80, ZX 81, ZX Spectrum, TS2068 and other clones
Post Reply
thricenightly
Member
Posts: 28
Joined: Thu Jun 01, 2017 5:46 pm

SP1 on zx: do I need to sync to the raster?

Post by thricenightly »

The SP1 wiki page claims "Flicker free operation without synchronizing with the raster", and looking through the examples I'm not seeing any 'halt's before the screen update calls.

Received wisdom for Spectrum developers is that graphics will flicker unless display file updates are done when the raster is doing the border. Does SP1 have a way round this? Is sync with the raster really not necessary?
alvin
Well known member
Posts: 1872
Joined: Mon Jul 16, 2007 7:39 pm

Post by alvin »

thricenightly wrote:Received wisdom for Spectrum developers is that graphics will flicker unless display file updates are done when the raster is doing the border. Does SP1 have a way round this? Is sync with the raster really not necessary?
No syncing is necessary. Flicker happens when you erase sprites and redraw them so that the raster may catch the erased state and for a frame the sprite will be gone. SP1 doesn't erase anything. Instead it draws the complete graphics for a particular character square in an 8-byte buffer and when the graphics are complete, it copies it to the screen. So the screen is never erased nor is it in a partially updated state which makes flicker impossible. Tearing, however, can happen and that's when you see the sprite in its next position above the raster mixed with the sprite in its old position below the raster but that's less a problem visually.

Decoupling from the raster was a deliberate design decision to make it really easy to use without having to count cycles and it was done to reclaim all the time spent in halt by other methods.
Post Reply