From 69226521b2d925aecfb0d11c0db680904a1d05d2 Mon Sep 17 00:00:00 2001 From: David du Colombier <0intro@gmail.com> Date: Fri, 16 Feb 1996 00:00:00 +0000 Subject: [PATCH] Plan 9 from Bell Labs 1996-02-16 --- carrera/screen.c | 10 +--------- pc/devata.c | 2 +- pc/devvga.c | 6 +----- pc/vgaark2000pv.c | 29 +++++++++++------------------ port/portfns.h | 1 + 5 files changed, 15 insertions(+), 33 deletions(-) diff --git a/carrera/screen.c b/carrera/screen.c index 4e83fd50dab0906185e7eed371508e691c0e8602..e44e9507b3cd05dd67db35096cb18bdd1165baeb 100644 --- a/carrera/screen.c +++ b/carrera/screen.c @@ -145,7 +145,6 @@ dacinit(void) { Dac *d; int i; - ulong r, g, b; d = DAC; @@ -168,14 +167,7 @@ dacinit(void) for(i = 0; i < 0x400; i++) d->cr2 = 0xff; - for(i = 0; i<256; i++) { - r = rep((i>>5) & 7, 3); - g = rep((i>>2) & 7, 3); - b = rep(i & 3, 2); - setcolor(i, r, g, b); - } - setcolor(170, 0xAAAAAAAA, 0xAAAAAAAA, 0xAAAAAAAA); - setcolor(85, 0x55555555, 0x55555555, 0x55555555); + graphicscmap(0); /* Overlay Palette Ram */ d->cr0 = 0x00; diff --git a/pc/devata.c b/pc/devata.c index 1dc7340fec37ce6ae5f59e8b316ef4129a023738..59f56a057da15ed99b0a475b072962f40907107f 100644 --- a/pc/devata.c +++ b/pc/devata.c @@ -401,7 +401,7 @@ atactlrprobe(int ctlrno, int irq) outb(port+Pctrl, Srst|nIEN); delay(10); outb(port+Pctrl, 0); - if(atactlrwait(ctlr, DHmagic, 0, MS2TK(20)){ + if(atactlrwait(ctlr, DHmagic, 0, MS2TK(20))){ DPRINT("ata%d: Srst status %ux/%ux/%ux\n", ctlrno, inb(port+Pstatus), inb(port+Pcylmsb), inb(port+Pcyllsb)); xfree(ctlr); diff --git a/pc/devvga.c b/pc/devvga.c index 7d25c643ac240b3ab4a749ec2969e94f14ca8a67..8878420c7e9a42a9a86c696ac48b685ff8a63afe 100644 --- a/pc/devvga.c +++ b/pc/devvga.c @@ -626,11 +626,7 @@ setscreen(int maxx, int maxy, int ldepth) /* default color map (has to be outside the lock) */ switch(ldepth){ case 3: - for(i = 0; i < Pcolours; i++) - setcolor(i, xnto32(i>>5, 3), xnto32(i>>2, 3), xnto32(i, 2)); - setcolor(0x55, xnto32(0x15, 6), xnto32(0x15, 6), xnto32(0x15, 6)); - setcolor(0xaa, xnto32(0x2a, 6), xnto32(0x2a, 6), xnto32(0x2a, 6)); - setcolor(0xff, xnto32(0x3f, 6), xnto32(0x3f, 6), xnto32(0x3f, 6)); + graphicscmap(0); break; case 2: case 1: diff --git a/pc/vgaark2000pv.c b/pc/vgaark2000pv.c index fcd5b7e8d48988e3645cb90df059bf90d0d47fd6..402dcc2bc68ddb7ab5bbbc81643dc08dbec85013 100644 --- a/pc/vgaark2000pv.c +++ b/pc/vgaark2000pv.c @@ -39,12 +39,12 @@ enable(void) /* * Disable the cursor then configure for X-Windows style, - * 64x64 and 4/8-bit colour depth. + * 32x32 and 4/8-bit colour depth. * Set cursor colours for 4/8-bit. */ seq20 = vgaxi(Seqx, 0x20) & ~0x1F; vgaxo(Seqx, 0x20, seq20); - seq20 |= 0x1C; + seq20 |= 0x18; vgaxo(Seqx, 0x26, Pwhite); vgaxo(Seqx, 0x27, Pwhite); @@ -54,13 +54,13 @@ enable(void) vgaxo(Seqx, 0x2B, Pblack); /* - * Cursor storage is a 1Kb block located in the last 16Kb - * of video memory. Crt25 is the index of which 1Kb block. + * Cursor storage is a 256 byte or 1Kb block located in the last + * 16Kb of video memory. Crt25 is the index of which block. */ storage = (vgaxi(Seqx, 0x10)>>6) & 0x03; storage = (1024*1024)<clr[2*y + x]|c->set[2*y + x]; *p++ = c->set[2*y + x]; @@ -132,9 +128,6 @@ load(Cursor *c) * Set the cursor hotpoint and enable the cursor. */ hotpoint = c->offset; -#ifdef notdef - vgaxo(Seqx, 0x20, seq20|0x08); -#endif unlock(&ark2000pvlock); } diff --git a/port/portfns.h b/port/portfns.h index fc9124387134d919eadb7a11c9a65527ec748cf9..0e35d4b22b3bcf5992679b0bb4287cf6a93baa29 100644 --- a/port/portfns.h +++ b/port/portfns.h @@ -94,6 +94,7 @@ void getcolor(ulong, ulong*, ulong*, ulong*); int getfields(char*, char**, int, char*); void gotolabel(Label*); void graphicsactive(int); +void graphicscmap(int); int haswaitq(void*); long hostdomainwrite(char*, int); long hostownerwrite(char*, int);