home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / caway349.zip / MISC / LINEAR.ZIP / PAGING.DOC < prev    next >
Text File  |  1995-10-27  |  2KB  |  55 lines

  1. Here is some code for creating a linear video buffer for svga cards.
  2. The supplied files are :
  3.  
  4.   Paging.doc  : This file
  5.   Paging.c    : C code.
  6.   Paging.h    : function prototypes.
  7.   Excepts.asm : stack calling convention of code.
  8.   Exceptr.asm : register calling convention of code.
  9.   Test.c      : Sample code.
  10.  
  11. The asm files uses WASM assembler.I don't know if it can be assembled by MASM
  12. or TASM
  13.  
  14. For building the sample code, just type :
  15.  
  16.   wcl386 /l=causeway /4r /Otexan test paging execptr.asm kbhitr.obj
  17. or
  18.   wcl386 /l=causeway /4s /Otexan test paging execpts.asm kbhits.obj
  19.  
  20.   (use the kbhit() patch)
  21.  
  22.  
  23. The assembly files have three functions for configuring the video card :
  24.  
  25.   VideoPrologue
  26.   VideoEpilogue
  27.   VideoBankSwitch
  28.  
  29. The VideoPrologue is called once when the buffer is created. It recommended
  30. to allocate the buffer after graphic mode have been set.
  31. The VideoEpilogue is called once when the buffer is destroyed.
  32.  
  33. The given code use the VESA bank switch system for 64 Kb granularity.
  34. For other values, EAX reg (the bank number) can be modified on entry :
  35.  
  36.  
  37.     Granularity                 Eax
  38.  
  39.        64k                       -
  40.        32k                      shl eax,1
  41.        16k                      shl eax,2
  42.         8k                      shl eax,3
  43.         4k                      shl eax,4
  44.  
  45. The code will be improved later...
  46.  
  47.  
  48. The C functions are (prototyped into paging.h) :
  49.  
  50.   void * GetLinearVideo(int VideoSize) VideoSize=size of videobuffer in MBytes.
  51.   void   CloseLinearVideo(void);
  52.  
  53.  
  54. J.P. (Sorry for the grammatical errors in english...)
  55.