home *** CD-ROM | disk | FTP | other *** search
/ The C Users' Group Library 1994 August / wc-cdrom-cusersgrouplibrary-1994-08.iso / listings / v_08_10 / 8n10103d < prev    next >
Text File  |  1990-08-20  |  1KB  |  25 lines

  1.  
  2.  
  3.        ch = (unsigned char)((y * colx + x) >> 15); /* find current page */
  4.        if (ch != old_page)                /* only change page if different */
  5.          {
  6.            dx = ati_extreg;       /* location of ATI card external register */
  7.            asm("     cli     ");          /* disable interrupts */
  8.            asm("     mov     al,0b2h");   /* page select */
  9.         asm(dx,"     out     dx,al");     /* ATI extended register */
  10.            asm("     inc     dl");
  11.            asm("     in      al,dx");
  12.            asm("     mov     ah,al");
  13.            asm("     and     ah,0e1h");   /* page mask */
  14.         asm(ch,"     or      ah,ch");     /* ch = memory page desired */
  15.            asm("     mov     al,0b2h");   /* page select */
  16.            asm("     dec     dl");
  17.            asm("     out     dx,ax");
  18.            asm("     sti     ");          /* enable interrupts */
  19.            old_page = ch;
  20.          }
  21.        addr = 655360 + ((y * colx + x) % 65536);
  22.        poke(addr, color);          /* write direct to real video memory */
  23.  
  24.  
  25.