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

1992/1109/pc/vga.c (diff list | history)

1992/1108/sys/src/9/pc/vga.c:233,2421992/1109/sys/src/9/pc/vga.c:233,245 (short | long | prev | next)
1992/1106    
	mbb = NULLMBB; 
 
	/* 
	 *  zero hard screen 
1992/1109    
	 *  zero hard screen and setup a bitmap for the new size 
1992/1106    
	 */ 
	memset((void*)SCREENMEM, 0xff, 64*1024); 
	vgascreen.ldepth = 0; 
1992/1109    
	if(ldepth == 3) 
		vgascreen.ldepth = 3; 
	else 
		vgascreen.ldepth = 0; 
1992/1106    
	vgascreen.base = (void*)SCREENMEM; 
	vgascreen.width = (maxx*(1<<ldepth))/32; 
	vgascreen.r.max = Pt(maxx, maxy); 
1992/1108/sys/src/9/pc/vga.c:243,2491992/1109/sys/src/9/pc/vga.c:246,252
1992/1106    
	vgascreen.clipr.max = vgascreen.r.max; 
 
	/* 
	 *  setup new soft screen 
1992/1109    
	 *  setup new soft screen, free memory for old screen 
1992/1106    
	 */ 
	gscreen.ldepth = ldepth; 
	gscreen.width = (maxx*(1<<ldepth))/32; 
1992/1108/sys/src/9/pc/vga.c:250,2561992/1109/sys/src/9/pc/vga.c:253,263
1992/0603    
	gscreen.r.max = Pt(maxx, maxy); 
1992/0604    
	gscreen.clipr.max = gscreen.r.max; 
1992/1106    
	len = gscreen.width * 4 * maxy; 
1992/1107    
	gscreen.base = ((ulong*)malloc(len+2*1024))+256; 
1992/1109    
	if(gscreen.base){ 
		free(gscreen.base); 
		gscreen.base = ((ulong*)smalloc(len+2*1024))+256; 
	} else 
		gscreen.base = ((ulong*)malloc(len+2*1024))+256; 
1992/1107    
	memset((char*)gscreen.base, 0xff, len); 
1992/1106    
 
	/* 
1992/1108/sys/src/9/pc/vga.c:334,3401992/1109/sys/src/9/pc/vga.c:341,347
1992/1108    
screenupdate(void) 
{ 
	uchar *sp, *hp; 
	int y, len, incs, inch; 
1992/1109    
	int y, len, incs, inch, bits; 
1992/1108    
	Rectangle r; 
 
	r = mbb; 
1992/1108/sys/src/9/pc/vga.c:352,3601992/1109/sys/src/9/pc/vga.c:359,368
1992/1108    
	if(r.max.y > gscreen.r.max.y) 
		r.max.y = gscreen.r.max.y; 
 
1992/1109    
	bits = 1<<vgascreen.ldepth; 
1992/1108    
	sp = (uchar*)gaddr(&gscreen, r.min); 
	hp = (uchar*)gaddr(&vgascreen, r.min); 
	len = (r.max.x + 31)/32 - r.min.x/32; 
1992/1109    
	len = (r.max.x*bits + 31)/32 - (r.min.x*bits)/32; 
1992/1108    
	len *= BY2WD; 
	if(len <= 0) 
		return; 
1992/1108/sys/src/9/pc/vga.c:364,3691992/1109/sys/src/9/pc/vga.c:372,379
1992/1108    
 
	switch(gscreen.ldepth){ 
	case 0: 
1992/1109    
	case 3: 
		/* reverse the bits */ 
1992/1108    
		for (y = r.min.y; y < r.max.y; y++){ 
			l0update(sp, hp, len); 
			sp += incs; 
1992/1108/sys/src/9/pc/vga.c:371,3761992/1109/sys/src/9/pc/vga.c:381,387
1992/1108    
		} 
		break; 
	case 1: 
1992/1109    
		/* reverse the bits and split into 2 bitmaps */ 
1992/1108    
		for (y = r.min.y; y < r.max.y; y++){ 
			l1update(sp, hp, len); 
			sp += incs; 


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