video memory segment

 BBS: Inland Empire Archive
Date: 06-01-92 (23:46)             Number: 151
From: MARK BUTLER                  Refer#: NONE
  To: MICHAEL MALLEY                Recvd: NO  
Subj: video memory segment           Conf: (2) Quik_Bas
 On 05-30-92 MICHAEL MALLEY wrote to CORIDON HENSHAW...

 MM> CH> JG> MB>   FUNCTION CRT%
 MM> CH> JG> MB>      IF (PEEK(1040) AND 48) = 48 THEN
 MM> CH> JG> MB>          CRT = 0  '<-------- monochrome, use &HB000
 MM> CH> JG> MB>      ELSE
 MM> CH> JG> MB>          CRT = -1 '<-------- color, use &HB800
 MM> CH> JG> MB>      END IF
 MM> CH> JG> MB>   END FUNCTION
 MM>
 MM> Hey guys, did you notice that there is no DEF SEG in that function?
 MM> As it stands, you are looking in DGROUP.  - Michael  :)

 Thwack!!! (the sound of my hand slamming my forehead)

 Yup, you're right Mike. When I posted this routine I got lazy and
 *didn't* go merge in the one from my SUBS dir... I just typed it in
 from memory (you know, the memory I have with that organic parity
 error?) The *-ACTUAL-* routine goes like this...

 FUNCTION CRT%
    DEF SEG = &H40
    IF (PEEK(1040) AND 48) <> 48 THEN
        CRT = 0   '<------- return for mono
    ELSE
        CRT = -1  '<------- return for color
    END IF
    DEF SEG
 END FUNCTION

 Now CRT% *should* return a 0 for monochrome. (If it _still_ doesn't,
 somebody shoot me ok?)

 MM>  * SLMR 2.1a * Have you ever just, well... sort of noticed your
 MM> tongue?
     ^^^^^^
        |
 Yeppirs, I did. Found it right here wrapped around my foot! <grin>


 -----------> MHB :-)

... OFFLINE 1.37 * Dogma is the arch-enemy of truth.
............................................................
..................


--- WM v2.01/91-0012
 * Origin: Com-Dat BBS  Hillsboro, OR.  HST (503) 681-0543 (1:105/314)
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