-/* 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
// ID_CA.C\r
-/* 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
// ID_CA.H\r
-/* 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
-/* 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
// ID_MM.H\r
boolean MML_CheckForEMS(void);\r
//byte MML_SetupEMS(mminfo_t *mm);\r
//void MML_ShutdownEMS(mminfo_t *mm);\r
-byte MM_MapEMS(global_game_variables_t *gvar);\r
+//byte MM_MapEMS(global_game_variables_t *gvar);\r
//byte MM_MapXEMS(global_game_variables_t *gvar);\r
boolean MML_CheckForXMS(void);\r
//void MML_SetupXMS(mminfo_t *mm, mminfotype *mmi);\r
//void MML_ShutdownXMS(mminfo_t *mm);\r
-void MML_UseSpace(word segstart, dword seglength, global_game_variables_t *gvar);\r
-void MML_ClearBlock(global_game_variables_t *gvar);\r
+void MML_UseSpace (word segstart, word seglength, global_game_variables_t *gvar);\r
+void MML_ClearBlock (global_game_variables_t *gvar);\r
\r
void MM_Startup(global_game_variables_t *gvar);\r
void MM_Shutdown(global_game_variables_t *gvar);\r
#include <hw/vga/vrs.h>\r
#endif\r
\r
-//gvar.video.ofs.bufferofs,gvar.video.ofs.displayofs,\r
+extern struct glob_game_vars *ggvv;\r
+\r
#define FIZZLEFADEFUNCTION \\r
if(gvar.in.inst->Keyboard[sc_F]){ FizzleFade(\\r
atoi(gvar.video.page[0].data),atoi(gvar.video.page[1].data),\\r
//from 16_mm\r
//==========================================================================\r
\r
-#define MAXBLOCKS 1024//kd=1300 wolf3d=700 cata=600\r
-//----#define MAXUMBS 12\r
+#define MAXBLOCKS 800//kd=1300 wolf3d=700 cata=600\r
\r
typedef struct mmblockstruct\r
{\r
- word start,length;\r
- //word start; dword length;\r
-//++++ word blob; //for data larger than 64k\r
+ unsigned start,length;\r
unsigned attributes;\r
memptr *useptr; // pointer to the segment start\r
struct mmblockstruct far *next;\r