/* Project 16 Source Code~\r
- * Copyright (C) 2012-2016 sparky4 & pngwen & andrius4669 & joncampbell123 & yakui-lover\r
+ * Copyright (C) 2012-2017 sparky4 & pngwen & andrius4669 & joncampbell123 & yakui-lover\r
*\r
* This file is part of Project 16.\r
*\r
\r
#define MAXPAGE 4\r
\r
+#define BDOFSCONV (unsigned __near)\r
+#define BOFS page[1].data\r
+#define DOFS page[0].data\r
+\r
+#define CONFIGNAME "config.16"\r
+\r
/*\r
* typedefs of the game variables!\r
*/\r
typedef struct {\r
- byte *data;\r
- word width;\r
- word height;\r
+ byte far *plane[4]; // 4 planes of image data\r
+ word width; // width of the image (spread across 4 planes)\r
+ word height; // height of the image (spread across 4 planes)\r
+ word pwidth; // the number of bytes in each plane\r
byte *palette;\r
- word offset;\r
-} bitmap_t;\r
+} planar_buf_t;\r
+\r
+//from 16_sprit.h\r
+#ifdef __WATCOMC__\r
+#include <hw/vga/vrl.h>\r
+\r
+typedef struct vrs_container{\r
+ // Size of a .vrs blob in memory\r
+ // minus header\r
+ dword data_size;\r
+ union{\r
+ byte far *buffer;\r
+ struct vrs_header far *vrs_hdr;\r
+ };\r
+ // Array of corresponding vrl line offsets\r
+ vrl1_vgax_offset_t **vrl_line_offsets;\r
+ //sprite buffer\r
+ byte far _seg *spribuff;\r
+} vrs_container_t;\r
+\r
+typedef struct vrl_container{\r
+ // Size of a .vrl blob in memory\r
+ // minus header\r
+ dword data_size;\r
+ union{\r
+ byte far *buffer;\r
+ struct vrl1_vgax_header far *vrl_header;\r
+ };\r
+ // Pointer to a corresponding vrl line offsets struct\r
+ vrl1_vgax_offset_t *line_offsets;\r
+ //sprite buffer\r
+ byte far _seg *spribuff;\r
+} vrl_container_t;\r
+\r
+typedef struct sprite\r
+{\r
+ // VRS container from which we will extract animation and image data\r
+ vrs_container_t spritesheet;\r
+ // Container for a vrl sprite\r
+ vrl_container_t sprite_vrl_cont;\r
+ // Current sprite id\r
+ int curr_spri_id;\r
+ // Index of a current sprite in an animation sequence\r
+ int curr_anim_spri;\r
+ // Current animation sequence\r
+ struct vrs_animation_list_entry_t *curr_anim_list;\r
+ // Index of current animation in relevant VRS offsets table\r
+ int curr_anim;\r
+ // Delay in time units untill we should change sprite\r
+ int delay;\r
+ // Position of sprite on screen\r
+ int x, y;\r
+} sprite_t;\r
+#endif\r
+\r
+//newer structs\r
+typedef struct\r
+{\r
+ int x; //entity exact position on the viewable map\r
+ int y; //entity exact position on the viewable map\r
+ int tx; //entity tile position on the viewable map\r
+ int ty; //entity tile position on the viewable map\r
+ int triggerx; //entity's trigger box tile position on the viewable map\r
+ int triggery; //entity's trigger box tile position on the viewable map\r
+// int sheetsetx; //NOT USED YET! entity sprite sheet set on the image x\r
+// int sheetsety; //NOT USED YET! entity sprite sheet set on the image y\r
+ nibble d; //direction to render sprite!! wwww\r
+ nibble pred; //prev. direction for animation changing\r
+ word dire; //sprite in use\r
+ nibble q; //loop variable for anumation and locking the playing to compleate the animation cycle to prevent issues with misalignment www\r
+// word speed; //entity speed!\r
+ word spt; //speed per tile\r
+#ifdef __WATCOMC__\r
+ sprite_t spri; // sprite used by entity\r
+#endif\r
+ sword hp; //hitpoints of the entity\r
+ nibble overdraww, overdrawh; // how many pixels to "overdraw" so that moving sprites with edge pixels don't leave streaks.\r
+ // if the sprite's edge pixels are clear anyway, you can set this to 0.\r
+ nibble /*int*/ persist_aniframe; // gonna be increased to 1 before being used, so 0 is ok for default\r
+} entity_t;\r
\r
+typedef struct\r
+{\r
+ int x; //entity exact position on the viewable map\r
+ int y; //entity exact position on the viewable map\r
+ int tx; //entity tile position on the viewable map\r
+ int ty; //entity tile position on the viewable map\r
+\r
+#ifdef __WATCOMC__\r
+ sprite_t spri; // sprite used by entity\r
+#endif\r
+ sword hp; //hitpoints of the entity\r
+} static_map_entity_t;\r
+\r
+//===========================================================================//\r
+\r
+//TODO: 16_mm and 16_ca must handle this\r
typedef struct {\r
- byte huge **data;\r
- word ntiles; /* the number of tiles */\r
- word twidth; /* width of the tiles */\r
- word theight; /* height of the tiles */\r
- byte *palette; /* palette for the tile set */\r
-} tileset_t;\r
+#ifdef __WATCOMC__\r
+ sprite_t *spri; // I will probibaly use this --sparky4\r
+#endif\r
+ word tileHeight, tileWidth; //defined by mapfile\r
+ unsigned int rows, cols;\r
+ byte imgname[8]; //image file of tileset (set to 8 because DOS ^^;)\r
+} tiles_t; //seems to be the tileset properties\r
\r
+//TODO: 16_mm and 16_ca must handle this\r
+//TODO: add variables from 16_ca\r
typedef struct {\r
- byte huge *plane[4]; /* 4 planes of image data */\r
- word width; /* width of the image (spread across 4 planes) */\r
- word height; /* height of the image (spread across 4 planes) */\r
- word pwidth; /* the number of bytes in each plane */\r
- byte *palette;\r
-} planar_buf_t;\r
+ byte layername[8];\r
+ byte *data; //TODO: 16_mm and 16_ca must handle this\r
+} mapl_t; //map layer array type def\r
\r
+#define MAPPLANES 3\r
+typedef struct {\r
+ //long planestart[3];\r
+ //unsigned planelength[3];\r
+ mapl_t layerdata[MAPPLANES]; // mapdata for multilayer (map index values for rendering which image on the tile)\r
+ tiles_t *tiles; //TODO: 16_mm and 16_ca must handle this // tilesets for layers (currently ony 4 can be loaded wwww)\r
+ int width, height; //this has to be signed!\r
+ byte name[16];\r
+} map_t;\r
+\r
+//===================================//\r
+\r
+typedef struct{\r
+ word tw; /* screen width in tiles */\r
+ word th; /* screen height in tiles */\r
+ word tilesw; /* virtual screen width in tiles */\r
+ word tilesh; /* virtual screen height in tiles */\r
+ sword tilemidposscreenx; /* middle tile x position */ /* needed for scroll system to work accordingly */\r
+ sword tilemidposscreeny; /* middle tile y position */ /* needed for scroll system to work accordingly */\r
+ sword tileplayerposscreenx; /* player position on screen */ /* needed for scroll and map system to work accordingly */\r
+ sword tileplayerposscreeny; /* player position on screen */ /* needed for scroll and map system to work accordingly */\r
+} pagetileinfo_t;\r
\r
-enum direction {STOP, UP, DOWN, LEFT, RIGHT};\r
typedef struct {\r
- int dx, dy; //backwards compait\r
- word id; /* the Identification number of the page~ For layering~ */\r
+ nibble/*word*/ id; /* the Identification number of the page~ For layering~ */\r
byte far* data; /* the data for the page */\r
- word sw; /* screen width */\r
- word sh; /* screen heigth */\r
- word tw; /* screen width in tiles */\r
- word th; /* screen height in tiles */\r
+ pagetileinfo_t ti; // the tile information of the page\r
+ word dx; /* col we are viewing on virtual screen (on page[0]) */ /* off screen buffer on the left size */\r
+ word dy; /* row we are viewing on virtual screen (on page[0]) */ /* off screen buffer on the top size */\r
+ word sw; /* screen width */ /* resolution */\r
+ word sh; /* screen heigth */ /* resolution */\r
word width; /* virtual width of the page */\r
word height; /* virtual height of the page */\r
- word tilesw; /* virtual screen width in tiles */\r
- word tilesh; /* virtual screen height in tiles */\r
- sword tilemidposscreenx; /* middle tile position */\r
- sword tilemidposscreeny; /* middle tile position */\r
- sword tileplayerposscreenx; /* player position on screen */\r
- sword tileplayerposscreeny; /* player position on screen */\r
- word stridew; /*width/4*/\r
- word pagesize; /* page size */\r
- word pi; /* incremention page by this much to preserve location */\r
- word delta; // How much should we shift the page for smooth scrolling\r
- enum direction d; // Direction we should shift the page\r
+ word stridew; /* width/4 */ /* VGA */\r
+ word pagesize; /* page size */\r
+ word pi; /* increment page by this much to preserve location */\r
+ int tlx,tly;\r
+//newer vars\r
+//TODO: find where they are used\r
+ sword delta; // How much should we shift the page for smooth scrolling\r
} page_t;\r
-typedef struct\r
+\r
+//from 16_in\r
+//==========================================================================\r
+#define KeyInt 9 // The keyboard ISR number\r
+\r
+//\r
+// mouse constants\r
+//\r
+#define MReset 0\r
+#define MButtons 3\r
+#define MDelta 11\r
+\r
+#define MouseInt 0x33\r
+//#define Mouse(x) _AX = x,geninterrupt(MouseInt)\r
+\r
+//\r
+// joystick constants\r
+//\r
+#define JoyScaleMax 32768\r
+#define JoyScaleShift 8\r
+#define MaxJoyValue 5000\r
+\r
+#define MaxPlayers 4\r
+#define MaxKbds 2\r
+#define MaxJoys 2\r
+#define NumCodes 128\r
+\r
+typedef byte ScanCode;\r
+\r
+typedef enum {\r
+ //ctrl_None, // MDM (GAMERS EDGE) - added\r
+ ctrl_Keyboard,\r
+ ctrl_Keyboard1 = ctrl_Keyboard,ctrl_Keyboard2,\r
+ ctrl_Joystick,\r
+ ctrl_Joystick1 = ctrl_Joystick,ctrl_Joystick2,\r
+ ctrl_Mouse,\r
+ } ControlType;\r
+typedef enum {\r
+ motion_Left = -1,motion_Up = -1,\r
+ motion_None = 0,\r
+ motion_Right = 1,motion_Down = 1\r
+ } Motion;\r
+typedef enum { // Quick lookup for total direction\r
+ /*dir_NorthWest, */dir_North,/* dir_NorthEast,*/\r
+ dir_West, dir_None, dir_East,\r
+ /*dir_SouthWest, */dir_South/*, dir_SouthEast*/\r
+ } Direction;\r
+typedef struct {\r
+ boolean near button0,button1,button2,button3;\r
+ int near x,y;\r
+ Motion near xaxis,yaxis;\r
+ Direction near dir;\r
+ } CursorInfo;\r
+\r
+typedef struct {\r
+ ScanCode near button0,button1,\r
+ //upleft,\r
+ up,\r
+ down,\r
+ left,\r
+ right\r
+ //upright,\r
+ //downleft,\r
+ //,downright\r
+ ;\r
+ } KeyboardDef;\r
+typedef struct {\r
+ word near joyMinX,joyMinY,\r
+ threshMinX,threshMinY,\r
+ threshMaxX,threshMaxY,\r
+ joyMaxX,joyMaxY,\r
+ joyMultXL,joyMultYL,\r
+ joyMultXH,joyMultYH;\r
+ } JoystickDef;\r
+\r
+typedef struct instat {\r
+ boolean CapsLock;\r
+ ScanCode CurCode,LastCode;\r
+\r
+ boolean Keyboard[NumCodes];\r
+ boolean Paused;\r
+ char LastASCII;\r
+ ScanCode LastScan;\r
+} inst_t;\r
+\r
+typedef struct// inconfig\r
{\r
- //sprite ....\r
- boolean wwww;\r
-} spri_t;\r
+ boolean IN_Started;\r
+//\r
+// configuration variables\r
+//\r
+ boolean JoysPresent[MaxJoys],\r
+ MousePresent,\r
+ JoyPadPresent;\r
+\r
+// Global variables\r
+ KeyboardDef KbdDefs[MaxKbds];\r
+ JoystickDef JoyDefs[MaxJoys];\r
+ inst_t *inst;\r
+} in_info_t;\r
\r
-typedef struct\r
+//==========================================================================\r
+\r
+typedef struct\r
{\r
- //vrs with sprite ....\r
- spri_t *spri;\r
-} vrs_t;\r
+ entity_t near enti;\r
+#ifdef __WATCOMC__\r
+ //struct sprite *spri; //supposively the sprite sheet data\r
+ //memptr gr;\r
+#endif\r
+// bitmap_t *data; //supposively the sprite sheet data//old format\r
+// bitmap_t bmp;\r
+\r
+ //input\r
+ byte near pdir; //previous direction~ used in IN_16 in IN_ReadControl()\r
+ CursorInfo info;\r
+ ControlType Controls;\r
+ word walktype;\r
+//newer vars\r
+ int dx, dy, delta; //TODO: what is this? ^^\r
+} player_t;\r
+\r
+//===========================================//\r
\r
typedef struct\r
{\r
- int profilehandle,debughandle,showmemhandle;\r
+ int profilehandle,debughandle,showmemhandle;\r
int heaphandle;\r
+ byte datadumpfilename[12];\r
+ byte heapdumpfilename[12];\r
} loghandle_t;\r
\r
typedef struct\r
word clock_start; //timer start\r
word *clock; //current time on clock\r
boolean fpscap; //cap the fps var\r
+ nibble wcpu; //stored value of cpu type\r
} kurokku_t;\r
\r
+//===================================//\r
+#define PALSIZE 768 //vga\r
+#define NUMCHUNKS 416 //keen\r
+//#define MAXSCANLINES 240 // size of ylookup table\r
+\r
+#define MAXSHIFTS 4\r
+#define STARTSPRITES 0 //temp\r
+\r
typedef struct\r
{\r
- word pn;\r
-} pan_t;\r
+ int width,\r
+ height,\r
+ orgx,orgy,\r
+ xl,yl,xh,yh,\r
+ shifts;\r
+} spritetabletype;\r
+\r
+typedef struct\r
+{\r
+ unsigned sourceoffset[MAXSHIFTS];\r
+ unsigned planesize[MAXSHIFTS];\r
+ unsigned width[MAXSHIFTS];\r
+ byte data[];\r
+} spritetype; // the memptr for each sprite points to this\r
+\r
+typedef struct\r
+{\r
+ int width,height;\r
+} pictabletype;\r
\r
//video\r
-#define NUMCHUNKS 416 //keen\r
+typedef struct\r
+{\r
+ word tileHeight, tileWidth; //defined by mapfile\r
+ word quadwh; //preproccessed quad size of tilewidth and tileheight\r
+} tile_dimention_t;\r
\r
+#define MAXSCROLLEDGES 2\r
typedef struct\r
{\r
+ unsigned panx,pany; // panning adjustments inside port in pixels\r
+ unsigned pansx,pansy;\r
+ unsigned panadjust; // panx/pany adjusted by screen resolution\r
+ int hscrollblocks,vscrollblocks;\r
+ int hscrolledge[MAXSCROLLEDGES],vscrolledge[MAXSCROLLEDGES];\r
+} pan_t;\r
+\r
+typedef struct\r
+{\r
+ sword x;\r
+ sword y;\r
+ word t;\r
+ boolean tlsw;\r
+ word color;\r
+ word bgcolor;\r
+} modexprint_t;\r
+\r
+typedef struct\r
+{\r
+//---- ylookup[MAXSCANLINES],\r
+ unsigned int offscreen_ofs;\r
+ unsigned int pattern_ofs;\r
+//+-+- unsigned bufferofs,linewidth,displayofs;\r
+ pan_t pan;\r
+\r
+} ofs_t; //unfinished\r
+\r
+typedef struct\r
+{\r
+//doslib origi vars\r
+ byte far * omemptr;\r
+ byte vga_draw_stride;\r
+ byte vga_draw_stride_limit; // further X clipping\r
+//end of doslib origi vars\r
+ boolean __near rss; //render sprite switch\r
+ boolean __near bgps; //bg preservation render switch between old and new\r
+} vga_state_t;\r
+\r
+typedef struct\r
+{\r
+ boolean VL_Started,VL_Initiated;\r
char old_mode; //old video mode before game!\r
- byte grneeded[NUMCHUNKS];\r
- page_t page[MAXPAGE]; //pointer to root page[0]\r
+ sword curr_mode; //modex curent mode\r
+ byte palette[PALSIZE], dpal[PALSIZE]; //palette array\r
+ page_t page[MAXPAGE]; //can be used as a pointer to root page[0]\r
word vmem_remain; //remaining video memory\r
byte num_of_pages; //number of actual pages\r
- boolean __near p; //render page number\r
- boolean __near r; //page flip if true\r
- word pr[MAXPAGE][4]; //render sections of pages\r
+ vga_state_t vga_state;\r
+ sword __near sprifilei; //player file's i\r
+ nibble __near p; //render page number\r
+ nibble __near sp; //show page number(for showpage)\r
+ boolean __near dorender; //page flip, showpage, or render if true\r
+ word pr[MAXPAGE][4]; //render sections of pages (this is supposed to be set up to draw sections of the screen if updated)\r
+\r
+ nibble sfip; //shinku_fps_indicator_page; // we're on page 1 now, shinku(). follow along please or it will not be visible.\r
+ ofs_t ofs; //offset vars used for doslib\r
+ word vh; //video combined height\r
+ modexprint_t print; //modexprint variables\r
+ tile_dimention_t td;\r
//0000word startclk; float clk, tickclk; //timer\r
+ //wolf3d vars\r
+ boolean screenfaded;\r
+ word bordercolor;\r
+ boolean fastpalette;\r
+ byte far palette1[256][3],far palette2[256][3];\r
+//???? pictabletype _seg *pictable;\r
+ //keen/cata vars\r
+// spritetabletype _seg *spritetable;\r
+// unsigned *shifttabletable[8];\r
} video_t;\r
\r
+//from scroll16\r
+//==========================================================================\r
+typedef struct\r
+{\r
+ map_t *map;\r
+ page_t *page;\r
+ int tx,ty; //appears to be the top left tile position on the viewable screen map\r
+ word dxThresh,dyThresh; //Threshold for physical tile switch\r
+ video_t *video; //pointer to game variables of the video\r
+ kurokku_t *kurokku; //pointer to game variables of the kurokku\r
+ nibble __near *p; // pointer to video's render page num\r
+ nibble __near *sp; // pointer to video's show page num\r
+ int dx, dy; // draw row and col var\r
+//newer vars!\r
+ int delta, d;\r
+} map_view_t;\r
+/* Map is presumed to:\r
+ * 1. Have all the required layers and tilesets within itself\r
+ * 2. Have a 'fence' around accessible blocks to simplify boundary logic\r
+ * 3. Have a persistent map and tile size among the layers\r
+ * Map view is presumed to:\r
+ * 1. Calculate, store and update a panning info, which includes, but not limited to:\r
+ * combined layer information, actual map representation (reflecting real state of the game),\r
+ * pixel shift for smooth tile scrolling.\r
+ * 2. Provide ways to draw a visible part of map. For simplicity with smooth scrolling,\r
+ * additional row/column is always drawn at the each side of the map. This implies that 'fence'\r
+ * should have a sprite too. Map is drawn left-to-right, top-to-bottom.\r
+ */\r
+\r
+//==========================================================================\r
+\r
//from 16_mm\r
//==========================================================================\r
\r
-#define MAXBLOCKS 1024\r
-#define MAXUMBS 12\r
+#define MAXBLOCKS 1024 //kd=1300 wolf3d=700 cata=600\r
\r
typedef struct mmblockstruct\r
{\r
- word start,length;\r
- //word start; dword length;\r
- word blob; //for data larger than 64k\r
+ //word start,length, blob; //for data larger than 64k\r
+ word start; dword length;\r
unsigned attributes;\r
memptr *useptr; // pointer to the segment start\r
- //huge struct mmblockstruct huge *next;\r
struct mmblockstruct far *next;\r
} mmblocktype;\r
\r
+typedef struct mmshowmemoryinfo\r
+{\r
+// unsigned x,y;\r
+ mmblocktype far *scan;\r
+} mmshowmemoryinfo_t;\r
+\r
typedef struct\r
{\r
dword nearheap,farheap,EMSmem,XMSmem,mainmem;\r
\r
typedef struct\r
{\r
- memptr bufferseg;\r
boolean mmstarted, bombonerror, mmerror;\r
- //huge void huge *farheap;\r
void far *farheap;\r
#ifdef __BORLANDC__\r
- void *nearheap;\r
+ void *nearheap;\r
#endif\r
#ifdef __WATCOMC__\r
void __near *nearheap;\r
#endif\r
- unsigned int EMSVer;\r
- word numUMBs,UMBbase[MAXUMBS];\r
- word totalEMSpages, freeEMSpages, EMSpagesmapped, EMSHandle, EMSPageFrame;\r
- //dword numUMBs,UMBbase[MAXUMBS];\r
- //huge mmblocktype huge mmblocks[MAXBLOCKS],huge *mmhead,huge *mmfree,huge *mmrover,huge *mmnew;\r
+//---- unsigned int EMSVer;\r
+//---- word numUMBs,UMBbase[MAXUMBS];\r
+//---- word totalEMSpages, freeEMSpages, EMSpagesmapped, EMSHandle, EMSPageFrame;\r
+//---- dword numUMBs,UMBbase[MAXUMBS];\r
mmblocktype far mmblocks[MAXBLOCKS],far *mmhead,far *mmfree,far *mmrover,far *mmnew;\r
+ memptr bufferseg; //Allocates bufferseg misc buffer\r
} mminfo_t;\r
\r
//==========================================================================\r
MainPagesUsed,\r
PMNumBlocks;\r
long PMFrameCount;\r
- PageListStruct far *PMPages;\r
- __SEGA *PMSegPages;\r
+ PageListStruct far *PMPages,\r
+ _seg *PMSegPages;\r
pm_mmi_t mm;\r
pm_emmi_t emm;\r
pm_xmmi_t xmm;\r
\r
//==========================================================================\r
\r
+//for 16_sd\r
+//==========================================================================\r
+\r
+/////////////////////////////////////////////////\r
+//\r
+// MUSE Header for .WL6\r
+// Created Tue Jul 14 15:04:53 1992\r
+//\r
+/////////////////////////////////////////////////\r
+\r
+#define NUMSOUNDS 87\r
+//--#define NUMSNDCHUNKS 288\r
+\r
+//\r
+// Sound names & indexes\r
+//\r
+typedef enum {\r
+ HITWALLSND, // 0\r
+ SELECTWPNSND, // 1\r
+ SELECTITEMSND, // 2\r
+ LASTSOUND\r
+ } soundnames;\r
+\r
+//\r
+// Base offsets\r
+//\r
+#define STARTPCSOUNDS 0\r
+#define STARTADLIBSOUNDS 87\r
+#define STARTDIGISOUNDS 174\r
+#define STARTMUSIC 0//++++261\r
+\r
+//\r
+// Music names & indexes\r
+//\r
+typedef enum {\r
+ CORNER_MUS, // 0\r
+ LASTMUSIC\r
+ } musicnames;\r
+\r
+/////////////////////////////////////////////////\r
+//\r
+// Thanks for playing with MUSE!\r
+//\r
+/////////////////////////////////////////////////\r
+\r
+#pragma pack(push,1)\r
+typedef struct imf_entry\r
+{\r
+ byte reg,data;\r
+ word delay;\r
+} imf_entry_t;\r
+#pragma pack(pop)\r
+\r
+typedef struct\r
+{\r
+ volatile unsigned long irq0_ticks;//=0;\r
+ volatile unsigned int irq0_cnt,irq0_add,irq0_max;//=0;\r
+ imf_entry_t* imf_music;//=NULL;\r
+ imf_entry_t* imf_play_ptr;//=NULL;\r
+ imf_entry_t* imf_music_end;//=NULL;\r
+ word imf_delay_countdown;//=0;\r
+ dword ptick,tickrate;\r
+} sd_t;\r
+\r
+//==========================================================================\r
+\r
//from 16_ca\r
//==========================================================================\r
\r
+#define NOMAPS\r
+#define NOGRAPHICS\r
+#define NOAUDIO\r
+\r
+//#define MAPHEADERLINKED\r
+//#define GRHEADERLINKED\r
+//#define AUDIOHEADERLINKED\r
+\r
#define NUMMAPS 4//39\r
-#define MAPPLANES 3\r
+#define NUMSNDCHUNKS 4//3\r
+//#define NUMPICS 4//132//wolf3d wl6\r
+\r
+#define STRUCTPIC 0\r
+#define CASVT dword //*start var type\r
+\r
+\r
+#define DATADIR "data/"\r
+#define GDICTNAME DATADIR"vgadict."\r
+#define GHEADNAME DATADIR"vgahead."\r
+#define GFILENAME DATADIR"vgagraph."\r
+\r
+\r
+#define MAPSEGBUF mapsegs\r
+#define MAPSEGPTR MAPSEGBUF[0]\r
+#define MAPSEGINLM (gvar->ca.MAPSEGPTR)\r
\r
typedef struct\r
{\r
word bit0,bit1; // 0-255 is a character, > is a pointer to a node\r
} huffnode;\r
\r
-typedef struct\r
+typedef struct\r
{\r
- int mapon, mapnum;\r
- __SEGA *mapsegs[4];\r
- __SEGA *mapheaderseg[NUMMAPS];\r
- __SEGA *tinf;\r
-} ca_mapinfo_t;\r
+ long planestart[3];\r
+ unsigned planelength[3];\r
+ unsigned width,height;\r
+ char name[16];\r
+} maptype;\r
\r
typedef struct\r
{\r
- int maphandle[4]; // handle to MAPTEMP / GAMEMAPS\r
-} ca_handle_t;\r
+ unsigned RLEWtag;\r
+ long headeroffsets[100];\r
+ byte tileinfo[];\r
+} mapfiletype;\r
\r
typedef struct\r
{\r
- byte ca_levelbit,ca_levelnum;\r
- ca_handle_t file; //files to open\r
- ca_mapinfo_t camap;\r
- __SEGA *grsegs[NUMCHUNKS];\r
- byte far grneeded[NUMCHUNKS];\r
- huffnode huffnode;\r
+ int maphandle; // handle to MAPTEMP / GAMEMAPS\r
+ int grhandle; // handle to EGAGRAPH\r
+ int audiohandle; // handle to AUDIOT / AUDIO\r
+} ca_handle_t;\r
+/*\r
+16/wf3d8086/id_ca.c: grstarts = (long _seg *)FP_SEG(&EGAhead);\r
+16/wf3d8086/id_ca.c: tinf = (byte _seg *)FP_SEG(&maphead);\r
+16/wf3d8086/id_ca.c: pos = ((mapfiletype _seg *)tinf)->headeroffsets[i];\r
+16/wf3d8086/id_ca.c: audiostarts = (long _seg *)FP_SEG(&audiohead);\r
+16/wf3d8086/id_ca.c: ((mapfiletype _seg *)tinf)->RLEWtag);\r
+16/wf3d8086/id_ca.c: ((mapfiletype _seg *)tinf)->RLEWtag);\r
+16/wf3d8086/id_ca.c: source = (byte _seg *)bufferseg+(pos-bufferstart);\r
+*/\r
+typedef struct //TODO: USE THIS!!!!\r
+{\r
+ byte ca_levelbit,ca_levelnum;\r
+ ca_handle_t file; //files to open\r
+\r
+ byte _seg *tinf;//?? where in the id engine is this used and what is it? --sparky4\r
+ int mapon, mapnum;\r
+ maptype _seg *mapheaderseg[NUMMAPS];\r
+ unsigned _seg *mapsegs[MAPPLANES];\r
+ void _seg *grsegs[NUMCHUNKS];\r
+ byte far grneeded[NUMCHUNKS];\r
+ word _seg *audiosegs[NUMSNDCHUNKS];//long\r
+\r
+ CASVT _seg *grstarts; // array of offsets in egagraph, -1 for sparse//long\r
+ CASVT _seg *audiostarts; // array of offsets in audio / audiot//long\r
+\r
+#ifdef GRHEADERLINKED\r
+ huffnode *grhuffman;\r
+#else\r
+ huffnode grhuffman[63];\r
+#endif\r
+\r
+#ifdef AUDIOHEADERLINKED\r
+ huffnode *audiohuffman;\r
+#else\r
+ huffnode audiohuffman[63];\r
+#endif\r
+\r
+ CASVT chunkcomplen,chunkexplen;//long\r
+\r
+ sd_t sd;\r
+ //TODO: extend! and learn from keen/wolf/catacomb's code wwww\r
+ memptr spribuff[64]; //temp\r
} ca_t;\r
\r
//==========================================================================\r
\r
//actual global game varables!\r
-typedef struct\r
+/*typedef struct {\r
+ boolean clearmem;\r
+} vidsw_t;\r
+\r
+typedef struct {\r
+ vidsw_t vsw;\r
+} sw_t;*/\r
+\r
+#ifdef __WATCOMC__\r
+extern char global_temp_status_text[512];\r
+extern char global_temp_status_text2[512];\r
+#endif\r
+\r
+typedef struct glob_game_vars\r
{\r
video_t video; // video settings variable\r
ca_t ca; // ca stuff\r
pm_t pm; // pm stuff\r
- loghandle_t handle; //handles for file logging\r
- kurokku_t kurokku; //clock struct\r
- mminfo_t mm; mminfotype mmi;\r
+ loghandle_t handle; //handles for file logging\r
+ kurokku_t kurokku; //clock struct\r
+ mminfo_t mm; mminfotype mmi; // mm stuff\r
+ in_info_t in; // 16_in info\r
+ player_t player[MaxPlayers]; // player vars\r
+ map_view_t mv[4];\r
+ map_t map;\r
+// sw_t sw;\r
+ boolean DLStarted;\r
} global_game_variables_t;\r
\r
-extern char global_temp_status_text[512];\r
-#ifdef __WATCOMC__\r
-#define EINVFMT EMFILE\r
-#endif\r
#endif /* _TYPEDEFSTRUCT_H_ */\r