X-Git-Url: http://4ch.mooo.com/gitweb/?a=blobdiff_plain;f=src%2Flib%2F16_mm.h;h=86bcdd575ef1b923134890136422873d5e7a3e70;hb=ce3c236194323bcbc331bad4a059ea95fb6c7947;hp=7c681255d63b52ee9cc50c27c5fa18c362d94f63;hpb=5965823c934f177a5ef1cd30ae9ee5dda2a95154;p=16.git
diff --git a/src/lib/16_mm.h b/src/lib/16_mm.h
index 7c681255..86bcdd57 100755
--- a/src/lib/16_mm.h
+++ b/src/lib/16_mm.h
@@ -1,38 +1,39 @@
-/* Catacomb Apocalypse Source Code
- * Copyright (C) 1993-2014 Flat Rock Software
+/* Project 16 Source Code~
+ * Copyright (C) 2012-2017 sparky4 & pngwen & andrius4669 & joncampbell123 & yakui-lover
*
- * This program is free software; you can redistribute it and/or modify
+ * This file is part of Project 16.
+ *
+ * Project 16 is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
+ * the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
- * This program is distributed in the hope that it will be useful,
+ * Project 16 is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see , or
+ * write to the Free Software Foundation, Inc., 51 Franklin Street,
+ * Fifth Floor, Boston, MA 02110-1301 USA.
+ *
*/
// ID_MM.H
-#ifndef __16_EXMM__
-#define __16_EXMM__
+#ifndef __16_MM__
+#define __16_MM__
#include
-#include
#include "src/lib/16_head.h"
#include "src/lib/16_hc.h"
#include "src/lib/16_tail.h"
-//++++mh #include "src/lib/16_in.h"
#ifdef __DEBUG__ // 1 == Debug/Dev ; 0 == Production/final
#define OUT_OF_MEM_MSG "MM_GetPtr: Out of memory!\nYou were short :%lu bytes\n"
-extern boolean debugpm;
#else
-#define OUT_OF_MEM_MSG "\npee\n"
+#define OUT_OF_MEM_MSG "\n"
#endif
//#define GETNEWBLOCK {if(!(mmnew=mmfree))Quit("MM_GETNEWBLOCK: No free blocks!") ;mmfree=mmfree->next;}
@@ -41,18 +42,18 @@ extern boolean debugpm;
#define FREEBLOCK(x) {*x->useptr=NULL;x->next=gvar->mm.mmfree;gvar->mm.mmfree=x;}
#define SAVENEARHEAP 0x200 // space to leave in data segment
-#define SAVEFARHEAP 0//x400 // space to leave in far heap
+#define SAVEFARHEAP 0x400 // space to leave in far heap
#define BUFFERSIZE 0x1000 // miscelanious, allways available buffer
-//moved to typdefst
+//moved to 16_tdef.h
//#define MAXBLOCKS 1024
-
//--------
#define EMS_INT 0x67
+#define EMM_INT 0x21
#define EMS_STATUS 0x40
#define EMS_GETFRAME 0x41
@@ -67,7 +68,7 @@ extern boolean debugpm;
#define XMS_INT 0x2f
#define XMS_CALL(v) _AH = (v);\
- __asm call [WORD PTR XMSDriver]
+ __asm call [DWORD PTR XMSDriver]
/*__asm { mov ah,[v]\*///}
#define XMS_VERSION 0x00
@@ -79,7 +80,7 @@ extern boolean debugpm;
#define XMS_GDISABLEA20 0x04
#define XMS_LENABLEA20 0x05
#define XMS_LDISABLEA20 0x06
-#define XMS_QUERYA20 0x07
+#define XMS_QUERYA20 0x07
#define XMS_QUERYFREE 0x08
#define XMS_ALLOC 0x09
@@ -106,6 +107,8 @@ extern boolean debugpm;
extern void (* beforesort) (void);
extern void (* aftersort) (void);
extern void (* XMSaddr) (void); // far pointer to XMS driver
+extern dword XMSDriver;
+extern word XMSVer;
//==========================================================================
@@ -134,7 +137,6 @@ extern void (* XMSaddr) (void); // far pointer to XMS driver
word blob; //for data larger than 64k
unsigned attributes;
memptr *useptr; // pointer to the segment start
- //huge struct mmblockstruct huge *next;
struct mmblockstruct far *next;
} mmblocktype;
@@ -143,7 +145,6 @@ typedef struct
{
memptr bufferseg;
boolean mmstarted, bombonerror, mmerror;
- //huge void huge *farheap;
void far *farheap;
#ifdef __BORLANDC__
void *nearheap;
@@ -156,7 +157,6 @@ typedef struct
unsigned int EMSVer;
word numUMBs,UMBbase[MAXUMBS];
//dword numUMBs,UMBbase[MAXUMBS];
- //huge mmblocktype huge mmblocks[MAXBLOCKS],huge *mmhead,huge *mmfree,huge *mmrover,huge *mmnew;
mmblocktype far mmblocks[MAXBLOCKS],far *mmhead,far *mmfree,far *mmrover,far *mmnew;
} mminfo_t;*/
@@ -182,13 +182,13 @@ typedef struct
boolean MML_CheckForEMS(void);
//byte MML_SetupEMS(mminfo_t *mm);
//void MML_ShutdownEMS(mminfo_t *mm);
-byte MM_MapEMS(global_game_variables_t *gvar);
-byte MM_MapXEMS(global_game_variables_t *gvar);
-//boolean MML_CheckForXMS(mminfo_t *mm);
+//byte MM_MapEMS(global_game_variables_t *gvar);
+//byte MM_MapXEMS(global_game_variables_t *gvar);
+boolean MML_CheckForXMS(void);
//void MML_SetupXMS(mminfo_t *mm, mminfotype *mmi);
//void MML_ShutdownXMS(mminfo_t *mm);
void MML_UseSpace(word segstart, dword seglength, global_game_variables_t *gvar);
-void MML_ClearBlock(global_game_variables_t *gvar);
+void MML_ClearBlock (global_game_variables_t *gvar);
void MM_Startup(global_game_variables_t *gvar);
void MM_Shutdown(global_game_variables_t *gvar);
@@ -207,6 +207,7 @@ void MM_Report_(global_game_variables_t *gvar);
void MM_BombOnError(boolean bomb, global_game_variables_t *gvar);
//void MM_GetNewBlock(mminfo_t *mm);
//void MM_FreeBlock(mmblocktype *x, mminfo_t *mm);
+void xms_call(byte v, global_game_variables_t *gvar);
//==========================================================================