home *** CD-ROM | disk | FTP | other *** search
/ Top Ten Mega Games 2 / TOP_TEN_Mega_Games_2.iso / SW / QPEG / DRVSRC / AHEAD.ASM next >
Assembly Source File  |  1994-07-01  |  1KB  |  65 lines

  1. ;
  2. ; QPEG video driver
  3. ; for VGA graphics cards based on Ahead chipsets.
  4. ; Should work with both Ahead A and B versions.
  5. ;
  6.  
  7.         .286
  8. Code    Segment Para 'Code'
  9.         Assume  cs:Code
  10.         Org 100h
  11.  
  12. Procs   dw      Bank,Init,Exit,0
  13.  
  14. AorB    db      1       ; 0=A, 1=B
  15.  
  16. Bank:   push    ax
  17.         mov     dx,03ceh
  18.         mov     ax,200fh
  19.         out     dx,ax
  20.         pop     ax
  21.         push    ax
  22.         test    cs:AorB,0fh
  23.         jz      AheadA
  24.  
  25. AheadB: mov     ah,al
  26.         shl     ah,4
  27.         or      ah,al
  28.         mov     al,0dh
  29.         out     dx,ax
  30.         pop     ax
  31.         retf
  32.  
  33. AheadA: push    bx
  34.         mov     bl,al
  35.         shl     ax,7
  36.         mov     al,0dh
  37.         out     dx,ax
  38.         mov     dl,0cch
  39.         in      al,dx
  40.         mov     dl,0c2h
  41.         and     al,11011111b
  42.         and     bl,01h
  43.         shl     bl,5
  44.         or      al,bl
  45.         out     dx,al
  46.         pop     bx
  47.         pop     ax
  48.         retf
  49.  
  50. Init:   mov     dx,03ceh
  51.         mov     ax,200fh
  52.         out     dx,ax
  53.         inc     dx
  54.         in      al,dx
  55.         and     al,0fh
  56.         mov     cs:AorB,al
  57.         retf
  58.  
  59. Exit:   retf
  60.  
  61. Code    Ends
  62.         End Procs
  63.  
  64. ; End of source.
  65.