From c3eb994b1c642a341b7ba3b0ab4eba5905568ea1 Mon Sep 17 00:00:00 2001 From: David du Colombier <0intro@gmail.com> Date: Tue, 10 Nov 1992 00:00:00 +0000 Subject: [PATCH] Plan 9 from Bell Labs 1992-11-10 --- pc/fns.h | 1 + pc/l.s | 8 ++++---- pc/main.c | 1 + pc/vga.c | 32 +++++++++++++++++++++----------- pc/vga.h | 3 +++ 5 files changed, 30 insertions(+), 15 deletions(-) diff --git a/pc/fns.h b/pc/fns.h index 2f53c8efda62be0cd98d8198355818e5b7f0dbe0..bf39bd5c080259b3a627bf637eb2b2d78e7a3744 100644 --- a/pc/fns.h +++ b/pc/fns.h @@ -35,6 +35,7 @@ void insl(int, void*, int); ulong isamem(int); void kbdinit(void); void l0update(uchar*, uchar*, int); +void l1update(uchar*, uchar*, int); void mathinit(void); void mmuinit(void); int modem(int); diff --git a/pc/l.s b/pc/l.s index 1c9d408f7302707a22d36806470364b60e35033b..36d45c57bfe0c23d29bc1030014bb31851481f11 100644 --- a/pc/l.s +++ b/pc/l.s @@ -642,12 +642,12 @@ TEXT config(SB),$0 TEXT l0update(SB),$0 XORL AX,AX MOVL len+8(FP),CX - MOVL from+0(FP),BX - MOVL to+4(FP),DX + MOVL from+0(FP),SI + MOVL to+4(FP),DI l00: - MOVB -1(BX)(CX*1),AL + MOVB -2(SI)(CX*2),AL MOVB bitrevtab(SB)(AX*1),AL - MOVB AL,-1(DX)(CX*1) + MOVB AL,-1(DI)(CX*1) LOOP l00 RET diff --git a/pc/main.c b/pc/main.c index 0778805878e9985d7a3c7e00e8212534396da0b9..86cecf94b014eb475772cc6a675d0ecb39a0341d 100644 --- a/pc/main.c +++ b/pc/main.c @@ -271,6 +271,7 @@ confinit(void) conf.npage1 = (i*MB - conf.base1)/BY2PG; conf.npage = conf.npage0 + conf.npage1; + conf.ldepth = 1; pcnt = screenbits()-1; /* Calculate % of memory for page pool */ pcnt = 70 - (pcnt*10); conf.upages = (conf.npage*pcnt)/100; diff --git a/pc/vga.c b/pc/vga.c index 4d0993db091fe3524b25ac0948acc130778c0f5a..9d9e1b16dc57c868b5ec4e41a0cb008f8e17806f 100644 --- a/pc/vga.c +++ b/pc/vga.c @@ -241,7 +241,7 @@ setscreen(int maxx, int maxy, int ldepth) else vgascreen.ldepth = 0; vgascreen.base = (void*)SCREENMEM; - vgascreen.width = (maxx*(1<>(3-vgascreen.ldepth); + hp = (uchar*)(vgascreen.base+(r.min.y*vgascreen.width)) + off; + off <<= gscreen.ldepth - vgascreen.ldepth; + sp = (uchar*)(gscreen.base+(r.min.y*gscreen.width)) + off; + len = (r.max.x*bits + 7)/8 - (r.min.x*bits)/8; if(len <= 0) return; @@ -446,7 +457,6 @@ screenputs(char *s, int n) } } rs.max = Pt(gscreen.r.max.x, out.pos.y+defont0.height); - unlock(&screenlock); mbbrect(rs); screenupdate(); } @@ -454,7 +464,7 @@ screenputs(char *s, int n) int screenbits(void) { - return 1; /* bits per pixel */ + return 1<