Programming

 BBS: Inland Empire Archive
Date: 12-20-92 (14:06)             Number: 382
From: SCOTT WUNSCH                 Refer#: NONE
  To: CHANSAK SAM                   Recvd: NO  
Subj: Programming                    Conf: (2) Quik_Bas
Seasons Greetings, Chansak!

  In our last episode of 16 Dec 92, Chansak Sam was heard
uttering the following to Crazy Horse:

 CS> 4.00, can not support more than 2 pages in screen 9. I would love it to,
 CS> but it won't without some sort of graphics library. I can tell you that

  Actually, there is no way that it can _at_all_.  Screen 9 is 640x350, 16
colours.  So, 640*350=224000.  Now, 16 colours means four
bits per pixel. 224000\2=112000.  Therefore, one page of
Screen 9 takes up 109k.  Now, the standard EGA adapter has
never had more than 256k of video memory.  Well, more than
two 109k pages (218k) are never going to fit in that.
Clear as mud?

 CS> some of this.
 CS>
 CS>  PALETTE ColorNumber, AmountOfPigment * 256 'This is for green
 CS>  PALETTE ColorNumber, AmountOfPigment * 256^2 'This is for blue
 CS>  PALETTE ColorNumber, AmountOfPigment       'This is for red

  Try this:

SUB VGAPal (Attr%, Red%, Green%, Blue%)
  PALETTE Attr%, (Red%) + (Green% * 256) + (Blue% * 65536)
END SUB

  This way you can mix the red, green, and blue colours to
produce a whole variety.  For example...

VGAPal 72, 63, 63, 0

  ...will make attribute number 72 pure yellow.

                                               /\   LLAP...
                                             > \ cott \\'unsch <
                                              \/

... Daddy?  What does this red button do?  <BEEP!>

--- GoldED 2.40
 * Origin: Season's Greetings from Regina, Sask, Canada! (1:140/23.1701)
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