Qbasicnews.com
October 25, 2021, 10:42:54 AM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News: Back to Qbasicnews.com | QB Online Help | FAQ | Chat | All Basic Code | QB Knowledge Base
 
   Home   Help Search Login Register  
Pages: 1 [2]
  Print  
Author Topic: FLICKER  (Read 6456 times)
na_th_an
*/-\*
*****
Posts: 8244



WWW
« Reply #15 on: June 20, 2006, 03:36:11 AM »

That's the pair that has been used since the VGA was invented :lol:

In fact is enough with the two. It's just checking for bit 3 which is set when the vertical retrace ends and reset when it starts over. What's executed is:

1.- Your came routines.
2.- If there's time left until retrace ends, wait.
3.- Wait until retrace starts over before changing the image.

Note that the pair is needed provided your stuff takes less than a retrace to happen, so you actually have to wait until the next one (otherwise you'd lose sync).
Logged

SCUMM (the band) on Myspace!
ComputerEmuzone Games Studio
underBASIC, homegrown musicians
[img]http://www.ojodepez-fanzine.net/almacen/yoghourtslover.png[/i
Anonymous
Guest
« Reply #16 on: June 20, 2006, 03:44:51 PM »

TBH, I only ever used Wait &h3da, 8. and I never had a problem.

edit: actually i spoke a little quickly. most programs that have graphics will process a fair amount of data before drawing, so THAT's what should happen i.e.:

Code:
processdata

draw

wait &h3da, 8


like i said, i never had a problem with it. Tongue You'll only have a problem if you can process your data before the gun jumps back (most likely NOT going to happen.)
Logged
RyanKelly
Forum Regular
**
Posts: 109



WWW
« Reply #17 on: June 20, 2006, 10:48:14 PM »

Quote from: "na_th_an"
It's just checking for bit 3 which is set when the vertical retrace ends and reset when it starts over.




Every reference I've ever read, including http://www.osdever.net/FreeVGA/vga/extreg.htm
indicates that bit 3 is set when the retrace begins and cleared when it ends.  Again, retrace does not refer to the time that the card is reading from memory and firing along the scan lines.  The vertical retrace is when the ray is being repositioned at the top left of the screen.

The code in the faq does not procceed during a vertical retrace, but rather just after (which means during the time that screen is being redrawn!) This, in effect, totally defeats the purpose.

The first wait statement does wait for a retrace, but if a retrace is already in progress it obviously doesn't wait at all, but at this point we don't know if the retrace has just begun or if it is about to end, so the second wait statement holds until the retrace has ended.  If anything these two statements should be done in the opposite order to ensure that blitting is performed just after the beginning of a retrace.
Logged
yetifoot
Ancient Guru
****
Posts: 575



« Reply #18 on: June 21, 2006, 07:32:28 AM »

I am very confused, in part because i never used qb enough to use ever know about wait and how it works.

I am waiting until bit 3 is 1 (set) here before drawing. (i stole this from rel)

This works on my machine, is this the correct way?

This seems to go with what ryan is saying (from what i can tell about how wait works)

Code:
 mov dx, 3DAh
vsync_loop:
  in al, dx
  and al, 8
  jz vsync_loop
  DO DRAW STUFF HERE
Logged

EVEN MEN OF STEEL RUST.
na_th_an
*/-\*
*****
Posts: 8244



WWW
« Reply #19 on: June 21, 2006, 08:47:34 AM »

I messed everything up, I just said it the way around Cheesy

The 8, 8 one is just "to get to a known state", such as the "WHILE INKEY$<>"": WEND" you put before your "WHILE INKEY$="":WEND". Not the same, but works in a simmilar way.
Logged

SCUMM (the band) on Myspace!
ComputerEmuzone Games Studio
underBASIC, homegrown musicians
[img]http://www.ojodepez-fanzine.net/almacen/yoghourtslover.png[/i
RyanKelly
Forum Regular
**
Posts: 109



WWW
« Reply #20 on: June 22, 2006, 11:00:04 PM »

Quote from: "na_th_an"
I messed everything up, I just said it the way around Cheesy

The 8, 8 one is just "to get to a known state", such as the "WHILE INKEY$<>"": WEND" you put before your "WHILE INKEY$="":WEND". Not the same, but works in a simmilar way.


I suspected that was the case, because your description of how should work was clear, which is why it took a me a bit to notice there was something odd with the code.

It was quite a while before I learned that the WAIT statement had an option XOR parameter.  Previously I used DO WHILE(INP(&H3DA) AND Cool : LOOP : WAIT &H3DA, 8.
Logged
relsoft
*/-\*
*****
Posts: 3927



WWW
« Reply #21 on: June 26, 2006, 12:15:05 PM »

SETVIDEOSEG. :*)
Logged

y smiley is 24 bit.


Genso's Junkyard:
http://rel.betterwebber.com/
Pages: 1 [2]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.21 | SMF © 2015, Simple Machines Valid XHTML 1.0! Valid CSS!