home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / World_Of_Computer_Software-02-386-Vol-2of3.iso / g / gametp20.zip / LIMEMS.INT < prev    next >
Text File  |  1992-11-05  |  3KB  |  75 lines

  1. Unit limems;
  2.  
  3. { LimEms version 1.0 Copyright (C) 1992 Scott D. Ramsay     }
  4. {                                  ramsays@access.digex.com }
  5.  
  6. {   This unit allows programmers to use EMS memory.  This unit is    }
  7. { used by DSOUND.TPU to load VOC files under 64k to EMS              }
  8. {   LIMEMS.TPU can be used freely in commerical and non-commerical   }
  9. { programs.  As long as you don't give yourself credit for writing   }
  10. { this portion of the code.  When distributing it please include all }
  11. { files and samples so others may enjoy using the code.  Thanks.     }
  12.  
  13. Interface
  14.  
  15. Uses DOS;
  16.  
  17. function emsINSTALLED:boolean;
  18. function emsSTATUS:boolean;
  19. procedure emsPAGES(var totalpages,pagesavailable:word);
  20. procedure emsGETMEM(pagesneeded:word;var handle:word);
  21. procedure emsMAP(handle,logicalpage,physicalpage:word);
  22. procedure emsADDRESS(var address:word);
  23. procedure emsFREEMEM(handle:word);
  24. procedure emsVERSION(var st:string);
  25.  
  26. { See Implementation section for description of functions }
  27.  
  28. implementation
  29.  
  30. (*************************************************************************)
  31. function emsINSTALLED:boolean;
  32.  
  33.   Returns TRUE if EMS driver is installed.
  34.  
  35. (*************************************************************************)
  36. function emsSTATUS:boolean;
  37.  
  38.   Returns TRUE is EMS is running ok.
  39.  
  40. (*************************************************************************)
  41. procedure emsADDRESS(var address:word);
  42.  
  43.   address       The segment to the EMS map window
  44.  
  45.  
  46. (*************************************************************************)
  47. procedure emsPAGES(var totalpages,pagesavailable:word);
  48.  
  49.   totalpages       Returns the number of 16k pages in EMS
  50.   pagesavailable   Returns the number of 16k pages available
  51.  
  52. (*************************************************************************)
  53. procedure emsGETMEM(pagesneeded:word;var handle:word);
  54.  
  55.   pagesneeded      Number of 16k pages to allocate
  56.   handle           EMS handle to allocated pages
  57.  
  58. (*************************************************************************)
  59. procedure emsmap(handle,logicalpage,physicalpage:word);
  60.  
  61.   Maps a EMS page to one of the 4 pages in the ems window.
  62.  
  63.   handle        EMS handle from emsGETMEM
  64.  
  65. (*************************************************************************)
  66. procedure emsfreemem(handle:word);
  67.  
  68.   Deallocate EMS memory
  69.  
  70.   handle       EMS handle from emsGETMEM
  71.  
  72. (*************************************************************************)
  73. procedure emsversion(var st:string);
  74.  
  75.   Returns the EMS version string