~kris/9p

9hist

c861cdf62958e103a42b8e506c2031e35ea5af50 — David du Colombier 32 years ago aa1d61a
Plan 9 from Bell Labs 1993-12-30
4 files changed, 63 insertions(+), 12 deletions(-)

M carrera/mem.h
M carrera/screen.c
M pc/devvga.c
M pc/mem.h
M carrera/mem.h => carrera/mem.h +1 -0
@@ 160,6 160,7 @@
#define	KZERO	KSEG0			/* base of kernel address space */
#define	KTZERO	(KZERO+0x20000)		/* first address in kernel text */
#define	USTKSIZE	(4*1024*1024)	/* size of user stack */
#define globalmem(x)	(((ulong)x)&KZERO)	/* addresses valid in all contexts */
/*
 * Exception codes
 */

M carrera/screen.c => carrera/screen.c +36 -7
@@ 172,14 172,14 @@ screeninit(void)
{
	int i, x;

	gscreen.ldepth = 0;

	setmode(&dfltmode);

	gscreen.ldepth = 3;
	for(i = 0; i < 16; i++){
		x = x6to32((i*63)/15);
		setcolor(i, x, x, x);
	}
	gscreen.ldepth = 0;

	/* allocate a new soft bitmap area */
	gscreen.base = xalloc(1024*1024);


@@ 303,7 303,18 @@ screenputs(char *s, int n)
void
getcolor(ulong p, ulong *pr, ulong *pg, ulong *pb)
{
	p &= (1<<(1<<gscreen.ldepth))-1;
	ulong x;

	switch(gscreen.ldepth){
	default:
		x = 0xf;
		break;
	case 3:
		x = 0xff;
		break;
	}
	p &= x;
	p ^= x;
	*pr = colormap[p][0];
	*pg = colormap[p][1];
	*pb = colormap[p][2];


@@ 312,7 323,18 @@ getcolor(ulong p, ulong *pr, ulong *pg, ulong *pb)
int
setcolor(ulong p, ulong r, ulong g, ulong b)
{
	p &= (1<<(1<<gscreen.ldepth))-1;
	ulong x;

	switch(gscreen.ldepth){
	default:
		x = 0xf;
		break;
	case 3:
		x = 0xff;
		break;
	}
	p &= x;
	p ^= x;
	colormap[p][0] = r;
	colormap[p][1] = g;
	colormap[p][2] = b;


@@ 442,7 464,14 @@ setmode(VGAmode *v)
	for(i = 0; i < sizeof(v->attribute); i++)
		arout(i, v->attribute[i]);

	EISAOUTB(0x3C6, 0x0F);	/* pel mask */
	switch(gscreen.ldepth){
	case 3:
		EISAOUTB(0x3C6, 0xFF);	/* pel mask */
		break;
	default:
		EISAOUTB(0x3C6, 0x0F);	/* pel mask */
		break;
	}
	EISAOUTB(0x3C8, 0x00);	/* pel write address */

	EISAOUTB(0x3bf, 0x03);	/* hercules compatibility reg */


@@ 522,8 551,8 @@ screenupdate(void)
		for(i = 0; i < len; i += 8) {
			s = (ulong*)(sp+i);
			h = (ulong*)(hp+i);
			in1 = ~s[0];
			in2 = ~s[1];
			in1 = s[0];
			in2 = s[1];
			h[0] = swiz(in2);
			h[1] = swiz(in1);
		}

M pc/devvga.c => pc/devvga.c +25 -5
@@ 471,12 471,10 @@ setscreen(int maxx, int maxy, int ldepth)
	case 2:
	case 1:
	case 0:
		gscreen.ldepth = 3;
		for(i = 0; i < 16; i++){
			x = x6to32((i*63)/15);
			setcolor(i, x, x, x);
		}
		gscreen.ldepth = ldepth;
		break;
	}
	cga = 0;


@@ 608,7 606,7 @@ screenupdate(void)
	switch(gscreen.ldepth){
	case 0:
		r.min.x &= ~15;		/* 16 pixel alignment for l0update() */
		f = l0update;
		f = memmove;
		len = (r.max.x + 7)/8 - r.min.x/8;
		if(len & 1)
			len++;		/* 16 bit alignment for l0update() */


@@ 1071,7 1069,18 @@ screenbits(void)
void
getcolor(ulong p, ulong *pr, ulong *pg, ulong *pb)
{
	p &= (1<<(1<<gscreen.ldepth))-1;
	ulong x;

	switch(gscreen.ldepth){
	default:
		x = 0xf;
		break;
	case 3:
		x = 0xff;
		break;
	}
	p &= x;
	p ^= x;
	lock(&screenlock);
	*pr = colormap[p][0];
	*pg = colormap[p][1];


@@ 1082,7 1091,18 @@ getcolor(ulong p, ulong *pr, ulong *pg, ulong *pb)
int
setcolor(ulong p, ulong r, ulong g, ulong b)
{
	p &= (1<<(1<<gscreen.ldepth))-1;
	ulong x;

	switch(gscreen.ldepth){
	default:
		x = 0xf;
		break;
	case 3:
		x = 0xff;
		break;
	}
	p &= x;
	p ^= x;
	lock(&screenlock);
	colormap[p][0] = r;
	colormap[p][1] = g;

M pc/mem.h => pc/mem.h +1 -0
@@ 49,6 49,7 @@
#define KSTACK		4096			/* Size of kernel stack */
#define ROMBIOS		(KZERO|0xF0000)
#define	ISAMEMSIZE	(4*MB)			/* mem space reserved for ISA */
#define globalmem(x)	(((ulong)x)&KZERO)	/* addresses valid in all contexts */

#define	MACHSIZE	4096