From 181c6beee3d42da41fc53f44f0aa3e9315016ad2 Mon Sep 17 00:00:00 2001 From: sparky4 Date: Sun, 23 Apr 2017 15:53:23 -0500 Subject: [PATCH] reverted part 2 --- src/lib/16_ca.c | 20 ++++++++++++-------- src/lib/16_ca.h | 20 ++++++++++++-------- src/lib/16_mm.c | 36 ++++++++++++++++++++---------------- src/lib/16_mm.h | 26 +++++++++++++++----------- src/lib/16_tail.h | 3 ++- src/lib/16_tdef.h | 7 ++----- 6 files changed, 63 insertions(+), 49 deletions(-) diff --git a/src/lib/16_ca.c b/src/lib/16_ca.c index d55ac7f0..008e4e84 100755 --- a/src/lib/16_ca.c +++ b/src/lib/16_ca.c @@ -1,19 +1,23 @@ -/* 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_CA.C diff --git a/src/lib/16_ca.h b/src/lib/16_ca.h index db9cba58..b69e96d4 100755 --- a/src/lib/16_ca.h +++ b/src/lib/16_ca.h @@ -1,19 +1,23 @@ -/* 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_CA.H diff --git a/src/lib/16_mm.c b/src/lib/16_mm.c index b6d2a267..706aaff1 100755 --- a/src/lib/16_mm.c +++ b/src/lib/16_mm.c @@ -1,19 +1,23 @@ -/* 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. + * */ // NEWMM.C @@ -550,7 +554,7 @@ getmemory: } #endif // printf("base=%u ", base); printf("size=%u\n", size); - MML_UseSpace(base,size, gvar); + MML_UseSpace (base,size, gvar); gvar->mmi.XMSmem += size*16; gvar->mm.UMBbase[gvar->mm.numUMBs] = base; gvar->mm.numUMBs++; @@ -609,7 +613,7 @@ void MML_ShutdownXMS(global_game_variables_t *gvar) { scan->blob=segm; - //MML_UseSpace(segstart, seglength, gvar); + //MML_UseSpace (segstart, seglength, gvar); printf("MML_UseSpace: Segment spans two blocks!\n"); //} @@ -624,7 +628,7 @@ void MML_ShutdownXMS(global_game_variables_t *gvar) } //++++todo: linked list of segment! */ -void MML_UseSpace(word segstart, dword seglength, global_game_variables_t *gvar) +void MML_UseSpace (word segstart, dword seglength, global_game_variables_t *gvar) { mmblocktype far *scan,far *last; word oldend; @@ -740,7 +744,7 @@ void MML_ClearBlock(global_game_variables_t *gvar) =================== */ -void MM_Startup(global_game_variables_t *gvar) +void MM_Startup (global_game_variables_t *gvar) { int i; //dword length,seglength; @@ -793,7 +797,7 @@ void MM_Startup(global_game_variables_t *gvar) length -= SAVENEARHEAP; seglength = length / 16; // now in paragraphs segstart = FP_SEG(start)+(FP_OFF(start)+15)/16; - MML_UseSpace(segstart,seglength, gvar); + MML_UseSpace (segstart,seglength, gvar); gvar->mmi.nearheap = length; //0000printf("near: start=%Fp segstart=%x seglen=%lu len=%lu\n", start, segstart, (dword)seglength, length); @@ -814,7 +818,7 @@ void MM_Startup(global_game_variables_t *gvar) length -= SAVEFARHEAP; seglength = length / 16; // now in paragraphs segstart = FP_SEG(start)+(FP_OFF(start)+15)/16; - MML_UseSpace(segstart,seglength, gvar); + MML_UseSpace (segstart,seglength, gvar); gvar->mmi.farheap = length; //0000printf("far: start=%Fp segstart=%x seglen=%lu len=%lu\n", start, segstart, (dword)seglength, length); @@ -837,7 +841,7 @@ void MM_Startup(global_game_variables_t *gvar) { MML_SetupEMS(gvar); // allocate space //16_PM: EMS4! AND EMS 3.2 MASSIVE DATA HANDLMENT! - MML_UseSpace(gvar->mm.EMSPageFrame,(MAPPAGES)*0x4000lu, gvar); + MML_UseSpace (gvar->mm.EMSPageFrame,(MAPPAGES)*0x4000lu, gvar); //if(gvar->pm.emm.EMSVer<0x40) MM_MapEMS(gvar); // map in used pages //else @@ -884,7 +888,7 @@ xmsskip: ==================== */ -void MM_Shutdown(global_game_variables_t *gvar) +void MM_Shutdown (global_game_variables_t *gvar) { if(!(gvar->mm.mmstarted)) return; diff --git a/src/lib/16_mm.h b/src/lib/16_mm.h index c5e89a2b..587e8800 100755 --- a/src/lib/16_mm.h +++ b/src/lib/16_mm.h @@ -1,19 +1,23 @@ -/* 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 @@ -178,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_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_UseSpace (word segstart, word seglength, 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); diff --git a/src/lib/16_tail.h b/src/lib/16_tail.h index 93022c26..5f1683d6 100755 --- a/src/lib/16_tail.h +++ b/src/lib/16_tail.h @@ -41,7 +41,8 @@ #include #endif -//gvar.video.ofs.bufferofs,gvar.video.ofs.displayofs, +extern struct glob_game_vars *ggvv; + #define FIZZLEFADEFUNCTION \ if(gvar.in.inst->Keyboard[sc_F]){ FizzleFade(\ atoi(gvar.video.page[0].data),atoi(gvar.video.page[1].data),\ diff --git a/src/lib/16_tdef.h b/src/lib/16_tdef.h index 1aa8b53f..3fa1feb3 100755 --- a/src/lib/16_tdef.h +++ b/src/lib/16_tdef.h @@ -468,14 +468,11 @@ typedef struct //from 16_mm //========================================================================== -#define MAXBLOCKS 1024//kd=1300 wolf3d=700 cata=600 -//----#define MAXUMBS 12 +#define MAXBLOCKS 800//kd=1300 wolf3d=700 cata=600 typedef struct mmblockstruct { - word start,length; - //word start; dword length; -//++++ word blob; //for data larger than 64k + unsigned start,length; unsigned attributes; memptr *useptr; // pointer to the segment start struct mmblockstruct far *next; -- 2.39.2