home *** CD-ROM | disk | FTP | other *** search
- /*
- dispmono.c
-
- % disp_MapMono monochome on/off functionw
-
- OWL 1.1
- Copyright (c) 1988, by Oakland Group, Inc.
- ALL RIGHTS RESERVED.
-
- Revision History:
- -----------------
- */
-
- #include "oakhead.h"
- #include "disppriv.h"
-
- #define WHITE 0x07
- #define BLACK 0x00
- #define BOLD 0x0F
- #define BLINK 0x08
-
- void disp_MapMono(mono)
- boolean mono;
- /*
- if mono == TRUE maps colors for mono displays.
-
- higher values are generalized as lighter than lower values, with the
- range being from 0 - 7 (8 - f are moduloed, but bolding and blinking
- are preserved), therefore:
-
- fore < back (eg. 0x31) maps to 0x70
- fore > back (eg. 0x25) maps to 0x07
- */
- {
- int f, b, diff;
-
- if (!mono) {
- for (f = 0; f < 0x10; f++) {
- for (b = 0; b < 0x10; b++) {
-
- disp_SetMapEntry((byte)(b * 0x10 + f), (opixval)b, (opixval)f);
- }
- }
- return;
- }
-
- for (f = 0; f < 0x10; f++) {
- for (b = 0; b < 0x10; b++) {
-
- if ((diff = b%0x08 - f%0x08) == 0) { /* f == b */
-
- disp_SetMapEntry((char)(b * 0x10 + f), BLACK, BLACK);
- }
- else if (diff > 0) { /* f < b */
-
- disp_SetMapEntry((char)(b * 0x10 + f),
- (b > 0x07) ? BOLD:WHITE, /* back, foreground */
- (f > 0x07) ? BOLD:BLACK);
- }
- else { /* f > b */
- disp_SetMapEntry((char)(b * 0x10 + f),
- (b > 0x07) ? BLINK:BLACK, /* back, foreground */
- (f > 0x07) ? BOLD:WHITE);
- }
- }
- }
- }
-