home *** CD-ROM | disk | FTP | other *** search
/ The Party 1994: Try This At Home / disk_image.bin / source / vexsrc / vga13x2.asm < prev    next >
Assembly Source File  |  1995-03-29  |  2KB  |  133 lines

  1. comment #
  2. /*****************************************************************************
  3.                                   ATTENTION!
  4.                            this source is VOTEWARE,
  5.               you may only use it to the conditions listed below:
  6.  
  7.   -You may modify it, or use parts of it in your own source as long as
  8.     this header stays on top of all files containing this source.
  9.   -You must give proper credit to the author, Niklas Beisert / pascal.
  10.   -You may not use it in commercial productions without the written
  11.     permission of the author.
  12.   -AND MOST IMPORTANT: you have to buy an Assembly '94 CD-ROM
  13.     by Sound Solutions (if you don't have it already) and vote for VEX-InTrO
  14.     in the PC-64k-Intro-Compo! (if you have already sent your voting card,
  15.     buy another one and fill it out CORRECTLY!!!)
  16. *****************************************************************************/
  17. #
  18.  
  19.  
  20.  
  21. ;// xmode routines...
  22.  
  23. .model large, c
  24. .386
  25. locals
  26.  
  27. .code
  28.  
  29. public vgaInit
  30. public vgaClose
  31. public vgaViewPage
  32. public vgaWaitRetrace
  33. public vgaFillScreen
  34.  
  35. vgaInit proc
  36.   mov dx,3c4h
  37.   mov al,4
  38.   out dx,al
  39.   inc dx
  40.   in al,dx
  41.   and al,0f7h
  42.   or al,4
  43.   out dx,al
  44.   mov dx,3d4h
  45.   mov al,14h
  46.   out dx,al
  47.   inc dx
  48.   in al,dx
  49.   and al,0bfh
  50.   out dx,al
  51.   dec dx
  52.   mov al,17h
  53.   out dx,al
  54.   inc dx
  55.   in al,dx
  56.   or al,40h
  57.   out dx,al
  58.  
  59.   ret
  60. endp
  61.  
  62. vgaClose proc
  63.   mov dx,3c4h
  64.   mov ax,0F02h
  65.   out dx,ax
  66.   mov al,4
  67.   out dx,al
  68.   inc dx
  69.   in al,dx
  70.   or al,08h
  71.   and al,not 04h
  72.   out dx,al
  73.   mov dx,3d4h
  74.   mov al,14h
  75.   out dx,al
  76.   inc dx
  77.   in al,dx
  78.   or al,40h
  79.   out dx,al
  80.   dec dx
  81.   mov al,17h
  82.   out dx,al
  83.   inc dx
  84.   in al,dx
  85.   and al,not 40h
  86.   out dx,al
  87.   ret
  88. endp
  89.  
  90. vgaViewPage proc p:word
  91.   mov al,0ch
  92.   mov ah,byte ptr p
  93.   shl ah,6
  94.   mov dx,3d4h
  95.   out dx,ax
  96.   ret
  97. endp
  98.  
  99. vgaWaitRetrace proc
  100.   mov dx,3dah
  101. @@l1:
  102.   in al,dx
  103.   and al,8
  104.   jnz @@l1
  105. @@l2:
  106.   in al,dx
  107.   and al,8
  108.   jz @@l2
  109.   ret
  110. endp
  111.  
  112. vgaFillScreen proc uses di, p:word, col:word
  113.   mov dx,3c4h
  114.   mov ax,0f02h
  115.   out dx,ax
  116.  
  117.   mov ax,0a000h
  118.   mov es,ax
  119.   mov al,byte ptr col
  120.   mov ah,al
  121.   mov bx,ax
  122.   shl eax,16
  123.   mov ax,bx
  124.   mov di,p
  125.   shl di,14
  126.   mov cx,1000h
  127.   rep stosd
  128.  
  129.   ret
  130. endp
  131.  
  132. end
  133.