OSDN Git Service

got pcxtest.exe to compile and work
[proj16/16.git] / src / lib / 16_tdef.h
index a1a2939..75ff0f2 100755 (executable)
@@ -1,5 +1,5 @@
 /* Project 16 Source Code~\r
- * Copyright (C) 2012-2017 sparky4 & pngwen & andrius4669 & joncampbell123 & yakui-lover\r
+ * Copyright (C) 2012-2022 sparky4 & pngwen & andrius4669 & joncampbell123 & yakui-lover\r
  *\r
  * This file is part of Project 16.\r
  *\r
  * typedefs of the game variables!\r
  */\r
 typedef struct {\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
+} planar_buf_t;\r
+\r
+#ifndef BITMAPT\r
+#define BITMAPT\r
+typedef struct {\r
        byte *data;\r
        word width;\r
        word height;\r
@@ -61,14 +71,7 @@ typedef struct {
        word theight;   // height of the tiles\r
        byte *palette;  // palette for the tile set\r
 } tileset_t;\r
-\r
-typedef struct {\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
-} planar_buf_t;\r
+#endif\r
 \r
 //from 16_sprit.h\r
 #ifdef __WATCOMC__\r
@@ -138,7 +141,7 @@ typedef     struct
        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 speed;             //entity speed!\r
        word spt;               //speed per tile\r
 #ifdef __WATCOMC__\r
        sprite_t spri; // sprite used by entity\r
@@ -204,6 +207,8 @@ typedef struct{
        sword tileplayerposscreeny;     /* player position on screen */ /* needed for scroll and map system to work accordingly */\r
 } pagetileinfo_t;\r
 \r
+#ifndef PAGET\r
+#define PAGET\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
@@ -222,6 +227,7 @@ typedef struct {
 //TODO: find where they are used\r
        sword delta;                    // How much should we shift the page for smooth scrolling\r
 } page_t;\r
+#endif\r
 \r
 //from 16_in\r
 //==========================================================================\r
@@ -332,8 +338,8 @@ typedef     struct
        //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
+       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
@@ -350,6 +356,8 @@ typedef struct
 {\r
        int profilehandle,debughandle,showmemhandle;\r
        int heaphandle;\r
+       byte datadumpfilename[12];\r
+       byte heapdumpfilename[12];\r
 } loghandle_t;\r
 \r
 typedef struct\r
@@ -366,7 +374,7 @@ typedef struct
 //===================================//\r
 #define PALSIZE                        768     //vga\r
 #define NUMCHUNKS              416     //keen\r
-#define MAXSCANLINES   240     // size of ylookup table\r
+//#define MAXSCANLINES 240     // size of ylookup table\r
 \r
 #define MAXSHIFTS              4\r
 #define STARTSPRITES   0       //temp\r
@@ -400,7 +408,7 @@ typedef struct
        word    quadwh;                 //preproccessed quad size of tilewidth and tileheight\r
 } tile_dimention_t;\r
 \r
-#define MAXSCROLLEDGES 6\r
+#define MAXSCROLLEDGES 2\r
 typedef struct\r
 {\r
        unsigned        panx,pany;              // panning adjustments inside port in pixels\r
@@ -412,6 +420,16 @@ typedef struct
 \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
@@ -450,6 +468,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.\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
@@ -457,7 +476,7 @@ typedef struct
        word            bordercolor;\r
        boolean fastpalette;\r
        byte            far     palette1[256][3],far palette2[256][3];\r
-       pictabletype    _seg *pictable;\r
+//???? pictabletype    _seg *pictable;\r
        //keen/cata vars\r
 //     spritetabletype _seg *spritetable;\r
 //     unsigned        *shifttabletable[8];\r
@@ -497,11 +516,12 @@ typedef struct
 //from 16_mm\r
 //==========================================================================\r
 \r
-#define MAXBLOCKS              800//kd=1300 wolf3d=700 cata=600\r
+#define MAXBLOCKS              1024            //kd=1300 wolf3d=700 cata=600\r
 \r
 typedef struct mmblockstruct\r
 {\r
-       unsigned        start,length;\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
        struct mmblockstruct far *next;\r
@@ -509,7 +529,7 @@ typedef struct mmblockstruct
 \r
 typedef struct mmshowmemoryinfo\r
 {\r
-       word x,y;\r
+//     unsigned x,y;\r
        mmblocktype far *scan;\r
 } mmshowmemoryinfo_t;\r
 \r
@@ -653,6 +673,49 @@ typedef struct
 \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
@@ -669,6 +732,7 @@ typedef struct
        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
@@ -756,19 +820,20 @@ typedef struct    //TODO: USE THIS!!!!
 #ifdef GRHEADERLINKED\r
        huffnode        *grhuffman;\r
 #else\r
-       huffnode        grhuffman[255];\r
+       huffnode        grhuffman[63];\r
 #endif\r
 \r
 #ifdef AUDIOHEADERLINKED\r
        huffnode        *audiohuffman;\r
 #else\r
-       huffnode        audiohuffman[255];\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
@@ -798,6 +863,7 @@ typedef struct glob_game_vars
        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