X-Git-Url: http://4ch.mooo.com/gitweb/?a=blobdiff_plain;f=src%2Flib%2F16_tdef.h;h=083f2fc2b558a5856550f695049ecc1d24d1b971;hb=26f6c93f37031261bf32b695a416b897fe21171e;hp=c87b272ec44e6a8c392d4121960d2270f6057ba6;hpb=5b7cb93f7c6a5a008302efff5f68023005a4daaf;p=16.git diff --git a/src/lib/16_tdef.h b/src/lib/16_tdef.h index c87b272e..083f2fc2 100755 --- a/src/lib/16_tdef.h +++ b/src/lib/16_tdef.h @@ -1,5 +1,5 @@ /* Project 16 Source Code~ - * Copyright (C) 2012-2017 sparky4 & pngwen & andrius4669 & joncampbell123 & yakui-lover + * Copyright (C) 2012-2022 sparky4 & pngwen & andrius4669 & joncampbell123 & yakui-lover * * This file is part of Project 16. * @@ -37,9 +37,25 @@ #define MAXPAGE 4 +#define BDOFSCONV (unsigned __near) +#define BOFS page[1].data +#define DOFS page[0].data + +#define CONFIGNAME "config.16" + /* * typedefs of the game variables! */ +typedef struct { + byte far *plane[4]; // 4 planes of image data + word width; // width of the image (spread across 4 planes) + word height; // height of the image (spread across 4 planes) + word pwidth; // the number of bytes in each plane + byte *palette; +} planar_buf_t; + +#ifndef BITMAPT +#define BITMAPT typedef struct { byte *data; word width; @@ -55,14 +71,7 @@ typedef struct { word theight; // height of the tiles byte *palette; // palette for the tile set } tileset_t; - -typedef struct { - byte far *plane[4]; // 4 planes of image data - word width; // width of the image (spread across 4 planes) - word height; // height of the image (spread across 4 planes) - word pwidth; // the number of bytes in each plane - byte *palette; -} planar_buf_t; +#endif //from 16_sprit.h #ifdef __WATCOMC__ @@ -78,6 +87,8 @@ typedef struct vrs_container{ }; // Array of corresponding vrl line offsets vrl1_vgax_offset_t **vrl_line_offsets; + //sprite buffer + byte far _seg *spribuff; } vrs_container_t; typedef struct vrl_container{ @@ -90,6 +101,8 @@ typedef struct vrl_container{ }; // Pointer to a corresponding vrl line offsets struct vrl1_vgax_offset_t *line_offsets; + //sprite buffer + byte far _seg *spribuff; } vrl_container_t; typedef struct sprite @@ -128,7 +141,7 @@ typedef struct nibble pred; //prev. direction for animation changing word dire; //sprite in use nibble q; //loop variable for anumation and locking the playing to compleate the animation cycle to prevent issues with misalignment www - word speed; //entity speed! +// word speed; //entity speed! word spt; //speed per tile #ifdef __WATCOMC__ sprite_t spri; // sprite used by entity @@ -322,8 +335,8 @@ typedef struct //struct sprite *spri; //supposively the sprite sheet data //memptr gr; #endif -// bitmap_t *data; //supposively the sprite sheet data//old format -// bitmap_t bmp; + bitmap_t *data; //supposively the sprite sheet data//old format + bitmap_t bmp; //input byte near pdir; //previous direction~ used in IN_16 in IN_ReadControl() @@ -340,6 +353,8 @@ typedef struct { int profilehandle,debughandle,showmemhandle; int heaphandle; + byte datadumpfilename[12]; + byte heapdumpfilename[12]; } loghandle_t; typedef struct @@ -354,9 +369,34 @@ typedef struct } kurokku_t; //===================================// -#define PALSIZE 768 -#define NUMCHUNKS 416 //keen -#define MAXSCANLINES 240 // size of ylookup table +#define PALSIZE 768 //vga +#define NUMCHUNKS 416 //keen +//#define MAXSCANLINES 240 // size of ylookup table + +#define MAXSHIFTS 4 +#define STARTSPRITES 0 //temp + +typedef struct +{ + int width, + height, + orgx,orgy, + xl,yl,xh,yh, + shifts; +} spritetabletype; + +typedef struct +{ + unsigned sourceoffset[MAXSHIFTS]; + unsigned planesize[MAXSHIFTS]; + unsigned width[MAXSHIFTS]; + byte data[]; +} spritetype; // the memptr for each sprite points to this + +typedef struct +{ + int width,height; +} pictabletype; //video typedef struct @@ -365,11 +405,34 @@ typedef struct word quadwh; //preproccessed quad size of tilewidth and tileheight } tile_dimention_t; +#define MAXSCROLLEDGES 2 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 +{ + sword x; + sword y; + word t; + boolean tlsw; + word color; + word bgcolor; +} modexprint_t; + +typedef struct +{ +//---- ylookup[MAXSCANLINES], unsigned int offscreen_ofs; unsigned int pattern_ofs; - unsigned bufferofs, ylookup[MAXSCANLINES], linewidth,displayofs; +//+-+- unsigned bufferofs,linewidth,displayofs; + pan_t pan; + } ofs_t; //unfinished typedef struct @@ -387,6 +450,7 @@ 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 @@ -401,6 +465,7 @@ 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 + modexprint_t print; //modexprint variables tile_dimention_t td; //0000word startclk; float clk, tickclk; //timer //wolf3d vars @@ -408,6 +473,10 @@ typedef struct word bordercolor; boolean fastpalette; byte far palette1[256][3],far palette2[256][3]; +//???? pictabletype _seg *pictable; + //keen/cata vars +// spritetabletype _seg *spritetable; +// unsigned *shifttabletable[8]; } video_t; //from scroll16 @@ -419,6 +488,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 @@ -443,19 +513,23 @@ typedef struct //from 16_mm //========================================================================== -#define MAXBLOCKS 1024//kd=1300 wolf3d=700 cata=600 -//----#define MAXUMBS 12 +#define MAXBLOCKS 1024 //kd=1300 wolf3d=700 cata=600 typedef struct mmblockstruct { - word start,length; - //word start; dword length; -//++++ word blob; //for data larger than 64k + //word start,length, blob; //for data larger than 64k + word start; dword length; unsigned attributes; memptr *useptr; // pointer to the segment start struct mmblockstruct far *next; } mmblocktype; +typedef struct mmshowmemoryinfo +{ +// unsigned x,y; + mmblocktype far *scan; +} mmshowmemoryinfo_t; + typedef struct { dword nearheap,farheap,EMSmem,XMSmem,mainmem; @@ -594,22 +668,100 @@ typedef struct //========================================================================== -/* +//for 16_sd +//========================================================================== + +///////////////////////////////////////////////// +// +// MUSE Header for .WL6 +// Created Tue Jul 14 15:04:53 1992 +// +///////////////////////////////////////////////// + +#define NUMSOUNDS 87 +//--#define NUMSNDCHUNKS 288 + +// +// Sound names & indexes +// +typedef enum { + HITWALLSND, // 0 + SELECTWPNSND, // 1 + SELECTITEMSND, // 2 + LASTSOUND + } soundnames; + +// +// Base offsets +// +#define STARTPCSOUNDS 0 +#define STARTADLIBSOUNDS 87 +#define STARTDIGISOUNDS 174 +#define STARTMUSIC 0//++++261 + +// +// Music names & indexes +// +typedef enum { + CORNER_MUS, // 0 + LASTMUSIC + } musicnames; + +///////////////////////////////////////////////// +// +// Thanks for playing with MUSE! +// +///////////////////////////////////////////////// + #pragma pack(push,1) -typedef struct imf_entry { - uint8_t reg,data; - uint16_t delay; +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; + dword ptick,tickrate; +} 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 MAPSEGBUF mapsegs +#define MAPSEGPTR MAPSEGBUF[0] +#define MAPSEGINLM (gvar->ca.MAPSEGPTR) typedef struct { @@ -626,15 +778,16 @@ typedef struct typedef struct { - int mapon, mapnum; - maptype _seg *mapheaderseg[NUMMAPS]; -} ca_mapinfo_t; + unsigned RLEWtag; + long headeroffsets[100]; + byte tileinfo[]; +} mapfiletype; 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); @@ -649,21 +802,35 @@ typedef struct //TODO: USE THIS!!!! { byte ca_levelbit,ca_levelnum; ca_handle_t file; //files to open - ca_mapinfo_t camap; byte _seg *tinf;//?? where in the id engine is this used and what is it? --sparky4 + int mapon, mapnum; + maptype _seg *mapheaderseg[NUMMAPS]; unsigned _seg *mapsegs[MAPPLANES]; void _seg *grsegs[NUMCHUNKS]; 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[63]; +#endif + +#ifdef AUDIOHEADERLINKED + huffnode *audiohuffman; +#else + huffnode audiohuffman[63]; +#endif + CASVT chunkcomplen,chunkexplen;//long + + sd_t sd; //TODO: extend! and learn from keen/wolf/catacomb's code wwww - memptr spribuff; + memptr spribuff[64]; //temp } ca_t; //========================================================================== @@ -677,7 +844,10 @@ typedef struct { vidsw_t vsw; } sw_t;*/ - +#ifdef __WATCOMC__ +extern char global_temp_status_text[512]; +extern char global_temp_status_text2[512]; +#endif typedef struct glob_game_vars { @@ -690,12 +860,9 @@ typedef struct glob_game_vars in_info_t in; // 16_in info player_t player[MaxPlayers]; // player vars map_view_t mv[4]; + map_t map; // sw_t sw; + boolean DLStarted; } global_game_variables_t; -#ifdef __WATCOMC__ -extern char global_temp_status_text[512]; -extern char global_temp_status_text2[512]; -#define EINVFMT EMFILE -#endif #endif /* _TYPEDEFSTRUCT_H_ */