I'm lost
Thanks for letting me know! I think I understand what's unclear concerning both things you mention:
'do stuff
If Timer-T=0 Then Wait Vbl
Why for the heavens would you want to slow down artificially this routine by half to 25 pfs?
Sometimes the "do stuff" part gets done within
one vertical blank. If there were no artificially added wait between this and Screen Swap, the display would in these cases suddenly update at a 50 fps rate. This is undesirable as I want the game to run at a
constant frame rate, hence the wait.
The example I showed you above works fluently at 50 fps and the change is seen... well, normally, as one would expect.
Frame: Command: Offset:
1 Screen Offset 0,1,0 (0,0)
2 Screen Offset 0,2,0 (0,0)
3 Screen Offset 0,3,0 (1,0)
4 Screen Offset 0,4,0 (2,0)
5 Screen Offset 0,5,0 (3,0)
6 - (4,0)
7 - (5,0)
8 - (5,0)
This table illustrates the relation between calls to Screen Offset and what's being displayed on the screen for each of eight frames. The offset is lagging a frame behind what one would consider natural behaviour! Running 50 fps (like in the table) makes almost nothing out of this peculiarity, especially when scrolling at constant speed in one direction. But when trying to go 25 fps (like me), the change of buffer and change of offset happens on separate frames if this is not taken into account. A nasty shaking results. And of course it never occured to me that something like THIS could be the reason! That is, until I suddenly had a stroke of luck...
The program that put me on the right track was based on your example (most notably the Box):
Screen Open 0,640,200,16,Lowres
Screen Display 0,128,50,320,200
Flash Off : Curs Off : Cls 0
Box 0,0 To 319,199
Double Buffer : Autoback 0
For X=0 to 320
Plot X,1
Screen Offset 0,X,0
Screen Swap : Wait Vbl
Next X
Isn't that point a litte far to the right...