Screen flickering

 BBS: Inland Empire Archive
Date: 03-04-93 (21:35)             Number: 343
From: MIKE HEBERT                  Refer#: NONE
  To: ALL                           Recvd: NO  
Subj: Screen flickering              Conf: (2) Quik_Bas
The following is a screen fader I made..  There is only one
flaw..   If you try to fade more than about 30 colors at a
time,the screen flickers, and I need to know how to suspend
the
vertical retracing (if possible), or some other way to help it...

I've tried using WAIT &H3DA,8 just before the interrupt,
but that causes the top 1/4 or so to black out.

I've tried separating colors in to "blocks", but it goes
too slow for my taste...

(By the way, I'm using a 16MHz 286 with Trident 8900 SVGA
card (512K) and an analog colour monitor, not capable of
displaying SVGA graphics...  The card was a little mistake
by the manufacturer... SHHH!!  :))

'------------------------------------------------

SUB FadeToBlack (SColor%, EColor%, FadeDelay!)
DIM Value%(SColor% TO (EColor% * 1.5))
xreg.ax = &H1017: xreg.bx = SColor%
xreg.cx = (EColor%) - SColor%
xreg.dx = VARPTR(Value%(SColor%))
xreg.es = VARSEG(Value%(SColor%))
CALL INTERRUPTX(&H10, xreg, xreg)

DEF SEG = VARSEG(Value%(SColor%))
offset = VARPTR(Value%(SColor%))

FOR T% = 1 TO 33
NextFadeDelay! = TIMER + FadeDelay!
     FOR Z% = SColor% + offset TO (EColor% * 3) + offset
          IF PEEK(Z%) > 1 THEN
               POKE Z%, PEEK(Z%) - 2
          END IF
     NEXT Z%
     xreg.ax = &H1012: xreg.bx = SColor%
     xreg.cx = (EColor%) - SColor%
     xreg.dx = VARPTR(Value%(SColor%))
     xreg.es = VARSEG(Value%(SColor%))
     WAIT &H3DA,8
     CALL INTERRUPTX(&H10, xreg, xreg)
DO
IF NextFadeDelay! <= TIMER THEN EXIT DO
LOOP
NEXT T%

'To clean up any left over colors . . .
FOR T% = SColor% + offset TO EColor% + offset
     POKE (T%), 0
NEXT T%
xreg.ax = &H1012: xreg.bx = SColor%
xreg.cx = (EColor%) - SColor%
xreg.dx = VARPTR(Value%(SColor%))
xreg.es = VARSEG(Value%(SColor%))
WAIT &H3DA, 8
CALL INTERRUPTX(&H10, xreg, xreg)
DEF SEG
END SUB

'------------------------------------------------


--- Maximus/2 2.01wb
 * Origin: TeeWunKay (1:140/37)
Outer Court
Echo Basic Postings

Books at Amazon:

Back to BASIC: The History, Corruption, and Future of the Language

Hackers: Heroes of the Computer Revolution (including Tiny BASIC)

Go to: The Story of the Math Majors, Bridge Players, Engineers, Chess Wizards, Scientists and Iconoclasts who were the Hero Programmers of the Software Revolution

The Advent of the Algorithm: The Idea that Rules the World

Moths in the Machine: The Power and Perils of Programming

Mastering Visual Basic .NET