fading out

 BBS: Inland Empire Archive
Date: 10-26-93 (13:50)             Number: 380
From: BILL WHITE                   Refer#: NONE
  To: CHRIS MENNIE                  Recvd: NO  
Subj: fading out                     Conf: (2) Quik_Bas
CM>         Does anybody have a routine for fading a VGA screen?


 ' Color demo using OUT statements
 ' By Andy Thomas -- August, 1993

 DEFINT A-Z
 SCREEN 13            'VGA 320x200x265 color mode
 Attr% = 1            ' For this we'll only use one color

 FOR I = 1 TO 50
  CIRCLE (165, 80), I, Attr%    'display something
 NEXT I

 RANDOMIZE TIMER      ' let's start with a random color

 Green = 64 * RND     ' range = 0 to 63
 Red = 64 * RND       ' range = 0 to 63
 Blue = 64 * RND      ' range = 0 to 63

 OUT &H3C8, Attr%     ' Color we're using
 OUT &H3C9, Red       ' set red
 OUT &H3C9, Green     ' set green
 OUT &H3C9, Blue      ' set blue

 DO
   OUT &H3C7, Attr%       ' Color we're using
   Red = INP(&H3C9)       ' get red value
   Green = INP(&H3C9)     ' get green value
   Blue = INP(&H3C9)      ' get blue value

   A$ = INKEY$            ' get keypress

   SELECT CASE A$         ' determine keypress
   CASE "R"
     IF Red <> 63 THEN Red = Red + 1
   CASE "G"
     IF Green <> 63 THEN Green = Green + 1
   CASE "B"
     IF Blue <> 63 THEN Blue = Blue + 1
   CASE "r"
     IF Red <> 0 THEN Red = Red - 1
   CASE "g"
     IF Green <> 0 THEN Green = Green - 1
   CASE "b"
     IF Blue <> 0 THEN Blue = Blue - 1
   CASE "+"
     IF Red <> 63 THEN Red = Red + 1
     IF Green <> 63 THEN Green = Green + 1
     IF Blue <> 63 THEN Blue = Blue + 1
   CASE "-"
     IF Red <> 0 THEN Red = Red - 1

     IF Green <> 0 THEN Green = Green - 1
     IF Blue <> 0 THEN Blue = Blue - 1
END SELECT

   OUT &H3C8, Attr%          ' Color we're using
   OUT &H3C9, Red            ' set red
   OUT &H3C9, Green          ' set green
   OUT &H3C9, Blue           ' set blue

   LOCATE 20, 1
   PRINT "Press R, G, or B to change colors."
   PRINT "+ and - change all."
   PRINT "<ESC> to end."
   PRINT "Lower case lessens,"
   PRINT "Upper case increases.";
   LOCATE 25, 1
   PRINT USING "Red = ##    Green = ##   Blue = ##"; Red; Green; Blue;

 LOOP UNTIL A$ = CHR$(27)
 END

$$43
 * SLMR 2.1a * You can keep your word better if you give it less often!

--- Maximus 2.01wb
 * Origin: Miami Amateur Computer Club BBS  HST/V32b/V42b (1:135/110)
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