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