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