From b1913c0415eac25f689bc927096c754744c2a517 Mon Sep 17 00:00:00 2001 From: David du Colombier <0intro@gmail.com> Date: Sat, 21 May 1994 00:00:00 +0000 Subject: [PATCH] Plan 9 from Bell Labs 1994-05-21 --- carrera/screen.c | 19 ------------------- pc/devvga.c | 12 +++++------- pc/fault386.c | 7 +++++-- pc/main.c | 2 +- port/devmouse.c | 23 +++++++++++------------ 5 files changed, 22 insertions(+), 41 deletions(-) diff --git a/carrera/screen.c b/carrera/screen.c index 9f1f11d8dfa8de6f5305af7b79a398418a0a80a8..7dd2b5238b36c296c052fdc7e06e3c437fca477c 100644 --- a/carrera/screen.c +++ b/carrera/screen.c @@ -76,26 +76,9 @@ Bitmap bgrnd = 0 }; -Cursor fatarrow = { - { -1, -1 }, - { - 0xff, 0xff, 0x80, 0x01, 0x80, 0x02, 0x80, 0x0c, - 0x80, 0x10, 0x80, 0x10, 0x80, 0x08, 0x80, 0x04, - 0x80, 0x02, 0x80, 0x01, 0x80, 0x02, 0x8c, 0x04, - 0x92, 0x08, 0x91, 0x10, 0xa0, 0xa0, 0xc0, 0x40, - }, - { - 0x00, 0x00, 0x7f, 0xfe, 0x7f, 0xfc, 0x7f, 0xf0, - 0x7f, 0xe0, 0x7f, 0xe0, 0x7f, 0xf0, 0x7f, 0xf8, - 0x7f, 0xfc, 0x7f, 0xfe, 0x7f, 0xfc, 0x73, 0xf8, - 0x61, 0xf0, 0x60, 0xe0, 0x40, 0x40, 0x00, 0x00, - }, -}; - static Rectangle window; static Point curpos; static int h, w; -extern Cursor arrow; void screenwin(void) @@ -221,8 +204,6 @@ screeninit(void) dacinit(); - memmove(&arrow, &fatarrow, sizeof(fatarrow)); - bitblt(&gscreen, Pt(0, 0), &gscreen, gscreen.r, 0); out.pos.x = MINX; out.pos.y = 0; diff --git a/pc/devvga.c b/pc/devvga.c index 03ccde15adfc869869831c54ac8984e91835cb5e..6a5fa5f876510c82a1afc7e27c86dd82313beb93 100644 --- a/pc/devvga.c +++ b/pc/devvga.c @@ -1268,7 +1268,9 @@ setcolor(ulong p, ulong r, ulong g, ulong b) /* * area to store the bits that are behind the cursor */ -ulong backbits[16*4]; +static ulong backbits[16*4]; +static ulong clrbits[16]; +static ulong setbits[16]; /* * the white border around the cursor @@ -1278,7 +1280,7 @@ Bitmap clr = {0, 0, 16, 16}, {0, 0, 16, 16}, 0, - 0, + clrbits, 0, 1, }; @@ -1291,7 +1293,7 @@ Bitmap set = {0, 0, 16, 16}, {0, 0, 16, 16}, 0, - 0, + setbits, 0, 1, }; @@ -1307,10 +1309,6 @@ cursorinit(void) cursor.l = cursorwork.width*BY2WD; if(!already){ - set.base = malloc(16*sizeof(ulong)); - clr.base = malloc(16*sizeof(ulong)); - if(set.base == 0 || clr.base == 0) - panic("cursorinit"); cursor.disable--; already = 1; } diff --git a/pc/fault386.c b/pc/fault386.c index 1bb9beb52fcf7e7a242a80daa8f78bf68a82f89b..7580082537bd3f8d2e82bcc656484521b6eaa139 100644 --- a/pc/fault386.c +++ b/pc/fault386.c @@ -18,13 +18,17 @@ fault386(Ureg *ur, void *arg) USED(arg); + if(up == 0){ + dumpregs(ur); + for(;;); + } + insyscall = up->insyscall; up->insyscall = 1; addr = getcr2(); read = !(ur->ecode & 2); user = (ur->cs&0xffff) == UESEL; spllo(); -/*print("F%d:A#%lux:U%d:R%d|", up->pid, addr, user, read);/**/ n = fault(addr, read); if(n < 0){ if(user){ @@ -33,7 +37,6 @@ fault386(Ureg *ur, void *arg) postnote(up, 1, buf, NDebug); return; } -print("fault: 0x%lux", addr); dumpregs(ur); panic("fault: 0x%lux", addr); } diff --git a/pc/main.c b/pc/main.c index 7139b0e49545096d749c12cda7d6b7730da692ba..dddc11e8cc313ae6b2ec2005349ef64cf5837cc9 100644 --- a/pc/main.c +++ b/pc/main.c @@ -67,7 +67,7 @@ main(void) /* * This tries to capture architecture dependencies since things - * like power management/reseting/mouse are outside the hardware + * like power management/resetting/mouse are outside the hardware * model. */ void diff --git a/port/devmouse.c b/port/devmouse.c index a0a35f33c891229a9bd2f22ca0186cec1564e28f..d1fa22d50484d7cd6321a7b48f2819ba7053094d 100644 --- a/port/devmouse.c +++ b/port/devmouse.c @@ -36,19 +36,18 @@ int mousetype; int mouseswap; Cursor curs; -Cursor arrow = -{ - {-1, -1}, - {0xFF, 0xE0, 0xFF, 0xE0, 0xFF, 0xC0, 0xFF, 0x00, - 0xFF, 0x00, 0xFF, 0x80, 0xFF, 0xC0, 0xFF, 0xE0, - 0xE7, 0xF0, 0xE3, 0xF8, 0xC1, 0xFC, 0x00, 0xFE, - 0x00, 0x7F, 0x00, 0x3E, 0x00, 0x1C, 0x00, 0x08, +Cursor arrow = { + { -1, -1 }, + { 0xFF, 0xFF, 0x80, 0x01, 0x80, 0x02, 0x80, 0x0C, + 0x80, 0x10, 0x80, 0x10, 0x80, 0x08, 0x80, 0x04, + 0x80, 0x02, 0x80, 0x01, 0x80, 0x02, 0x8C, 0x04, + 0x92, 0x08, 0x91, 0x10, 0xA0, 0xA0, 0xC0, 0x40, + }, + { 0x00, 0x00, 0x7F, 0xFE, 0x7F, 0xFC, 0x7F, 0xF0, + 0x7F, 0xE0, 0x7F, 0xE0, 0x7F, 0xF0, 0x7F, 0xF8, + 0x7F, 0xFC, 0x7F, 0xFE, 0x7F, 0xFC, 0x73, 0xF8, + 0x61, 0xF0, 0x60, 0xE0, 0x40, 0x40, 0x00, 0x00, }, - {0x00, 0x00, 0x7F, 0xC0, 0x7F, 0x00, 0x7C, 0x00, - 0x7E, 0x00, 0x7F, 0x00, 0x6F, 0x80, 0x67, 0xC0, - 0x43, 0xE0, 0x41, 0xF0, 0x00, 0xF8, 0x00, 0x7C, - 0x00, 0x3E, 0x00, 0x1C, 0x00, 0x08, 0x00, 0x00, - } }; void Cursortocursor(Cursor*);