7 #define SAVENEARHEAP 0x400 // space to leave in data segment
\r
8 #define SAVEFARHEAP 0 // space to leave in far heap
\r
10 #define BUFFERSIZE 0x1000 // miscelanious, allways available buffer
\r
12 #define MAXBLOCKS 700
\r
17 #define EMS_INT 0x67
\r
19 #define EMS_STATUS 0x40
\r
20 #define EMS_GETFRAME 0x41
\r
21 #define EMS_GETPAGES 0x42
\r
22 #define EMS_ALLOCPAGES 0x43
\r
23 #define EMS_MAPPAGE 0x44
\r
24 #define EMS_FREEPAGES 0x45
\r
25 #define EMS_VERSION 0x46
\r
29 #define XMS_INT 0x2f
\r
30 #define XMS_CALL(v) _AH = (v);\
\r
31 asm call [DWORD PTR XMSDriver]
\r
33 #define XMS_VERSION 0x00
\r
35 #define XMS_ALLOCHMA 0x01
\r
36 #define XMS_FREEHMA 0x02
\r
38 #define XMS_GENABLEA20 0x03
\r
39 #define XMS_GDISABLEA20 0x04
\r
40 #define XMS_LENABLEA20 0x05
\r
41 #define XMS_LDISABLEA20 0x06
\r
42 #define XMS_QUERYA20 0x07
\r
44 #define XMS_QUERYFREE 0x08
\r
45 #define XMS_ALLOC 0x09
\r
46 #define XMS_FREE 0x0A
\r
47 #define XMS_MOVE 0x0B
\r
48 #define XMS_LOCK 0x0C
\r
49 #define XMS_UNLOCK 0x0D
\r
50 #define XMS_GETINFO 0x0E
\r
51 #define XMS_RESIZE 0x0F
\r
53 #define XMS_ALLOCUMB 0x10
\r
54 #define XMS_FREEUMB 0x11
\r
56 //==========================================================================
\r
58 typedef void _seg * memptr;
\r
62 long nearheap,farheap,EMSmem,XMSmem,mainmem;
\r
65 //==========================================================================
\r
67 extern mminfotype mminfo;
\r
68 extern memptr bufferseg;
\r
69 extern boolean mmerror;
\r
71 extern void (* beforesort) (void);
\r
72 extern void (* aftersort) (void);
\r
74 //==========================================================================
\r
76 void MM_Startup (void);
\r
77 void MM_Shutdown (void);
\r
78 void MM_MapEMS (void);
\r
80 void MM_GetPtr (memptr *baseptr,unsigned long size);
\r
81 void MM_FreePtr (memptr *baseptr);
\r
83 void MM_SetPurge (memptr *baseptr, int purge);
\r
84 void MM_SetLock (memptr *baseptr, boolean locked);
\r
85 void MM_SortMem (void);
\r
87 void MM_ShowMemory (void);
\r
89 long MM_UnusedMemory (void);
\r
90 long MM_TotalFree (void);
\r
92 void MM_BombOnError (boolean bomb);
\r
94 void MML_UseSpace (unsigned segstart, unsigned seglength);
\r