home *** CD-ROM | disk | FTP | other *** search
/ Shareware Compilation 6 / SharewareCD_06.zip / pcspace / vesah.asm < prev    next >
Assembly Source File  |  1993-10-05  |  3KB  |  126 lines

  1. ;init V2.0 / bank V2.0 routines for VESA 256 colors
  2. ;(c) 1993 Christian Wagner (wagner@informatik.tu-muenchen.de)
  3. ; and Peter Liebel
  4. ;for Pcspace from Peter Liebel
  5.  
  6. ;Pcspace-screen driver VESA- 256colors
  7. ;
  8. ;To create a vesah.drv:
  9. ; tasm vesah
  10. ; tlink vesah
  11. ; exe2bin vesah
  12. ; ren vesah.bin vesah.drv
  13. ;
  14. ; Attention: Maximum length of the drv file: 256 Bytes
  15.  
  16. prog  segment dword 'code'
  17.  assume cs:prog
  18.  
  19. start  proc  far
  20.        ; Initialize entry point for video mode
  21.        jmp short init
  22.  
  23.        ; Set the entry point 64k bank and set the segment address to es
  24.        ; The bank number has been set in al.
  25.        jmp short bank
  26.  
  27.      ;parameter for the driver
  28.        db 255 ;number of colors-1
  29.        ;Table of parameters for initialization
  30.        db 01h ;Mode 0: resolution 640*480
  31.        db 03h ;Mode 1: resolution 800*600
  32.        db 05h ;Mode 2: resolution 1024*768
  33.        db -1  ;Mode 3: resolution 1280*960 (no such resolution)
  34.        db -1  ;Mode 4: resolution 1280*1024 (no such resolution)
  35.  
  36.        db "VESA 256colors" ;Identification text for SETUP
  37.        db 0                ;length can be adjustable
  38.  
  39.      ;Initialize video mode
  40.      ;Used registers: ax,bx
  41.      ;al has been set to the value of the parameter table
  42.      ;No such resolution (Par.-1) has been captured already.
  43.  init:  push    bx              ;offsetadress of the driver
  44.         mov     bl,al           ;value of the parameter table
  45.         mov     bh,1
  46.         mov     ax,4f02h
  47.         int     10h
  48.  
  49.         xor     bx,bx
  50.         mov     dx,1
  51.         mov     ax,4f05h
  52.         int     10h
  53.  
  54.         mov     ax,0a000h
  55.         mov     es,ax
  56.         mov     es:0,ah
  57.         push    ax
  58.  
  59.         xor     bx,bx
  60.         xor     dx,dx
  61.         mov     ax,4f05h
  62.         push    ax
  63.         int     10h
  64.         xor     dx,dx
  65.         mov     bx,1
  66.         pop     ax
  67.         int     10h
  68.  
  69.         pop     ax
  70.         mov     bx,100h
  71.         mov     cl,8
  72.    grlp:shl     bx,1
  73.         dec     cl
  74.         jz      grout
  75.         cmp     es:bx,ah
  76.         jne     grlp
  77.  
  78.   grout:pop     bx
  79.         add     bx,1+offset mark
  80.         mov     cs:bx,cl
  81.  
  82.         xor     bx,bx
  83.         mov     dx,1
  84.         mov     ax,4f05h
  85.         int     10h
  86.  
  87.         xor     al,al
  88.         mov     es:0,al
  89.         retf
  90.  
  91.  
  92.      ;set video bank
  93.      ;Used registers: ax,dx,es
  94.  bank:
  95.         push    bx
  96.         push    cx
  97.  
  98.         xor     dx,dx
  99.         mov     dl,al
  100.  
  101.    mark:mov     cl,0
  102.         shl     dx,cl
  103.         push    dx              ;save bank no.
  104.  
  105.         xor     bx,bx           ;set frame no.0
  106.         mov     ax,4f05h        ;VESA frame function
  107.         int     10h
  108.  
  109.         pop     dx              ;restore bank
  110.         mov     bx,01           ;set frame no.1
  111.         mov     ax,4f05h        ;VESA frame function
  112.         int     10h
  113.  
  114.         mov     dx,0a000h       ;segmentadr. video memory
  115.         mov     es,dx
  116.  
  117.         pop     cx
  118.         pop     bx
  119.         retf
  120.  
  121.  
  122. start  endp
  123.  
  124. prog  ends
  125.  
  126.  end  start