9fans archive / 2000 / 07 / 93 /    prev next

From: "Bruce G. Stewart" <bruce.g.stewart@wor...>
Subject: Re: [9fans] Fixing the Older Millennium-1 Cursor
Date: Thu, 6 Jul 2000 08:48:46 GMT

Here's a more comprehensive fix for the Millennium I Cursor problem.

Instead of adding the line I showed in a previous message,
insert lines 408 through 428 from the following near the
end of the init function in /sys/src/cmd/aux/vga/mga2164w.c:

   405          mga->tvp[0x3A] = 0;
   406          mga->tvp[0x06] = 0;
   407
   408          {
   409                  // bgs 05-Jul-00 - Fix vertical blanking setup
   410                  // This should probably be corrected in vga.c too.
   411
   412                  int svb = mode->y;              // Start vertical blanking
after the last displayed line
   413                  int evb = mode->vt;             // End vertical blanking
after the total line count
   414
   415                  if(mode->interlace == 'v'){     // A field is 1/2 of the
lines in interlaced mode
   416                          svb /= 2;
   417                          evb /= 2;
   418                  }
   419                  --svb;
   420                  --evb;                          // line counter counts from
0
   421
   422                  vga->crt[0x15]     = svb;
   423                  vga->crt[0x07]     = (vga->crt[0x07]     & ~0x08) | ((svb &
0x100) >> 5);
   424                  vga->crt[0x09]     = (vga->crt[0x09]     & ~0x20) | ((svb &
0x200) >> 4);
   425                  mga->crtcext[0x02] = (mga->crtcext[0x02] & ~0x18) | ((svb &
0xC00) >> 7);
   426                                                  // MGA specific: bits 10 and
11
   427                  vga->crt[0x16]     = evb;
   428          }
   429
   430          clockcalc(vga, ctlr, mode->z);
   431
   432
   433          mga->option = mga->option & ~0x3000;
   434          if(vga->vmz > 2*Meg)
   435                  mga->option |= 0x1000;

Then build and reboot:

cd /sys/src/cmd/aux/vga
disk/kfscmd allow
mk install
disk/kfscmd halt
Ctrl-Alt-Delete

This fixes problems with both the start and end of the vertical blanking interval,
and should work for interlaced and non-interlaced modes alike.



"Bruce G. Stewart" wrote:

> I missed the first part of this thread, so I don't know if the problem it
> refers to has been solved. Here's the fix I put in for the cursor on a
> Millennium I card (this particular card was V2.3.)
>
> The change adjusts the end-vertical-blanking parameter to be 2 less than the
> number of lines, visible and not, per scan. It has NOT been tested with
> interlaced
> modes; in fact, it has not been tested with anything other than -m p815
> 1600x1200x8.
>
> You will want to save the file /386/bin/aux/vga somewhere in case you need to go
> back.
>
> Add the line numbered 357 here to the function init() in file
> /sys/src/cmd/aux/vga/mga2164w.c:
>
> 353
> 354          offset = (mode->x*mode->z) >> ((pixbuswidth==32)? 6 : 7);
> 355          vga->crt[0x13] = offset;
> 356          vga->crt[0x14] = 0;
> 357          vga->crt[0x16] = mode->vt - 2; // bgs 30-Jun-00
> 358          vga->crt[0x17] = 0xE3;
> 359
>
> Stephen Wynne wrote:
>
> > RAMDAC docs: http://www.ti.com/sc/docs/products/analog/tvp3025.html
> > Where to get started: /src/9/pc/vgamga2164w.c
> > What v3 does support: http://www.ti.com/sc/docs/products/analog/tvp3026.html