1 /* Catacomb Armageddon Source Code
\r
2 * Copyright (C) 1993-2014 Flat Rock Software
\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
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
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
25 #define SAVENEARHEAP 0x400 // space to leave in data segment
\r
26 #define SAVEFARHEAP 0 // space to leave in far heap
\r
28 #define BUFFERSIZE 0x1000 // miscelanious, allways available buffer
\r
30 #define MAXBLOCKS 600
\r
35 #define EMS_INT 0x67
\r
37 #define EMS_STATUS 0x40
\r
38 #define EMS_GETFRAME 0x41
\r
39 #define EMS_GETPAGES 0x42
\r
40 #define EMS_ALLOCPAGES 0x43
\r
41 #define EMS_MAPPAGE 0x44
\r
42 #define EMS_FREEPAGES 0x45
\r
43 #define EMS_VERSION 0x46
\r
47 #define XMS_VERSION 0x00
\r
49 #define XMS_ALLOCHMA 0x01
\r
50 #define XMS_FREEHMA 0x02
\r
52 #define XMS_GENABLEA20 0x03
\r
53 #define XMS_GDISABLEA20 0x04
\r
54 #define XMS_LENABLEA20 0x05
\r
55 #define XMS_LDISABLEA20 0x06
\r
56 #define XMS_QUERYA20 0x07
\r
58 #define XMS_QUERYREE 0x08
\r
59 #define XMS_ALLOC 0x09
\r
60 #define XMS_FREE 0x0A
\r
61 #define XMS_MOVE 0x0B
\r
62 #define XMS_LOCK 0x0C
\r
63 #define XMS_UNLOCK 0x0D
\r
64 #define XMS_GETINFO 0x0E
\r
65 #define XMS_RESIZE 0x0F
\r
67 #define XMS_ALLOCUMB 0x10
\r
68 #define XMS_FREEUMB 0x11
\r
70 //==========================================================================
\r
72 typedef void _seg * memptr;
\r
76 long nearheap,farheap,EMSmem,XMSmem,mainmem;
\r
79 //==========================================================================
\r
81 extern mminfotype mminfo;
\r
82 extern memptr bufferseg;
\r
83 extern boolean mmerror;
\r
85 extern void (* beforesort) (void);
\r
86 extern void (* aftersort) (void);
\r
88 //==========================================================================
\r
90 void MM_Startup (void);
\r
91 void MM_Shutdown (void);
\r
92 void MM_MapEMS (void);
\r
94 void MM_GetPtr (memptr *baseptr,unsigned long size);
\r
95 void MM_FreePtr (memptr *baseptr);
\r
97 void MM_SetPurge (memptr *baseptr, int purge);
\r
98 void MM_SetLock (memptr *baseptr, boolean locked);
\r
99 void MM_SortMem (void);
\r
101 void MM_ShowMemory (void);
\r
103 long MM_UnusedMemory (void);
\r
104 long MM_TotalFree (void);
\r
106 void MM_BombOnError (boolean bomb);
\r