Posts: 1,241
Threads: 107
Joined: Feb 2003
Im just asking someone please just explain this fully to me? i know that it stops the flickering for me sometimes but i also heard there was a longer version of it. im just so confused, please explain.
the mind is a beautiful thing, use it and make the world a more beautiful place.
Posts: 3,368
Threads: 195
Joined: Jan 2003
The answer:
Code:
GOOGLE.com: "wait &h3DA, 8"
Code:
WAIT &H3DA, 8
WAIT &H3DA, 8, 8
http://hem.passagen.se/hedsen/myprg/bigfexpl.htm
See, you don't need us. Forums on technology are obsolete, actually.
Peace cannot be obtained without war. Why? If there is already peace, it is unnecessary for war. If there is no peace, there is already war."
Visit www.neobasic.net to see rubbish in all its finest.
Posts: 3,616
Threads: 287
Joined: Jan 2003
Well agamemnus, people might not need us, but I'm going to explain anyway:
WAIT is just a simple loop. It WAITs for a certain status on a certain port. In WAIT &H3DA,8 it waits for the 3DAh port (The screen port, I think) to have a certain status, and while it does, it runs through a loop.
See, the screen is constantly flickering on and off, updating.
WAIT &H3DA,8 happens to work like this:
Wait for screen to flicker off (WAIT &H3DA,8 )
Draw graphics to screen
Meaning that you don't see the graphics being drawn, hence reducing flicker.
Now, the WAIT &H3DA,8 and WAIT &H3DA,8,8 used together work like this:
Wait for screen to flicker off (WAIT &H3DA,8 )
Draw graphics to screen
Wait for screen to flicker on (WAIT &H3DA,8,8 )
So before the program proceeds, it waits for the graphics to be displayed.
Hope that cleared things up for you, mech1031.
f only life let you press CTRL-Z.
--------------------------------------
Freebasic is like QB, except it doesn't suck.
Posts: 6,419
Threads: 74
Joined: Mar 2002
Zack has almost explained everything correctly
Just some points:
1. &H3DA is VGA Vertical retrace port. Its bit 3 equals 0 when no retrace is being done, 1 when the retrace is being done. Retrace is a screen update.
2. This is done to draw things on screen when the image is fixed so when the next update occurs the screen gets updated with the new data and no flicker happens.
3. This doesn't work very well in Windows 'cause it make interrupts to have its fake multitasking. Page flipping will flicker in a DOS box, so you better use double buffering.
Posts: 1,241
Threads: 107
Joined: Feb 2003
thanx guys. it works good both ways. and thanks for explaining it, although next time i have a problem i guess i should try other sources before bothering you guys.
the mind is a beautiful thing, use it and make the world a more beautiful place.
Posts: 3,368
Threads: 195
Joined: Jan 2003
nah.
Peace cannot be obtained without war. Why? If there is already peace, it is unnecessary for war. If there is no peace, there is already war."
Visit www.neobasic.net to see rubbish in all its finest.
Posts: 3,616
Threads: 287
Joined: Jan 2003
Quote:thanx guys. it works good both ways. and thanks for explaining it, although next time i have a problem i guess i should try other sources before bothering you guys.
NO!!! If everbody did that, then this forum would get boring!
Keep asking :wink:
BTW na_th_an, thanks for the corrections. I think I heard that somewhere, I just forgot. Things that sound like trigonometry tend to slip my mind (I mean, "Vertical Retrace"? Sounds like some kind of trig function :wink: )
f only life let you press CTRL-Z.
--------------------------------------
Freebasic is like QB, except it doesn't suck.