-/* Catacomb Apocalypse Source Code\r
- * Copyright (C) 1993-2014 Flat Rock Software\r
+/* Project 16 Source Code~\r
+ * Copyright (C) 2012-2017 sparky4 & pngwen & andrius4669 & joncampbell123 & yakui-lover\r
*\r
- * This program is free software; you can redistribute it and/or modify\r
+ * This file is part of Project 16.\r
+ *\r
+ * Project 16 is free software; you can redistribute it and/or modify\r
* it under the terms of the GNU General Public License as published by\r
- * the Free Software Foundation; either version 2 of the License, or\r
+ * the Free Software Foundation; either version 3 of the License, or\r
* (at your option) any later version.\r
*\r
- * This program is distributed in the hope that it will be useful,\r
+ * Project 16 is distributed in the hope that it will be useful,\r
* but WITHOUT ANY WARRANTY; without even the implied warranty of\r
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r
* GNU General Public License for more details.\r
*\r
- * You should have received a copy of the GNU General Public License along\r
- * with this program; if not, write to the Free Software Foundation, Inc.,\r
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.\r
+ * You should have received a copy of the GNU General Public License\r
+ * along with this program. If not, see <http://www.gnu.org/licenses/>, or\r
+ * write to the Free Software Foundation, Inc., 51 Franklin Street,\r
+ * Fifth Floor, Boston, MA 02110-1301 USA.\r
+ *\r
*/\r
\r
// NEWMM.C\r
}\r
#endif\r
// printf("base=%u ", base); printf("size=%u\n", size);\r
- MML_UseSpace(base,size, gvar);\r
+ MML_UseSpace (base,size, gvar);\r
gvar->mmi.XMSmem += size*16;\r
gvar->mm.UMBbase[gvar->mm.numUMBs] = base;\r
gvar->mm.numUMBs++;\r
{\r
scan->blob=segm;\r
\r
- //MML_UseSpace(segstart, seglength, gvar);\r
+ //MML_UseSpace (segstart, seglength, gvar);\r
\r
printf("MML_UseSpace: Segment spans two blocks!\n");\r
//}\r
}\r
//++++todo: linked list of segment!\r
*/\r
-void MML_UseSpace(word segstart, dword seglength, global_game_variables_t *gvar)\r
+void MML_UseSpace (word segstart, dword seglength, global_game_variables_t *gvar)\r
{\r
mmblocktype far *scan,far *last;\r
word oldend;\r
===================\r
*/\r
\r
-void MM_Startup(global_game_variables_t *gvar)\r
+void MM_Startup (global_game_variables_t *gvar)\r
{\r
int i;\r
//dword length,seglength;\r
length -= SAVENEARHEAP;\r
seglength = length / 16; // now in paragraphs\r
segstart = FP_SEG(start)+(FP_OFF(start)+15)/16;\r
- MML_UseSpace(segstart,seglength, gvar);\r
+ MML_UseSpace (segstart,seglength, gvar);\r
gvar->mmi.nearheap = length;\r
//0000printf("near: start=%Fp segstart=%x seglen=%lu len=%lu\n", start, segstart, (dword)seglength, length);\r
\r
length -= SAVEFARHEAP;\r
seglength = length / 16; // now in paragraphs\r
segstart = FP_SEG(start)+(FP_OFF(start)+15)/16;\r
- MML_UseSpace(segstart,seglength, gvar);\r
+ MML_UseSpace (segstart,seglength, gvar);\r
gvar->mmi.farheap = length;\r
//0000printf("far: start=%Fp segstart=%x seglen=%lu len=%lu\n", start, segstart, (dword)seglength, length);\r
\r
{\r
MML_SetupEMS(gvar); // allocate space\r
//16_PM: EMS4! AND EMS 3.2 MASSIVE DATA HANDLMENT!\r
- MML_UseSpace(gvar->mm.EMSPageFrame,(MAPPAGES)*0x4000lu, gvar);\r
+ MML_UseSpace (gvar->mm.EMSPageFrame,(MAPPAGES)*0x4000lu, gvar);\r
//if(gvar->pm.emm.EMSVer<0x40)\r
MM_MapEMS(gvar); // map in used pages\r
//else\r
====================\r
*/\r
\r
-void MM_Shutdown(global_game_variables_t *gvar)\r
+void MM_Shutdown (global_game_variables_t *gvar)\r
{\r
if(!(gvar->mm.mmstarted))\r
return;\r
gvar->mm.mmnew->useptr = baseptr;\r
//if(gvar->mm.mmnew->useptr==NULL){\r
#ifdef __DEBUG_MM__\r
+ printf("MM_GetPtr\n");\r
if(dbg_debugmm>0){\r
- printf("MM_GetPtr\n");\r
//%04x\r
printf(" baseptr=%Fp ", baseptr); printf("useptr=%Fp\n", gvar->mm.mmnew->useptr);\r
printf(" *baseptr=%Fp ", *baseptr); printf("*useptr=%Fp\n", *(gvar->mm.mmnew->useptr));\r
printf(" &baseptr=%Fp ", &baseptr); printf("&useptr=%Fp\n", &(gvar->mm.mmnew->useptr));\r
}\r
+ printf(" size is %lu\n", size);\r
#endif\r
//Quit(gvar, "gvar->mm.mmnew->useptr==NULL"); }\r
gvar->mm.mmnew->attributes = BASEATTRIBUTES;\r