head 1.8; access ; symbols ; locks ; comment @@; 1.8 date 89.05.02.16.25.23; author pkern; state Exp; branches ; next 1.7; 1.7 date 89.04.05.15.51.50; author pkern; state Exp; branches ; next 1.6; 1.6 date 89.04.05.15.22.03; author pkern; state Exp; branches ; next 1.5; 1.5 date 89.04.04.19.02.57; author pkern; state Exp; branches ; next 1.4; 1.4 date 89.03.23.13.34.49; author pkern; state Exp; branches ; next 1.3; 1.3 date 89.02.06.16.42.17; author pkern; state Exp; branches ; next 1.2; 1.2 date 89.02.03.15.55.30; author pkern; state Exp; branches ; next 1.1; 1.1 date 89.01.31.14.28.12; author pkern; state Exp; branches ; next ; desc @@ 1.8 log @*** empty log message *** @ text @/* * screen handling routines for TI Professional (including graphics) * * Note: * - it seems necessary to assert the status line after each CLEANing * (a minor annoyance, but if we want to enforce a status line ...) * * Copyright (c) 1989 University of Toronto. All rights reserved. * Anyone may use or copy this software, except that it may not be * sold for profit, that this copyright notice remain intact, and that * credit is given where it is due. The University of Toronto and the * author make no warranty and accept no liability for this software. */ static char rcsid[] = "$Header: screen.ti,v 1.7 89/04/05 15:51:50 pkern Exp $"; #include #include "cterm.h" #include "ti.h" #define BLANK 0x0f /* #define SCR_MEM (0xde000000) /* screen location */ #define SCR_MEM (0xde00) /* screen location segment */ #define L_ATTR *((char far *)0xdf800000) /* attribute latch */ #define CRSR_BLK 0x600c /* slow-blinking block cursor code */ #define CRSR_UL 0x4b0b /* fast-blinking underline cursor */ static union REGS r; static struct SREGS sr; static int xattr=0x0f, o_xattr; /* current attribute storage */ static char o_scrn[SCRSIZE]; /* screen memory storage */ static char o_attr[SCRSIZE]; /* attribute storage */ static int o_xy; /* cursor position memory */ static char far *scrn; /* screen position memory */ /* text colours/intensities */ uchar c_norm=5, c_rev=5, c_bold=7; static uchar o_norm=5, o_rev=5, o_bold=7; /* macros for frequently used code */ #define crtint int86(CRT_INT, &r, &r) #define GO_HOME r.h.ah=2; r.x.dx=0; crtint; #define DO_STAT r.h.ah=0x15; r.x.cx=24; crtint; #define GO_XY(a,b) \ r.h.ah=2; r.h.dh=(a); r.h.dl=(b); crtint; #define CLEAN(n) \ r.x.ax=0x0920; r.h.bl=(0x08|c_norm); r.x.cx=(n); \ crtint; L_ATTR = xattr; /* set status region on 25th line */ init_scr() { DO_STAT segread(&sr); attribs(0); } /* eliminate status region, reset attributes */ reset_scr() { r.h.ah = 0x15; r.x.cx = 0; crtint; L_ATTR = BLANK; } curs_xy(x, y) uchar x, y; { GO_XY(x-1, y-1) } xypos(xp, yp) uchar *xp, *yp; { r.h.ah = 3; crtint; *xp = r.h.dh+1; *yp = r.h.dl+1; } columns(n) int n; { GO_HOME CLEAN(80*24) DO_STAT return(80); /* can't do 132 columns on a TI */ } bkgnd(sw) int sw; { /* reverse background not worth the * extra code needed to implement it. */ } /* scroll up n lines between min_y and max_y */ scrl_up(n, min_y, max_y, x, y) uchar n, min_y, max_y, x, y; { r.h.ah = 6; r.h.al = 1; r.h.dh = 0; r.h.dl = min_y-1+n; r.h.bh = 0; r.h.bl = min_y-1; r.h.ch = 80; r.h.cl = max_y - (min_y-1) - n; crtint; GO_XY(0, max_y-n) CLEAN(80 * n) GO_XY(x-1, y-1) DO_STAT } /* scroll down n lines between min_y and max_y */ scrl_down(n, min_y, max_y, x, y) uchar n, min_y, max_y, x, y; { r.h.ah = 7; r.h.al = 1; r.h.dh = 0; r.h.dl = min_y-1; r.h.bh = 0; r.h.bl = min_y-1+n; r.h.ch = 80; r.h.cl = max_y - (min_y-1) - n; crtint; GO_XY(0, min_y-1) CLEAN(80 * n) GO_XY(x-1, y-1) DO_STAT } /* eol : erase to end of line */ eol_erase(x, y) uchar x, y; { if (x > 80) return; CLEAN(80-(x-1)) DO_STAT } /* * bol : erase from beginning of line to cursor pos. * ie. goto head of line, erase chars, return to original pos */ bol_erase(x, y) uchar x, y; { GO_XY(0, y-1) CLEAN(x) GO_XY(x-1, y-1) DO_STAT } /* eos : erase to end of line and to end of screen */ eos_erase(x, y) uchar x, y; { CLEAN( (24-y) * 80 + (80-(x-1)) ) DO_STAT } /* * bos : erase from beginning of screen (home) to cursor pos. * ie. goto head of screen, erase to original pos, return to position */ bos_erase(x, y) uchar x, y; { GO_HOME CLEAN(80 * (y-1) + x) GO_XY(x-1, y-1) DO_STAT } /* goto head of line, erase line, return to original pos */ line_erase(x, y) uchar x, y; { GO_XY(0, y-1) CLEAN(80) GO_XY(x-1, y-1) DO_STAT } /* goto head of screen, erase all, return to pos */ /* could've used AH=0x13 but it also erases the status line */ all_erase(x, y) uchar x, y; { GO_HOME CLEAN(80*24) GO_XY(x-1, y-1) DO_STAT } /* * insert line(s) : * scroll down n lines, goto head of original line, erase empty space */ line_ins(n, x, y, max_y) uchar n, x, y, max_y; { if (y-1+n < max_y) { r.h.ah = 6; r.h.al = 1; r.h.dh = 0; r.h.dl = y-1; r.h.bh = 0; r.h.bl = y-1+n; r.h.ch = 80; r.h.cl = max_y-(y-1)-n; crtint; } else n = max_y - (y-1); GO_XY(0, y-1) CLEAN(80 * n) DO_STAT } /* * delete line(s) : * scroll up n lines, goto new empty line, erase lines, * return to head of original line */ line_del(n, x, y, max_y) uchar n, x, y, max_y; { if (y-1+n < max_y) { r.h.ah = 6; r.h.al = 1; r.h.dh = 0; r.h.dl = y-1+n; r.h.bh = 0; r.h.bl = y-1; r.h.ch = 80; r.h.cl = max_y-(y-1)-n; crtint; } else n = max_y - (y-1); GO_XY(0, max_y-n) CLEAN(80 * n) GO_XY(0, y-1) DO_STAT } /* * delete char(s) : * ie. scroll rest of line to the left, goto line-end, erase n chars * and return to original cursor pos */ char_del(n, x, y) uchar n, x, y; { if (x-1+n < 80) { r.h.ah = 6; r.h.al = 1; r.h.dh = x-1+n; r.h.dl = y-1; r.h.bh = x-1; r.h.bl = y-1; r.h.ch = 80-(x-1)-n; r.h.cl = 1; crtint; } else n = 80-(x-1); GO_XY(80-n, y-1) CLEAN(n) GO_XY(x-1, y-1) DO_STAT } /* * insert char(s) : * ie. scroll rest of line to right and clean out new space(s) */ char_ins(n, x, y) uchar n, x, y; { if (x-1+n < 80) { r.h.ah = 6; r.h.al = 1; r.h.dh = x-1; r.h.dl = y-1; r.h.bh = x-1+n; r.h.bl = y-1; r.h.ch = 80-(x-1)-n; r.h.cl = 1; crtint; } else n = 80-(x-1); CLEAN(n) DO_STAT } /* * set attributes */ attribs(attr) uchar attr; { r.h.ah = 0x16; r.h.bl = 0x08 | c_norm; if (attr & AT_REV) r.h.bl = 0x08 | c_rev; if (attr & AT_BOLD) { r.h.bl = 0x08 | c_bold; attr &= 0x07; } r.h.bl |= (attr << 4); L_ATTR = r.h.bl; xattr = r.h.bl; /* crtint; */ } /* * screen alignment test : * home cursor and write a screen of E's in normal attrib mode. * previous attribs are not forgotten. */ e_screen() { GO_HOME r.h.ah = 0x09; r.h.al = 'E'; r.h.bl = 0x08 | c_norm; /* ordinary attribs */ r.x.cx = 80 * 24; crtint; /* screen of E's */ L_ATTR = xattr; DO_STAT } /* basic single-char output */ burpc(c, x, y) int c, x, y; { r.h.ah = 0x0e; r.h.al = c; crtint; } /* insert mode burpc() */ /* move line right, deposit char */ insurpc(c, x, y) int c, x, y; { if (x < 80) { r.h.ah = 6; r.h.al = 1; r.h.bh = x; r.h.bl = y-1; r.h.ch = 80-x; r.h.cl = 1; r.h.dh = x-1; r.h.dl = y-1; crtint; } L_ATTR = xattr; r.h.ah = 0x0e; r.h.al = c; crtint; } /* output string at x,y with attr */ burps(s, x, y, at) char *s; uchar x, y, at; { GO_XY(x-1, y-1) r.h.ah = 0x10; r.h.al = 0x08 | c_norm; if (at & AT_REV) r.h.al = 0x08 | c_rev; if (at & AT_BOLD) { r.h.al = 0x08 | c_bold; at &= 0x07; } r.h.al |= (at << 4); xattr = r.h.al; r.x.bx = (int)s; r.x.cx = strlen(s); r.x.dx = sr.ds; crtint; } /* set cursor type */ curs_type(sw) uchar sw; { r.h.ah = 1; r.x.cx = (sw) ? CRSR_BLK : CRSR_UL; crtint; } /* save screen image & cursor position */ save_scr() { register int n; register char far *s; register char *os, *ap; register uchar xa, xn; r.h.ah = 3; crtint; o_xy = r.x.dx; r.h.ah = 0x17; crtint; scrn = (char far *) MK_FP(SCR_MEM, r.x.dx); n = SCRSIZE; s = scrn; os = o_scrn; ap = o_attr; o_xattr = xattr; xn = 0; while (n--) { *os++ = *s++; xa = L_ATTR; if (xa == xn) xa = 0; else xn = xa; *ap++ = xa; } o_norm = c_norm; o_rev = c_rev; o_bold = c_bold; } /* restore screen image & cursor position */ restore_scr() { uchar c_new; register int n; register char far *s; register char *os, *ap; c_new = (c_norm != o_norm) || (c_rev != o_rev) || (c_bold != o_bold); r.h.ah = 0x17; crtint; scrn = (char far *) MK_FP(SCR_MEM, r.x.dx); n = SCRSIZE; s = scrn; os = o_scrn; ap = o_attr; while (n--) { if (*ap++) { register uchar xa; xa = (*(ap-1)); if (c_new) { register uchar xn; xn = xa & 7; xa &= 0xf8; if (xn == o_norm) xn = c_norm; else if (xn == o_rev) xn = c_rev; else if (xn == o_bold) xn = c_bold; xa |= xn; } L_ATTR = xa; } *s++ = *os++; } r.h.ah = 2; r.x.dx = o_xy; crtint; xattr = o_xattr & 7; o_xattr &= 0xf8; if (xattr == o_norm) xattr = c_norm; else if (xattr == o_rev) xattr = c_rev; else if (xattr == o_bold) xattr = c_bold; xattr |= o_xattr; L_ATTR = xattr; } /* save text in line lnum from o_scrn to buf */ scgets(buf, siz, lnum) char buf[]; int siz, lnum; { int i, j, n; if (lnum > 24) return(-1); j = (lnum-1) * 80; /* first column */ n = (lnum*80) - 1; /* last column */ /* find last non-blank char in line */ for (; j < n; n--) if (o_scrn[n] != NUL && o_scrn[n] != ' ') { n++; break; } /* save text to buf */ for (i=0; i < siz && j < n; i++, j++) buf[i] = o_scrn[j]; buf[i] = NUL; return(i); } /* write string to status line */ uchar c_stat=3; sturp(s, x, y) char *s; int x, y; { GO_XY(0, 24) r.h.ah = 0x10; r.h.al = (c_stat) ? (0x18 | c_stat) : 0; r.x.bx = (int)s; r.x.cx = strlen(s); r.x.dx = sr.ds; crtint; GO_XY(x-1, y-1) L_ATTR = xattr; } /* delay for n milliseconds */ dsleep(n) unsigned int n; { r.h.ah = 5; r.x.cx = n; int86(0x48, &r, &r); } /* sound bell/horn/whistle/whatever */ beep(x, y) int x, y; { r.h.ah = 0x0e; r.h.al = 7; /* ^G */ crtint; } /* bios -- Clear Text Screen And Home the Cursor */ clr_home() { r.h.ah = 0x13; crtint; } /* dburp -- put debug message on status line */ dburp(s) char *s; { uchar x, y; xypos(&x, &y); sturp(s, x, y); } /* erase graphics screen */ gfx_erase() { r.h.ah = 0x14; crtint; } /* TI Pro graphics nitty-gritty */ /* graphics screen limits */ #define GMAX_X 720 #define GMAX_Y 300 /* graphics palette attribute latches (write-only) */ #define L_BLU *((char far *)0xdf000010) #define L_GRN *((char far *)0xdf000020) #define L_RED *((char far *)0xdf000030) /* our own latch memory since latches are write-only */ static uchar l_blu=0xAA, l_red=0xCC, l_grn=0xF0; /* sync our latches with the real ones */ #define L_SYNC L_BLU=l_blu; L_RED=l_red; L_GRN=l_grn; /* * l_tab: * latch table for possible graphics plane config * The following l_tab arrangement makes green (intensity 4) the * "most significant colour" and blue (intensity 1) the "least * significant colour" with red (intensity 2) in between. * If there is only 1 bit-plane present, the available colours * will be green and black. With 2 bit-planes the available * colours will be yellow (intensity 6), green, red and black. * With all 3 bit-planes present, blue is finally available so all * 8 colours/intensities can be used (black is a colour, isn't it? :-) * See also "#define ADJUST" */ static uchar l_tab[24] = { /* Grn Red Blu */ 0xFF, 0xFF, 0xFF, /* - - - */ 0xFE, 0x00, 0x00, /* - - A */ 0xFE, 0x00, 0x00, /* - B - */ 0xF0, 0xEE, 0x00, /* - B A */ 0xFE, 0x00, 0x00, /* C - - */ 0xFC, 0xFA, 0x00, /* C - A */ 0xF0, 0xEE, 0x00, /* C B - */ 0xF0, 0xCC, 0xAA /* C B A */ }; static uchar cnum=3, cmap=7; /* # of bit-planes, which are installed */ /* * ADJUST: adjust colour if some bit-planes are missing */ /* quick & dirty: assumes has only 1 or has all 3 bit-planes */ #define ADJUST(a) if (cnum==1 && a) a=cmap; /* #define ADJUST(a) \ switch (cnum) { \ case 1: if (a) a = cmap; break; \ case 2: a = (a+1)>>1; \ if (~cmap & 2) a = (a&2)<<1 | (a&1); \ else if (~cmap & 1) a = a << 1; \ break; \ } /* */ /* graphics bank (bit-plane) access */ #define GBa(m) *((unsigned int far *)0xc0000000+m) #define GBb(m) *((unsigned int far *)0xc8000000+m) #define GBc(m) *((unsigned int far *)0xd0000000+m) #define GBOFS(a,b) (((b)*46)+((a)/16)) /* x,y byte offset */ #define GMASK(a) (0x8000 >> ((a)%16)) /* bit offset for x */ init_gfx() { int i, n = 0; extern unsigned int sysconfig; extern uchar interlace, gcolour; extern int gmax_x, gmax_y, gmax_clr; L_BLU = L_RED = L_GRN = 0; gmax_x = GMAX_X; gmax_y = GMAX_Y; cmap = (sysconfig >> 12) & 7; /* count number of installed gfx banks (max 3) */ for (i = cnum = 0; i < 3; i++) cnum += (cmap >> i) & 1; gmax_clr = 1 << cnum; i = cmap * 3; l_grn = l_tab[i]; l_red = l_tab[i+1]; l_blu = l_tab[i+2]; /* C B A --> B C A (ie. map banks to colours) */ cmap = ((cmap & 4)>>1) | ((cmap & 2)<<1) | (cmap & 1); if (interlace) { gcolour = gmax_clr-1; L_SYNC } } gfx_colour(n) uchar n; { ADJUST(n) return(n); } static unsigned int ofs, msk; #define BOINK(a) \ if (a & 1) GBa(ofs) |= msk; else GBa(ofs) &= ~msk; \ if (a & 4) GBb(ofs) |= msk; else GBb(ofs) &= ~msk; \ if (a & 2) GBc(ofs) |= msk; else GBc(ofs) &= ~msk; #define GPEEK \ (((GBa(ofs) & msk) == msk) \ | (((GBc(ofs) & msk) == msk) << 1) \ | (((GBb(ofs) & msk) == msk) << 2)) /* gpeek -- get a pixel's colour */ gpeek(x, y) int x, y; { uchar c; msk = GMASK(x); ofs = GBOFS(x,y); /* * c = ((GBa(ofs) & msk) == msk); * c |= ((GBc(ofs) & msk) == msk) << 1; * c |= ((GBb(ofs) & msk) == msk) << 2; */ c = GPEEK; ADJUST(c) return(c); } /* boink -- light a pixel */ boink(x,y,c) int x, y; register uchar c; { msk = GMASK(x); ofs = GBOFS(x,y); BOINK(c) } /* * hline -- only does horizontal lines (union regulations :-) * use solid(ie. multi bit) masks and increment the offset */ hline(x,y,n,c) int x,y,n; uchar c; { if (n < 0) { n = -n; x -= n; if (x < 0) { n += x; x = 0; } } msk = 0xffff >> (x%16); /* make mask go to end of 16bit word */ for(ofs=GBOFS(x,y); ofs < GBOFS(x+n, y); ofs++) { BOINK(c) msk = 0xffff; /* ie. solid while between end-points */ } msk &= ~(0xffff >> ((x+n)%16)); /* remainder word mask */ BOINK(c) } /* * vline -- vertical lines only * get bit mask once then move it up or down * by changing only the offset +/- 46. */ vline(x,y,n,c) int x,y,n; uchar c; { if (n < 0) { n = -n; y -= n; if (y < 0) { n += y; y = 0; } } msk = GMASK(x); ofs = GBOFS(x,y); for (; n; n--, ofs+=46) { BOINK(c) } } /* xrun -- optimize search for runs in x direction */ xrun(x, y, c, dir) int x, y, dir; uchar c; { uchar cx; unsigned int ba, bb, bc; msk = GMASK(x); ofs = GBOFS(x,y); ba = GBa(ofs); bb = GBb(ofs); bc = GBc(ofs); while (0 <= x && x < GMAX_X) { cx = ((ba & msk) == msk) \ | (((bc & msk) == msk) << 1)\ | (((bb & msk) == msk) << 2); if (c == cx) break; x += dir; msk = GMASK(x); if (((dir > 0) && (x%16) == 0) || ((dir < 0) && (x%16) == 15)) { ofs = GBOFS(x,y); ba = GBa(ofs); bb = GBb(ofs); bc = GBc(ofs); } } if (c == cx) x -= dir; if (x < 0) return(0); if (x >= GMAX_X) return(GMAX_X-1); return(x); } @ 1.7 log @attrib reading/writing cleaned up @ text @d14 1 a14 1 static char rcsid[] = "$Header: screen.ti,v 1.5 89/04/04 19:02:57 pkern Exp $"; d40 1 d49 1 a49 1 r.x.ax=0x0920; r.h.bl=c_norm; r.x.cx=(n); \ d87 3 d394 1 d400 1 a401 1 register uchar xa; d405 4 d413 1 a413 2 s = scrn; os = o_scrn; ap = o_attr; xattr = o_xattr; d415 13 a427 1 if (xa = *ap++) d429 1 d436 6 d449 1 a449 1 { @ 1.6 log @aborted attempt at reverse background. returning to revision 1.5 @ text @d35 1 a35 1 static int o_xy=~0; /* cursor position memory */ a40 3 /* reverse video toggle */ static uchar sw_rev=0; d48 1 a48 1 r.x.ax=0x0920; r.h.bl=c_norm^sw_rev; r.x.cx=(n); \ a88 8 /* change background */ #define REVFLIP(tgl,tmp,res) \ tmp = res & 7; \ if (tmp == c_norm) tmp = c_rev; \ else if (tmp == c_rev) tmp = c_norm; \ tmp |= res & 0xf8; \ res = (tgl)?(tmp ^ 0x10):(~tmp ^ 0xef); d92 2 a93 50 uchar xc, xa, xn; char *ap, z_attr[SCRSIZE], z_scrn[SCRSIZE]; register int n; register char *os; register char far *s; if ((sw_rev && !sw) || (!sw_rev && sw)) { xa = c_rev; c_rev = c_norm; c_norm = xa; r.h.ah = 0x17; crtint; scrn = (char far *) MK_FP(SCR_MEM, r.x.dx); n = SCRSIZE; s = scrn; os = z_scrn; ap = z_attr; xn = 0; while (n--) { *os++ = *s++; xa = L_ATTR; if (xa == xn) *ap++ = '\0'; else { xc = xa; REVFLIP(sw,xn,xa) *ap++ = xa; xn = xc; } } n = SCRSIZE; s = scrn; os = z_scrn; ap = z_attr; while (n--) { if (xa = *ap++) L_ATTR = xa; *s++ = *os++; } if (~o_xy) { for (n=SCRSIZE, ap=o_attr, xn=0; n; n--, ap++, xn=0) { if (!*ap) continue; xa = *ap; REVFLIP(sw,xn,xa) *ap = xa; } REVFLIP(sw,xn,o_xattr) } REVFLIP(sw,xn,xattr) } sw_rev = (sw) ? 0x10 : 0; L_ATTR = xattr; a289 1 r.h.bl ^= sw_rev; d305 1 a305 1 r.h.bl = 0x08 | c_norm | sw_rev; /* ordinary attribs */ a349 1 r.h.al ^= sw_rev; a368 1 uchar xa, xn; d372 1 d374 1 a374 2 r.h.ah = 3; crtint; d376 2 a377 3 r.h.ah = 0x17; crtint; /* scrn = SCR_MEM | r.x.dx; */ d384 5 a388 2 *os++ = *s++; xa = L_ATTR; *ap++ = (xa == xn) ? '\0' : (xn=xa); d400 1 a400 3 r.h.ah = 0x17; crtint; /* scrn = SCR_MEM | r.x.dx; */ d407 2 a408 1 if (xa = *ap++) L_ATTR = xa; a415 1 o_xy = ~0; @ 1.5 log @many changes, including code to save attribs when flipping to setup (thanks to Ed Ferguson @@ TI for prodding :-) @ text @d14 1 a14 1 static char rcsid[] = "$Header: screen.ti,v 1.4 89/03/23 13:34:49 pkern Exp $"; d35 1 a35 1 static int o_xy; /* cursor position memory */ d41 3 d51 1 a51 1 r.x.ax=0x0920; r.h.bl=c_norm; r.x.cx=(n); \ d92 63 d349 1 d365 1 a365 1 r.h.bl = 0x08 | c_norm; /* ordinary attribs */ d410 1 d430 1 d445 5 a449 2 ap = o_attr; o_xattr = xattr; while (n--) { *os++ = *s++; *ap++ = L_ATTR; } d456 1 d468 4 a471 1 while (n--) { L_ATTR = *ap++; *s++ = *os++; } d477 1 @ 1.4 log @sysconfig used to find out which graphics bit-planes are available RGB latches set up accordingly. Colour adjust macro currently assumes a system has 1 plane or 3 planes (since a 2-plane machine isn't likely) gfx_colour() returns colour according to latch configurations @ text @d4 2 a5 7 * Notes: * - the attribute information for individual positions on the screen * can only be accessed through AH=0x08 (as far as I can tell). * This would take too long when saving the screen image so * attributes are lost when switching save_scr() to restore_scr(). * * - it seems necessary to assert the status line after each CLEANing d14 1 a14 1 static char rcsid[] = "$Header: screen.ti,v 1.3 89/02/06 16:42:17 pkern Exp $"; d24 1 a24 1 #define L_ATTR *((char far *)0xdf000800) /* attribute latch */ d31 1 a31 1 static int xattr=0x0f; /* attribute storage */ d34 1 d38 3 d48 1 a48 1 r.x.ax=0x0920; r.h.bl=BLANK; r.x.cx=(n); \ d83 2 a84 2 ncols(columns) int columns; a274 2 uchar c_norm=5, c_rev=5, c_bold=7; d296 1 a296 1 r.h.ah = 0x0a; d298 1 a298 1 r.h.bl = 0x1d; /* ordinary attribs */ d326 1 a362 1 register char *os; d364 1 d376 2 a377 1 while (n--) *os++ = *s++; a383 1 register char *os; d385 1 d394 2 a395 1 while (n--) *s++ = *os++; d400 1 d547 1 a547 1 /* quick & dirty: assumes only 1 or all 3 bit-planes */ @ 1.3 log @scgets() added @ text @d13 5 a17 1 * copyright (c) University of Toronto, 1988. d19 1 a19 1 static char rcsid[] = "$Header: screen.ti,v 1.2 89/02/03 15:55:30 pkern Exp $"; d57 1 d84 5 d273 2 a274 4 /* set attributes * "bold" = 2 levels dimmer * reverse video also = 2 levels dimmer. * (so reverse and bold is 4 levels dimmer) d276 2 d282 3 a284 3 r.h.bl = 0x0f; /* char enable, max intensity */ if (attr & AT_BOLD) { r.h.bl -= 3; attr &= 0x07; } if (attr & AT_REV) r.h.bl -= 2; d341 3 a343 3 r.h.al = 0x0f; if (at & AT_BOLD) { r.h.al -= 2; at &= 0x07; } if (at & AT_REV) r.h.al -= 2; d431 1 a431 1 uchar stcolour=3; d439 1 a439 1 r.h.al = (stcolour) ? (0x18 | stcolour) : 0; d506 1 a506 1 /* graphics palette attribute latches */ d511 1 d513 1 d515 43 d559 4 a562 4 /* graphics bank (or plane) access */ #define GBa(i) *((unsigned int far *)0xc0000000+i) #define GBb(i) *((unsigned int far *)0xc8000000+i) #define GBc(i) *((unsigned int far *)0xd0000000+i) d569 2 a570 1 extern int gmax_x, gmax_y; d572 1 d579 11 d591 1 a591 1 gcolour = 7; d596 7 d605 3 a607 3 GBa(ofs) = (a & 1) ? (GBa(ofs) | msk) : (GBa(ofs) & ~msk); \ GBb(ofs) = (a & 4) ? (GBb(ofs) | msk) : (GBb(ofs) & ~msk); \ GBc(ofs) = (a & 2) ? (GBc(ofs) | msk) : (GBc(ofs) & ~msk); d610 3 a612 3 ((((GBa(ofs) & msk) == msk) * 1) \ | (((GBc(ofs) & msk) == msk) * 2) \ | (((GBb(ofs) & msk) == msk) * 4)) d628 1 d635 1 a635 1 uchar c; d698 2 a699 2 + (((bc & msk) == msk) * 2)\ + (((bb & msk) == msk) * 4); @ 1.2 log @*** empty log message *** @ text @d15 1 a15 1 static char rcsid[] = "$Header: screen.ti,v 1.1 89/01/31 14:28:12 pkern Exp $"; d34 1 a34 1 /* static */ char o_scrn[SCRSIZE]; /* screen memory storage */ d390 28 @ 1.1 log @Initial revision @ text @d15 1 a15 1 static char rcsid[] = "$Header: screen.c,v 1.5 89/01/31 14:27:13 pkern Exp $"; d419 11 @