plan 9 kernel history: overview | file list | diff list

1996/0216/pc/vgaark2000pv.c (diff list | history)

1996/0215/sys/src/9/pc/vgaark2000pv.c:39,501996/0216/sys/src/9/pc/vgaark2000pv.c:39,50 (short | long | prev | next)
1995/0516    
 
	/* 
	 * Disable the cursor then configure for X-Windows style, 
	 * 64x64 and 4/8-bit colour depth. 
1996/0216    
	 * 32x32 and 4/8-bit colour depth. 
1995/0516    
	 * Set cursor colours for 4/8-bit. 
	 */ 
	seq20 = vgaxi(Seqx, 0x20) & ~0x1F; 
	vgaxo(Seqx, 0x20, seq20); 
	seq20 |= 0x1C; 
1996/0216    
	seq20 |= 0x18; 
1995/0516    
 
	vgaxo(Seqx, 0x26, Pwhite); 
	vgaxo(Seqx, 0x27, Pwhite); 
1996/0215/sys/src/9/pc/vgaark2000pv.c:54,661996/0216/sys/src/9/pc/vgaark2000pv.c:54,66
1995/0516    
	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. 
1996/0216    
	 * Cursor storage is a 256 byte or 1Kb block located in the last 
	 * 16Kb of video memory. Crt25 is the index of which block. 
1995/0516    
	 */ 
	storage = (vgaxi(Seqx, 0x10)>>6) & 0x03; 
	storage = (1024*1024)<<storage; 
	storage -= 1024; 
	vgaxo(Seqx, 0x25, 0x3C); 
1996/0216    
	storage -= 256; 
	vgaxo(Seqx, 0x25, 0x3F); 
1995/0516    
 
	/* 
	 * Enable the cursor. 
1996/0215/sys/src/9/pc/vgaark2000pv.c:71,771996/0216/sys/src/9/pc/vgaark2000pv.c:71,77
1995/0516    
static void 
load(Cursor *c) 
{ 
	uchar *p, seq20; 
1996/0216    
	uchar *p; 
1995/0516    
	int x, y; 
 
	/* 
1996/0215/sys/src/9/pc/vgaark2000pv.c:81,971996/0216/sys/src/9/pc/vgaark2000pv.c:81,93
1995/0516    
	 * just make sure it's enabled. 
	 */ 
	lock(&ark2000pvlock); 
1995/0623    
	seq20 = vgaxi(Seqx, 0x20); 
1995/0516    
	if(memcmp(c, &curcursor, sizeof(Cursor)) == 0){ 
1995/0623    
		vgaxo(Seqx, 0x20, seq20|0x08); 
1996/0216    
		vgaxo(Seqx, 0x20, vgaxi(Seqx, 0x20)|0x08); 
1995/0516    
		unlock(&ark2000pvlock); 
		return; 
	} 
	memmove(&curcursor, c, sizeof(Cursor)); 
 
1995/0808    
#ifdef notdef 
1995/0623    
	vgaxo(Seqx, 0x20, seq20 & ~0x08); 
1995/0808    
#endif 
1995/0516    
	/* 
	 * Is linear addressing turned on? This will determine 
	 * how we access the cursor storage. 
1996/0215/sys/src/9/pc/vgaark2000pv.c:111,1221996/0216/sys/src/9/pc/vgaark2000pv.c:107,118
1995/0516    
	 *	 0   1	underlying pixel colour 
	 *	 1   0	background colour 
	 *	 1   1	foreground colour 
	 * Put the cursor into the top-left of the 64x64 array. 
1996/0216    
	 * Put the cursor into the top-left of the 32x32 array. 
1995/0516    
	 * The manual doesn't say what the data layout in memory is - 
	 * this worked out by trial and error. 
	 */ 
	for(y = 0; y < 64; y++){ 
		for(x = 0; x < 64/8; x++){ 
1996/0216    
	for(y = 0; y < 32; y++){ 
		for(x = 0; x < 32/8; x++){ 
1995/0516    
			if(x < 16/8 && y < 16){ 
				*p++ = c->clr[2*y + x]|c->set[2*y + x]; 
				*p++ = c->set[2*y + x]; 
1996/0215/sys/src/9/pc/vgaark2000pv.c:132,1401996/0216/sys/src/9/pc/vgaark2000pv.c:128,133
1995/0516    
	 * Set the cursor hotpoint and enable the cursor. 
	 */ 
	hotpoint = c->offset; 
1995/0808    
#ifdef notdef 
1995/0623    
	vgaxo(Seqx, 0x20, seq20|0x08); 
1995/0808    
#endif 
1995/0516    
 
	unlock(&ark2000pvlock); 
} 


source code copyright © 1990-2005 Lucent Technologies; see license
Plan 9 distribution
comments to russ cox (rsc@swtch.com)