X-Git-Url: http://4ch.mooo.com/gitweb/?p=16.git;a=blobdiff_plain;f=src%2Flib%2F16_tdef.h;h=08b9699624d2e35b85c6abcaa82bc49d6794ae71;hp=10fd1eea58a9ef02f36f113d7666fcedb353d198;hb=c8d0f894b450f6dc3b80fbe28fedff4d424ce294;hpb=6cba56b1dbbb43864494ad852fecb24f5a75df7f diff --git a/src/lib/16_tdef.h b/src/lib/16_tdef.h index 10fd1eea..08b96996 100755 --- a/src/lib/16_tdef.h +++ b/src/lib/16_tdef.h @@ -66,12 +66,38 @@ typedef struct { //from 16_sprit.h #ifdef __WATCOMC__ +#include + +typedef struct vrs_container{ + // Size of a .vrs blob in memory + // minus header + dword data_size; + union{ + byte far *buffer; + struct vrs_header far *vrs_hdr; + }; + // Array of corresponding vrl line offsets + vrl1_vgax_offset_t **vrl_line_offsets; +} vrs_container_t; + +typedef struct vrl_container{ + // Size of a .vrl blob in memory + // minus header + dword data_size; + union{ + byte far *buffer; + struct vrl1_vgax_header far *vrl_header; + }; + // Pointer to a corresponding vrl line offsets struct + vrl1_vgax_offset_t *line_offsets; +} vrl_container_t; + typedef struct sprite { // VRS container from which we will extract animation and image data - struct vrs_container *spritesheet; + vrs_container_t spritesheet; // Container for a vrl sprite - struct vrl_container *sprite_vrl_cont; + vrl_container_t sprite_vrl_cont; // Current sprite id int curr_spri_id; // Index of a current sprite in an animation sequence @@ -189,6 +215,30 @@ typedef struct { //from 16_in //========================================================================== +#define KeyInt 9 // The keyboard ISR number + +// +// mouse constants +// +#define MReset 0 +#define MButtons 3 +#define MDelta 11 + +#define MouseInt 0x33 +//#define Mouse(x) _AX = x,geninterrupt(MouseInt) + +// +// joystick constants +// +#define JoyScaleMax 32768 +#define JoyScaleShift 8 +#define MaxJoyValue 5000 + +#define MaxPlayers 4 +#define MaxKbds 2 +#define MaxJoys 2 +#define NumCodes 128 + typedef byte ScanCode; typedef enum { @@ -204,12 +254,10 @@ typedef enum { motion_None = 0, motion_Right = 1,motion_Down = 1 } Motion; -typedef enum { - dir_North,//dir_NorthEast, - dir_West,//dir_Nortinest, - dir_None, - dir_East,//,dir_SouthEast, - dir_South,//dir_Soutinest, +typedef enum { // Quick lookup for total direction + /*dir_NorthWest, */dir_North,/* dir_NorthEast,*/ + dir_West, dir_None, dir_East, + /*dir_SouthWest, */dir_South/*, dir_SouthEast*/ } Direction; typedef struct { boolean near button0,button1,button2,button3; @@ -239,6 +287,33 @@ typedef struct { joyMultXH,joyMultYH; } JoystickDef; +typedef struct instat { + boolean CapsLock; + ScanCode CurCode,LastCode; + + boolean Keyboard[NumCodes]; + boolean Paused; + char LastASCII; + ScanCode LastScan; +} inst_t; + +typedef struct// inconfig +{ + boolean IN_Started; +// +// configuration variables +// + boolean JoysPresent[MaxJoys], + MousePresent, + JoyPadPresent; + +// Global variables + KeyboardDef KbdDefs[MaxKbds]; + JoystickDef JoyDefs[MaxJoys]; + //struct instat *inst; + inst_t *inst; +} in_info_t; + //========================================================================== typedef struct @@ -358,7 +433,7 @@ typedef struct mmblockstruct { word start,length; //word start; dword length; - word blob; //for data larger than 64k +//++++ word blob; //for data larger than 64k unsigned attributes; memptr *useptr; // pointer to the segment start struct mmblockstruct far *next; @@ -376,7 +451,7 @@ typedef struct boolean mmstarted, bombonerror, mmerror; void far *farheap; #ifdef __BORLANDC__ - void *nearheap; + void *nearheap; #endif #ifdef __WATCOMC__ void __near *nearheap; @@ -492,8 +567,8 @@ typedef struct MainPagesUsed, PMNumBlocks; long PMFrameCount; - PageListStruct far *PMPages; - __SEGA *PMSegPages; + PageListStruct far *PMPages, + _seg *PMSegPages; pm_mmi_t mm; pm_emmi_t emm; pm_xmmi_t xmm; @@ -517,7 +592,7 @@ typedef struct typedef struct { int mapon, mapnum; - //__SEGA *mapheaderseg[NUMMAPS]; + //maptype _seg *mapheaderseg[NUMMAPS]; } ca_mapinfo_t; typedef struct @@ -526,20 +601,37 @@ typedef struct int grhandle[4]; // handle to EGAGRAPH int audiohandle[4]; // handle to AUDIOT / AUDIO } ca_handle_t; - +/* + 16/wf3d8086/id_ca.c:byte _seg *tinf; +16/wf3d8086/id_ca.c:unsigned _seg *mapsegs[MAPPLANES]; +16/wf3d8086/id_ca.c:maptype _seg *mapheaderseg[NUMMAPS]; +16/wf3d8086/id_ca.c:byte _seg *audiosegs[NUMSNDCHUNKS]; +16/wf3d8086/id_ca.c:void _seg *grsegs[NUMCHUNKS]; +16/wf3d8086/id_ca.c:long _seg *grstarts; // array of offsets in egagraph, -1 for sparse +16/wf3d8086/id_ca.c:long _seg *audiostarts; // array of offsets in audio / audiot +16/wf3d8086/id_ca.c: grstarts = (long _seg *)FP_SEG(&EGAhead); +16/wf3d8086/id_ca.c: tinf = (byte _seg *)FP_SEG(&maphead); +16/wf3d8086/id_ca.c: pos = ((mapfiletype _seg *)tinf)->headeroffsets[i]; +16/wf3d8086/id_ca.c: audiostarts = (long _seg *)FP_SEG(&audiohead); +16/wf3d8086/id_ca.c: ((mapfiletype _seg *)tinf)->RLEWtag); +16/wf3d8086/id_ca.c: ((mapfiletype _seg *)tinf)->RLEWtag); +16/wf3d8086/id_ca.c: source = (byte _seg *)bufferseg+(pos-bufferstart);*/ typedef struct //TODO: USE THIS!!!! { byte ca_levelbit,ca_levelnum; ca_handle_t file; //files to open ca_mapinfo_t camap; - memptr/*__SEGA*/ mapsegs[MAP_LAYERS]; - memptr/*__SEGA*/ *grsegs[NUMCHUNKS]; + unsigned _seg *mapsegs[MAP_LAYERS]; + void _seg *grsegs[NUMCHUNKS]; byte far grneeded[NUMCHUNKS]; - memptr/*byte _seg*/ *audiosegs[NUMSNDCHUNKS]; + 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 //misc memptr - memptr tinf[4]; + byte _seg *tinf[4]; huffnode huffnode; @@ -551,21 +643,25 @@ typedef struct //TODO: USE THIS!!!! //actual global game varables! typedef enum { - ENGI_EXIT, ENGI_QUIT, ENGI_RUN, - ENGI_INPUT, + ENGI_MENU, ENGI_PAUSE } engi_stat_t; +//ENGI_INPUT, typedef struct { + engi_stat_t engi_stat; video_t video; // video settings variable ca_t ca; // ca stuff pm_t pm; // pm stuff - loghandle_t handle; //handles for file logging - kurokku_t kurokku; //clock struct - mminfo_t mm; mminfotype mmi; + loghandle_t handle; //handles for file logging + kurokku_t kurokku; //clock struct + mminfo_t mm; mminfotype mmi; // mm stuff + in_info_t in; // 16_in info + player_t player[MaxPlayers]; // player vars + map_view_t mv[4]; } global_game_variables_t; #ifdef __WATCOMC__