ID_MM.H 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. /* Catacomb Armageddon Source Code
  2. * Copyright (C) 1993-2014 Flat Rock Software
  3. *
  4. * This program is free software; you can redistribute it and/or modify
  5. * it under the terms of the GNU General Public License as published by
  6. * the Free Software Foundation; either version 2 of the License, or
  7. * (at your option) any later version.
  8. *
  9. * This program is distributed in the hope that it will be useful,
  10. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. * GNU General Public License for more details.
  13. *
  14. * You should have received a copy of the GNU General Public License along
  15. * with this program; if not, write to the Free Software Foundation, Inc.,
  16. * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  17. */
  18. // ID_MM.H
  19. #ifndef __ID_CA__
  20. #define __ID_CA__
  21. #define SAVENEARHEAP 0x400 // space to leave in data segment
  22. #define SAVEFARHEAP 0 // space to leave in far heap
  23. #define BUFFERSIZE 0x1000 // miscelanious, allways available buffer
  24. #define MAXBLOCKS 600
  25. //--------
  26. #define EMS_INT 0x67
  27. #define EMS_STATUS 0x40
  28. #define EMS_GETFRAME 0x41
  29. #define EMS_GETPAGES 0x42
  30. #define EMS_ALLOCPAGES 0x43
  31. #define EMS_MAPPAGE 0x44
  32. #define EMS_FREEPAGES 0x45
  33. #define EMS_VERSION 0x46
  34. //--------
  35. #define XMS_VERSION 0x00
  36. #define XMS_ALLOCHMA 0x01
  37. #define XMS_FREEHMA 0x02
  38. #define XMS_GENABLEA20 0x03
  39. #define XMS_GDISABLEA20 0x04
  40. #define XMS_LENABLEA20 0x05
  41. #define XMS_LDISABLEA20 0x06
  42. #define XMS_QUERYA20 0x07
  43. #define XMS_QUERYREE 0x08
  44. #define XMS_ALLOC 0x09
  45. #define XMS_FREE 0x0A
  46. #define XMS_MOVE 0x0B
  47. #define XMS_LOCK 0x0C
  48. #define XMS_UNLOCK 0x0D
  49. #define XMS_GETINFO 0x0E
  50. #define XMS_RESIZE 0x0F
  51. #define XMS_ALLOCUMB 0x10
  52. #define XMS_FREEUMB 0x11
  53. //==========================================================================
  54. typedef void _seg * memptr;
  55. typedef struct
  56. {
  57. long nearheap,farheap,EMSmem,XMSmem,mainmem;
  58. } mminfotype;
  59. //==========================================================================
  60. extern mminfotype mminfo;
  61. extern memptr bufferseg;
  62. extern boolean mmerror;
  63. extern void (* beforesort) (void);
  64. extern void (* aftersort) (void);
  65. //==========================================================================
  66. void MM_Startup (void);
  67. void MM_Shutdown (void);
  68. void MM_MapEMS (void);
  69. void MM_GetPtr (memptr *baseptr,unsigned long size);
  70. void MM_FreePtr (memptr *baseptr);
  71. void MM_SetPurge (memptr *baseptr, int purge);
  72. void MM_SetLock (memptr *baseptr, boolean locked);
  73. void MM_SortMem (void);
  74. void MM_ShowMemory (void);
  75. long MM_UnusedMemory (void);
  76. long MM_TotalFree (void);
  77. void MM_BombOnError (boolean bomb);
  78. #endif