home *** CD-ROM | disk | FTP | other *** search
/ Graphics Plus / Graphics Plus.iso / msdos / compresn / dvpeg / src1b / svgamode.asm < prev    next >
Encoding:
Assembly Source File  |  1992-06-06  |  1.9 KB  |  103 lines

  1.  
  2.     include model.h
  3.  
  4. ;
  5. ;    VGAKIT Version 4.1
  6. ;
  7. ;    Copyright 1988,89,90,91 John Bridges
  8. ;    Free for use in commercial, shareware or freeware applications
  9. ;
  10. ;    SVGAMODE.ASM
  11. ;
  12. ;
  13. .data
  14.     extrn    cirrus:byte,everex:byte,paradise:byte,tseng:byte,trident:byte
  15.     extrn    t8900:byte,ativga:byte,aheada:byte,aheadb:byte
  16.     extrn    oaktech:byte,video7:byte,chipstech:byte,tseng4:byte,genoa:byte
  17.     extrn    ncr:byte,compaq:byte,vesa:byte
  18.     extrn    vga512:byte,vga1024:byte,hi_color:byte
  19.  
  20.     extrn    curbk:word
  21.  
  22.     public    maxx,maxy,xwidth
  23.  
  24. maxx    dw    ?        ;xwidth of screen in pixels
  25. maxy    dw    ?        ;height of screen in pixels
  26. xwidth    dw    ?        ;actual xwidth of screen in bytes
  27.  
  28. .code
  29.  
  30.     public    svgamode
  31.     public    txtmode
  32.     public    setmany
  33.  
  34. svgamode proc vid_mode:word, max_x:word        ;Set 640x480x256 on most SVGA cards
  35.     mov ax, [vid_mode]
  36.     cmp    [vesa],0            ; override for vesa since its special
  37.     jz    notvesa
  38.     mov    ax,4f02h
  39.     mov    bx,101h
  40.     jmp    setupmode
  41. notvesa:
  42.     cmp [video7], 0        ; special case for these cards
  43.     jz notvid7
  44.     mov bl,67h
  45.     jmp setupmode
  46. notvid7:
  47.     cmp    [tseng4], 0        ; test for tseng 4000
  48.     jz        try_everex
  49.     cmp    [hi_color], 0    ; test for hi color & tseng 4000
  50.     jz        try_everex
  51.     mov   bx, [vid_mode]
  52.     mov    ax, 10f0h
  53.     jmp    setupmode
  54. try_everex:
  55.     cmp [everex], 0        ; another special
  56.     jz setupmode
  57.     mov bl, 30h
  58.  
  59. setupmode:
  60.     int    10h
  61.  
  62.     mov    [curbk],-1
  63.     mov    ax,max_x
  64.     mov    [maxx],ax        ;default xwidth to whatever for now
  65.     cmp    [compaq],0
  66.     jz    nokludge
  67.     mov    ax,1024
  68. nokludge:
  69.     mov    [xwidth],ax
  70.     mov    ax,40h
  71.     mov    es,ax
  72.     mov    al,es:[84h]        ;get height of screen
  73.     inc    al
  74.     mul    byte ptr es:[85h]
  75.     mov    [maxy],ax
  76.  
  77. nots:    ret
  78. svgamode endp
  79.  
  80. txtmode    proc
  81.     mov    ax,3
  82.     int    10h
  83.     ret
  84. txtmode    endp
  85.  
  86. setmany proc    palbuf:ptr byte,begcol:word,numcol:word
  87. if @Datasize
  88.     les    dx,[palbuf]
  89. else
  90.     mov    ax,ds
  91.     mov    es,ax
  92.     mov    dx,[palbuf]
  93. endif
  94.     mov    bx,[begcol]
  95.     mov    cx,[numcol]
  96.     mov    ax,1012h
  97.     int    10h
  98.     ret
  99. setmany endp
  100.  
  101.     end
  102.  
  103.