Re: Bright Backgrounds ?!

 BBS: Inland Empire Archive
Date: 05-26-92 (09:09)             Number: 178
From: ROB SMETANA @ 914/201        Refer#: 131
  To: JOE CRIGGER                   Recvd: NO  
Subj: Re: Bright Backgrounds ?!      Conf: (2) Quik_Bas
> Does anyone know how to replace the blinking colors into bright
> backgrounds?!?
Joe, try the following (2 messages).

'Contains SUB BrightBackground () to enable bright background colors.
'The basis for this sub was code posted by Monte Ferguson.
'
'    This CALLs Interrupt ....   Therefore, you MUST load a QLB
'    with QB's Interrupt handler (eg. /l QB.QLB or /l QBX.QLB).
'    This also uses Crescent's MONITOR function.  If you don't
'    have this, hard-code
'
'Syntax:  CALL BrightBackground(ONorOFF)
'         where:  ONorOFF = any non-zero value to enable bright bg
'                 ONorOFF = zero to turn bright bg off and re-enable
'                           blinking
'
'Note:  CGA or higher ONLY.  You can't get bright backgrounds
'       on mono/Hercules (you'll get blinking instead).
'
'       Bright backgrounds are actually achieved by using
'       blinking foregrounds -- then zapping the PC to display
'       them differently. The demo below illustrates the effects.
'
'FINAL NOTE:  I've had reports that this does NOT work on old,
'             true-blue IBM CGAs.  They blink instead.  I'd
'             appreciate feedback or comments on this --
'             especially if someone has a fix.
'
'FINAL, FINAL NOTE:  There IS a speed penalty here.  Therefore,
'                    for maximum speed, call only when necessary.
DEFINT A-Z

DECLARE FUNCTION Monitor ()

DECLARE SUB BrightBackground (TurnBrightBGOn%)

TYPE RegType                     'type required by Call Interrupt
  ax    AS INTEGER
  bx    AS INTEGER
  cx    AS INTEGER
  dx    AS INTEGER
  bp    AS INTEGER
  si    AS INTEGER
  di    AS INTEGER
  flags AS INTEGER
  ds    AS INTEGER
  es    AS INTEGER
END TYPE

DIM SHARED Inregs AS RegType, Outregs AS RegType

'========================================
'                demo
'========================================

COLOR 15, 0: CLS

'...display some blinking text

FOR x = 1 TO 8
    COLOR x + 16, x - 1
    PRINT "now is the time for all good ..."
NEXT

PRINT : PRINT : COLOR 15, 0
PRINT "About to turn bright ON.   Press any key . . ."
d$ = INPUT$(1)

'...turn Bright BGs ON

BrightBGOn = 1                'use any non-zero value
CALL BrightBackground(BrightBGOn)

PRINT : PRINT
FOR x = 1 TO 8
    COLOR x + 16, x - 1
    PRINT "now is the time for all good ..."
NEXT

'...now turn Bright BGs off (and restore blinking)
PRINT : COLOR 15, 0
PRINT "About to turn bright OFF.  Press any key . . ."
d$ = INPUT$(1)

BrightBGOn = 0                'zero turns OFF bright BGs
Call BrightBackground(BrightBGOn)

'***** and of part 1 (continued next message)

--- RBBSMail 17.3A
 # Origin: PCUG BBS - San Francisco HST/V.32 415-621-2609 (RBBS 8:914/201.0)
 * Origin: Gateway System to/from RBBS-NET (RBBS-PC 1:10/8)
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