From 3bcd7fdc88a1ae0a536e7631b50719ae7b320d4b Mon Sep 17 00:00:00 2001 From: sparky4 Date: Mon, 24 Apr 2017 08:26:53 -0500 Subject: [PATCH] 16_ca needs huge amounts of work and I should remember what needs to be done soon[going to port rest of code to borland c some time so we can use the core components of id engine here ][going to add 16_us.c eventually but the debug system and CA_ PM_ and MM_ usage is priority now]older zcroll renamed to xcroll][zcroll is now the pre menu game loop system with PROPER data usage with CAMMPM] added 1st scroll back [i work on CA] --- BCWOLF.LOG | 25 ++++++ __seguse.txt | 164 ++++++++++++++++++---------------------- src/exmmtest.c | 2 +- src/lib/16_ca.c | 28 +++---- src/lib/16_sd.c | 4 +- src/lib/16_t.h | 21 ++++- src/lib/vgmsnd/vgmSnd.c | 4 +- 7 files changed, 140 insertions(+), 108 deletions(-) create mode 100755 BCWOLF.LOG diff --git a/BCWOLF.LOG b/BCWOLF.LOG new file mode 100755 index 00000000..f1a3abc0 --- /dev/null +++ b/BCWOLF.LOG @@ -0,0 +1,25 @@ +VL_MungePic==================================== +4EC3:FFAE (memptr *)&temp +4EC3:FFAE (memptr)temp +460A:4628 &temp +4628:3DC2 temp +=============================================== + SDL_SetDS(): OK +CAL_SetupGrFile: + chunkcomplen size is 350 +CalcHeight() +heightnumerator +211968 15360 828 0 +a 6234 +b 12 +d 8734 +d 8 +ax 4 +al 5 + nx 0 +pee 2408 +gxt gyt nx gx gy +0 0 22528 0 0 +0 0 0 0 22528 +ch 14 +compiled on Apr 19 2017 12:39:47 diff --git a/__seguse.txt b/__seguse.txt index d9d49f56..720dc06a 100755 --- a/__seguse.txt +++ b/__seguse.txt @@ -1,6 +1,6 @@ -------------------------------------------------------------------------------- - ./qkeen.sh start -------------------------------------------------------------------------------- +------------------------------------------------------------------------------- + ./qkeen.sh start +------------------------------------------------------------------------------- 16/keen/id_ca.c:byte _seg *tinf; 16/keen/id_ca.c:unsigned _seg *mapsegs[3]; 16/keen/id_ca.c:maptype _seg *mapheaderseg[NUMMAPS]; @@ -66,11 +66,11 @@ 16/keen/id_vw.h:extern pictabletype _seg *pictable; 16/keen/id_vw.h:extern pictabletype _seg *picmtable; 16/keen/id_vw.h:extern spritetabletype _seg *spritetable; -=============== ./qkeen.sh end =============== -------------------------------------------------------------------------------- - ./qwolf.sh start -------------------------------------------------------------------------------- -==== 16/wf3d8086 ==== +=============== ./qkeen.sh end =============== +------------------------------------------------------------------------------- + ./qwolf.sh start +------------------------------------------------------------------------------- +==== 16/wf3d8086 ==== 16/wf3d8086/contigsc.c:byte _seg *endscalermemory; 16/wf3d8086/contigsc.c: endscalermemory = (void _seg *)(seg+ofs/16); 16/wf3d8086/contigsc.c: t_compshape _seg *shape; @@ -103,13 +103,6 @@ 16/wf3d8086/id_vh.c: src = (byte _seg *)grsegs[STARTTILE8]; 16/wf3d8086/id_vh.c: src = (byte _seg *)grsegs[STARTTILE16]; 16/wf3d8086/id_vh.c: src = (byte _seg *)grsegs[STARTTILE16+i]; -16/wf3d8086/oldscale.c:t_compscale _seg *scaledirectory[MAXSCALEHEIGHT+1]; -16/wf3d8086/oldscale.c:t_compscale _seg *work; -16/wf3d8086/oldscale.c: _fmemcpy ((byte _seg *)(*finalspot),(byte _seg *)work,totalsize); -16/wf3d8086/oldscale.c: t_compshape _seg *shape; -16/wf3d8086/oldscale.c: t_compscale _seg *comptable; -16/wf3d8086/oldscale.c: t_compshape _seg *shape; -16/wf3d8086/oldscale.c: t_compscale _seg *comptable; 16/wf3d8086/wl_debug.c: spritetype _seg *block; 16/wf3d8086/wl_debug.c:extern word _seg *DigiList; 16/wf3d8086/wl_menu.c: fontstruct _seg *font; @@ -137,78 +130,71 @@ 16/wf3d8086/id_vh.h:extern pictabletype _seg *picmtable; 16/wf3d8086/id_vh.h:extern spritetabletype _seg *spritetable; 16/wf3d8086/wl_def.h:extern t_compscale _seg *scaledirectory[MAXSCALEHEIGHT+1]; -==== 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/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/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; 16/Catacomb3D/C3_GAME.C: text = (char _seg *)grsegs[LEVEL1TEXT+mapon]; 16/Catacomb3D/C3_GAME.C: src = (byte _seg *)grsegs[STARTTILE8]; @@ -277,7 +263,7 @@ 16/Catacomb3D/ID_VW.H:extern pictabletype _seg *pictable; 16/Catacomb3D/ID_VW.H:extern pictabletype _seg *picmtable; 16/Catacomb3D/ID_VW.H:extern spritetabletype _seg *spritetable; -==== 16/CatacombApocalypse ==== +==== 16/CatacombApocalypse ==== 16/CatacombApocalypse/C6_GAME.C: text = (char _seg *)grsegs[LEVEL1TEXT+mapon]; 16/CatacombApocalypse/C6_GAME.C: src = (byte _seg *)grsegs[STARTTILE8]; 16/CatacombApocalypse/C6_GAME.C: src = (byte _seg *)grsegs[STARTTILE16]; @@ -349,4 +335,4 @@ 16/CatacombApocalypse/ID_VW.H:extern pictabletype _seg *picmtable; 16/CatacombApocalypse/ID_VW.H:extern spritetabletype _seg *spritetable; 16/CatacombApocalypse/ID_VW.H:void VWL_MeasureString (char far *string, word *width, word *height, fontstruct _seg *font); -=============== ./qcata.sh end =============== +=============== ./qcata.sh end =============== diff --git a/src/exmmtest.c b/src/exmmtest.c index 8742c046..ea73aa99 100755 --- a/src/exmmtest.c +++ b/src/exmmtest.c @@ -57,7 +57,7 @@ #define BBUFNAME gvar.mm.bufferseg//bigbuffer //#define INITBBUF static memptr BBUFNAME; -#define BBUFPTR MEMPTR BBUFNAME +#define BBUFPTR MEMPTRCONV BBUFNAME #ifdef __BORLANDC__ #define BBUF (memptr *)BBUFPTR diff --git a/src/lib/16_ca.c b/src/lib/16_ca.c index 8dd2da0a..64c6674a 100755 --- a/src/lib/16_ca.c +++ b/src/lib/16_ca.c @@ -1041,7 +1041,9 @@ void CAL_SetupGrFile (global_game_variables_t *gvar) { char fname[13]; int handle; +#if NUMPICS>0 memptr compseg; +#endif #ifdef GRHEADERLINKED @@ -1069,7 +1071,7 @@ void CAL_SetupGrFile (global_game_variables_t *gvar) // // load the data offsets from ???head.ext // - MM_GetPtr (MEMPTR gvar->ca.grstarts,(NUMCHUNKS+1)*FILEPOSSIZE, gvar); + MM_GetPtr (MEMPTRCONV gvar->ca.grstarts,(NUMCHUNKS+1)*FILEPOSSIZE, gvar); strcpy(fname,GHEADNAME); strcat(fname,EXTENSION); @@ -1100,7 +1102,7 @@ void CAL_SetupGrFile (global_game_variables_t *gvar) // load the pic and sprite headers into the arrays in the data segment // #if NUMPICS>0 - MM_GetPtr(MEMPTR gvar->video.pictable,NUMPICS*sizeof(pictabletype),gvar); + MM_GetPtr(MEMPTRCONV gvar->video.pictable,NUMPICS*sizeof(pictabletype),gvar); CAL_GetGrChunkLength(STRUCTPIC,gvar); // position file pointer MM_GetPtr(&compseg,gvar->ca.chunkcomplen, gvar); CA_FarRead (gvar->ca.file.grhandle,compseg,gvar->ca.chunkcomplen,gvar); @@ -1109,7 +1111,7 @@ void CAL_SetupGrFile (global_game_variables_t *gvar) #endif #if NUMPICM>0 - MM_GetPtr(MEMPTR picmtable,NUMPICM*sizeof(pictabletype)); + MM_GetPtr(MEMPTRCONV picmtable,NUMPICM*sizeof(pictabletype)); CAL_GetGrChunkLength(STRUCTPICM); // position file pointer MM_GetPtr(&compseg,gvar->ca.chunkcomplen); CA_FarRead (gvar->ca.file.grhandle,compseg,gvar->ca.chunkcomplen); @@ -1118,7 +1120,7 @@ void CAL_SetupGrFile (global_game_variables_t *gvar) #endif #if NUMSPRITES>0 - MM_GetPtr(MEMPTR spritetable,NUMSPRITES*sizeof(spritetabletype)); + MM_GetPtr(MEMPTRCONV spritetable,NUMSPRITES*sizeof(spritetabletype)); CAL_GetGrChunkLength(STRUCTSPRITE); // position file pointer MM_GetPtr(&compseg,gvar->ca.chunkcomplen); CA_FarRead (gvar->ca.file.grhandle,compseg,gvar->ca.chunkcomplen); @@ -1154,7 +1156,7 @@ void CAL_SetupMapFile (global_game_variables_t *gvar) O_RDONLY | O_BINARY, S_IREAD)) == -1) Quit (gvar, "Can't open maphead.mph"); length = filelength(handle); - MM_GetPtr (MEMPTR gvar->ca.tinf,length,gvar); + MM_GetPtr (MEMPTRCONV gvar->ca.tinf,length,gvar); CA_FarRead(handle, gvar->ca.tinf, length,gvar); close(handle); //#else @@ -1205,7 +1207,7 @@ void CAL_SetupMapFile (global_game_variables_t *gvar) O_RDONLY | O_BINARY, S_IREAD)) == -1) Quit (gvar, "Can't open AUDIOHED.16""!"); length = filelength(handle); - MM_GetPtr (MEMPTR audiostarts,length); + MM_GetPtr (MEMPTRCONV audiostarts,length); CA_FarRead(handle, (byte far *)audiostarts, length); close(handle); #else @@ -1329,7 +1331,7 @@ void CA_CacheAudioChunk (int chunk) if (audiosegs[chunk]) { - MM_SetPurge (MEMPTR audiosegs[chunk],0); + MM_SetPurge (MEMPTRCONV audiosegs[chunk],0); return; // allready in memory } @@ -1351,7 +1353,7 @@ void CA_CacheAudioChunk (int chunk) #ifndef AUDIOHEADERLINKED - MM_GetPtr (MEMPTR audiosegs[chunk],compressed); + MM_GetPtr (MEMPTRCONV audiosegs[chunk],compressed); if (mmerror) return; @@ -1376,7 +1378,7 @@ void CA_CacheAudioChunk (int chunk) expanded = *(long far *)source; source += 4; // skip over length - MM_GetPtr (MEMPTR audiosegs[chunk],expanded); + MM_GetPtr (MEMPTRCONV audiosegs[chunk],expanded); if (mmerror) goto done; CAL_HuffExpand (source,audiosegs[chunk],expanded,audiohuffman); @@ -1417,7 +1419,7 @@ void CA_LoadAllSounds (void) for (i=0;ica.camapheaderseg[mapnum],sizeof(maptype)); +// MM_GetPtr(MEMPTRCONV gvar->ca.camapheaderseg[mapnum],sizeof(maptype)); // lseek(maphandle,pos,SEEK_SET); // CA_FarRead (maphandle,(memptr)mapheaderseg[mapnum],sizeof(maptype)); // } // else -// MM_SetPurge (MEMPTR mapheaderseg[mapnum], 0, &(gvar->mm)); +// MM_SetPurge (MEMPTRCONV mapheaderseg[mapnum], 0, &(gvar->mm)); // // load the planes in @@ -1968,7 +1970,7 @@ void CA_CacheMap (global_game_variables_t *gvar) if (!compressed) continue; // the plane is not used in this game - dest = MEMPTR mapsegs[plane]; + dest = MEMPTRCONV mapsegs[plane]; MM_GetPtr(dest,size); lseek(maphandle,pos,SEEK_SET); diff --git a/src/lib/16_sd.c b/src/lib/16_sd.c index b82ff3e8..610f7ed0 100755 --- a/src/lib/16_sd.c +++ b/src/lib/16_sd.c @@ -226,7 +226,7 @@ void SD_Initimf(global_game_variables_t *gvar) void SD_imf_free_music(global_game_variables_t *gvar) { // if (gvar->ca.sd.imf_music) free(gvar->ca.sd.imf_music); - MM_FreePtr(MEMPTR gvar->ca.audiosegs[0], gvar); //TODO make behave like id engine + MM_FreePtr(MEMPTRCONV gvar->ca.audiosegs[0], gvar); //TODO make behave like id engine gvar->ca.sd.imf_music = gvar->ca.sd.imf_play_ptr = gvar->ca.sd.imf_music_end = NULL; gvar->ca.sd.imf_delay_countdown = 0; } @@ -256,7 +256,7 @@ int SD_imf_load_music(const char *path, global_game_variables_t *gvar) } len -= len & 3; - MM_GetPtr(MEMPTR gvar->ca.audiosegs[0],len, gvar); + MM_GetPtr(MEMPTRCONV gvar->ca.audiosegs[0],len, gvar); gvar->ca.sd.imf_music = (struct imf_entry *)gvar->ca.audiosegs[0]; if (gvar->ca.sd.imf_music == NULL) { close(fd); diff --git a/src/lib/16_t.h b/src/lib/16_t.h index ce881ae8..764bf51e 100755 --- a/src/lib/16_t.h +++ b/src/lib/16_t.h @@ -65,9 +65,28 @@ MK_FP(segment value, 0)*/ typedef void _seg * memptr; -#define MEMPTR (memptr *)&//old is &(memptr) +#define MEMPTRCONV (memptr *)& +//bcc +#ifdef __BORLANDC__ +#define MEMPTRANDPERCONV & +//#define BYTEFARPTRCONV (unsigned char far *) +//#define SMDPTRANDPERCONV & +//#define SDFPTRANDPERCONV & +//#define OBTPTRANDPERCONV & +//#define SDTPTRANDPERCONV & +#endif +// + +//wcc #ifdef __WATCOMC__ //functions found in borland c but not watcom c +#define MEMPTRANDPERCONV +//#define BYTEFARPTRCONV +//#define SMDPTRANDPERCONV (void *)& +//#define SDFPTRANDPERCONV (struct diskfree_t *)& +//#define OBTPTRANDPERCONV (void const *)& +//#define SDTPTRANDPERCONV (struct dostime_t *)& + #define _argv __argv #define _argc __argc #define geninterrupt(n) int86(n,&CPURegs,&CPURegs); diff --git a/src/lib/vgmsnd/vgmSnd.c b/src/lib/vgmsnd/vgmSnd.c index 30d3a383..2cfd8690 100755 --- a/src/lib/vgmsnd/vgmSnd.c +++ b/src/lib/vgmsnd/vgmSnd.c @@ -172,7 +172,7 @@ UINT8 OpenVGMFile(const char* FileName, VGM_FILE* vgmFile, global_game_variables vgmFile->dataLen = vgmBaseHdr.lngEOFOffset + 0x04; //vgmFile->data = (UINT8*)malloc(vgmFile->dataLen); - MM_GetPtr(MEMPTR gvar->ca.audiosegs[0], vgmFile->dataLen, gvar); + MM_GetPtr(MEMPTRCONV gvar->ca.audiosegs[0], vgmFile->dataLen, gvar); vgmFile->data = (UINT8*)gvar->ca.audiosegs[0]; if (vgmFile->data == NULL) { @@ -217,7 +217,7 @@ UINT8 OpenVGMFile(const char* FileName, VGM_FILE* vgmFile, global_game_variables void FreeVGMFile(VGM_FILE* vgmFile, global_game_variables_t *gvar) { //if(vgmFile->data){ free(vgmFile->data); vgmFile->data = NULL; } - MM_FreePtr(MEMPTR gvar->ca.audiosegs[0], gvar); + MM_FreePtr(MEMPTRCONV gvar->ca.audiosegs[0], gvar); if(vgmFile->data) free(vgmFile->data); vgmFile->dataLen = 0; -- 2.39.5