From: sparky4 Date: Mon, 24 Apr 2017 13:37:57 +0000 (-0500) Subject: updating xcrollbroke commit X-Git-Url: http://4ch.mooo.com/gitweb/?p=16.git;a=commitdiff_plain;h=767a51ba929d4110350572d014665644fa2288d5 updating xcrollbroke commit --- diff --git a/makefile b/makefile index 5c21b2ad..575e318f 100755 --- a/makefile +++ b/makefile @@ -119,7 +119,7 @@ UPXQ=-qqq # # compile flags # -S_FLAGS=-sg -st -of+ -zu -zdf -zff -zgf -k32768#24576 +S_FLAGS=-sg -st -of+ -zu -zdp -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 diff --git a/src/16.c b/src/16.c index 7f22e1b6..eb64dde7 100755 --- a/src/16.c +++ b/src/16.c @@ -54,6 +54,6 @@ main(int argc, char *argv[]) //++++ DemoLoop();//to be defined in 16_tail -//++++ Quit("Demo loop exited???"); +//++++ Quit(gvar, "Demo loop exited???"); } diff --git a/src/lib/16_ca.c b/src/lib/16_ca.c index 64c6674a..ccab39ba 100755 --- a/src/lib/16_ca.c +++ b/src/lib/16_ca.c @@ -36,7 +36,7 @@ loaded into the data segment #pragma warn -pro #pragma warn -use -//#define THREEBYTEGRSTARTS +#define THREEBYTEGRSTARTS //https://github.com/open-watcom/open-watcom-v2/issues/279#issuecomment-244587566 for _seg //http://www.shikadi.net/moddingwiki/GameMaps_Format for info on the code /* @@ -121,9 +121,9 @@ huffnode audiohuffman[255]; int grhandle; // handle to EGAGRAPH int maphandle; // handle to MAPTEMP / GAMEMAPS int audiohandle; // handle to AUDIOT / AUDIO - -long c hunkcomplen,c hunkexplen; - +*/ +long chunkcomplen,chunkexplen; +/* SDMode oldsoundmode; @@ -138,14 +138,14 @@ void CAL_CarmackExpand (unsigned far *source, unsigned far *dest, #ifdef THREEBYTEGRSTARTS #define FILEPOSSIZE 3 //#define GRFILEPOS(c) (*(long far *)(((byte far *)grstarts)+(c)*3)&0xffffff) -long GRFILEPOS(int c, global_game_variables_t *gvar) +CASVT GRFILEPOS(int c, global_game_variables_t *gvar) { - long value; + CASVT value; int offset; offset = c*3; - value = *(long far *)(((byte far *)gvar->ca.grstarts)+offset); + value = *(CASVT far *)(((byte far *)gvar->ca.grstarts)+offset); value &= 0x00ffffffl; @@ -156,7 +156,11 @@ long GRFILEPOS(int c, global_game_variables_t *gvar) }; #else #define FILEPOSSIZE 4 -#define GRFILEPOS(c) (gvar->ca.grstarts[c]) +//#define GRFILEPOS(c) (gvar->ca.grstarts[c]) +CASVT GRFILEPOS(int c, global_game_variables_t *gvar) +{ + return gvar->ca.grstarts[c]; +} #endif /* @@ -208,9 +212,9 @@ void CA_CloseDebug(global_game_variables_t *gvar) void CAL_GetGrChunkLength (int chunk,global_game_variables_t *gvar) { - lseek(gvar->ca.file.grhandle,GRFILEPOS(chunk),SEEK_SET); + lseek(gvar->ca.file.grhandle,GRFILEPOS(chunk,gvar),SEEK_SET); read(gvar->ca.file.grhandle,&gvar->ca.chunkexplen,sizeof(gvar->ca.chunkexplen)); - gvar->ca.chunkcomplen = GRFILEPOS(chunk+1)-GRFILEPOS(chunk)-4; + gvar->ca.chunkcomplen = GRFILEPOS(chunk+1,gvar)-GRFILEPOS(chunk,gvar)-4; } @@ -1104,7 +1108,10 @@ void CAL_SetupGrFile (global_game_variables_t *gvar) #if NUMPICS>0 MM_GetPtr(MEMPTRCONV gvar->video.pictable,NUMPICS*sizeof(pictabletype),gvar); CAL_GetGrChunkLength(STRUCTPIC,gvar); // position file pointer - MM_GetPtr(&compseg,gvar->ca.chunkcomplen, gvar); + printf("CAL_SetupGrFile:\n"); + printf(" gvar->ca.chunkcomplen size is %lu\n", gvar->ca.chunkcomplen); + MM_GetPtr(&compseg,gvar->ca.chunkcomplen,gvar); + IN_Ack(gvar); CA_FarRead (gvar->ca.file.grhandle,compseg,gvar->ca.chunkcomplen,gvar); CAL_HuffExpand (compseg, (byte far *)gvar->video.pictable,NUMPICS*sizeof(pictabletype),gvar->ca.grhuffman); MM_FreePtr(&compseg,gvar); @@ -1175,11 +1182,11 @@ void CAL_SetupMapFile (global_game_variables_t *gvar) /*#ifdef MAPHEADERLINKED if ((maphandle = open("GAMEMAPS.16"ENSION, O_RDONLY | O_BINARY, S_IREAD)) == -1) - Quit ("Can't open GAMEMAPS.16"ENSION"!"); + Quit (gvar, "Can't open GAMEMAPS.16"ENSION"!"); #else if ((maphandle = open("MAPTEMP.16"ENSION, O_RDONLY | O_BINARY, S_IREAD)) == -1) - Quit ("Can't open MAPTEMP.16"ENSION"!"); + Quit (gvar, "Can't open MAPTEMP.16"ENSION"!"); #endif*/ } @@ -1799,15 +1806,15 @@ void CAL_ReadGrChunk (int chunk) // load the chunk into a buffer, either the miscbuffer if it fits, or allocate // a larger buffer // - pos = GRFILEPOS(chunk); + pos = GRFILEPOS(chunk,gvar); if (pos<0) // $FFFFFFFF start is a sparse tile return; next = chunk +1; - while (GRFILEPOS(next) == -1) // skip past any sparse tiles + while (GRFILEPOS(next,gvar) == -1) // skip past any sparse tiles next++; - compressed = GRFILEPOS(next)-pos; + compressed = GRFILEPOS(next,gvar)-pos; lseek(gvar->ca.file.grhandle,pos,SEEK_SET); @@ -1867,7 +1874,7 @@ void CA_CacheGrChunk (int chunk) // load the chunk into a buffer, either the miscbuffer if it fits, or allocate // a larger buffer // - pos = GRFILEPOS(chunk); + pos = GRFILEPOS(chunk,gvar); if (pos<0) // $FFFFFFFF start is a sparse tile return; @@ -1875,7 +1882,7 @@ void CA_CacheGrChunk (int chunk) while (GRFILEPOS(next) == -1) // skip past any sparse tiles next++; - compressed = GRFILEPOS(next)-pos; + compressed = GRFILEPOS(next,gvar)-pos; lseek(gvar->ca.file.grhandle,pos,SEEK_SET); @@ -2354,7 +2361,7 @@ void CAL_CacheMarks (char *title, global_game_variables_t *gvar) if (dialog && updatecachebox) updatecachebox (); - pos = GRFILEPOS(i); + pos = GRFILEPOS(i,gvar); if (pos<0) continue; @@ -2362,7 +2369,7 @@ void CAL_CacheMarks (char *title, global_game_variables_t *gvar) while (GRFILEPOS(next) == -1) // skip past any sparse tiles next++; - compressed = GRFILEPOS(next)-pos; + compressed = GRFILEPOS(next,gvar)-pos; endpos = pos+compressed; if (compressed<=BUFFERSIZE) @@ -2385,10 +2392,10 @@ void CAL_CacheMarks (char *title, global_game_variables_t *gvar) if (next == NUMCHUNKS) continue; - nextpos = GRFILEPOS(next); - while (GRFILEPOS(++next) == -1) // skip past any sparse tiles + nextpos = GRFILEPOS(next,gvar); + while (GRFILEPOS(++next,gvar) == -1) // skip past any sparse tiles ; - nextendpos = GRFILEPOS(next); + nextendpos = GRFILEPOS(next,gvar); if (nextpos - endpos <= MAXEMPTYREAD && nextendpos-pos <= BUFFERSIZE) endpos = nextendpos; diff --git a/src/lib/16_mm.c b/src/lib/16_mm.c index d43432fe..b6636ddf 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 @@ -28,7 +32,7 @@ Primary coder: John Carmack RELIES ON --------- -Quit (global_game_variables_t *gvar, char *error) function +Quit (gvar, global_game_variables_t *gvar, char *error) function WORK TO DO @@ -54,6 +58,37 @@ Open Watcom port by sparky4 #pragma warn -pro #pragma warn -use +/* +============================================================================= + + LOCAL INFO + +============================================================================= +*/ + +#define LOCKBIT 0x80 // if set in attributes, block cannot be moved +#define PURGEBITS 3 // 0-3 level, 0= unpurgable, 3= purge first +#define PURGEMASK 0xfffc +#define BASEATTRIBUTES 0 // unlocked, non purgable + +//#define MAXUMBS 10 + +/*typedef struct mmblockstruct +{ + unsigned start,length; + unsigned attributes; + memptr *useptr; // pointer to the segment start + struct mmblockstruct far *next; +} mmblocktype;*/ + + +//#define GETNEWBLOCK {if(!(mmnew=mmfree))Quit("MM_GETNEWBLOCK: No free blocks!") ;mmfree=mmfree->next;} +// + +#define GETNEWBLOCK {if(!gvar->mm.mmfree)MML_ClearBlock(gvar);gvar->mm.mmnew=gvar->mm.mmfree;gvar->mm.mmfree=gvar->mm.mmfree->next;} + +#define FREEBLOCK(x) {*x->useptr=NULL;x->next=gvar->mm.mmfree;gvar->mm.mmfree=x;} + /* ============================================================================= @@ -62,9 +97,12 @@ Open Watcom port by sparky4 ============================================================================= */ +/*mminfotype mminfo; +memptr bufferseg; +boolean mmerror;*/ + void (* beforesort) (void); void (* aftersort) (void); -void (* XMSaddr) (void); // far pointer to XMS driver /* ============================================================================= @@ -73,6 +111,38 @@ void (* XMSaddr) (void); // far pointer to XMS driver ============================================================================= */ + +/*boolean mmstarted; + +void far *farheap; +void *nearheap; + +mmblocktype far mmblocks[MAXBLOCKS] + ,far *mmhead,far *mmfree,far *mmrover,far *mmnew; + +boolean bombonerror;*/ + +//unsigned totalEMSpages,freeEMSpages,EMSpageframe,EMSpagesmapped,EMShandle; + +void (* XMSaddr) (void); // far pointer to XMS driver + +/*unsigned numUMBs,UMBbase[MAXUMBS];*/ + +//========================================================================== + +// +// local prototypes +// + +boolean MML_CheckForEMS (void); +void MML_ShutdownEMS (void); +void MM_MapEMS (void); +boolean MML_CheckForXMS (void); +void MML_ShutdownXMS (void); +//void MML_UseSpace (unsigned segstart, unsigned seglength); +//void MML_ClearBlock (void); + +//========================================================================== #ifndef __16_PM__ #if 0 static char *ParmStringsexmm[] = {"noems","noxms",""}; @@ -624,10 +694,10 @@ 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 (unsigned segstart, unsigned seglength, global_game_variables_t *gvar) { mmblocktype far *scan,far *last; - word oldend; + unsigned oldend; sdword extra; //word segm=1; @@ -656,8 +726,9 @@ void MML_UseSpace(word segstart, dword seglength, global_game_variables_t *gvar) // take the given range out of the block // oldend = scan->start + scan->length; - extra = oldend - (segstart+((unsigned)seglength)); + extra = oldend - (segstart+seglength); if (extra < 0) +#ifdef __DEBUG_MM__ { printf("========================================\n"); printf("start=%x ", scan->start); @@ -671,6 +742,9 @@ void MML_UseSpace(word segstart, dword seglength, global_game_variables_t *gvar) printf("========================================\n"); //return; } +#else + Quit (gvar, "MML_UseSpace: Segment spans two blocks!"); +#endif if (segstart == scan->start) { @@ -707,7 +781,7 @@ void MML_UseSpace(word segstart, dword seglength, global_game_variables_t *gvar) ==================== */ -void MML_ClearBlock(global_game_variables_t *gvar) +void MML_ClearBlock (global_game_variables_t *gvar) { mmblocktype far *scan;//,far *last; @@ -723,7 +797,7 @@ void MML_ClearBlock(global_game_variables_t *gvar) scan = scan->next; } - printf("MM_ClearBlock: No purgable blocks!\n"); + Quit (gvar, "MM_ClearBlock: No purgable blocks!\n"); } @@ -740,26 +814,24 @@ 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; - dword length; word seglength; + dword length; void far *start; - word segstart;//,endfree; + unsigned segstart,seglength;//,endfree; if(gvar->mm.mmstarted) - MM_Shutdown(gvar); + MM_Shutdown (gvar); gvar->mm.mmstarted = true; gvar->mm.bombonerror = true; - // // set up the linked list (everything in the free list; // gvar->mm.mmhead = NULL; gvar->mm.mmfree = &(gvar->mm.mmblocks[0]); - for(i=0;imm.mmblocks[i].next = &(gvar->mm.mmblocks[i+1]); gvar->mm.mmblocks[i].next = NULL; @@ -774,6 +846,7 @@ void MM_Startup(global_game_variables_t *gvar) gvar->mm.mmnew->next = NULL; gvar->mm.mmrover = gvar->mm.mmhead; + // // get all available near conventional memory segments // @@ -793,7 +866,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 +887,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); @@ -869,7 +942,7 @@ xmsskip: // gvar->mm.mmrover = gvar->mm.mmhead; // start looking for space after low block - MM_GetPtr(&(gvar->mm.bufferseg),BUFFERSIZE, gvar); + MM_GetPtr (&(gvar->mm.bufferseg),BUFFERSIZE, gvar); } //========================================================================== @@ -884,7 +957,7 @@ xmsskip: ==================== */ -void MM_Shutdown(global_game_variables_t *gvar) +void MM_Shutdown (global_game_variables_t *gvar) { if(!(gvar->mm.mmstarted)) return; @@ -922,10 +995,10 @@ void MM_Shutdown(global_game_variables_t *gvar) ==================== */ -void MM_GetPtr (memptr *baseptr, dword size, global_game_variables_t *gvar) +void MM_GetPtr (memptr *baseptr,dword size, global_game_variables_t *gvar) { mmblocktype far *scan,far *lastscan,far *endscan - ,far *purge,far *next; + ,far *purge,far *next; int search; unsigned needed,startseg; @@ -934,18 +1007,19 @@ void MM_GetPtr (memptr *baseptr, dword size, global_game_variables_t *gvar) GETNEWBLOCK; // fill in start and next after a spot is found gvar->mm.mmnew->length = needed; gvar->mm.mmnew->useptr = baseptr; + gvar->mm.mmnew->attributes = BASEATTRIBUTES; //if(gvar->mm.mmnew->useptr==NULL){ #ifdef __DEBUG_MM__ + printf("MM_GetPtr\n"); if(dbg_debugmm>0){ - printf("MM_GetPtr\n"); //%04x printf(" baseptr=%Fp ", baseptr); printf("useptr=%Fp\n", gvar->mm.mmnew->useptr); printf(" *baseptr=%Fp ", *baseptr); printf("*useptr=%Fp\n", *(gvar->mm.mmnew->useptr)); printf(" &baseptr=%Fp ", &baseptr); printf("&useptr=%Fp\n", &(gvar->mm.mmnew->useptr)); } + printf(" size is %lu\n", size); #endif - //Quit(gvar, "gvar->mm.mmnew->useptr==NULL"); } - gvar->mm.mmnew->attributes = BASEATTRIBUTES; + //Quit (gvar, "gvar->mm.mmnew->useptr==NULL"); } //tryagain: for (search = 0; search<3; search++) @@ -1023,7 +1097,7 @@ void MM_GetPtr (memptr *baseptr, dword size, global_game_variables_t *gvar) //heapdump(); #endif printf(OUT_OF_MEM_MSG,(size-gvar->mmi.nearheap)); - Quit(gvar, "for stability reasons the program will shut down! wwww\n"); + Quit (gvar, "for stability reasons the program will shut down! wwww\n"); } else gvar->mm.mmerror = true; @@ -1051,13 +1125,13 @@ void MM_FreePtr (memptr *baseptr, global_game_variables_t *gvar) if (baseptr == gvar->mm.mmrover->useptr) // removed the last allocated block gvar->mm.mmrover = gvar->mm.mmhead; - while(scan->useptr != baseptr && scan) + while (scan->useptr != baseptr && scan) { last = scan; scan = scan->next; } - if(!scan) + if (!scan) Quit (gvar, "MM_FreePtr: Block not found!"); last->next = scan->next; @@ -1094,7 +1168,7 @@ void MM_SetPurge (memptr *baseptr, int purge, global_game_variables_t *gvar) else if (gvar->mm.mmrover == start) Quit (gvar, "MM_SetPurge: Block not found!"); - } while(1); + } while (1); gvar->mm.mmrover->attributes &= ~PURGEBITS; gvar->mm.mmrover->attributes |= purge; @@ -1169,7 +1243,7 @@ void MM_SortMem (global_game_variables_t *gvar) playing += STARTADLIBSOUNDS; break; } - MM_SetLock((memptr *)&audiosegs[playing],true); + MM_SetLock(MEMPTRCONV audiosegs[playing],true); } @@ -1177,16 +1251,16 @@ void MM_SortMem (global_game_variables_t *gvar) oldborder = gvar->video.bordercolor; gvar->video.bordercolor = modexPalOverscan(15); - if(beforesort) + if (beforesort) beforesort(); scan = gvar->mm.mmhead; last = NULL; // shut up compiler warning - while(scan) + while (scan) { - if(scan->attributes & LOCKBIT) + if (scan->attributes & LOCKBIT) { // // block is locked, so try to pile later blocks right after it @@ -1195,7 +1269,7 @@ void MM_SortMem (global_game_variables_t *gvar) } else { - if(scan->attributes & PURGEBITS) + if (scan->attributes & PURGEBITS) { // // throw out the purgable block @@ -1211,12 +1285,12 @@ void MM_SortMem (global_game_variables_t *gvar) // // push the non purgable block on top of the last moved block // - if(scan->start != start) + if (scan->start != start) { length = scan->length; source = scan->start; dest = start; - while(length > 0xf00) + while (length > 0xf00) { movedata(source,0,dest,0,0xf00*16); length -= 0xf00; @@ -1238,7 +1312,7 @@ void MM_SortMem (global_game_variables_t *gvar) gvar->mm.mmrover = gvar->mm.mmhead; - if(aftersort) + if (aftersort) aftersort(); VL_ColorBorder (oldborder, &gvar->video); diff --git a/src/lib/16_mm.h b/src/lib/16_mm.h index f890a3bb..4516571d 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 @@ -29,7 +33,7 @@ #ifdef __DEBUG__ // 1 == Debug/Dev ; 0 == Production/final #define OUT_OF_MEM_MSG "MM_GetPtr: Out of memory!\nYou were short :%lu bytes\n" #else -#define OUT_OF_MEM_MSG "\npee\n" +#define OUT_OF_MEM_MSG "\n" #endif //#define GETNEWBLOCK {if(!(mmnew=mmfree))Quit("MM_GETNEWBLOCK: No free blocks!") ;mmfree=mmfree->next;} @@ -37,8 +41,8 @@ #define FREEBLOCK(x) {*x->useptr=NULL;x->next=gvar->mm.mmfree;gvar->mm.mmfree=x;} -#define SAVENEARHEAP 0x200 // space to leave in data segment -#define SAVEFARHEAP 0x400 // space to leave in far heap +#define SAVENEARHEAP 0x400 // space to leave in data segment +#define SAVEFARHEAP 0 // space to leave in far heap #define BUFFERSIZE 0x1000 // miscelanious, allways available buffer @@ -102,7 +106,7 @@ extern void (* beforesort) (void); extern void (* aftersort) (void); -extern void (* XMSaddr) (void); // far pointer to XMS driver +//extern void (* XMSaddr) (void); // far pointer to XMS driver extern dword XMSDriver; extern word XMSVer; @@ -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 (unsigned segstart, unsigned 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_pm.c b/src/lib/16_pm.c index 858bd4b9..ce81eb4a 100755 --- a/src/lib/16_pm.c +++ b/src/lib/16_pm.c @@ -1420,7 +1420,7 @@ PM_NextFrame(global_game_variables_t *gvar) { char buf[40]; sprintf(buf,"PM_NextFrame: Page %d is locked",i); - Quit(gvar, buf); + Quit (gvar, buf); } } //#endif diff --git a/src/lib/16_tdef.h b/src/lib/16_tdef.h index f45195d6..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; @@ -660,9 +657,10 @@ typedef struct #define NUMMAPS 4//39 #define NUMSNDCHUNKS 4//3 -//#define NUMPICS 132//wolf3d wl6 +//#define NUMPICS 4//132//wolf3d wl6 #define STRUCTPIC 0 +#define CASVT dword //*start var type #define DATADIR "data/" @@ -718,8 +716,8 @@ typedef struct //TODO: USE THIS!!!! byte far grneeded[NUMCHUNKS]; word _seg *audiosegs[NUMSNDCHUNKS];//long - word _seg *grstarts; // array of offsets in egagraph, -1 for sparse//long - word _seg *audiostarts; // array of offsets in audio / audiot//long + CASVT _seg *grstarts; // array of offsets in egagraph, -1 for sparse//long + CASVT _seg *audiostarts; // array of offsets in audio / audiot//long #ifdef GRHEADERLINKED huffnode *grhuffman; @@ -733,7 +731,7 @@ typedef struct //TODO: USE THIS!!!! huffnode audiohuffman[255]; #endif - long chunkcomplen,chunkexplen; + CASVT chunkcomplen,chunkexplen;//long sd_t sd; //TODO: extend! and learn from keen/wolf/catacomb's code wwww diff --git a/src/lib/doslib b/src/lib/doslib index 059ad77f..638c985b 160000 --- a/src/lib/doslib +++ b/src/lib/doslib @@ -1 +1 @@ -Subproject commit 059ad77f65a48b9501eca26c0d4811960ada9e54 +Subproject commit 638c985bf9cf640e2dfc70dda473ca4f6fbfca31 diff --git a/src/sountest.c b/src/sountest.c index d15a5462..94d2f254 100755 --- a/src/sountest.c +++ b/src/sountest.c @@ -70,7 +70,7 @@ void main(int argc, char near *argv[]) //FMSetVoice(0, &testInst); if(!init_adlib()) { - Quit(&gvar, "Cannot init library"); + Quit (&gvar, "Cannot init library"); } if (adlib_fm_voices > 9) diff --git a/src/xcroll.c b/src/xcroll.c index ed02457e..9e968ae5 100755 --- a/src/xcroll.c +++ b/src/xcroll.c @@ -121,9 +121,7 @@ void main(int argc, char *argv[]) modexFadeOn(4, &gvar.video.palette); #endif - IN_StartAck (&gvar); - MM_ShowMemory(&gvar); - while (!IN_CheckAck (&gvar)){} +// IN_StartAck (&gvar); MM_ShowMemory(&gvar); while (!IN_CheckAck (&gvar)){} #ifdef FADE modexPalBlack(); //so player will not see loadings~ #endif