home *** CD-ROM | disk | FTP | other *** search
/ Current Shareware 1994 January / SHAR194.ISO / viewers / qpeg10c.zip / DELLS3.ASM < prev    next >
Assembly Source File  |  1993-10-25  |  2KB  |  82 lines

  1. ;
  2. ; QPEG video driver
  3. ; for S3 86c805 chipsets (DELL Local Bus)
  4. ; Tested on DELL 433/T. Other S3 cards may require additional code in init.
  5. ;
  6. ; Lenny Lim, 1993
  7. ;
  8.  
  9.         .286
  10. Code    Segment Para 'Code'
  11.         Assume  cs:Code
  12.         Org 100h
  13.  
  14. Procs   dw      Bank,Init,Exit,0
  15.  
  16. plan16  db      0               ; stores 1 for planar 16 color mode
  17.  
  18. Bank:   cmp     plan16,2
  19.         jne     svga
  20.         retf
  21. svga:
  22.         mov     dx, 3d4h        ; Enable extended registers
  23.         push    ax
  24.         mov     al, 38h
  25.         out     dx, al
  26.         inc     dx
  27.         mov     al, 48h
  28.         out     dx, al
  29.  
  30.         dec     dx              ; Enable write to bank registers
  31.         mov     al, 31h
  32.         out     dx, al
  33.         inc     dx
  34.         mov     al, 89h
  35.         in      al, dx
  36.         push    ax
  37.         dec     dx
  38.         mov     al, 31h
  39.         out     dx, al
  40.         inc     dx
  41.         pop     ax
  42.         or      al, 9
  43.         out     dx, al
  44.  
  45.         dec     dx              ; Switch banks
  46.         mov     al, 35h
  47.         out     dx, al
  48.         inc     dx
  49.         pop     ax
  50.         cmp     cs:plan16, 1
  51.         jne     col256
  52.         shl     al, 2
  53. col256:
  54.         out     dx, al
  55.  
  56.         dec     dx              ; Disable extended registers
  57.         mov     al, 38h
  58.         out     dx, al
  59.         inc     dx
  60.         mov     al, 0
  61.         out     dx, al
  62.  
  63.         retf
  64.  
  65. Init:   cmp     al, 13h
  66.         jg      svgainit
  67.         mov     cs:plan16, 2
  68.         retf
  69.  
  70. svgainit:
  71.         and     al, 1
  72.         xor     al, 1
  73.         mov     cs:plan16, al
  74.         retf
  75.  
  76. Exit:   retf
  77.  
  78. Code    Ends
  79.         End Procs
  80.  
  81. ; End of source.
  82.