Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Waiting / Creating a delay
#11
Well, I have to say it again: You have to use the couple of WAITs (not just one), or you won't avoid flicker:

Code:
WAIT &H3DA,8
WAIT &H3DA,8,8

General explanation on WHY both lines (and not only the first) have to be used is here: http://faq.qbasicnews.com/?blast=VerticalRetrace (almighty, almighty FAQ Big GrinBig GrinBig Grin)

This will give ya a pseudoprecise 60 to 70 fps (a number in between) depending on several factors such as program effectivenes, computer speed, and some neat and scary stuff Wink

Never use a FOR/NEXT to make your prog going slower, 'cause in a slower computer it will run slower, and in a faster computer it will run faster. Imagine that you tune your speed for a 200 Mhz computer... How could a 3 Ghz computer owner be able to play it?
SCUMM (the band) on Myspace!
ComputerEmuzone Games Studio
underBASIC, homegrown musicians
[img]http://www.ojodepez-fanzine.net/almacen/yoghourtslover.png[/i
Reply
#12
I've tried using both lines nath, but sometimes the second line doesn't have any effect. I know it works, and the resultant flicker is because of a different part of the program, but the second line just doesn't seem to make a difference sometimes, that's why I left it out.
Reply
#13
Thanks na_th_an, that works perfectly! I appreciate the help.
img]http://b.domaindlx.com/cygh/mycophob3.gif[/img]
Reply
#14
In plain DOS You can delay for less than a millisecond by combining PC Timer reading and the PIT register reading.
Unfortunately in Windows this gives random wrong readings (times that are inferior than former reads)
I can post a demo if you want.
For short delays in Windows you should use the timers in libraries as DQB or UGL.
Antoni
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)