]> 4ch.mooo.com Git - 16.git/blob - src/lib/16_tail.h
==== REPO AND DEBUG WORK==== I did many things to the repo and adding ability to...
[16.git] / src / lib / 16_tail.h
1 /* Project 16 Source Code~\r
2  * Copyright (C) 2012-2017 sparky4 & pngwen & andrius4669 & joncampbell123 & yakui-lover\r
3  *\r
4  * This file is part of Project 16.\r
5  *\r
6  * Project 16 is free software; you can redistribute it and/or modify\r
7  * it under the terms of the GNU General Public License as published by\r
8  * the Free Software Foundation; either version 3 of the License, or\r
9  * (at your option) any later version.\r
10  *\r
11  * Project 16 is distributed in the hope that it will be useful,\r
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of\r
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
14  * GNU General Public License for more details.\r
15  *\r
16  * You should have received a copy of the GNU General Public License\r
17  * along with this program.  If not, see <http://www.gnu.org/licenses/>, or\r
18  * write to the Free Software Foundation, Inc., 51 Franklin Street,\r
19  * Fifth Floor, Boston, MA 02110-1301 USA.\r
20  *\r
21  */\r
22 \r
23 #ifndef __16_TAIL__\r
24 #define __16_TAIL__\r
25 \r
26 #include "src/lib/16_head.h"\r
27 #include "src/lib/16text.h"\r
28 #include "src/lib/16_pm.h"\r
29 #include "src/lib/16_mm.h"\r
30 #include "src/lib/16_ca.h"\r
31 #include "src/lib/16_in.h"\r
32 #include "src/lib/16_dbg.h"\r
33 #include "src/lib/16_vl.h"\r
34 #include "src/lib/testpatt.h"\r
35 \r
36 #ifdef __WATCOMC__\r
37 #include <hw/cpu/cpu.h>\r
38 #include <hw/dos/dos.h>\r
39 #include <hw/vga/vga.h>\r
40 #include <hw/vga/vrl.h>\r
41 #include <hw/vga/vrs.h>\r
42 #endif\r
43 \r
44 //gvar.video.ofs.bufferofs,gvar.video.ofs.displayofs,\r
45 #define FIZZLEFADEFUNCTION \\r
46         if(gvar.in.inst->Keyboard[sc_F]){ FizzleFade(\\r
47         atoi(gvar.video.page[0].data),atoi(gvar.video.page[1].data),\\r
48 320,240,true, &gvar);   IN_UserInput(1, &gvar); } \\r
49 \r
50 #define TAIL_FUNCTIONKEYFUNCTIONS \\r
51         if(gvar.in.inst->Keyboard[88]){ panswitch=!panswitch;                                                   IN_UserInput(1, &gvar); } \\r
52         TAIL_FUNCTIONKEYFUNCTIONS0EXE\r
53 \r
54 #define RFDEBUGFUNCTIONS\r
55 #ifdef __DEBUG_RF__\r
56 #undef RFDEBUGFUNCTIONS\r
57 #define RFDEBUGFUNCTIONS \\r
58         if(gvar.in.inst->Keyboard[sc_F11]){ dbg_pagedelayrendermap=!dbg_pagedelayrendermap;             IN_UserInput(1, &gvar); } \\r
59         if(gvar.in.inst->Keyboard[sc_F9]){ dbg_pagenorendermap=!dbg_pagenorendermap;                    IN_UserInput(1, &gvar); }\r
60 #endif\r
61 \r
62 /*#define MAPDEBUGFUNCTIONS\r
63 #ifdef __DEBUG_MAP__\r
64 #undef MAPDEBUGFUNCTIONS\r
65 #define MAPDEBUGFUNCTIONS \\r
66         if(gvar.in.inst->Keyboard[sc_F12]){ dbg_maptext!=dbg_maptext;                                           IN_UserInput(1, &gvar); }\r
67 #endif*/\r
68 \r
69 /*#define SPRIDEBUGFUNCTIONS\r
70 #ifdef __DEBUG_SPRI__\r
71 #undef SPRIDEBUGFUNCTIONS\r
72 #define SPRIDEBUGFUNCTIONS \\r
73         if(gvar.in.inst->Keyboard[sc_Y]){ dbg_delayanimation=!dbg_delayanimation;                               IN_UserInput(1, &gvar); }\r
74 //      if(gvar.in.inst->Keyboard[sc_F9]){ dbg_pagenorendermap=!dbg_pagenorendermap;                    IN_UserInput(1, &gvar); }\r
75 #endif*/\r
76 \r
77 #define TAIL_FUNCTIONKEYFUNCTIONS0EXE \\r
78         if(gvar.in.inst->Keyboard[sc_F4]){ turboXT(12);                                                                 IN_UserInput(1, &gvar); } \\r
79         if(gvar.in.inst->Keyboard[68/*sc_F10*/]){ gvar.kurokku.fpscap=!gvar.kurokku.fpscap;                     IN_UserInput(1, &gvar); } \\r
80         if(gvar.in.inst->Keyboard[sc_F8]){ gvar.video.vga_state.bgps=!gvar.video.vga_state.bgps;                IN_UserInput(1, &gvar); } \\r
81         if(gvar.in.inst->Keyboard[sc_F7]){ VL_ShowPage(&gvar.video.page, 0, 1);                                         IN_UserInput(1, &gvar); } \\r
82         if(gvar.in.inst->Keyboard[sc_F6]){ VL_ShowPage(&gvar.video.page, 0, 0);                                         IN_UserInput(1, &gvar); } \\r
83         if(gvar.in.inst->Keyboard[sc_T]){ gvar.video.vga_state.rss=!gvar.video.vga_state.rss;                   IN_UserInput(1, &gvar); } \\r
84         if(gvar.in.inst->Keyboard[sc_P]){ modexpdump(0, &gvar);                                                 IN_UserInput(1, &gvar); } \\r
85         if(gvar.in.inst->Keyboard[sc_Y]){ dbg_delayanimation=!dbg_delayanimation;                               IN_UserInput(1, &gvar); } \\r
86         if(gvar.in.inst->Keyboard[sc_Q]){ VL_modexPrintTextBox(&gvar);                                          IN_UserInput(1, &gvar); } \\r
87         if(gvar.in.inst->Keyboard[sc_W]){ VL_MemToScreen((byte __far *)&gvar, 64, 64, 16, 16, &gvar);   IN_UserInput(1, &gvar); } \\r
88         if(gvar.in.inst->Keyboard[sc_LBrkt]){ ShowPalVal (&gvar);                                                       IN_UserInput(1, &gvar); } \\r
89         if(gvar.in.inst->Keyboard[sc_M]){ MM_ShowMemory(&gvar); MM_DumpData (&gvar);                    IN_UserInput(1, &gvar); } \\r
90         RFDEBUGFUNCTIONS\r
91 //FIZZLEFADEFUNCTION\r
92 \r
93 #define TAIL_PANKEYFUN \\r
94         TAIL_PANKEYFUNZC \\r
95         TAIL_FUNCTIONKEYDRAWJUNK\r
96 \r
97 #define TAIL_PANKEYFUNZC \\r
98         ZC_panPageManual(&gvar.mv, &gvar.player, 0);\r
99 \r
100 #define FUNCTIONKEYSHOWMV \\r
101         if(gvar.in.inst->Keyboard[1+1]){ gvar.video.sp=0; VL_ShowPage(&gvar.video.page, 0, 0); } \\r
102         if(gvar.in.inst->Keyboard[2+1]){ gvar.video.sp=1; VL_ShowPage(&gvar.video.page, 0, 0); } \\r
103         if(gvar.in.inst->Keyboard[3+1]){ gvar.video.sp=2; VL_ShowPage(&gvar.video.page, 0, 1); } \\r
104         if(gvar.in.inst->Keyboard[4+1]){ gvar.video.sp=3; VL_ShowPage(&gvar.video.page, 0, 1); }\r
105 \r
106 #define TAIL_FUNCTIONKEYDRAWJUNK \\r
107         FUNCTIONKEYSHOWMV \\r
108         TAIL_FUNCTIONKEYDRAWJUNKNOMV\r
109 \r
110 #define TAIL_FUNCTIONKEYDRAWJUNKNOMV \\r
111         if(gvar.in.inst->Keyboard[sc_A]){ modexClearRegion(&gvar.video.page[2], 0, 0, gvar.video.page[2].sw, gvar.video.page[2].sh, 3); } \\r
112         if(gvar.in.inst->Keyboard[sc_S]){ modexClearRegion(&gvar.video.page[3], 0, 0, gvar.video.page[3].sw, gvar.video.page[3].sh, 4); } \\r
113 \\r
114         if(gvar.in.inst->Keyboard[sc_Z]){ DRAWCORNERBOXES } \\r
115         if(gvar.in.inst->Keyboard[sc_X]){ TESTBG12 } \\r
116         if(gvar.in.inst->Keyboard[sc_C]){ TESTBG34 } \\r
117         if(gvar.in.inst->Keyboard[sc_V]){ VL_PatternDraw(&gvar.video, 0, 1, 1); } \\r
118         if(gvar.in.inst->Keyboard[sc_I]){ dbg_maptext=!dbg_maptext; IN_UserInput(1, &gvar); } \\r
119         if(gvar.in.inst->Keyboard[sc_PgDn]){ \\r
120                 rotateR(gvar.video.palette, sizeof(gvar.video.palette)/sizeof(gvar.video.palette[0])); \\r
121                 VL_UpdatePaletteWrite(&gvar.video.palette, 0, 255, &gvar);              IN_UserInput(1, &gvar); } \\r
122         if(gvar.in.inst->Keyboard[sc_PgUp]){ \\r
123                 rotateL(gvar.video.palette, sizeof(gvar.video.palette)/sizeof(gvar.video.palette[0])); \\r
124                 VL_UpdatePaletteWrite(&gvar.video.palette, 0, 255, &gvar);              IN_UserInput(1, &gvar); }\r
125 #ifdef __BORLANDC__\r
126 #define PAL_WRITE_REG              0x03C8   /* Color register, write address */\r
127 #define PAL_DATA_REG                    0x03C9   /* Color register, data port */\r
128 #endif\r
129 \r
130 void    Shutdown16(global_game_variables_t *gvar),\r
131         Startup16(global_game_variables_t *gvar),\r
132         StartupCAMMPM (global_game_variables_t *gvar),\r
133         ShutdownCAMMPM (global_game_variables_t *gvar);\r
134 void TL_DosLibStartup(global_game_variables_t *gvar);\r
135 void TL_VidInit(global_game_variables_t *gvar);\r
136 boolean FizzleFade (unsigned source, unsigned dest, unsigned width, unsigned height, unsigned frames, boolean abortable, global_game_variables_t *gvar);\r
137 void DebugMemory_(global_game_variables_t *gvar, boolean q);\r
138 void ClearMemory (global_game_variables_t *gvar);\r
139 void Quit (global_game_variables_t *gvar, char *error);\r
140 void turboXT(byte bakapee);\r
141 void nibbletest();\r
142 void booleantest();\r
143 \r
144 #endif  /*__16_TAIL__ */\r