+++ /dev/null
-VL_MungePic====================================\r
-4EC3:FFAE (memptr *)&temp\r
-4EC3:FFAE (memptr)temp\r
-460A:4628 &temp\r
-4628:3DC2 temp\r
-===============================================\r
- SDL_SetDS(): OK\r
-CAL_SetupGrFile:\r
- chunkcomplen size is 350\r
-CalcHeight()\r
-heightnumerator\r
-211968 15360 828 0\r
-a 6234\r
-b 12\r
-d 8734\r
-d 8\r
-ax 4\r
-al 5\r
- nx 0\r
-pee 2408\r
-gxt gyt nx gx gy\r
-0 0 22528 0 0\r
-0 0 0 0 22528\r
-ch 14\r
-compiled on Apr 19 2017 12:39:47\r
--------------------------------------------------------------------------------\r
- ./qkeen.sh start\r
--------------------------------------------------------------------------------\r
+-------------------------------------------------------------------------------
+ ./qkeen.sh start
+-------------------------------------------------------------------------------
16/keen/id_ca.c:byte _seg *tinf;\r
16/keen/id_ca.c:unsigned _seg *mapsegs[3];\r
16/keen/id_ca.c:maptype _seg *mapheaderseg[NUMMAPS];\r
16/keen/id_vw.h:extern pictabletype _seg *pictable;\r
16/keen/id_vw.h:extern pictabletype _seg *picmtable;\r
16/keen/id_vw.h:extern spritetabletype _seg *spritetable;\r
-=============== ./qkeen.sh end ===============\r
--------------------------------------------------------------------------------\r
- ./qwolf.sh start\r
--------------------------------------------------------------------------------\r
-==== 16/wf3d8086 ====\r
+=============== ./qkeen.sh end ===============
+-------------------------------------------------------------------------------
+ ./qwolf.sh start
+-------------------------------------------------------------------------------
+==== 16/wf3d8086 ====
16/wf3d8086/contigsc.c:byte _seg *endscalermemory;\r
16/wf3d8086/contigsc.c: endscalermemory = (void _seg *)(seg+ofs/16);\r
16/wf3d8086/contigsc.c: t_compshape _seg *shape;\r
16/wf3d8086/id_vh.c: src = (byte _seg *)grsegs[STARTTILE8];\r
16/wf3d8086/id_vh.c: src = (byte _seg *)grsegs[STARTTILE16];\r
16/wf3d8086/id_vh.c: src = (byte _seg *)grsegs[STARTTILE16+i];\r
+16/wf3d8086/oldscale.c:t_compscale _seg *scaledirectory[MAXSCALEHEIGHT+1];\r
+16/wf3d8086/oldscale.c:t_compscale _seg *work;\r
+16/wf3d8086/oldscale.c: _fmemcpy ((byte _seg *)(*finalspot),(byte _seg *)work,totalsize);\r
+16/wf3d8086/oldscale.c: t_compshape _seg *shape;\r
+16/wf3d8086/oldscale.c: t_compscale _seg *comptable;\r
+16/wf3d8086/oldscale.c: t_compshape _seg *shape;\r
+16/wf3d8086/oldscale.c: t_compscale _seg *comptable;\r
16/wf3d8086/wl_debug.c: spritetype _seg *block;\r
16/wf3d8086/wl_debug.c:extern word _seg *DigiList;\r
16/wf3d8086/wl_menu.c: fontstruct _seg *font;\r
16/wf3d8086/id_vh.h:extern pictabletype _seg *picmtable;\r
16/wf3d8086/id_vh.h:extern spritetabletype _seg *spritetable;\r
16/wf3d8086/wl_def.h:extern t_compscale _seg *scaledirectory[MAXSCALEHEIGHT+1];\r
-==== 16/wolf3d/WOLFSRC ====\r
-16/wolf3d/WOLFSRC/CONTIGSC.C:byte _seg *endscalermemory;\r
-16/wolf3d/WOLFSRC/CONTIGSC.C: endscalermemory = (void _seg *)(seg+ofs/16);\r
-16/wolf3d/WOLFSRC/CONTIGSC.C: t_compshape _seg *shape;\r
-16/wolf3d/WOLFSRC/CONTIGSC.C: t_compshape _seg *shape;\r
-16/wolf3d/WOLFSRC/ID_CA.C:byte _seg *tinf;\r
-16/wolf3d/WOLFSRC/ID_CA.C:unsigned _seg *mapsegs[MAPPLANES];\r
-16/wolf3d/WOLFSRC/ID_CA.C:maptype _seg *mapheaderseg[NUMMAPS];\r
-16/wolf3d/WOLFSRC/ID_CA.C:byte _seg *audiosegs[NUMSNDCHUNKS];\r
-16/wolf3d/WOLFSRC/ID_CA.C:void _seg *grsegs[NUMCHUNKS];\r
-16/wolf3d/WOLFSRC/ID_CA.C:long _seg *grstarts; // array of offsets in egagraph, -1 for sparse\r
-16/wolf3d/WOLFSRC/ID_CA.C:long _seg *audiostarts; // array of offsets in audio / audiot\r
-16/wolf3d/WOLFSRC/ID_CA.C: grstarts = (long _seg *)FP_SEG(&EGAhead);\r
-16/wolf3d/WOLFSRC/ID_CA.C: tinf = (byte _seg *)FP_SEG(&maphead);\r
-16/wolf3d/WOLFSRC/ID_CA.C: pos = ((mapfiletype _seg *)tinf)->headeroffsets[i];\r
-16/wolf3d/WOLFSRC/ID_CA.C: audiostarts = (long _seg *)FP_SEG(&audiohead);\r
-16/wolf3d/WOLFSRC/ID_CA.C: ((mapfiletype _seg *)tinf)->RLEWtag);\r
-16/wolf3d/WOLFSRC/ID_CA.C: ((mapfiletype _seg *)tinf)->RLEWtag);\r
-16/wolf3d/WOLFSRC/ID_CA.C: source = (byte _seg *)bufferseg+(pos-bufferstart);\r
-16/wolf3d/WOLFSRC/ID_IN.C: byte _seg *DemoBuffer;\r
-16/wolf3d/WOLFSRC/ID_PM.C: _seg *PMSegPages;\r
-16/wolf3d/WOLFSRC/ID_PM.C: void _seg *buf;\r
-16/wolf3d/WOLFSRC/ID_PM.C: MM_FreePtr(&(void _seg *)PMSegPages);\r
-16/wolf3d/WOLFSRC/ID_SD.C: word *SoundTable; // Really * _seg *SoundTable, but that don't work\r
-16/wolf3d/WOLFSRC/ID_SD.C: word _seg *DigiList;\r
-16/wolf3d/WOLFSRC/ID_VH.C:pictabletype _seg *pictable;\r
-16/wolf3d/WOLFSRC/ID_VH.C: byte _seg *temp, far *dest, far *srcline;\r
-16/wolf3d/WOLFSRC/ID_VH.C: , fontstruct _seg *font)\r
-16/wolf3d/WOLFSRC/ID_VH.C: VWL_MeasureString(string,width,height,(fontstruct _seg *)grsegs[STARTFONT+fontnumber]);\r
-16/wolf3d/WOLFSRC/ID_VH.C: VWL_MeasureString(string,width,height,(fontstruct _seg *)grsegs[STARTFONTM+fontnumber]);\r
-16/wolf3d/WOLFSRC/ID_VH.C: src = (byte _seg *)grsegs[STARTTILE8];\r
-16/wolf3d/WOLFSRC/ID_VH.C: src = (byte _seg *)grsegs[STARTTILE16];\r
-16/wolf3d/WOLFSRC/ID_VH.C: src = (byte _seg *)grsegs[STARTTILE16+i];\r
-16/wolf3d/WOLFSRC/WL_DEBUG.C: spritetype _seg *block;\r
-16/wolf3d/WOLFSRC/WL_DEBUG.C:extern word _seg *DigiList;\r
-16/wolf3d/WOLFSRC/WL_MENU.C: fontstruct _seg *font;\r
-16/wolf3d/WOLFSRC/WL_SCALE.C:t_compscale _seg *scaledirectory[MAXSCALEHEIGHT+1];\r
-16/wolf3d/WOLFSRC/WL_SCALE.C:t_compscale _seg *work;\r
-16/wolf3d/WOLFSRC/WL_SCALE.C: _fmemcpy ((byte _seg *)(*finalspot),(byte _seg *)work,totalsize);\r
-16/wolf3d/WOLFSRC/WL_SCALE.C: t_compshape _seg *shape;\r
-16/wolf3d/WOLFSRC/WL_SCALE.C: t_compscale _seg *comptable;\r
-16/wolf3d/WOLFSRC/WL_SCALE.C: t_compshape _seg *shape;\r
-16/wolf3d/WOLFSRC/WL_SCALE.C: t_compscale _seg *comptable;\r
-16/wolf3d/WOLFSRC/WL_TEXT.C: text = (char _seg *)grsegs[artnum];\r
-16/wolf3d/WOLFSRC/WL_TEXT.C: text = (char _seg *)layout;\r
-16/wolf3d/WOLFSRC/WL_TEXT.C: text = (char _seg *)grsegs[artnum];\r
-16/wolf3d/WOLFSRC/WL_TEXT.C: text = (char _seg *)layout;\r
-16/wolf3d/WOLFSRC/ID_CA.H:extern byte _seg *tinf;\r
-16/wolf3d/WOLFSRC/ID_CA.H:extern unsigned _seg *mapsegs[MAPPLANES];\r
-16/wolf3d/WOLFSRC/ID_CA.H:extern maptype _seg *mapheaderseg[NUMMAPS];\r
-16/wolf3d/WOLFSRC/ID_CA.H:extern byte _seg *audiosegs[NUMSNDCHUNKS];\r
-16/wolf3d/WOLFSRC/ID_CA.H:extern void _seg *grsegs[NUMCHUNKS];\r
-16/wolf3d/WOLFSRC/ID_CA.H:extern long _seg *grstarts; // array of offsets in egagraph, -1 for sparse\r
-16/wolf3d/WOLFSRC/ID_CA.H:extern long _seg *audiostarts; // array of offsets in audio / audiot\r
-16/wolf3d/WOLFSRC/ID_IN.H:extern byte _seg *DemoBuffer;\r
-16/wolf3d/WOLFSRC/ID_MM.H:typedef void _seg * memptr;\r
-16/wolf3d/WOLFSRC/ID_VH.H:extern pictabletype _seg *pictable;\r
-16/wolf3d/WOLFSRC/ID_VH.H:extern pictabletype _seg *picmtable;\r
-16/wolf3d/WOLFSRC/ID_VH.H:extern spritetabletype _seg *spritetable;\r
-16/wolf3d/WOLFSRC/WL_DEF.H:extern t_compscale _seg *scaledirectory[MAXSCALEHEIGHT+1];\r
-=============== ./qwolf.sh end ===============\r
--------------------------------------------------------------------------------\r
- ./qcata.sh start\r
--------------------------------------------------------------------------------\r
-==== 16/Catacomb3D ====\r
+==== 16/wolf3d/WOLFSRC ====
+16/wolf3d/WOLFSRC/CONTIGSC.C:byte _seg *endscalermemory;
+16/wolf3d/WOLFSRC/CONTIGSC.C: endscalermemory = (void _seg *)(seg+ofs/16);
+16/wolf3d/WOLFSRC/CONTIGSC.C: t_compshape _seg *shape;
+16/wolf3d/WOLFSRC/CONTIGSC.C: t_compshape _seg *shape;
+16/wolf3d/WOLFSRC/ID_CA.C:byte _seg *tinf;
+16/wolf3d/WOLFSRC/ID_CA.C:unsigned _seg *mapsegs[MAPPLANES];
+16/wolf3d/WOLFSRC/ID_CA.C:maptype _seg *mapheaderseg[NUMMAPS];
+16/wolf3d/WOLFSRC/ID_CA.C:byte _seg *audiosegs[NUMSNDCHUNKS];
+16/wolf3d/WOLFSRC/ID_CA.C:void _seg *grsegs[NUMCHUNKS];
+16/wolf3d/WOLFSRC/ID_CA.C:long _seg *grstarts; // array of offsets in egagraph, -1 for sparse
+16/wolf3d/WOLFSRC/ID_CA.C:long _seg *audiostarts; // array of offsets in audio / audiot
+16/wolf3d/WOLFSRC/ID_CA.C: grstarts = (long _seg *)FP_SEG(&EGAhead);
+16/wolf3d/WOLFSRC/ID_CA.C: tinf = (byte _seg *)FP_SEG(&maphead);
+16/wolf3d/WOLFSRC/ID_CA.C: pos = ((mapfiletype _seg *)tinf)->headeroffsets[i];
+16/wolf3d/WOLFSRC/ID_CA.C: audiostarts = (long _seg *)FP_SEG(&audiohead);
+16/wolf3d/WOLFSRC/ID_CA.C: ((mapfiletype _seg *)tinf)->RLEWtag);
+16/wolf3d/WOLFSRC/ID_CA.C: ((mapfiletype _seg *)tinf)->RLEWtag);
+16/wolf3d/WOLFSRC/ID_CA.C: source = (byte _seg *)bufferseg+(pos-bufferstart);
+16/wolf3d/WOLFSRC/ID_IN.C: byte _seg *DemoBuffer;
+16/wolf3d/WOLFSRC/ID_PM.C: _seg *PMSegPages;
+16/wolf3d/WOLFSRC/ID_PM.C: void _seg *buf;
+16/wolf3d/WOLFSRC/ID_PM.C: MM_FreePtr(&(void _seg *)PMSegPages);
+16/wolf3d/WOLFSRC/ID_SD.C: word *SoundTable; // Really * _seg *SoundTable, but that don't work
+16/wolf3d/WOLFSRC/ID_SD.C: word _seg *DigiList;
+16/wolf3d/WOLFSRC/ID_VH.C:pictabletype _seg *pictable;
+16/wolf3d/WOLFSRC/ID_VH.C: byte _seg *temp, far *dest, far *srcline;
+16/wolf3d/WOLFSRC/ID_VH.C: , fontstruct _seg *font)
+16/wolf3d/WOLFSRC/ID_VH.C: VWL_MeasureString(string,width,height,(fontstruct _seg *)grsegs[STARTFONT+fontnumber]);
+16/wolf3d/WOLFSRC/ID_VH.C: VWL_MeasureString(string,width,height,(fontstruct _seg *)grsegs[STARTFONTM+fontnumber]);
+16/wolf3d/WOLFSRC/ID_VH.C: src = (byte _seg *)grsegs[STARTTILE8];
+16/wolf3d/WOLFSRC/ID_VH.C: src = (byte _seg *)grsegs[STARTTILE16];
+16/wolf3d/WOLFSRC/ID_VH.C: src = (byte _seg *)grsegs[STARTTILE16+i];
+16/wolf3d/WOLFSRC/OLDSCALE.C:t_compscale _seg *scaledirectory[MAXSCALEHEIGHT+1];
+16/wolf3d/WOLFSRC/OLDSCALE.C:t_compscale _seg *work;
+16/wolf3d/WOLFSRC/OLDSCALE.C: _fmemcpy ((byte _seg *)(*finalspot),(byte _seg *)work,totalsize);
+16/wolf3d/WOLFSRC/OLDSCALE.C: t_compshape _seg *shape;
+16/wolf3d/WOLFSRC/OLDSCALE.C: t_compscale _seg *comptable;
+16/wolf3d/WOLFSRC/OLDSCALE.C: t_compshape _seg *shape;
+16/wolf3d/WOLFSRC/OLDSCALE.C: t_compscale _seg *comptable;
+16/wolf3d/WOLFSRC/WL_DEBUG.C: spritetype _seg *block;
+16/wolf3d/WOLFSRC/WL_DEBUG.C:extern word _seg *DigiList;
+16/wolf3d/WOLFSRC/WL_MENU.C: fontstruct _seg *font;
+16/wolf3d/WOLFSRC/WL_SCALE.C:t_compscale _seg *scaledirectory[MAXSCALEHEIGHT+1];
+16/wolf3d/WOLFSRC/WL_SCALE.C:t_compscale _seg *work;
+16/wolf3d/WOLFSRC/WL_SCALE.C: _fmemcpy ((byte _seg *)(*finalspot),(byte _seg *)work,totalsize);
+16/wolf3d/WOLFSRC/WL_SCALE.C: t_compshape _seg *shape;
+16/wolf3d/WOLFSRC/WL_SCALE.C: t_compscale _seg *comptable;
+16/wolf3d/WOLFSRC/WL_SCALE.C: t_compshape _seg *shape;
+16/wolf3d/WOLFSRC/WL_SCALE.C: t_compscale _seg *comptable;
+16/wolf3d/WOLFSRC/WL_TEXT.C: text = (char _seg *)grsegs[artnum];
+16/wolf3d/WOLFSRC/WL_TEXT.C: text = (char _seg *)layout;
+16/wolf3d/WOLFSRC/WL_TEXT.C: text = (char _seg *)grsegs[artnum];
+16/wolf3d/WOLFSRC/WL_TEXT.C: text = (char _seg *)layout;
+16/wolf3d/WOLFSRC/ID_CA.H:extern byte _seg *tinf;
+16/wolf3d/WOLFSRC/ID_CA.H:extern unsigned _seg *mapsegs[MAPPLANES];
+16/wolf3d/WOLFSRC/ID_CA.H:extern maptype _seg *mapheaderseg[NUMMAPS];
+16/wolf3d/WOLFSRC/ID_CA.H:extern byte _seg *audiosegs[NUMSNDCHUNKS];
+16/wolf3d/WOLFSRC/ID_CA.H:extern void _seg *grsegs[NUMCHUNKS];
+16/wolf3d/WOLFSRC/ID_CA.H:extern long _seg *grstarts; // array of offsets in egagraph, -1 for sparse
+16/wolf3d/WOLFSRC/ID_CA.H:extern long _seg *audiostarts; // array of offsets in audio / audiot
+16/wolf3d/WOLFSRC/ID_IN.H:extern byte _seg *DemoBuffer;
+16/wolf3d/WOLFSRC/ID_MM.H:typedef void _seg * memptr;
+16/wolf3d/WOLFSRC/ID_VH.H:extern pictabletype _seg *pictable;
+16/wolf3d/WOLFSRC/ID_VH.H:extern pictabletype _seg *picmtable;
+16/wolf3d/WOLFSRC/ID_VH.H:extern spritetabletype _seg *spritetable;
+16/wolf3d/WOLFSRC/WL_DEF.H:extern t_compscale _seg *scaledirectory[MAXSCALEHEIGHT+1];
+=============== ./qwolf.sh end ===============
+-------------------------------------------------------------------------------
+ ./qcata.sh start
+-------------------------------------------------------------------------------
+==== 16/Catacomb3D ====
16/Catacomb3D/C3_DEBUG.C: spritetype _seg *block;\r
16/Catacomb3D/C3_GAME.C: text = (char _seg *)grsegs[LEVEL1TEXT+mapon];\r
16/Catacomb3D/C3_GAME.C: src = (byte _seg *)grsegs[STARTTILE8];\r
16/Catacomb3D/ID_VW.H:extern pictabletype _seg *pictable;\r
16/Catacomb3D/ID_VW.H:extern pictabletype _seg *picmtable;\r
16/Catacomb3D/ID_VW.H:extern spritetabletype _seg *spritetable;\r
-==== 16/CatacombApocalypse ====\r
+==== 16/CatacombApocalypse ====
16/CatacombApocalypse/C6_GAME.C: text = (char _seg *)grsegs[LEVEL1TEXT+mapon];\r
16/CatacombApocalypse/C6_GAME.C: src = (byte _seg *)grsegs[STARTTILE8];\r
16/CatacombApocalypse/C6_GAME.C: src = (byte _seg *)grsegs[STARTTILE16];\r
16/CatacombApocalypse/ID_VW.H:extern pictabletype _seg *picmtable;\r
16/CatacombApocalypse/ID_VW.H:extern spritetabletype _seg *spritetable;\r
16/CatacombApocalypse/ID_VW.H:void VWL_MeasureString (char far *string, word *width, word *height, fontstruct _seg *font);\r
-=============== ./qcata.sh end ===============\r
+=============== ./qcata.sh end ===============
#
# compile flags
#
-S_FLAGS=-sg -st -of+ -zu -zdp -zff -zgf -k32768#24576
+S_FLAGS=-sg -st -of+ -zu -zdf -zff -zgf -k32768#24576
Z_FLAGS=-zk0 -zc -zm#### -zp4 -ei
O_FLAGS=-opnr -oe=24 -oil+ -outback -ohm
T_FLAGS=-bt=dos -wx -m$(MEMORYMODE) -0 -fpi87 -d1 -fo=.$(OBJ)## -e=65536
\r
//++++ DemoLoop();//to be defined in 16_tail\r
\r
-//++++ Quit(gvar, "Demo loop exited???");\r
+//++++ Quit("Demo loop exited???");\r
\r
}\r
\r
#define BBUFNAME gvar.mm.bufferseg//bigbuffer\r
//#define INITBBUF static memptr BBUFNAME;\r
-#define BBUFPTR MEMPTRCONV BBUFNAME\r
+#define BBUFPTR MEMPTR BBUFNAME\r
\r
#ifdef __BORLANDC__\r
#define BBUF (memptr *)BBUFPTR\r
-/* Project 16 Source Code~\r
- * Copyright (C) 2012-2017 sparky4 & pngwen & andrius4669 & joncampbell123 & yakui-lover\r
+/* Catacomb Apocalypse Source Code\r
+ * Copyright (C) 1993-2014 Flat Rock Software\r
*\r
- * This file is part of Project 16.\r
- *\r
- * Project 16 is free software; you can redistribute it and/or modify\r
+ * This program 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 3 of the License, or\r
+ * the Free Software Foundation; either version 2 of the License, or\r
* (at your option) any later version.\r
*\r
- * Project 16 is distributed in the hope that it will be useful,\r
+ * This program 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\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
+ * 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
*/\r
\r
// ID_CA.C\r
#pragma warn -pro\r
#pragma warn -use\r
\r
-#define THREEBYTEGRSTARTS\r
+//#define THREEBYTEGRSTARTS\r
//https://github.com/open-watcom/open-watcom-v2/issues/279#issuecomment-244587566 for _seg\r
//http://www.shikadi.net/moddingwiki/GameMaps_Format for info on the code\r
/*\r
int grhandle; // handle to EGAGRAPH\r
int maphandle; // handle to MAPTEMP / GAMEMAPS\r
int audiohandle; // handle to AUDIOT / AUDIO\r
-*/\r
-long chunkcomplen,chunkexplen;\r
-/*\r
+\r
+long c hunkcomplen,c hunkexplen;\r
+\r
SDMode oldsoundmode;\r
\r
\r
#ifdef THREEBYTEGRSTARTS\r
#define FILEPOSSIZE 3\r
//#define GRFILEPOS(c) (*(long far *)(((byte far *)grstarts)+(c)*3)&0xffffff)\r
-CASVT GRFILEPOS(int c, global_game_variables_t *gvar)\r
+long GRFILEPOS(int c, global_game_variables_t *gvar)\r
{\r
- CASVT value;\r
+ long value;\r
int offset;\r
\r
offset = c*3;\r
\r
- value = *(CASVT far *)(((byte far *)gvar->ca.grstarts)+offset);\r
+ value = *(long far *)(((byte far *)gvar->ca.grstarts)+offset);\r
\r
value &= 0x00ffffffl;\r
\r
};\r
#else\r
#define FILEPOSSIZE 4\r
-//#define GRFILEPOS(c) (gvar->ca.grstarts[c])\r
-CASVT GRFILEPOS(int c, global_game_variables_t *gvar)\r
-{\r
- return gvar->ca.grstarts[c];\r
-}\r
+#define GRFILEPOS(c) (gvar->ca.grstarts[c])\r
#endif\r
\r
/*\r
\r
void CAL_GetGrChunkLength (int chunk,global_game_variables_t *gvar)\r
{\r
- lseek(gvar->ca.file.grhandle,GRFILEPOS(chunk,gvar),SEEK_SET);\r
+ lseek(gvar->ca.file.grhandle,GRFILEPOS(chunk),SEEK_SET);\r
read(gvar->ca.file.grhandle,&gvar->ca.chunkexplen,sizeof(gvar->ca.chunkexplen));\r
- gvar->ca.chunkcomplen = GRFILEPOS(chunk+1,gvar)-GRFILEPOS(chunk,gvar)-4;\r
+ gvar->ca.chunkcomplen = GRFILEPOS(chunk+1)-GRFILEPOS(chunk)-4;\r
}\r
\r
\r
//\r
// load the data offsets from ???head.ext\r
//\r
- MM_GetPtr (MEMPTRCONV gvar->ca.grstarts,(NUMCHUNKS+1)*FILEPOSSIZE, gvar);\r
+ MM_GetPtr (MEMPTR gvar->ca.grstarts,(NUMCHUNKS+1)*FILEPOSSIZE, gvar);\r
\r
strcpy(fname,GHEADNAME);\r
strcat(fname,EXTENSION);\r
// load the pic and sprite headers into the arrays in the data segment\r
//\r
#if NUMPICS>0\r
- MM_GetPtr(MEMPTRCONV gvar->video.pictable,NUMPICS*sizeof(pictabletype),gvar);\r
+ MM_GetPtr(MEMPTR gvar->video.pictable,NUMPICS*sizeof(pictabletype),gvar);\r
CAL_GetGrChunkLength(STRUCTPIC,gvar); // position file pointer\r
- printf("CAL_SetupGrFile:\n");\r
- printf(" gvar->ca.chunkcomplen size is %lu\n", gvar->ca.chunkcomplen);\r
- MM_GetPtr(&compseg,gvar->ca.chunkcomplen,gvar);\r
- IN_Ack(gvar);\r
+ MM_GetPtr(&compseg,gvar->ca.chunkcomplen, gvar);\r
CA_FarRead (gvar->ca.file.grhandle,compseg,gvar->ca.chunkcomplen,gvar);\r
CAL_HuffExpand (compseg, (byte far *)gvar->video.pictable,NUMPICS*sizeof(pictabletype),gvar->ca.grhuffman);\r
MM_FreePtr(&compseg,gvar);\r
#endif\r
\r
#if NUMPICM>0\r
- MM_GetPtr(MEMPTRCONV picmtable,NUMPICM*sizeof(pictabletype));\r
+ MM_GetPtr(MEMPTR picmtable,NUMPICM*sizeof(pictabletype));\r
CAL_GetGrChunkLength(STRUCTPICM); // position file pointer\r
MM_GetPtr(&compseg,gvar->ca.chunkcomplen);\r
CA_FarRead (gvar->ca.file.grhandle,compseg,gvar->ca.chunkcomplen);\r
#endif\r
\r
#if NUMSPRITES>0\r
- MM_GetPtr(MEMPTRCONV spritetable,NUMSPRITES*sizeof(spritetabletype));\r
+ MM_GetPtr(MEMPTR spritetable,NUMSPRITES*sizeof(spritetabletype));\r
CAL_GetGrChunkLength(STRUCTSPRITE); // position file pointer\r
MM_GetPtr(&compseg,gvar->ca.chunkcomplen);\r
CA_FarRead (gvar->ca.file.grhandle,compseg,gvar->ca.chunkcomplen);\r
O_RDONLY | O_BINARY, S_IREAD)) == -1)\r
Quit (gvar, "Can't open maphead.mph");\r
length = filelength(handle);\r
- MM_GetPtr (MEMPTRCONV gvar->ca.tinf,length,gvar);\r
+ MM_GetPtr (MEMPTR gvar->ca.tinf,length,gvar);\r
CA_FarRead(handle, gvar->ca.tinf, length,gvar);\r
close(handle);\r
//#else\r
O_RDONLY | O_BINARY, S_IREAD)) == -1)\r
Quit (gvar, "Can't open AUDIOHED.16""!");\r
length = filelength(handle);\r
- MM_GetPtr (MEMPTRCONV audiostarts,length);\r
+ MM_GetPtr (MEMPTR audiostarts,length);\r
CA_FarRead(handle, (byte far *)audiostarts, length);\r
close(handle);\r
#else\r
\r
if (audiosegs[chunk])\r
{\r
- MM_SetPurge (MEMPTRCONV audiosegs[chunk],0);\r
+ MM_SetPurge (MEMPTR audiosegs[chunk],0);\r
return; // allready in memory\r
}\r
\r
\r
#ifndef AUDIOHEADERLINKED\r
\r
- MM_GetPtr (MEMPTRCONV audiosegs[chunk],compressed);\r
+ MM_GetPtr (MEMPTR audiosegs[chunk],compressed);\r
if (mmerror)\r
return;\r
\r
\r
expanded = *(long far *)source;\r
source += 4; // skip over length\r
- MM_GetPtr (MEMPTRCONV audiosegs[chunk],expanded);\r
+ MM_GetPtr (MEMPTR audiosegs[chunk],expanded);\r
if (mmerror)\r
goto done;\r
CAL_HuffExpand (source,audiosegs[chunk],expanded,audiohuffman);\r
\r
for (i=0;i<NUMSOUNDS;i++,start++)\r
if (audiosegs[start])\r
- MM_SetPurge (MEMPTRCONV audiosegs[start],3); // make purgable\r
+ MM_SetPurge (MEMPTR audiosegs[start],3); // make purgable\r
\r
cachein:\r
\r
// load the chunk into a buffer, either the miscbuffer if it fits, or allocate\r
// a larger buffer\r
//\r
- pos = GRFILEPOS(chunk,gvar);\r
+ pos = GRFILEPOS(chunk);\r
if (pos<0) // $FFFFFFFF start is a sparse tile\r
return;\r
\r
next = chunk +1;\r
- while (GRFILEPOS(next,gvar) == -1) // skip past any sparse tiles\r
+ while (GRFILEPOS(next) == -1) // skip past any sparse tiles\r
next++;\r
\r
- compressed = GRFILEPOS(next,gvar)-pos;\r
+ compressed = GRFILEPOS(next)-pos;\r
\r
lseek(gvar->ca.file.grhandle,pos,SEEK_SET);\r
\r
// load the chunk into a buffer, either the miscbuffer if it fits, or allocate\r
// a larger buffer\r
//\r
- pos = GRFILEPOS(chunk,gvar);\r
+ pos = GRFILEPOS(chunk);\r
if (pos<0) // $FFFFFFFF start is a sparse tile\r
return;\r
\r
while (GRFILEPOS(next) == -1) // skip past any sparse tiles\r
next++;\r
\r
- compressed = GRFILEPOS(next,gvar)-pos;\r
+ compressed = GRFILEPOS(next)-pos;\r
\r
lseek(gvar->ca.file.grhandle,pos,SEEK_SET);\r
\r
// if (pos<0) // $FFFFFFFF start is a sparse map\r
// printf("CA_CacheMap: Tried to load a non existent map!");\r
\r
-// MM_GetPtr(MEMPTRCONV gvar->ca.camapheaderseg[mapnum],sizeof(maptype));\r
+// MM_GetPtr(MEMPTR gvar->ca.camapheaderseg[mapnum],sizeof(maptype));\r
// lseek(maphandle,pos,SEEK_SET);\r
// CA_FarRead (maphandle,(memptr)mapheaderseg[mapnum],sizeof(maptype));\r
// }\r
// else\r
-// MM_SetPurge (MEMPTRCONV mapheaderseg[mapnum], 0, &(gvar->mm));\r
+// MM_SetPurge (MEMPTR mapheaderseg[mapnum], 0, &(gvar->mm));\r
\r
//\r
// load the planes in\r
if (!compressed)\r
continue; // the plane is not used in this game\r
\r
- dest = MEMPTRCONV mapsegs[plane];\r
+ dest = MEMPTR mapsegs[plane];\r
MM_GetPtr(dest,size);\r
\r
lseek(maphandle,pos,SEEK_SET);\r
if (dialog && updatecachebox)\r
updatecachebox ();\r
\r
- pos = GRFILEPOS(i,gvar);\r
+ pos = GRFILEPOS(i);\r
if (pos<0)\r
continue;\r
\r
while (GRFILEPOS(next) == -1) // skip past any sparse tiles\r
next++;\r
\r
- compressed = GRFILEPOS(next,gvar)-pos;\r
+ compressed = GRFILEPOS(next)-pos;\r
endpos = pos+compressed;\r
\r
if (compressed<=BUFFERSIZE)\r
if (next == NUMCHUNKS)\r
continue;\r
\r
- nextpos = GRFILEPOS(next,gvar);\r
- while (GRFILEPOS(++next,gvar) == -1) // skip past any sparse tiles\r
+ nextpos = GRFILEPOS(next);\r
+ while (GRFILEPOS(++next) == -1) // skip past any sparse tiles\r
;\r
- nextendpos = GRFILEPOS(next,gvar);\r
+ nextendpos = GRFILEPOS(next);\r
if (nextpos - endpos <= MAXEMPTYREAD\r
&& nextendpos-pos <= BUFFERSIZE)\r
endpos = nextendpos;\r
-/* Project 16 Source Code~\r
- * Copyright (C) 2012-2017 sparky4 & pngwen & andrius4669 & joncampbell123 & yakui-lover\r
+/* Catacomb Apocalypse Source Code\r
+ * Copyright (C) 1993-2014 Flat Rock Software\r
*\r
- * This file is part of Project 16.\r
- *\r
- * Project 16 is free software; you can redistribute it and/or modify\r
+ * This program 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 3 of the License, or\r
+ * the Free Software Foundation; either version 2 of the License, or\r
* (at your option) any later version.\r
*\r
- * Project 16 is distributed in the hope that it will be useful,\r
+ * This program 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\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
+ * 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
*/\r
\r
// ID_CA.H\r
//#define __DEBUG_2__\r
//#define __DEBUG_CA__\r
//#define __DEBUG_PM__\r
-#define __DEBUG_MM__\r
+//#define __DEBUG_MM__\r
//#define __DEBUG_RF__\r
#define __DEBUG_SPRI__\r
\r
-/* Project 16 Source Code~\r
- * Copyright (C) 2012-2017 sparky4 & pngwen & andrius4669 & joncampbell123 & yakui-lover\r
+/* Catacomb Apocalypse Source Code\r
+ * Copyright (C) 1993-2014 Flat Rock Software\r
*\r
- * This file is part of Project 16.\r
- *\r
- * Project 16 is free software; you can redistribute it and/or modify\r
+ * This program 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 3 of the License, or\r
+ * the Free Software Foundation; either version 2 of the License, or\r
* (at your option) any later version.\r
*\r
- * Project 16 is distributed in the hope that it will be useful,\r
+ * This program 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\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
+ * 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
*/\r
\r
// NEWMM.C\r
#pragma warn -pro\r
#pragma warn -use\r
\r
-\r
-/*\r
-=============================================================================\r
-\r
- LOCAL INFO\r
-\r
-=============================================================================\r
-*/\r
-\r
-//#define LOCKBIT 0x80 // if set in attributes, block cannot be moved\r
-//#define PURGEBITS 3 // 0-3 level, 0= unpurgable, 3= purge first\r
-//#define PURGEMASK 0xfffc\r
-//#define BASEATTRIBUTES 0 // unlocked, non purgable\r
-\r
-//#define MAXUMBS 10\r
-\r
-/*typedef struct mmblockstruct\r
-{\r
- unsigned start,length;\r
- unsigned attributes;\r
- memptr *useptr; // pointer to the segment start\r
- struct mmblockstruct far *next;\r
-} mmblocktype;*/\r
-\r
-\r
-//#define GETNEWBLOCK {if(!(mmnew=mmfree))Quit("MM_GETNEWBLOCK: No free blocks!") ;mmfree=mmfree->next;}\r
-//\r
-\r
-//#define GETNEWBLOCK {if(!gvar->mm.mmfree)MML_ClearBlock(gvar);gvar->mm.mmnew=gvar->mm.mmfree;gvar->mm.mmfree=gvar->mm.mmfree->next;}\r
-\r
-//#define FREEBLOCK(x) {*x->useptr=NULL;x->next=gvar->mm.mmfree;gvar->mm.mmfree=x;}\r
-\r
/*\r
=============================================================================\r
\r
=============================================================================\r
*/\r
\r
-/*mminfotype mminfo;\r
-memptr bufferseg;\r
-boolean mmerror;*/\r
-\r
void (* beforesort) (void);\r
void (* aftersort) (void);\r
+void (* XMSaddr) (void); // far pointer to XMS driver\r
\r
/*\r
=============================================================================\r
\r
=============================================================================\r
*/\r
-\r
-/*boolean mmstarted;\r
-\r
-void far *farheap;\r
-void *nearheap;\r
-\r
-mmblocktype far mmblocks[MAXBLOCKS]\r
- ,far *mmhead,far *mmfree,far *mmrover,far *mmnew;\r
-\r
-boolean bombonerror;*/\r
-\r
-//unsigned totalEMSpages,freeEMSpages,EMSpageframe,EMSpagesmapped,EMShandle;\r
-\r
-void (* XMSaddr) (void); // far pointer to XMS driver\r
-\r
-/*unsigned numUMBs,UMBbase[MAXUMBS];*/\r
-\r
-//==========================================================================\r
-\r
-//\r
-// local prototypes\r
-//\r
-\r
-boolean MML_CheckForEMS (void);\r
-void MML_ShutdownEMS (void);\r
-void MM_MapEMS (void);\r
-boolean MML_CheckForXMS (void);\r
-void MML_ShutdownXMS (void);\r
-//void MML_UseSpace (unsigned segstart, unsigned seglength);\r
-//void MML_ClearBlock (void);\r
-\r
-//==========================================================================\r
#ifndef __16_PM__\r
#if 0\r
static char *ParmStringsexmm[] = {"noems","noxms",""};\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, word 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
// take the given range out of the block\r
//\r
oldend = scan->start + scan->length;\r
- extra = oldend - (segstart+seglength);\r
+ extra = oldend - (segstart+((unsigned)seglength));\r
if (extra < 0)\r
-#ifdef __DEBUG_MM__\r
{\r
printf("========================================\n");\r
printf("start=%x ", scan->start);\r
printf("========================================\n");\r
//return;\r
}\r
-#else\r
- Quit ("MML_UseSpace: Segment spans two blocks!");\r
-#endif\r
\r
if (segstart == scan->start)\r
{\r
====================\r
*/\r
\r
-void MML_ClearBlock (global_game_variables_t *gvar)\r
+void MML_ClearBlock(global_game_variables_t *gvar)\r
{\r
mmblocktype far *scan;//,far *last;\r
\r
scan = scan->next;\r
}\r
\r
- Quit (gvar, "MM_ClearBlock: No purgable blocks!\n");\r
+ printf("MM_ClearBlock: No purgable blocks!\n");\r
}\r
\r
\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;\r
+ //dword length,seglength;\r
+ dword length; word seglength;\r
void far *start;\r
- word segstart,seglength;//,endfree;\r
+ word segstart;//,endfree;\r
\r
if(gvar->mm.mmstarted)\r
- MM_Shutdown (gvar);\r
+ MM_Shutdown(gvar);\r
\r
gvar->mm.mmstarted = true;\r
gvar->mm.bombonerror = true;\r
//\r
gvar->mm.mmhead = NULL;\r
gvar->mm.mmfree = &(gvar->mm.mmblocks[0]);\r
- for (i=0;i<MAXBLOCKS-1;i++)\r
+ for(i=0;i<MAXBLOCKS-1;i++)\r
gvar->mm.mmblocks[i].next = &(gvar->mm.mmblocks[i+1]);\r
gvar->mm.mmblocks[i].next = NULL;\r
\r
gvar->mm.mmnew->next = NULL;\r
gvar->mm.mmrover = gvar->mm.mmhead;\r
\r
-\r
//\r
// get all available near conventional memory segments\r
//\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
gvar->mm.mmrover = gvar->mm.mmhead; // start looking for space after low block\r
\r
- MM_GetPtr (&(gvar->mm.bufferseg),BUFFERSIZE, gvar);\r
+ MM_GetPtr(&(gvar->mm.bufferseg),BUFFERSIZE, gvar);\r
}\r
\r
//==========================================================================\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
====================\r
*/\r
\r
-void MM_GetPtr (memptr *baseptr,dword size, global_game_variables_t *gvar)\r
+void MM_GetPtr (memptr *baseptr, dword size, global_game_variables_t *gvar)\r
{\r
mmblocktype far *scan,far *lastscan,far *endscan\r
- ,far *purge,far *next;\r
+ ,far *purge,far *next;\r
int search;\r
unsigned needed,startseg;\r
\r
GETNEWBLOCK; // fill in start and next after a spot is found\r
gvar->mm.mmnew->length = needed;\r
gvar->mm.mmnew->useptr = baseptr;\r
- gvar->mm.mmnew->attributes = BASEATTRIBUTES;\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
\r
//tryagain:\r
for (search = 0; search<3; search++)\r
-/* Project 16 Source Code~\r
- * Copyright (C) 2012-2017 sparky4 & pngwen & andrius4669 & joncampbell123 & yakui-lover\r
+/* Catacomb Apocalypse Source Code\r
+ * Copyright (C) 1993-2014 Flat Rock Software\r
*\r
- * This file is part of Project 16.\r
- *\r
- * Project 16 is free software; you can redistribute it and/or modify\r
+ * This program 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 3 of the License, or\r
+ * the Free Software Foundation; either version 2 of the License, or\r
* (at your option) any later version.\r
*\r
- * Project 16 is distributed in the hope that it will be useful,\r
+ * This program 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\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
+ * 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
*/\r
\r
// ID_MM.H\r
#ifdef __DEBUG__ // 1 == Debug/Dev ; 0 == Production/final\r
#define OUT_OF_MEM_MSG "MM_GetPtr: Out of memory!\nYou were short :%lu bytes\n"\r
#else\r
-#define OUT_OF_MEM_MSG "\n"\r
+#define OUT_OF_MEM_MSG "\npee\n"\r
#endif\r
\r
//#define GETNEWBLOCK {if(!(mmnew=mmfree))Quit("MM_GETNEWBLOCK: No free blocks!") ;mmfree=mmfree->next;}\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, word seglength, global_game_variables_t *gvar);\r
-void MML_ClearBlock (global_game_variables_t *gvar);\r
+void MML_UseSpace(word segstart, dword 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
void SD_imf_free_music(global_game_variables_t *gvar)\r
{\r
// if (gvar->ca.sd.imf_music) free(gvar->ca.sd.imf_music);\r
- MM_FreePtr(MEMPTRCONV gvar->ca.audiosegs[0], gvar); //TODO make behave like id engine\r
+ MM_FreePtr(MEMPTR gvar->ca.audiosegs[0], gvar); //TODO make behave like id engine\r
gvar->ca.sd.imf_music = gvar->ca.sd.imf_play_ptr = gvar->ca.sd.imf_music_end = NULL;\r
gvar->ca.sd.imf_delay_countdown = 0;\r
}\r
}\r
len -= len & 3;\r
\r
- MM_GetPtr(MEMPTRCONV gvar->ca.audiosegs[0],len, gvar);\r
+ MM_GetPtr(MEMPTR gvar->ca.audiosegs[0],len, gvar);\r
gvar->ca.sd.imf_music = (struct imf_entry *)gvar->ca.audiosegs[0];\r
if (gvar->ca.sd.imf_music == NULL) {\r
close(fd);\r
\r
typedef void _seg * memptr;\r
\r
-#define MEMPTRCONV (memptr *)&\r
+#define MEMPTR (memptr *)&//old is &(memptr)\r
\r
-//bcc\r
-#ifdef __BORLANDC__\r
-#define MEMPTRANDPERCONV &\r
-//#define BYTEFARPTRCONV (unsigned char far *)\r
-//#define SMDPTRANDPERCONV &\r
-//#define SDFPTRANDPERCONV &\r
-//#define OBTPTRANDPERCONV &\r
-//#define SDTPTRANDPERCONV &\r
-#endif\r
-//\r
-\r
-//wcc\r
#ifdef __WATCOMC__ //functions found in borland c but not watcom c\r
-#define MEMPTRANDPERCONV\r
-//#define BYTEFARPTRCONV\r
-//#define SMDPTRANDPERCONV (void *)&\r
-//#define SDFPTRANDPERCONV (struct diskfree_t *)&\r
-//#define OBTPTRANDPERCONV (void const *)&\r
-//#define SDTPTRANDPERCONV (struct dostime_t *)&\r
-\r
#define _argv __argv\r
#define _argc __argc\r
#define geninterrupt(n) int86(n,&CPURegs,&CPURegs);\r
#include <hw/vga/vrs.h>\r
#endif\r
\r
-extern struct glob_game_vars *ggvv;\r
-\r
+//gvar.video.ofs.bufferofs,gvar.video.ofs.displayofs,\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 800//kd=1300 wolf3d=700 cata=600\r
+#define MAXBLOCKS 1024//kd=1300 wolf3d=700 cata=600\r
+//----#define MAXUMBS 12\r
\r
typedef struct mmblockstruct\r
{\r
- unsigned start,length;\r
+ word start,length;\r
+ //word start; dword length;\r
+//++++ word blob; //for data larger than 64k\r
unsigned attributes;\r
memptr *useptr; // pointer to the segment start\r
struct mmblockstruct far *next;\r
\r
#define NUMMAPS 4//39\r
#define NUMSNDCHUNKS 4//3\r
-//#define NUMPICS 4//132//wolf3d wl6\r
+//#define NUMPICS 132//wolf3d wl6\r
\r
#define STRUCTPIC 0\r
-#define CASVT dword //*start var type\r
\r
\r
#define DATADIR "data/"\r
byte far grneeded[NUMCHUNKS];\r
word _seg *audiosegs[NUMSNDCHUNKS];//long\r
\r
- CASVT _seg *grstarts; // array of offsets in egagraph, -1 for sparse//long\r
- CASVT _seg *audiostarts; // array of offsets in audio / audiot//long\r
+ word _seg *grstarts; // array of offsets in egagraph, -1 for sparse//long\r
+ word _seg *audiostarts; // array of offsets in audio / audiot//long\r
\r
#ifdef GRHEADERLINKED\r
huffnode *grhuffman;\r
huffnode audiohuffman[255];\r
#endif\r
\r
- CASVT chunkcomplen,chunkexplen;//long\r
+ long chunkcomplen,chunkexplen;\r
\r
sd_t sd;\r
//TODO: extend! and learn from keen/wolf/catacomb's code wwww\r
\r
vgmFile->dataLen = vgmBaseHdr.lngEOFOffset + 0x04;\r
//vgmFile->data = (UINT8*)malloc(vgmFile->dataLen);\r
- MM_GetPtr(MEMPTRCONV gvar->ca.audiosegs[0], vgmFile->dataLen, gvar);\r
+ MM_GetPtr(MEMPTR gvar->ca.audiosegs[0], vgmFile->dataLen, gvar);\r
vgmFile->data = (UINT8*)gvar->ca.audiosegs[0];\r
if (vgmFile->data == NULL)\r
{\r
void FreeVGMFile(VGM_FILE* vgmFile, global_game_variables_t *gvar)\r
{\r
//if(vgmFile->data){ free(vgmFile->data); vgmFile->data = NULL; }\r
- MM_FreePtr(MEMPTRCONV gvar->ca.audiosegs[0], gvar);\r
+ MM_FreePtr(MEMPTR gvar->ca.audiosegs[0], gvar);\r
if(vgmFile->data) free(vgmFile->data);\r
vgmFile->dataLen = 0;\r
\r
modexFadeOn(4, &gvar.video.palette);\r
#endif\r
\r
- IN_StartAck (&gvar); MM_ShowMemory(&gvar); while (!IN_CheckAck (&gvar)){}\r
+ IN_StartAck (&gvar);\r
+ MM_ShowMemory(&gvar);\r
+ while (!IN_CheckAck (&gvar)){}\r
#ifdef FADE\r
modexPalBlack(); //so player will not see loadings~\r
#endif\r