I know now a sys in BASIC takes about 50 rasterlines.
For PAL with its 312 rasterlines/frame max 6 times a sys can be executed in the same frame.
Take some jittering in account: max 5.
For NTSC with its 262 rasterlines/frame it is less: max 4 with jitter.
I wanted to do some smooth scrolling. Vertical and Horizontal.
Reg12/13 and 24 for vertical smooth scroll and reg12/13 and 25 for horizontal.
In order for this to work, these regs have to be set in the same frame.
Any flickering occurs in my opinion when reg12/13 and reg24or25 are set in different frames.
So with this newly discovered command WAIT I can sync in BASIC on the start of the visible screen. And do some experiments very easy. I don’t know where the VDC or Vice latch the regs 12/13 but I am sure not in the visible screen therefore I sync at the end of vblank.
For vertical monochrome smooth scroll I have to change reg12, reg13 and reg24.
That is 3 times a sys: that should work in PAL and NTSC:
s=dec(“d600”):v=dec(“cdcc”)
wait s,32:wait s,32,32:sysv,high,12:sysv,low,13:sysv,smooth,24
For horizontal monochrome smooth scroll I have to change reg12, reg13 and reg25:
wait s,32:wait s,32,32:sysv,high,12:sysv,low,13:sysv,71-smooth,25.
When I did that I got some jitter in the lower part of the screen.
That was because reg25 was changed too early, still in the visible screen.
And reg25 takes effect immediately on the screen.
So I had to wait till the border was reached: wait s,32 and then set reg25:
wait s,32:wait s,32,32:sysv,high,12:sysv,low,13:wait s,32:sysv,71-smooth,25.
That worked. See prog:
Now I wanted color: two extra sys’s: sysv,high,20:sysv,low,21 for start attribute.
No hope for NTSC with max 4 sys’s.
And jitter for PAL. Let’s sync on start of vblank and hope to jump over the latching position of regs 12/13, I thought. In Vice3.2 that worked, can’t test it on a real C128.
See prog:
I have color smooth scroll but only just and not for NTSC. Not good enough.
I dumped the wait command and wrote a little ML-programm to sync on start of screen and set reg12/13 with one sys and set reg 20/21 with also one sys.
sys4864,high,low:rem sync and set12/13
sys4884,high,low:rem set 20/21
sysv,smooth,24:rem or horizontal sysv,71-smooth,25
only 3 sys’s: works like a charm.
See prog: