View Single Post
Old 30 September 2019, 14:04   #73
Photon
Moderator
 
Photon's Avatar
 
Join Date: Nov 2004
Location: Eksjö / Sweden
Posts: 5,604
Quote:
Originally Posted by Toni Wilen View Post
I usually simply wait for line x and then wait until line is not x.
This is reliable, but the CPU would then do nothing but busy-wait for a whole scanline, i.e. 0.4% CPU time wasted.

Quote:
EOF vs TOF
Waiting for line $138 = EOF is essentially the same as waiting for line $1a = TOF, except for the flyback of the beam. So if you poll for these raster lines and execute code, any Vblank interrupt will interrupt that code after a very short while.

So if code is executed after a raster busy wait in main, that relies on values set by the int, read them at EOF quickly before the int hits (and never re-read them later in the code), because they may be changed by the int mid-execution.

Last edited by Photon; 30 September 2019 at 16:23.
Photon is offline  
 
Page generated in 0.04451 seconds with 11 queries