Forum
equivalent of waitvbl (from Amos and sdlBasic) needed - Printable Version

+- Forum (https://www.boriel.com/forum)
+-- Forum: Compilers and Computer Languages (https://www.boriel.com/forum/forumdisplay.php?fid=12)
+--- Forum: ZX Basic Compiler (https://www.boriel.com/forum/forumdisplay.php?fid=11)
+---- Forum: Help & Support (https://www.boriel.com/forum/forumdisplay.php?fid=16)
+---- Thread: equivalent of waitvbl (from Amos and sdlBasic) needed (/showthread.php?tid=384)



equivalent of waitvbl (from Amos and sdlBasic) needed - nitrofurano - 10-08-2011

i tried this code

Code:
#include <print64.bas>
10 ink 7:paper 0:border 2: bright 1:flash 0:cls
20 let x=10:let y=10
30 printat64(y,x):print64("X")
100 let a$=inkey$
200 if a$="w" or a$="W" or a$="7" or a$=chr$(11) then printat64(y,x):print64(" "):y=y-1:printat64(y,x):print64("X"):end if
210 if a$="s" or a$="S" or a$="6" or a$=chr$(10) then printat64(y,x):print64(" "):y=y+1:printat64(y,x):print64("X"):end if
220 if a$="a" or a$="A" or a$="5" or a$=chr$(8) then printat64(y,x):print64(" "):x=x-1:printat64(y,x):print64("X"):end if
230 if a$="d" or a$="D" or a$="8" or a$=chr$(9) then printat64(y,x):print64(" "):x=x+1:printat64(y,x):print64("X"):end if
1000 goto 100

but it runs too fast, and i only need to synchronize it with the display frequence (50hz or 60hz)
i think zxspectrum uses this with some z80 interrupt instruction? which one, and how can we use it inside 'asm/endasm'?


Re: equivalent of waitvbl (from Amos and sdlBasic) needed - LCD - 10-09-2011

Why not use PAUSE 1?
The Z80 instruction is HALT by the way.


Re: equivalent of waitvbl (from Amos and sdlBasic) needed - nitrofurano - 10-09-2011

thanks, LCD! Smile