From 61c1d90f4208ca72536a6ce19e485a1bc12099cd Mon Sep 17 00:00:00 2001 From: David du Colombier <0intro@gmail.com> Date: Sun, 12 Dec 1999 00:00:00 +0000 Subject: [PATCH] Plan 9 from Bell Labs 1999-12-12 --- pc/vgat2r4.c | 33 ++++++++++++++++++++++++++++++--- 1 file changed, 30 insertions(+), 3 deletions(-) diff --git a/pc/vgat2r4.c b/pc/vgat2r4.c index 9be7935f6e8800869cf5f9ed013f135b3d40af3b..38aa9ddbf198de2c9c557569649999acd7ebad44 100644 --- a/pc/vgat2r4.c +++ b/pc/vgat2r4.c @@ -385,10 +385,10 @@ waitforcmd(VGAscr *scr) x = 0; d = scr->mmio + RBaseD; - while((d[Flow]&1) && x++ < 1000000) + while((d[Flow]&0x1B) && x++ < 1000000) ; if(x >= 1000000) /* shouldn't happen */ - iprint("flow %8lux\n", d[Busy]); + iprint("flow %8lux\n", d[Flow]); } /* wait until memory controller not busy (i.e. wait for writes to flush) */ @@ -412,7 +412,31 @@ t2r4hwscroll(VGAscr *scr, Rectangle r, Rectangle sr) int ctl; Point dp, sp; ulong *d; + int depth; + if(r.min.y == sr.min.y){ /* a purely horizontal scroll */ + depth = scr->gscreen->depth; + switch(depth){ + case 32: + /* + * Using the SGI flat panels with the Ticket-to-Ride IV, horizontal + * 32-bit scrolls don't work perfectly on rectangles of width <= 24. + * we bail on a bigger bound for padding. + */ + if(Dx(r) < 32) + return 0; + break; + case 16: + /* + * Using the SGI flat panels with the Ticket-to-Ride IV, horizontal + * 16-bit scrolls don't work perfectly on rectangles of width <= 96. + * we bail on a bigger bound for padding. + */ + if(Dx(r) < 104) + return 0; + break; + } + } waitformem(scr); waitforfifo(scr); d = scr->mmio + RBaseD; @@ -426,7 +450,7 @@ t2r4hwscroll(VGAscr *scr, Rectangle r, Rectangle sr) sp.x = sr.max.x-1; } - if(r.min.y <= sr.min.y){ + if(r.min.y < sr.min.y){ dp.y = r.min.y; sp.y = sr.min.y; }else{ @@ -439,6 +463,8 @@ t2r4hwscroll(VGAscr *scr, Rectangle r, Rectangle sr) d[CmdRop] = 0xC; /* copy source */ d[CmdStyle] = 0; d[CmdPatrn] = 0; + d[Fore] = 0; + d[Back] = 0; /* writing XY1 executes cmd */ d[XY3] = ctl; @@ -465,6 +491,7 @@ t2r4hwfill(VGAscr *scr, Rectangle r, ulong sval) d[CmdStyle] = 1; /* use source from Fore register */ d[CmdPatrn] = 0; /* no stipple */ d[Fore] = sval; + d[Back] = sval; /* writing XY1 executes cmd */ d[XY3] = 0;