home *** CD-ROM | disk | FTP | other *** search
- '%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- '% (C) 1987 HUMBLEWARE Custom Programming Author: Lawrence A. Westhaver %
- '% 247 Paul Martin Drive, Baltimore MD 21227 (301) 799-1975 %
- '%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- '% %
- '% FILENAME: TRANSA2C.SUB LAST UPDATE: 05-24-1987 %
- '% %
- '% DESCRIPTION: Translates an ATTRIBUTE value used by many video interupt %
- '% calls to the COLOR n,n notation used by QuickBASIC. %
- '% %
- '% CALL: CALL TRANSA2C(AT%,FG%,BG%) %
- '% %
- '% INPUTS: AT% = Attribute value (0-255). %
- '% %
- '% OUTPUTS: FG% = Foreground color (0-31). %
- '% %
- '% BG% = Background color (0-7). %
- '% %
- '% NOTE: If the attribute value is out of range, the foreground %
- '% color will be returned as white (7) and the background %
- '% color will be returned as black (0). %
- '% %
- '%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-
-
- SUB TRANSA2C(AT%,FG%,BG%) Static
-
-
- 'zero outputs
-
- FG%=0
- BG%=0
-
-
- 'check attribute for out of range
-
- IF AT%<0 OR AT%>255 THEN
- FG%=7
- BG%=0
- EXIT SUB
- END IF
-
-
- 'set foreground blink
-
- IF (AT% AND 128) THEN
- FG%=FG%+16
- END IF
-
-
- 'set background color
-
- IF (AT% AND 64) THEN
- BG%=BG%+4
- END IF
-
- IF (AT% AND 32) THEN
- BG%=BG%+2
- END IF
-
- IF (AT% AND 16) THEN
- BG%=BG%+1
- END IF
-
-
- 'set foreground intensity
-
- IF (AT% AND 8) THEN
- FG%=FG%+8
- END IF
-
-
- 'set foreground color
-
- IF (AT% AND 4) THEN
- FG%=FG%+4
- END IF
-
- IF (AT% AND 2) THEN
- FG%=FG%+2
- END IF
-
- IF (AT% AND 1) THEN
- FG%=FG%+1
- END IF
-
-
- END SUB 'transa2c
-