X-Git-Url: http://4ch.mooo.com/gitweb/?a=blobdiff_plain;f=src%2Flib%2F16_tdef.h;h=3fa1feb335ced492a655faf2c2195e411e338469;hb=050d28da3358d5c1434fda542ec11adbee182ea5;hp=2c2d0f723a115ad5f02e64862c907b770a0e1603;hpb=b0c0fabf3e7a284d2713e11b30015818f91097e4;p=16.git diff --git a/src/lib/16_tdef.h b/src/lib/16_tdef.h index 2c2d0f72..3fa1feb3 100755 --- a/src/lib/16_tdef.h +++ b/src/lib/16_tdef.h @@ -37,6 +37,10 @@ #define MAXPAGE 4 +#define BDOFSCONV (unsigned __near) +#define BOFS page[1].data +#define DOFS page[0].data + /* * typedefs of the game variables! */ @@ -354,13 +358,40 @@ typedef struct } kurokku_t; //===================================// -#define PALSIZE 768 +#define PALSIZE 768 #define NUMCHUNKS 416 //keen +#define MAXSCANLINES 240 // size of ylookup table + +typedef struct +{ + int width,height; +} pictabletype; + //video typedef struct { + word tileHeight, tileWidth; //defined by mapfile + word quadwh; //preproccessed quad size of tilewidth and tileheight +} tile_dimention_t; + +#define MAXSCROLLEDGES 6 +typedef struct +{ + unsigned panx,pany; // panning adjustments inside port in pixels + unsigned pansx,pansy; + unsigned panadjust; // panx/pany adjusted by screen resolution + int hscrollblocks,vscrollblocks; + int hscrolledge[MAXSCROLLEDGES],vscrolledge[MAXSCROLLEDGES]; +} pan_t; + +typedef struct +{ + //ylookup[MAXSCANLINES], unsigned int offscreen_ofs; unsigned int pattern_ofs; +// unsigned bufferofs,linewidth,displayofs; + pan_t pan; + } ofs_t; //unfinished typedef struct @@ -376,7 +407,9 @@ typedef struct typedef struct { + boolean VL_Started,VL_Initiated; char old_mode; //old video mode before game! + sword curr_mode; //modex curent mode byte palette[PALSIZE], dpal[PALSIZE]; //palette array page_t page[MAXPAGE]; //can be used as a pointer to root page[0] word vmem_remain; //remaining video memory @@ -391,7 +424,14 @@ typedef struct nibble sfip; //shinku_fps_indicator_page; // we're on page 1 now, shinku(). follow along please or it will not be visible. ofs_t ofs; //offset vars used for doslib word vh; //video combined height + tile_dimention_t td; //0000word startclk; float clk, tickclk; //timer + //wolf3d vars + boolean screenfaded; + word bordercolor; + boolean fastpalette; + byte far palette1[256][3],far palette2[256][3]; + pictabletype _seg *pictable; } video_t; //from scroll16 @@ -403,6 +443,7 @@ typedef struct int tx,ty; //appears to be the top left tile position on the viewable screen map word dxThresh,dyThresh; //Threshold for physical tile switch video_t *video; //pointer to game variables of the video + kurokku_t *kurokku; //pointer to game variables of the kurokku nibble __near *p; // pointer to video's render page num nibble __near *sp; // pointer to video's show page num int dx, dy; // draw row and col var @@ -427,19 +468,22 @@ typedef struct //from 16_mm //========================================================================== -#define MAXBLOCKS 1024 -#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; } mmblocktype; +typedef struct mmshowmemoryinfo +{ + word x,y; + mmblocktype far *scan; +} mmshowmemoryinfo_t; + typedef struct { dword nearheap,farheap,EMSmem,XMSmem,mainmem; @@ -448,7 +492,6 @@ typedef struct typedef struct { - memptr bufferseg; boolean mmstarted, bombonerror, mmerror; void far *farheap; #ifdef __BORLANDC__ @@ -457,11 +500,12 @@ typedef struct #ifdef __WATCOMC__ void __near *nearheap; #endif - unsigned int EMSVer; - word numUMBs,UMBbase[MAXUMBS]; - word totalEMSpages, freeEMSpages, EMSpagesmapped, EMSHandle, EMSPageFrame; - //dword numUMBs,UMBbase[MAXUMBS]; +//---- unsigned int EMSVer; +//---- word numUMBs,UMBbase[MAXUMBS]; +//---- word totalEMSpages, freeEMSpages, EMSpagesmapped, EMSHandle, EMSPageFrame; +//---- dword numUMBs,UMBbase[MAXUMBS]; mmblocktype far mmblocks[MAXBLOCKS],far *mmhead,far *mmfree,far *mmrover,far *mmnew; + memptr bufferseg; //Allocates bufferseg misc buffer } mminfo_t; //========================================================================== @@ -578,11 +622,53 @@ typedef struct //========================================================================== +//for 16_sd +//========================================================================== +#pragma pack(push,1) +typedef struct imf_entry +{ + byte reg,data; + word delay; +} imf_entry_t; +#pragma pack(pop) + +typedef struct +{ + volatile unsigned long irq0_ticks;//=0; + volatile unsigned int irq0_cnt,irq0_add,irq0_max;//=0; + imf_entry_t* imf_music;//=NULL; + imf_entry_t* imf_play_ptr;//=NULL; + imf_entry_t* imf_music_end;//=NULL; + word imf_delay_countdown;//=0; +} sd_t; + +//========================================================================== + //from 16_ca //========================================================================== +#define NOMAPS +//#define NOGRAPHICS +#define NOAUDIO + +#define MAPHEADERLINKED +//#define GRHEADERLINKED +#define AUDIOHEADERLINKED + #define NUMMAPS 4//39 -#define NUMSNDCHUNKS 84 +#define NUMSNDCHUNKS 4//3 +//#define NUMPICS 4//132//wolf3d wl6 + +#define STRUCTPIC 0 +#define CASVT dword //*start var type + + +#define DATADIR "data/" +#define GDICTNAME DATADIR"vgadict." +#define GHEADNAME DATADIR"vgahead." +#define GFILENAME DATADIR"vgagraph." +#define EXTENSION "hb1" + typedef struct { @@ -605,9 +691,9 @@ typedef struct typedef struct { - int maphandle[4]; // handle to MAPTEMP / GAMEMAPS - int grhandle[4]; // handle to EGAGRAPH - int audiohandle[4]; // handle to AUDIOT / AUDIO + int maphandle; // handle to MAPTEMP / GAMEMAPS + int grhandle; // handle to EGAGRAPH + int audiohandle; // handle to AUDIOT / AUDIO } ca_handle_t; /* 16/wf3d8086/id_ca.c: grstarts = (long _seg *)FP_SEG(&EGAhead); @@ -630,11 +716,24 @@ 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 - huffnode huffnode; +#ifdef GRHEADERLINKED + huffnode *grhuffman; +#else + huffnode grhuffman[255]; +#endif + +#ifdef AUDIOHEADERLINKED + huffnode *audiohuffman; +#else + huffnode audiohuffman[255]; +#endif + CASVT chunkcomplen,chunkexplen;//long + + sd_t sd; //TODO: extend! and learn from keen/wolf/catacomb's code wwww memptr spribuff; } ca_t; @@ -642,17 +741,18 @@ typedef struct //TODO: USE THIS!!!! //========================================================================== //actual global game varables! -/*typedef enum { - ENGI_QUIT, - ENGI_RUN, - ENGI_MENU, - ENGI_PAUSE -} engi_stat_t;*/ -//ENGI_INPUT, +/*typedef struct { + boolean clearmem; +} vidsw_t; -typedef struct +typedef struct { + vidsw_t vsw; +} sw_t;*/ + + + +typedef struct glob_game_vars { -//---- engi_stat_t engi_stat; video_t video; // video settings variable ca_t ca; // ca stuff pm_t pm; // pm stuff @@ -662,6 +762,8 @@ typedef struct in_info_t in; // 16_in info player_t player[MaxPlayers]; // player vars map_view_t mv[4]; +// sw_t sw; + boolean DLStarted; } global_game_variables_t; #ifdef __WATCOMC__