From: sparky4 Date: Thu, 2 Jul 2015 16:42:00 +0000 (-0500) Subject: modified: src/lib/16_ca.c X-Git-Url: http://4ch.mooo.com/gitweb/?a=commitdiff_plain;h=61da0962e85739dc05c35eddb279d400ebbb455f;p=16.git modified: src/lib/16_ca.c modified: src/lib/16_ca.h modified: src/lib/16_head.c modified: src/lib/16_head.h --- diff --git a/src/lib/16_ca.c b/src/lib/16_ca.c index bacb7181..29df8f63 100644 --- a/src/lib/16_ca.c +++ b/src/lib/16_ca.c @@ -30,14 +30,10 @@ loaded into the data segment ============================================================================= */ -#include "ID_HEADS.H" -#pragma hdrstop -#include "ID_STRS.H" +#include "src/lib/16_head.h" +//#include "ID_STRS.H" -#pragma warn -pro -#pragma warn -use - -#define THREEBYTEGRSTARTS +//#define THREEBYTEGRSTARTS /* ============================================================================= @@ -53,12 +49,12 @@ typedef struct } huffnode; -typedef struct +/*typedef struct { unsigned RLEWtag; long headeroffsets[100]; byte tileinfo[]; -} mapfiletype; +} mapfiletype;*/ /* @@ -69,7 +65,7 @@ typedef struct ============================================================================= */ -byte _seg *tinf; +/*byte _seg *tinf; int mapon; unsigned _seg *mapsegs[3]; @@ -80,7 +76,7 @@ void _seg *grsegs[NUMCHUNKS]; byte far grneeded[NUMCHUNKS]; byte ca_levelbit,ca_levelnum; -int profilehandle,debughandle; +int profilehandle,debughandle;*/ void (*drawcachebox) (char *title, unsigned numcache); void (*updatecachebox) (void); @@ -224,7 +220,7 @@ void CAL_GetGrChunkLength (int chunk) boolean CA_FarRead (int handle, byte far *dest, long length) { if (length>0xffffl) - Quit ("CA_FarRead doesn't support 64K reads yet!"); + printf("CA_FarRead doesn't support 64K reads yet!\n"); asm push ds asm mov bx,[handle] @@ -364,7 +360,7 @@ boolean CA_LoadFile (char *filename, memptr *ptr) =============== */ -void CAL_OptimizeNodes (huffnode *table) +void CAL_OptimizeNodes(huffnode *table) { huffnode *node; int i; @@ -2187,4 +2183,3 @@ void CA_CacheMarks (char *title) if (dialog && finishcachebox) finishcachebox(); } - diff --git a/src/lib/16_ca.h b/src/lib/16_ca.h index 380ae297..c4ab6705 100644 --- a/src/lib/16_ca.h +++ b/src/lib/16_ca.h @@ -18,18 +18,10 @@ // ID_CA.H -#ifndef __TYPES__ -#include "ID_TYPES.H" -#endif - #ifndef __ID_MM__ #include "ID_MM.H" #endif -#ifndef __ID_GLOB__ -#include "ID_GLOB.H" -#endif - #define __ID_CA__ //=========================================================================== @@ -38,26 +30,26 @@ //#define NOGRAPHICS //#define NOAUDIO -#define MAPHEADERLINKED -#define GRHEADERLINKED -#define AUDIOHEADERLINKED +//#define MAPHEADERLINKED +//#define GRHEADERLINKED +//#define AUDIOHEADERLINKED -#define NUMMAPS 39 -#define MAPPLANES 3 +//#define NUMMAPS 39 +//#define MAPPLANES 3 //=========================================================================== -typedef struct +/*typedef struct { long planestart[3]; unsigned planelength[3]; unsigned width,height; char name[16]; -} maptype; +} maptype;*/ //=========================================================================== -extern byte _seg *tinf; +/*extern byte _seg *tinf; extern int mapon; extern unsigned _seg *mapsegs[3]; @@ -70,7 +62,7 @@ extern byte ca_levelbit,ca_levelnum; extern char *titleptr[8]; -extern int profilehandle,debughandle; +extern int profilehandle,debughandle;*/ // // hooks for custom cache dialogs @@ -83,8 +75,7 @@ extern void (*finishcachebox) (void); // just for the score box reshifting -void CAL_ShiftSprite (unsigned segment,unsigned source,unsigned dest, - unsigned width, unsigned height, unsigned pixshift, boolean domask); +//void CAL_ShiftSprite (unsigned segment,unsigned source,unsigned dest,unsigned width, unsigned height, unsigned pixshift, boolean domask); //=========================================================================== @@ -95,19 +86,17 @@ boolean CA_FarWrite (int handle, byte far *source, long length); boolean CA_ReadFile (char *filename, memptr *ptr); boolean CA_LoadFile (char *filename, memptr *ptr); -long CA_RLEWCompress (unsigned huge *source, long length, unsigned huge *dest, - unsigned rlewtag); +long CA_RLEWCompress (unsigned huge *source, long length, unsigned huge *dest,unsigned rlewtag); -void CA_RLEWexpand (unsigned huge *source, unsigned huge *dest,long length, - unsigned rlewtag); +void CA_RLEWexpand (unsigned huge *source, unsigned huge *dest,long length,unsigned rlewtag); void CA_Startup (void); void CA_Shutdown (void); -void CA_CacheAudioChunk (int chunk); -void CA_LoadAllSounds (void); +//void CA_CacheAudioChunk (int chunk); +//void CA_LoadAllSounds (void); -void CA_UpLevel (void); +/*void CA_UpLevel (void); void CA_DownLevel (void); void CA_SetAllPurge (void); @@ -120,5 +109,5 @@ void CA_ClearAllMarks (void); void CA_CacheGrChunk (int chunk); void CA_CacheMap (int mapnum); -void CA_CacheMarks (char *title); +void CA_CacheMarks (char *title);*/ diff --git a/src/lib/16_head.c b/src/lib/16_head.c index d56b5260..6ad9bcc1 100644 --- a/src/lib/16_head.c +++ b/src/lib/16_head.c @@ -163,3 +163,66 @@ US_CheckParm(char *parm,char **strings) } return(-1); } + +/* +========================== += += Quit += +========================== +*/ + +/*void Quit(char *error, ...) +{ + short exit_code=0; + unsigned finscreen; + + va_list ap; + + va_start(ap,error); + +#ifndef CATALOG + if (!error) + { + CA_SetAllPurge (); + CA_CacheGrChunk (PIRACY); + finscreen = (unsigned)grsegs[PIRACY]; + } +#endif + + //ShutdownId (); + + if (error && *error) + { + vprintf(error,ap); + exit_code = 1; + } +#ifndef CATALOG + else + if (!NoWait) + { + movedata (finscreen,0,0xb800,0,4000); + bioskey (0); + } +#endif + + va_end(ap); + +#ifndef CATALOG + if (!error) + { + _argc = 2; + _argv[1] = "LAST.SHL"; + _argv[2] = "ENDSCN.SCN"; + _argv[3] = NULL; + if (execv("LOADSCN.EXE", _argv) == -1) + { + clrscr(); + puts("Couldn't find executable LOADSCN.EXE.\n"); + exit(1); + } + } +#endif + + exit(exit_code); +}*/ diff --git a/src/lib/16_head.h b/src/lib/16_head.h index 225af5d3..95292d5d 100644 --- a/src/lib/16_head.h +++ b/src/lib/16_head.h @@ -142,5 +142,6 @@ void* AllocateLargestFreeBlock(size_t* Size); size_t GetFreeSize(void); long int filesize(FILE *fp); int US_CheckParm(char *parm,char **strings); +//void Quit(char *error, ...); #endif/*_LIBHEAD_H_*/