'=========================================================================== ' Subject: VERTICAL SYNC DEMO Date: 05-15-97 (10:04) ' Author: Davey W. Taylor Code: QB, QBasic, PDS ' Origin: audio.squad@mailbox.swipnet.se Packet: GRAPHICS.ABC '=========================================================================== 'Demonstration of how to sync graphics to the screens vertical retrace 'Davey W Taylor DECLARE SUB SetPal (Attr%, Red%, Green%, Blue%) SCREEN 1 CLS PRINT ".05 delay without sync" DO SetPal 0, 0, 0, 0 'change pal s# = TIMER: DO: LOOP UNTIL TIMER - s# >= .05 'delay SetPal 0, 15, 15, 15 'change pal s# = TIMER: DO: LOOP UNTIL TIMER - s# >= .05 'delay LOOP WHILE INKEY$ = "" SetPal 0, 0, 0, 0 CLS PRINT ".05 delay with sync" DO WAIT &H3DA, 8 'wait for retrace SetPal 0, 0, 0, 0 'change pal s# = TIMER: DO: LOOP UNTIL TIMER - s# >= .05 'delay WAIT &H3DA, 8 'wait for retrace SetPal 0, 15, 15, 15 'change pal s# = TIMER: DO: LOOP UNTIL TIMER - s# >= .05 'delay LOOP WHILE INKEY$ = "" DEFINT A-Z SUB SetPal (Attr%, Red%, Green%, Blue%) 'SUB to set a color attribute OUT &H3C7, Attr% OUT &H3C8, Attr% OUT &H3C9, Red% OUT &H3C9, Green% OUT &H3C9, Blue% END SUB