|
|
|
1993/0226/sys/src/9/ss/screen.c:1,549 –
1993/0501/sys/src/9/ss/screen.c:0
(short | long | prev)
|
Deleted.
rsc Mon Mar 7 10:33:19 2005
|
|
1990/1223
| |
#include "u.h"
|
|
1992/0321
| |
#include "../port/lib.h"
|
|
1990/1223
| |
#include "mem.h"
#include "dat.h"
#include "fns.h"
#include "io.h"
|
|
1992/0111
| |
#include "../port/error.h"
|
|
1990/1223
| |
|
|
1992/0211
| |
#include <libg.h>
|
|
1990/1223
| |
#include <gnot.h>
|
|
1991/0708
| |
#include "screen.h"
|
|
1990/1223
| |
#define MINX 8
|
|
1992/0208
| |
extern GSubfont defont0;
GSubfont *defont;
|
|
1992/1020
| |
int islcd;
|
|
1990/1223
| |
struct{
Point pos;
int bwid;
}out;
|
|
1992/0813
| |
static ulong rep(ulong, int);
void (*kprofp)(ulong);
|
|
1990/1223
| |
|
|
1992/0904
| |
typedef struct Video Video;
struct Video
|
|
1992/0813
| |
{
|
|
1992/0904
| |
/* Brooktree 458/451 */
|
|
1992/0817
| |
uchar addr; /* address register */
|
|
1992/0815
| |
uchar pad0[3];
|
|
1992/0817
| |
uchar color; /* color palette */
|
|
1992/0815
| |
uchar pad1[3];
|
|
1992/0817
| |
uchar cntrl; /* control register */
|
|
1992/0815
| |
uchar pad2[3];
|
|
1992/0817
| |
uchar ovrl; /* overlay palette */
|
|
1992/0815
| |
uchar pad3[3];
|
|
1992/0905
| |
#ifdef notright
|
|
1992/0904
| |
/* Sun-4 video chip */
uchar mcr; /* master control register */
uchar sr; /* status register */
uchar csa; /* cursor start address */
uchar cea; /* cursor end address */
uchar hbs; /* horizontal blank set */
uchar hbc; /* horizontal blank clear */
uchar hss; /* horizontal sync set */
uchar hsc; /* horizontal sync clear */
uchar csc; /* composite sync clear */
uchar vbsh; /* vertical blank set high byte */
uchar vbsl; /* vertical blank set low byte */
uchar vbc; /* vertical blank clear */
uchar vss; /* vertical sync set */
uchar vsc; /* vertical sync clear */
uchar xcs; /* transfer cycle hold off set */
uchar xcc; /* transfer cycle hold off clear */
|
|
1992/0905
| |
#endif
} *vid;
|
|
1992/0813
| |
|
|
1992/0810
| |
GBitmap gscreen;
struct screens
|
|
1990/1223
| |
{
|
|
1992/0812
| |
char *type;
|
|
1992/0810
| |
int x;
int y;
int ld;
|
|
1992/0904
| |
ulong vidaddr;
|
|
1992/0810
| |
}screens[] = {
|
|
1992/0813
| |
{ "bwtwo", 1152, 900, 0, 0x400000 },
|
|
1992/0814
| |
{ "cgsix", 1152, 900, 3, 0x200000 },
|
|
1993/0217
| |
{ "cgthree", 1152, 900, 3, 0x400000 }, /* data from rwolff */
|
|
1990/1223
| |
0
};
|
|
1991/1228
| |
Lock screenlock;
|
|
1990/1223
| |
void
|
|
1992/0904
| |
screeninit(char *str, int slot)
|
|
1990/1223
| |
{
|
|
1992/0810
| |
struct screens *s;
|
|
1992/0813
| |
ulong n, r, g, b;
int i;
int havecol;
|
|
1992/0810
| |
for(s=screens; s->type; s++)
|
|
1992/0812
| |
if(strcmp(s->type, str) == 0)
|
|
1992/0810
| |
goto found;
/* default is 0th element of table */
if(conf.monitor){
s = screens;
goto found;
|
|
1992/0811
| |
}
|
|
1992/0810
| |
conf.monitor = 0;
return;
found:
gscreen.zero = 0;
|
|
1992/0812
| |
gscreen.width = (s->x<<s->ld)/(8*sizeof(ulong));
n = sizeof(ulong) * gscreen.width * s->y;
|
|
1992/0904
| |
gscreen.base = (ulong*)kmapregion(DISPLAYRAM(slot), n, PTENOCACHE|PTEIO);
|
|
1992/0810
| |
gscreen.ldepth = s->ld;
gscreen.r = Rect(0, 0, s->x, s->y);
gscreen.clipr = gscreen.r;
gscreen.cache = 0;
|
|
1990/1226
| |
defont = &defont0;
|
|
1990/1223
| |
gbitblt(&gscreen, Pt(0, 0), &gscreen, gscreen.r, 0);
out.pos.x = MINX;
out.pos.y = 0;
out.bwid = defont0.info[' '].width;
|
|
1992/0904
| |
vid = (Video*)(kmappa(FRAMEBUF(slot)+s->vidaddr, PTENOCACHE|PTEIO)->va);
|
|
1992/0813
| |
if(gscreen.ldepth == 3){
|
|
1992/0904
| |
vid->addr = 4;
vid->cntrl = 0xFF; /* enable all planes */
vid->addr = 5;
vid->cntrl = 0x00; /* no blinking */
vid->addr = 6;
vid->cntrl = 0x43; /* enable palette ram and display */
vid->addr = 7;
vid->cntrl = 0x00; /* no tests */
|
|
1992/0813
| |
havecol = 0;
if(havecol) {
|
|
1992/0824
| |
/*
* For now, just use a fixed colormap, where pixel i is
* regarded as 3 bits of red, 3 bits of green, and 2 bits of blue.
* Intensities are inverted so that 0 means white, 255 means black.
* Exception: pixels 85 and 170 are set to intermediate grey values
* so that 2-bit grey scale images will look ok on this screen.
*/
|
|
1992/0813
| |
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(85, 0xAAAAAAAA, 0xAAAAAAAA, 0xAAAAAAAA);
setcolor(170, 0x55555555, 0x55555555, 0x55555555);
} else {
|
|
1992/0904
| |
vid->addr = 0;
|
|
1992/0815
| |
for(i=255; i>=0; i--){
|
|
1992/0904
| |
vid->color = i;
vid->color = i;
vid->color = i;
|
|
1992/0815
| |
}
|
|
1992/0813
| |
}
}
|
|
1990/1223
| |
}
|
|
1992/0904
| |
void
|
|
1991/1228
| |
screenputnl(void)
{
|
|
1992/0807
| |
if(!conf.monitor)
return;
|
|
1991/1228
| |
out.pos.x = MINX;
out.pos.y += defont0.height;
if(out.pos.y > gscreen.r.max.y-defont0.height)
out.pos.y = gscreen.r.min.y;
gbitblt(&gscreen, Pt(0, out.pos.y), &gscreen,
Rect(0, out.pos.y, gscreen.r.max.x, out.pos.y+2*defont0.height), 0);
}
void
|
|
1991/0604
| |
screenputs(char *s, int n)
|
|
1990/1223
| |
{
|
|
1991/1223
| |
Rune r;
int i;
char buf[4];
|
|
1992/0807
| |
if(!conf.monitor)
return;
|
|
1992/0914
| |
if((getpsr()&SPL(15))){
if(!canlock(&screenlock))
return; /* don't deadlock trying to print in interrupt */
}else
lock(&screenlock);
|
|
1991/1223
| |
while(n > 0){
i = chartorune(&r, s);
if(i == 0){
s++;
--n;
continue;
}
memmove(buf, s, i);
buf[i] = 0;
n -= i;
s += i;
|
|
1991/1228
| |
if(r == '\n')
screenputnl();
else if(r == '\t'){
|
|
1991/1223
| |
out.pos.x += (8-((out.pos.x-MINX)/out.bwid&7))*out.bwid;
if(out.pos.x >= gscreen.r.max.x)
|
|
1991/1228
| |
screenputnl();
|
|
1991/1223
| |
}else if(r == '\b'){
if(out.pos.x >= out.bwid+MINX){
out.pos.x -= out.bwid;
|
|
1992/0208
| |
gsubfstring(&gscreen, out.pos, defont, " ", S);
|
|
1991/1223
| |
}
}else{
if(out.pos.x >= gscreen.r.max.x-out.bwid)
|
|
1991/1228
| |
screenputnl();
|
|
1992/0208
| |
out.pos = gsubfstring(&gscreen, out.pos, defont, buf, S);
|
|
1991/1223
| |
}
}
|
|
1991/1228
| |
unlock(&screenlock);
|
|
1990/1223
| |
}
|
|
1990/1231
| |
/*
|
|
1991/0112
| |
* Map is indexed by keyboard char, output is ASCII.
|
|
1992/0813
| |
* Plan 9-isms:
* Return sends newline and Line Feed sends carriage return.
|
|
1991/0112
| |
* Delete and Backspace both send backspace.
* Num Lock sends delete (rubout).
* Alt Graph is VIEW (scroll).
|
|
1992/0813
| |
* Compose builds Unicode characters.
|
|
1990/1231
| |
*/
uchar keymap[128] = {
/* 00 L1 02 L2 04 F1 F2 07 */
0xFF, 0x80, 0xFF, 0x81, 0xFF, 0x82, 0x83, 0xFF,
|
|
1991/0112
| |
/* F3 09 F4 0b F5 altgr F6 0f */
0x84, 0xFF, 0x85, 0xFF, 0x86, 0x80, 0x87, 0xFF,
|
|
1990/1231
| |
/* F7 F8 F9 Alt 14 R1 R2 R3 */
0x88, 0x89, 0x8a, 0x8b, 0xFF, 0x8c, 0x8d, 0x8e,
/* 18 L3 L4 1b 1c Esc 1 2 */
0xFF, 0x8f, 0x90, 0xFF, 0xFF, 0x1b, '1', '2',
/* 3 4 5 6 7 8 9 0 */
'3', '4', '5', '6', '7', '8', '9', '0',
/* - = ` bs 2c R4 R5 R6 */
'-', '=', '`', '\b', 0xFF, 0x91, 0x92, 0x93,
|
|
1991/0112
| |
/* 30 L5 del L6 34 tab q w */
0xFF, 0x94, 0xFF, 0x95, 0xFF, '\t', 'q', 'w',
|
|
1990/1231
| |
/* e r t y u i o p */
'e', 'r', 't', 'y', 'u', 'i', 'o', 'p',
|
|
1991/0112
| |
/* [ ] dele comp R7 R8 R9 r - */
'[', ']', '\b', 0xB6, 0x96, 0x97, 0x98, 0xFF,
|
|
1990/1231
| |
/* L7 L8 4a 4b ctrl a s d */
0x99, 0x9a, 0xFF, 0xFF, 0xF0, 'a', 's', 'd',
/* f g h j k l ; ' */
'f', 'g', 'h', 'j', 'k', 'l', ';', '\'',
|
|
1991/0112
| |
/* \ ret enter R10 R11 R12 ins L9 */
|
|
1990/1231
| |
'\\', '\n', 0xFF, 0x9b, 0x9c, 0x9d, 0xFF, 0x9e,
|
|
1991/0112
| |
/* 60 L10 numlk shift z x c v */
0xFF, 0x9f, 0x7F, 0xF1, 'z', 'x', 'c', 'v',
|
|
1990/1231
| |
/* b n m , . / shift lf */
'b', 'n', 'm', ',', '.', '/', 0xF1, '\r',
|
|
1991/0112
| |
/* R13 R14 R15 73 74 75 help caps */
|
|
1990/1231
| |
0xA0, 0xA1, 0xA2, 0xFF, 0xFF, 0xFF, 0xFF, 0xF2,
|
|
1991/0112
| |
/* lloz 79 rloz 7b 7c r + 7e 7f */
|
|
1990/1231
| |
0xA3, ' ', 0xA4, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
};
uchar keymapshift[128] = {
/* 00 L1 02 L2 04 F1 F2 07 */
0xFF, 0x80, 0xFF, 0x81, 0xFF, 0x82, 0x83, 0xFF,
|
|
1991/0112
| |
/* F3 09 F4 0b F5 altgr F6 0f */
0x84, 0xFF, 0x85, 0xFF, 0x86, 0x80, 0x87, 0xFF,
|
|
1990/1231
| |
/* F7 F8 F9 Alt 14 R1 R2 R3 */
0x88, 0x89, 0x8a, 0x8b, 0xFF, 0x8c, 0x8d, 0x8e,
/* 18 L3 L4 1b 1c Esc 1 2 */
0xFF, 0x8f, 0x90, 0xFF, 0xFF, 0x1b, '!', '@',
/* 3 4 5 6 7 8 9 0 */
'#', '$', '%', '^', '&', '*', '(', ')',
/* - = ` bs 2c R4 R5 R6 */
'_', '+', '~', '\b', 0xFF, 0x91, 0x92, 0x93,
|
|
1991/0112
| |
/* 30 L5 del L6 34 tab q w */
0xFF, 0x94, 0xFF, 0x95, 0xFF, '\t', 'Q', 'W',
|
|
1990/1231
| |
/* e r t y u i o p */
'E', 'R', 'T', 'Y', 'U', 'I', 'O', 'P',
|
|
1991/0112
| |
/* [ ] dele comp R7 R8 R9 r - */
'{', '}', '\b', 0xB6, 0x96, 0x97, 0x98, 0xFF,
|
|
1990/1231
| |
/* L7 L8 4a 4b ctrl a s d */
0x99, 0x9a, 0xFF, 0xFF, 0xF0, 'A', 'S', 'D',
/* f g h j k l ; ' */
'F', 'G', 'H', 'J', 'K', 'L', ':', '"',
|
|
1991/0112
| |
/* \ ret enter R10 R11 R12 ins L9 */
|
|
1990/1231
| |
'|', '\n', 0xFF, 0x9b, 0x9c, 0x9d, 0xFF, 0x9e,
|
|
1991/0112
| |
/* 60 L10 numlk shift z x c v */
0xFF, 0x9f, 0x7F, 0xF1, 'Z', 'X', 'C', 'V',
|
|
1990/1231
| |
/* b n m , . / shift lf */
'B', 'N', 'M', '<', '>', '?', 0xF1, '\r',
|
|
1991/0112
| |
/* R13 R14 R15 73 74 75 help caps */
|
|
1990/1231
| |
0xA0, 0xA1, 0xA2, 0xFF, 0xFF, 0xFF, 0xFF, 0xF2,
|
|
1991/0112
| |
/* lloz 79 rloz 7b 7c r + 7e 7f */
|
|
1990/1231
| |
0xA3, ' ', 0xA4, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
};
uchar keymapctrl[128] = {
/* 00 L1 02 L2 04 F1 F2 07 */
0xFF, 0x80, 0xFF, 0x81, 0xFF, 0x82, 0x83, 0xFF,
|
|
1991/0112
| |
/* F3 09 F4 0b F5 altgr F6 0f */
0x84, 0xFF, 0x85, 0xFF, 0x86, 0x80, 0x87, 0xFF,
|
|
1990/1231
| |
/* F7 F8 F9 Alt 14 R1 R2 R3 */
0x88, 0x89, 0x8a, 0x8b, 0xFF, 0x8c, 0x8d, 0x8e,
/* 18 L3 L4 1b 1c Esc 1 2 */
0xFF, 0x8f, 0x90, 0xFF, 0xFF, 0x1b, '!', '@',
/* 3 4 5 6 7 8 9 0 */
'#', '$', '%', '^', '&', '*', '(', ')',
/* - = ` bs 2c R4 R5 R6 */
'_', '+', '~', '\b', 0xFF, 0x91, 0x92, 0x93,
|
|
1991/0112
| |
/* 30 L5 del L6 34 tab q w */
0xFF, 0x94, 0xFF, 0x95, 0xFF, '\t', 0x11, 0x17,
|
|
1990/1231
| |
/* e r t y u i o p */
0x05, 0x12, 0x14, 0x19, 0x15, 0x09, 0x0F, 0x10,
|
|
1991/0112
| |
/* [ ] dele comp R7 R8 R9 r - */
0x1B, 0x1D, '\b', 0xB6, 0x96, 0x97, 0x98, 0xFF,
|
|
1990/1231
| |
/* L7 L8 4a 4b ctrl a s d */
0x99, 0x9a, 0xFF, 0xFF, 0xF0, 0x01, 0x13, 0x04,
/* f g h j k l ; ' */
0x06, 0x07, 0x08, 0x0A, 0x0B, 0x0C,':', '"',
|
|
1991/0112
| |
/* \ ret enter R10 R11 R12 ins L9 */
|
|
1990/1231
| |
0x1C, '\n', 0xFF, 0x9b, 0x9c, 0x9d, 0xFF, 0x9e,
|
|
1991/0112
| |
/* 60 L10 numlk shift z x c v */
0xFF, 0x9f, 0x7F, 0xF1, 0x1A, 0x18, 0x03, 0x16,
|
|
1990/1231
| |
/* b n m , . / shift lf */
0x02, 0x0E, 0x0D, '<', '>', '?', 0xF1, '\r',
|
|
1991/0112
| |
/* R13 R14 R15 73 74 75 help caps */
|
|
1990/1231
| |
0xA0, 0xA1, 0xA2, 0xFF, 0xFF, 0xFF, 0xFF, 0xF2,
|
|
1991/0112
| |
/* lloz 79 rloz 7b 7c r + 7e 7f */
|
|
1990/1231
| |
0xA3, ' ', 0xA4, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
};
uchar keymapshiftctrl[128] = {
/* 00 L1 02 L2 04 F1 F2 07 */
0xFF, 0x80, 0xFF, 0x81, 0xFF, 0x82, 0x83, 0xFF,
|
|
1991/0112
| |
/* F3 09 F4 0b F5 altgr F6 0f */
0x84, 0xFF, 0x85, 0xFF, 0x86, 0x80, 0x87, 0xFF,
|
|
1990/1231
| |
/* F7 F8 F9 Alt 14 R1 R2 R3 */
0x88, 0x89, 0x8a, 0x8b, 0xFF, 0x8c, 0x8d, 0x8e,
/* 18 L3 L4 1b 1c Esc 1 2 */
0xFF, 0x8f, 0x90, 0xFF, 0xFF, 0x1b, '!', 0x00,
/* 3 4 5 6 7 8 9 0 */
'#', '$', '%', 0x1E, '&', '*', '(', ')',
/* - = ` bs 2c R4 R5 R6 */
0x1F, '+', '~', '\b', 0xFF, 0x91, 0x92, 0x93,
|
|
1991/0112
| |
/* 30 L5 del L6 34 tab q w */
0xFF, 0x94, 0xFF, 0x95, 0xFF, '\t', 0x11, 0x17,
|
|
1990/1231
| |
/* e r t y u i o p */
0x05, 0x12, 0x14, 0x19, 0x15, 0x09, 0x0F, 0x10,
|
|
1991/0112
| |
/* [ ] dele comp R7 R8 R9 r - */
0x1B, 0x1D, '\b', 0xB6, 0x96, 0x97, 0x98, 0xFF,
|
|
1990/1231
| |
/* L7 L8 4a 4b ctrl a s d */
0x99, 0x9a, 0xFF, 0xFF, 0xF0, 0x01, 0x13, 0x04,
/* f g h j k l ; ' */
0x06, 0x07, 0x08, 0x0A, 0x0B, 0x0C,':', '"',
|
|
1991/0112
| |
/* \ ret enter R10 R11 R12 ins L9 */
0x1C, '\n', 0xFF, 0x9b, 0x9c, 0x9d, 0xFF, 0x9e,
/* 60 L10 numlk shift z x c v */
0xFF, 0x9f, 0x7F, 0xF1, 0x1A, 0x18, 0x03, 0x16,
|
|
1990/1231
| |
/* b n m , . / shift lf */
0x02, 0x0E, 0x0D, '<', '>', '?', 0xF1, '\r',
|
|
1991/0112
| |
/* R13 R14 R15 73 74 75 help caps */
|
|
1990/1231
| |
0xA0, 0xA1, 0xA2, 0xFF, 0xFF, 0xFF, 0xFF, 0xF2,
|
|
1991/0112
| |
/* lloz 79 rloz 7b 7c r + 7e 7f */
|
|
1990/1231
| |
0xA3, ' ', 0xA4, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
};
static uchar *kbdmap[4] = {
keymap,
keymapshift,
keymapctrl,
keymapshiftctrl
};
|
|
1991/0604
| |
int
kbdstate(IOQ *q, int c)
|
|
1990/1231
| |
{
static shift = 0x00;
static caps = 0;
static long startclick;
|
|
1991/0713
| |
static int repeatc;
|
|
1991/1211
| |
static int lstate;
static uchar kc[4];
|
|
1992/0711
| |
uchar ch;
|
|
1991/1211
| |
int i, nk;
|
|
1990/1231
| |
|
|
1992/0711
| |
USED(q);
|
|
1991/1211
| |
ch = kbdmap[shift][c&0x7F];
|
|
1990/1231
| |
if(c==0x7F){ /* all keys up */
|
|
1991/0713
| |
norepeat:
kbdrepeat(0);
|
|
1992/0711
| |
return 0;
|
|
1990/1231
| |
}
|
|
1991/1211
| |
if(ch == 0xFF) /* shouldn't happen; ignore */
|
|
1992/0711
| |
return 0;
|
|
1990/1231
| |
if(c & 0x80){ /* key went up */
|
|
1991/1211
| |
if(ch == 0xF0){ /* control */
|
|
1990/1231
| |
shift &= ~2;
|
|
1991/0713
| |
goto norepeat;
|
|
1990/1223
| |
}
|
|
1991/1211
| |
if(ch == 0xF1){ /* shift */
|
|
1990/1231
| |
shift &= ~1;
|
|
1991/0713
| |
goto norepeat;
|
|
1990/1231
| |
}
|
|
1991/1211
| |
if(ch == 0xF2){ /* caps */
|
|
1991/0713
| |
goto norepeat;
|
|
1990/1231
| |
}
|
|
1991/0713
| |
goto norepeat;
|
|
1990/1223
| |
}
|
|
1991/1211
| |
if(ch == 0xF0){ /* control */
|
|
1990/1231
| |
shift |= 2;
|
|
1991/0713
| |
goto norepeat;
|
|
1990/1223
| |
}
|
|
1991/1211
| |
if(ch==0xF1){ /* shift */
|
|
1990/1231
| |
shift |= 1;
|
|
1991/0713
| |
goto norepeat;
|
|
1990/1231
| |
}
|
|
1991/1211
| |
if(ch==0xF2){ /* caps */
|
|
1990/1231
| |
caps ^= 1;
|
|
1991/0713
| |
goto norepeat;
|
|
1990/1231
| |
}
|
|
1991/1211
| |
if(caps && 'a'<=ch && ch<='z')
ch |= ' ';
repeatc = ch;
|
|
1991/0713
| |
kbdrepeat(1);
|
|
1991/1211
| |
if(ch == 0xB6) /* Compose */
lstate = 1;
|
|
1991/0112
| |
else{
|
|
1991/1211
| |
switch(lstate){
|
|
1991/0112
| |
case 1:
|
|
1991/1211
| |
kc[0] = ch;
lstate = 2;
if(ch == 'X')
lstate = 3;
|
|
1991/0112
| |
break;
case 2:
|
|
1991/1211
| |
kc[1] = ch;
c = latin1(kc);
nk = 2;
putit:
lstate = 0;
if(c != -1)
kbdputc(&kbdq, c);
else for(i=0; i<nk; i++)
kbdputc(&kbdq, kc[i]);
break;
case 3:
case 4:
case 5:
kc[lstate-2] = ch;
lstate++;
break;
case 6:
kc[4] = ch;
c = unicode(kc);
nk = 5;
goto putit;
|
|
1991/0112
| |
default:
|
|
1991/1211
| |
kbdputc(&kbdq, ch);
break;
|
|
1991/0112
| |
}
}
|
|
1992/0711
| |
return 0;
|
|
1991/0604
| |
}
void
buzz(int freq, int dur)
{
|
|
1992/0703
| |
USED(freq, dur);
|
|
1991/0604
| |
}
void
lights(int mask)
{
|
|
1992/0703
| |
USED(mask);
|
|
1991/0707
| |
}
int
screenbits(void)
{
return 1; /* bits per pixel */
}
void
getcolor(ulong p, ulong *pr, ulong *pg, ulong *pb)
{
|
|
1992/0813
| |
uchar r, g, b;
|
|
1991/0707
| |
ulong ans;
/*
|
|
1992/0815
| |
* The slc monochrome says 0 is white (max intensity).
|
|
1991/0707
| |
*/
|
|
1992/0815
| |
if(gscreen.ldepth == 0) {
|
|
1992/0813
| |
if(p == 0)
ans = ~0;
else
ans = 0;
*pr = *pg = *pb = ans;
} else {
|
|
1992/0904
| |
*(uchar *)&vid->addr = p & 0xFF;
r = vid->color;
g = vid->color;
b = vid->color;
|
|
1992/0813
| |
*pr = (r<<24) | (r<<16) | (r<<8) | r;
*pg = (g<<24) | (g<<16) | (g<<8) | g;
*pb = (b<<24) | (b<<16) | (b<<8) | b;
}
|
|
1991/0707
| |
}
int
setcolor(ulong p, ulong r, ulong g, ulong b)
{
|
|
1992/0815
| |
if(gscreen.ldepth == 0)
|
|
1992/0813
| |
return 0; /* can't change mono screen colormap */
|
|
1992/0815
| |
else{
|
|
1992/0904
| |
vid->addr = p & 0xFF;
vid->color = r >> 24;
vid->color = g >> 24;
vid->color = b >> 24;
|
|
1992/0813
| |
return 1;
}
|
|
1991/0707
| |
}
int
hwcursset(uchar *s, uchar *c, int ox, int oy)
{
|
|
1992/0711
| |
USED(s, c, ox, oy);
|
|
1991/0707
| |
return 0;
}
int
hwcursmove(int x, int y)
{
|
|
1992/0711
| |
USED(x, y);
|
|
1991/0707
| |
return 0;
}
|
|
1992/0813
| |
/* replicate (from top) value in v (n bits) until it fills a ulong */
static ulong
rep(ulong v, int n)
{
int o;
ulong rv;
rv = 0;
for(o = 32 - n; o >= 0; o -= n)
rv |= (v << o);
return rv;
|
|
1992/1020
| |
}
|
|
1992/1030
| |
/*
* set/change mouse configuration
*/
|
|
1992/1020
| |
void
|
|
1992/1030
| |
mousectl(char *arg)
|
|
1992/1020
| |
{
|
|
1992/1030
| |
USED(arg);
}
|