]> 4ch.mooo.com Git - 16.git/blobdiff - src/lib/16_tdef.h
==== bcexmm.exe works again! yay! ==== wwww
[16.git] / src / lib / 16_tdef.h
index b9889a25aa0b6083c62aeabb2ff7d61dff836e03..dbda778a0b9fa4f49dbd188377d5be301c08ba75 100755 (executable)
@@ -50,10 +50,10 @@ typedef struct {
 \r
 typedef struct {\r
        byte far **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
+       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
 \r
 typedef struct {\r
@@ -64,60 +64,6 @@ typedef struct {
        byte *palette;\r
 } planar_buf_t;\r
 \r
-//TODO: 16_mm and 16_ca must handle this\r
-typedef struct {\r
-       bitmap_t far *btdata;           //old\r
-       planar_buf_t far *data; //old\r
-       word tileHeight, tileWidth;\r
-       unsigned int rows, cols;\r
-//     #ifdef __DEBUG__\r
-//     boolean debug_text;     //show the value of the tile! wwww\r
-//     byte *debug_data;\r
-//     #endif\r
-} tiles_t;\r
-\r
-//TODO: 16_mm and 16_ca must handle this\r
-//TODO: add variables from 16_ca\r
-typedef struct {\r
-       //long          planestart[3];\r
-       //unsigned      planelength[3];\r
-       byte *data;                     //TODO: 16_mm and 16_ca must handle this\r
-       byte * far *layerdata;  //TODO: 16_mm and 16_ca must handle this\r
-       tiles_t *tiles;         //TODO: 16_mm and 16_ca must handle this\r
-       tiles_t * far *layertile;       //TODO: 16_mm and 16_ca must handle this\r
-       int width, height;              //this has to be signed!\r
-       char            name[16];\r
-} map_t;\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
-} tileinfo_t;\r
-\r
-typedef struct {\r
-       nibble/*word*/ id;      /* the Identification number of the page~ For layering~ */\r
-       byte far* data; /* the data for the page */\r
-       tileinfo_t      ti;\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 stridew;                   /* width/4 */   /* VGA */\r
-       word pagesize;                  /* page size */\r
-       word pi;                                /* increment page by this much to preserve location */\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
-\r
 //from 16_sprit.h\r
 #ifdef __WATCOMC__\r
 typedef struct sprite\r
@@ -159,7 +105,7 @@ typedef     struct
        word speed;             //entity speed!\r
        word spt;               //speed per tile\r
 #ifdef __WATCOMC__\r
-       sprite_t *spri; // sprite used by entity\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
@@ -167,6 +113,80 @@ typedef    struct
        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
+#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    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 MAP_LAYERS 3\r
+typedef struct {\r
+       //long          planestart[3];\r
+       //unsigned      planelength[3];\r
+       mapl_t layerdata[MAP_LAYERS];   // 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
+typedef struct {\r
+       nibble/*word*/ id;      /* the Identification number of the page~ For layering~ */\r
+       byte far* data; /* the data for the page */\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 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
+\r
 //from 16_in\r
 //==========================================================================\r
 typedef        byte            ScanCode;\r
@@ -226,10 +246,10 @@ typedef   struct
        entity_t near   enti;\r
 #ifdef __WATCOMC__\r
        //struct sprite *spri;  //supposively the sprite sheet data\r
-       memptr          gr;\r
+       //memptr                gr;\r
 #endif\r
-       bitmap_t        *data;          //supposively the sprite sheet data//old format\r
-       bitmap_t        bmp;\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
@@ -256,20 +276,23 @@ typedef struct
        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\r
+#define NUMCHUNKS      416     //keen\r
 //video\r
 typedef struct\r
 {\r
        unsigned int offscreen_ofs;\r
        unsigned int pattern_ofs;\r
-} ofs_t;\r
-#define NUMCHUNKS      416     //keen\r
+} ofs_t;       //unfinished\r
 \r
 typedef struct\r
 {\r
        char old_mode;          //old video mode before game!\r
-       byte palette[768];              //palette array\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
@@ -353,7 +376,7 @@ typedef struct
        boolean         mmstarted, bombonerror, mmerror;\r
        void far        *farheap;\r
 #ifdef __BORLANDC__\r
-       void    *nearheap;\r
+       void            *nearheap;\r
 #endif\r
 #ifdef __WATCOMC__\r
        void __near     *nearheap;\r
@@ -470,7 +493,7 @@ typedef struct
                                        PMNumBlocks;\r
        long                    PMFrameCount;\r
        PageListStruct  far *PMPages;\r
-       __SEGA *PMSegPages;\r
+       memptr/*__SEGA*/ *PMSegPages;\r
        pm_mmi_t        mm;\r
        pm_emmi_t       emm;\r
        pm_xmmi_t       xmm;\r
@@ -484,6 +507,7 @@ typedef struct
 \r
 #define NUMMAPS                4//39\r
 #define MAPPLANES              3\r
+#define NUMSNDCHUNKS           84\r
 \r
 typedef struct\r
 {\r
@@ -493,23 +517,30 @@ typedef struct
 typedef struct\r
 {\r
        int             mapon, mapnum;\r
-       __SEGA  *mapsegs[4];\r
-       __SEGA  *mapheaderseg[NUMMAPS];\r
-       __SEGA  *tinf;\r
+       //__SEGA        *mapheaderseg[NUMMAPS];\r
 } ca_mapinfo_t;\r
 \r
 typedef struct\r
 {\r
        int                     maphandle[4];           // handle to MAPTEMP / GAMEMAPS\r
+       int                     grhandle[4];            // handle to EGAGRAPH\r
+       int                     audiohandle[4]; // handle to AUDIOT / AUDIO\r
 } ca_handle_t;\r
 \r
-typedef struct\r
+typedef struct //TODO: USE THIS!!!!\r
 {\r
-       byte            ca_levelbit,ca_levelnum;\r
-       ca_handle_t     file;           //files to open\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
+\r
+       memptr/*__SEGA*/        mapsegs[MAP_LAYERS];\r
+       memptr/*__SEGA*/        *grsegs[NUMCHUNKS];\r
+       byte            far             grneeded[NUMCHUNKS];\r
+       memptr/*byte _seg*/     *audiosegs[NUMSNDCHUNKS];\r
+\r
+       //misc memptr\r
+       memptr tinf[4];\r
+\r
        huffnode huffnode;\r
 \r
        //TODO: extend! and learn from keen/wolf/catacomb's code wwww\r
@@ -539,6 +570,7 @@ typedef struct
 \r
 #ifdef __WATCOMC__\r
 extern char global_temp_status_text[512];\r
+extern char global_temp_status_text2[512];\r
 #define EINVFMT EMFILE\r
 #endif\r
 #endif /* _TYPEDEFSTRUCT_H_ */\r