Revisão | b8c9d5fcb2b66420bc673f54b14cc5d0ea5283ed (tree) |
---|---|
Hora | 2017-11-10 03:46:58 |
Autor | sparky4 <sparky4@cock...> |
Commiter | sparky4 |
i did a butt load of tweaking to the paltest code and i did verious fixes here and there. paltest needs serious work. I need to study the code i wrote and i also NEED to comment it wwww
@@ -209,7 +209,7 @@ void modexLoadPalFile(char *filename, byte *palette); | ||
209 | 209 | void VL_LoadPalFile(const char *filename, byte *palette, global_game_variables_t *gvar); |
210 | 210 | void VL_LoadPalFileCore(byte *palette, global_game_variables_t *gvar); |
211 | 211 | void VL_SetCorePal(global_game_variables_t *gvar); |
212 | -//void VLL_LoadPalFilewithoffset(const char *filename, byte *palette, word o, global_game_variables_t *gvar); | |
212 | +void VLL_LoadPalFilewithoffset(const char *filename, byte *palette, word o, word palsize, global_game_variables_t *gvar); | |
213 | 213 | void VL_UpdatePaletteWrite(byte *palette, word o, word palsize, global_game_variables_t *gvar); |
214 | 214 | void VL_PaletteSync(global_game_variables_t *gvar); |
215 | 215 | void modexSavePalFile(char *filename, byte *palette); |
@@ -189,7 +189,7 @@ aqpee: | ||
189 | 189 | while(aq<=aa) |
190 | 190 | { |
191 | 191 | #ifdef BEVERBOSEPALCHECK |
192 | - printf("a[%02d]=(%d)\n", aq, a[aq]);// | |
192 | +// printf("a[%02d]=(%d)\n", aq, a[aq]);//0000 | |
193 | 193 | #endif |
194 | 194 | if(a[aq]==-1) aq++; |
195 | 195 | else { aqoffset++; break; } |
@@ -2,8 +2,10 @@ | ||
2 | 2 | #define __16_VLPALD_H__ |
3 | 3 | |
4 | 4 | #define BEVERBOSEPALCHECK |
5 | +//#define BEVERBOSECOLORCHECK | |
6 | +//#define DONOTPALCHECK | |
5 | 7 | |
6 | -#ifdef BEVERBOSEPALCHECK | |
8 | +#ifdef BEVERBOSECOLORCHECK | |
7 | 9 | #define CHKCOLDBGOUT1 \ |
8 | 10 | printf("q: %02d\n", (*q));\ |
9 | 11 | printf("chkcolor start~\n");\ |
@@ -44,6 +46,17 @@ | ||
44 | 46 | printf("2 (*i): %d\n", (*i)/3); \ |
45 | 47 | printf("2 offset of color in palette (*q): %d\n", (*q)/3); \ |
46 | 48 | printf("chkcolor end~\n"); |
49 | +#else | |
50 | +#define CHKCOLDBGOUT1 | |
51 | +#define CHKCOLDBGOUT2 | |
52 | +#define CHKCOLDBGOUT3 | |
53 | +#define CHKCOLDBGOUT4 | |
54 | +#define CHKCOLDBGOUT5 | |
55 | +#define CHKCOLDBGOUT6 | |
56 | +#define CHKCOLDBGOUT7 | |
57 | +#define CHKCOLDBGOUT8 | |
58 | +#define CHKCOLDBGOUT9 | |
59 | +#define CHKCOLDBGOUT10 | |
47 | 60 | #endif |
48 | 61 | //======// |
49 | 62 |
@@ -1 +1 @@ | ||
1 | -Subproject commit 9f68b899de82e9ed49cf03bd617820f98db034c3 | |
1 | +Subproject commit 2b7b2ed6b38382723b80be134cb5d22284de2eb4 |
@@ -165,19 +165,18 @@ void main() | ||
165 | 165 | Created linked list will be 11->11->11->13->13->20 */ |
166 | 166 | pushll(&head, 20); |
167 | 167 | pushll(&head, 13); |
168 | - pushll(&head, 13); | |
168 | + pushll(&head, 13); | |
169 | + pushll(&head, 11); | |
169 | 170 | pushll(&head, 11); |
170 | 171 | pushll(&head, 11); |
171 | - pushll(&head, 11); | |
172 | - | |
172 | + | |
173 | 173 | printf("\n Linked list before duplicate removal "); |
174 | - printList(head); | |
175 | - | |
174 | + printList(head); | |
175 | + | |
176 | 176 | /* Remove duplicates from linked list */ |
177 | - removeDuplicates(head); | |
178 | - | |
179 | - printf("\n Linked list after duplicate removal "); | |
180 | - printList(head); | |
181 | - | |
177 | + removeDuplicates(head); | |
178 | + | |
179 | + printf("\n Linked list after duplicate removal "); | |
180 | + printList(head); | |
182 | 181 | } |
183 | 182 | #endif |
@@ -29,7 +29,7 @@ | ||
29 | 29 | #define LGQ 32 |
30 | 30 | #define HGQ 55 |
31 | 31 | |
32 | -static word far* clockw= (word far*) 0x046C; /* 18.2hz clock */ | |
32 | +static word far* clockw= (word far*) 0x046C; // 18.2hz clock // | |
33 | 33 | |
34 | 34 | void drawboxesmodex(page_t *pg) |
35 | 35 | { |
@@ -47,102 +47,63 @@ void copyboxesmodex(page_t *page, boolean pn) | ||
47 | 47 | void main(int argc, char *argv[]) |
48 | 48 | { |
49 | 49 | static word paloffset=0; |
50 | - global_game_variables_t gvar; | |
51 | - | |
52 | -// map_view_t mv[4]; | |
53 | - map_t map; | |
50 | + static global_game_variables_t gvar; | |
54 | 51 | |
55 | 52 | int i, j; |
56 | 53 | word startclk, endclk; |
57 | 54 | word k; |
58 | 55 | |
56 | +#ifndef DONOTPALCHECK | |
59 | 57 | imgtestpal_t bmp1, bmp2; |
60 | - | |
61 | - | |
62 | 58 | bmp1.width=bmp2.width= 40; |
63 | 59 | bmp1.width=bmp2.height= 30; |
60 | +#endif | |
64 | 61 | |
65 | 62 | //====word colo=LGQ; |
66 | 63 | |
67 | - // DOSLIB: check our environment | |
68 | - /*probe_dos(); | |
69 | - | |
70 | - // DOSLIB: what CPU are we using? | |
71 | - // NTS: I can see from the makefile Sparky4 intends this to run on 8088 by the -0 switch in CFLAGS. | |
72 | - // So this code by itself shouldn't care too much what CPU it's running on. Except that other | |
73 | - // parts of this project (DOSLIB itself) rely on CPU detection to know what is appropriate for | |
74 | - // the CPU to carry out tasks. --J.C. | |
75 | - cpu_probe(); | |
76 | - | |
77 | - // DOSLIB: check for VGA | |
78 | - if (!probe_vga()) { | |
79 | - printf("VGA probe failed\n"); | |
80 | - return; | |
81 | - } | |
82 | - // hardware must be VGA or higher! | |
83 | - if (!(vga_state.vga_flags & VGA_IS_VGA)) { | |
84 | - printf("This program requires VGA or higher graphics hardware\n"); | |
85 | - return; | |
86 | - } | |
87 | - | |
88 | - if (_DEBUG_INIT() == 0) { | |
89 | -#ifdef DEBUGSERIAL | |
90 | - printf("WARNING: Failed to initialize DEBUG output\n"); | |
91 | -#endif | |
92 | - } | |
93 | - _DEBUG("Serial debug output started\n"); // NTS: All serial output must end messages with newline, or DOSBox-X will not emit text to log | |
94 | - _DEBUGF("Serial debug output printf test %u %u %u\n",1U,2U,3U);*/ | |
95 | 64 | Startup16(&gvar); |
96 | 65 | |
97 | - /* save the palette */ | |
66 | + // save the palette // | |
98 | 67 | //====modexPalSave(pal); |
99 | 68 | //====modexFadeOff(1, pal); |
100 | 69 | //====modexPalBlack(); |
101 | 70 | |
102 | - //IN_Startup(); | |
103 | 71 | IN_Default(0,&gvar.player[0],ctrl_Keyboard1, &gvar); |
104 | 72 | EN_initPlayer(&gvar.player[0], &gvar.video); |
105 | 73 | |
106 | - VGAmodeX(1, 1, &gvar); | |
107 | - modexPalBlack(); | |
74 | + VL_Startup(&gvar);//VGAmodeX(1, 1, &gvar); | |
75 | + modexPalBlack(); VL_PaletteSync(&gvar); | |
108 | 76 | |
109 | - /* load our palette */ | |
77 | + // load our palette // | |
110 | 78 | VL_LoadPalFile("data/16.pal", &gvar.video.palette, &gvar); |
79 | +#ifndef DONOTPALCHECK | |
111 | 80 | bmp1.offset=(paloffset/3); |
112 | - VL_palette(&bmp1, &gvar.video.palette, &paloffset, 0, 0, &gvar); | |
81 | +// VL_palette(&bmp1, &gvar.video.palette, &paloffset, 0, 0, &gvar); | |
113 | 82 | |
114 | 83 | //VL_LoadPalFilewithoffset("data/default.pal", &palette, paloffset); |
115 | 84 | modexLoadPalFile("data/16t.pal", &gvar.video.dpal); |
85 | + //VLL_LoadPalFilewithoffset("data/16t.pal", &gvar.video.palette, paloffset, 8, &gvar); | |
116 | 86 | bmp2.offset=(paloffset/3); |
117 | - VL_palette(&bmp2, &gvar.video.dpal, &paloffset, 0, 0, &gvar); | |
87 | +// VL_palette(&bmp2, &gvar.video.dpal, &paloffset, 0, 0, &gvar); | |
118 | 88 | //====modexLoadPalFile("data/default.pal", &pal2); |
89 | +#endif | |
90 | + VL_PaletteSync(&gvar); | |
119 | 91 | |
120 | - /* overscan show */ | |
92 | + // overscan show // | |
121 | 93 | //modexPalOverscan(44+1); |
122 | 94 | |
123 | - /* set up the page, but with 16 pixels on all borders in offscreen mem */ | |
95 | + // set up the page, but with 16 pixels on all borders in offscreen mem // | |
124 | 96 | modexHiganbanaPageSetup(&gvar); |
125 | - ZC_MVSetup(&gvar.mv, &map, &gvar); | |
126 | - | |
127 | - /* fill the page with one color, but with a black border */ | |
128 | - /*modexClearRegion(&gvar.video.page[1], 0, 0, gvar.video.page[1].width, gvar.video.page[1].height, 15); | |
129 | - modexClearRegion(&gvar.video.page[1], 16, 16, gvar.video.page[1].sw, gvar.video.page[1].sh, 128); | |
130 | - modexClearRegion(&gvar.video.page[1], 32, 32, gvar.video.page[1].sw-32, gvar.video.page[1].sh-32, 42); | |
131 | - modexClearRegion(&gvar.video.page[1], 48, 48, gvar.video.page[1].sw-64, gvar.video.page[1].sh-64, 128); | |
132 | - modexShowPage(&gvar.video.page[1]); | |
133 | - modexClearRegion(&gvar.video.page[0], 0, 0, gvar.video.page[0].width, gvar.video.page[0].height, 15); | |
134 | - modexClearRegion(&gvar.video.page[0], 16, 16, gvar.video.page[0].sw, gvar.video.page[0].sh, 128); | |
135 | - modexClearRegion(&gvar.video.page[0], 32, 32, gvar.video.page[0].sw-32, gvar.video.page[0].sh-32, 42); | |
136 | - modexClearRegion(&gvar.video.page[0], 48, 48, gvar.video.page[0].sw-64, gvar.video.page[0].sh-64, 128); | |
137 | - modexShowPage(&gvar.video.page[0]);*/ | |
97 | + ZC_MVSetup(&gvar.mv, &gvar.map, &gvar); | |
138 | 98 | |
99 | + // fill the page with one color, but with a black border // | |
139 | 100 | drawboxesmodex(&gvar.video.page[0]); |
140 | 101 | copyboxesmodex(&gvar.video.page, 1); |
141 | 102 | modexClearRegion(&gvar.video.page[2], 0, 0, gvar.video.page[2].sw, gvar.video.page[2].sh, 4); |
142 | 103 | modexClearRegion(&gvar.video.page[3], 0, 0, gvar.video.page[3].sw, gvar.video.page[3].sh, 6); |
143 | 104 | |
144 | 105 | |
145 | - /* fade in */ | |
106 | + // fade in // | |
146 | 107 | //====modexFadeOn(1, pal2); |
147 | 108 | |
148 | 109 | i=0,k=0,j=0; |
@@ -160,7 +121,8 @@ void main(int argc, char *argv[]) | ||
160 | 121 | TAIL_PANKEYFUN; |
161 | 122 | if(gvar.in.inst->Keyboard[12]) modexClearRegion(&gvar.video.page[0], (gvar.video.page[0].width/2)-4, (gvar.video.page[0].height/2)-16, 24, 32, 15); |
162 | 123 | if(gvar.in.inst->Keyboard[13]) modexClearRegion(&gvar.video.page[1], (gvar.video.page[1].width/2)-4, (gvar.video.page[1].height/2)-16, 24, 32, 15); |
163 | -/*==== if(gvar.in.inst->Keyboard[7)){ | |
124 | +#if 0 | |
125 | +//==== if(gvar.in.inst->Keyboard[7)){ | |
164 | 126 | for(i=0;i<3;i++) |
165 | 127 | { |
166 | 128 | pal2[i] = rand()%64; |
@@ -169,7 +131,8 @@ void main(int argc, char *argv[]) | ||
169 | 131 | if(colo>HGQ) colo=LGQ; |
170 | 132 | } |
171 | 133 | // if(i>PAL_SIZE) i=0; |
172 | - }//9*/ | |
134 | + }//9 | |
135 | +#endif | |
173 | 136 | if(gvar.in.inst->Keyboard[25]){ modexpdump(gvar.video.sp, &gvar); IN_UserInput(1, &gvar); }//p |
174 | 137 | if(gvar.in.inst->Keyboard[sc_I]){ drawboxesmodex(&gvar.video.page[gvar.video.sp]); IN_UserInput(1, &gvar); }//i |
175 | 138 | if(gvar.in.inst->Keyboard[sc_O]){ copyboxesmodex(&gvar.video.page, !gvar.video.sp); IN_UserInput(1, &gvar); }//o |
@@ -179,19 +142,17 @@ void main(int argc, char *argv[]) | ||
179 | 142 | |
180 | 143 | endclk = *clockw; |
181 | 144 | |
182 | - /* fade back to text mode */ | |
145 | + // fade back to text mode // | |
183 | 146 | //====modexFadeOff(1, pal2); |
184 | 147 | //====modexPalBlack(); |
185 | - VGAmodeX(0, 1, &gvar); | |
186 | - Shutdown16(&gvar); | |
187 | - printf("Project 16 vidtest.exe. This is just a test file!\n"); | |
148 | + Shutdown16(&gvar);//VGAmodeX(0, 1, &gvar); | |
149 | + printf("Project 16 paltest.exe. This is just a test file!\n"); | |
188 | 150 | printf("version %s\n", VERSION); |
189 | 151 | VL_PrintmodexmemInfo(&gvar.video); |
190 | 152 | printf("tx=%d ", gvar.mv[gvar.video.sp].tx); printf("ty=%d ", gvar.mv[gvar.video.sp].ty); printf("gvar.player.d=%d\n", gvar.player[0].enti.d); |
191 | 153 | printf("\n====\n"); |
192 | 154 | printf("0 paloffset= %d\n", paloffset/3); |
193 | 155 | printf("====\n\n"); |
194 | - //IN_Shutdown(); | |
195 | 156 | //====modexPalBlack(); |
196 | 157 | //====modexFadeOn(1, pal); |
197 | 158 | } |
@@ -15,6 +15,11 @@ void main() | ||
15 | 15 | PRINT_OPAQUE_STRUCT(&gvar.mm); |
16 | 16 | printf("mmi:\n"); |
17 | 17 | PRINT_OPAQUE_STRUCT(&gvar.mmi); |
18 | + printf("sizeof gvar.video=%d\n", sizeof(gvar.video)); | |
19 | + printf("sizeof gvar.ca=%d\n", sizeof(gvar.ca)); | |
20 | + printf("sizeof gvar.pm=%d\n", sizeof(gvar.pm)); | |
21 | + printf("sizeof gvar.mm=%d\n", sizeof(gvar.mm)); | |
22 | + printf("sizeof gvar.mmi=%d\n", sizeof(gvar.mmi)); | |
18 | 23 | printf("sizeof gvar=%d\n", sizeof(gvar)); |
19 | 24 | // handle |
20 | 25 | // kurokku |
@@ -29,7 +29,7 @@ | ||
29 | 29 | #define LGQ 32 |
30 | 30 | #define HGQ 55 |
31 | 31 | |
32 | -static word far* clockw= (word far*) 0x046C; /* 18.2hz clock */ | |
32 | +static word far* clockw= (word far*) 0x046C; // 18.2hz clock // | |
33 | 33 | |
34 | 34 | void drawboxesmodex(page_t *pg) |
35 | 35 | { |
@@ -47,44 +47,44 @@ void copyboxesmodex(page_t *page, boolean pn) | ||
47 | 47 | void main(int argc, char *argv[]) |
48 | 48 | { |
49 | 49 | static global_game_variables_t gvar; |
50 | - map_t map; | |
51 | 50 | |
52 | 51 | int i, j; |
53 | 52 | word startclk, endclk; |
54 | 53 | word k; |
55 | 54 | |
55 | + //====word colo=LGQ; | |
56 | + | |
56 | 57 | Startup16(&gvar); |
57 | 58 | |
58 | - /* save the palette */ | |
59 | + // save the palette // | |
59 | 60 | //====modexPalSave(pal); |
60 | 61 | //====modexFadeOff(1, pal); |
61 | 62 | //====modexPalBlack(); |
62 | 63 | |
63 | - //IN_Startup(); | |
64 | 64 | IN_Default(0,&gvar.player[0],ctrl_Keyboard1, &gvar); |
65 | 65 | EN_initPlayer(&gvar.player[0], &gvar.video); |
66 | 66 | |
67 | - VGAmodeX(1, 1, &gvar); | |
67 | + VL_Startup(&gvar);//VGAmodeX(1, 1, &gvar); | |
68 | 68 | modexPalBlack(); |
69 | 69 | |
70 | - /* load our palette */ | |
70 | + // load our palette // | |
71 | 71 | VL_LoadPalFile("data/16.pal", &gvar.video.palette, &gvar); |
72 | 72 | |
73 | - /* overscan show */ | |
73 | + // overscan show // | |
74 | 74 | //modexPalOverscan(44+1); |
75 | 75 | |
76 | - /* set up the page, but with 16 pixels on all borders in offscreen mem */ | |
76 | + // set up the page, but with 16 pixels on all borders in offscreen mem // | |
77 | 77 | modexHiganbanaPageSetup(&gvar); |
78 | - ZC_MVSetup(&gvar.mv, &map, &gvar); | |
78 | + ZC_MVSetup(&gvar.mv, &gvar.map, &gvar); | |
79 | 79 | |
80 | - /* fill the page with one color, but with a black border */ | |
80 | + // fill the page with one color, but with a black border // | |
81 | 81 | drawboxesmodex(&gvar.video.page[0]); |
82 | 82 | copyboxesmodex(&gvar.video.page, 1); |
83 | 83 | modexClearRegion(&gvar.video.page[2], 0, 0, gvar.video.page[2].sw, gvar.video.page[2].sh, 4); |
84 | 84 | modexClearRegion(&gvar.video.page[3], 0, 0, gvar.video.page[3].sw, gvar.video.page[3].sh, 6); |
85 | 85 | |
86 | 86 | |
87 | - /* fade in */ | |
87 | + // fade in // | |
88 | 88 | //====modexFadeOn(1, pal2); |
89 | 89 | |
90 | 90 | i=0,k=0,j=0; |
@@ -112,16 +112,14 @@ void main(int argc, char *argv[]) | ||
112 | 112 | |
113 | 113 | endclk = *clockw; |
114 | 114 | |
115 | - /* fade back to text mode */ | |
115 | + // fade back to text mode // | |
116 | 116 | //====modexFadeOff(1, pal2); |
117 | 117 | //====modexPalBlack(); |
118 | - VGAmodeX(0, 1, &gvar); | |
119 | - Shutdown16(&gvar); | |
118 | + Shutdown16(&gvar);//VGAmodeX(0, 1, &gvar); | |
120 | 119 | printf("Project 16 vidtest.exe. This is just a test file!\n"); |
121 | 120 | printf("version %s\n", VERSION); |
122 | 121 | VL_PrintmodexmemInfo(&gvar.video); |
123 | 122 | printf("tx=%d ", gvar.mv[gvar.video.sp].tx); printf("ty=%d ", gvar.mv[gvar.video.sp].ty); printf("gvar.player.d=%d\n", gvar.player[0].enti.d); |
124 | - //IN_Shutdown(); | |
125 | 123 | //====modexPalBlack(); |
126 | 124 | //====modexFadeOn(1, pal); |
127 | 125 | } |
@@ -22,19 +22,15 @@ | ||
22 | 22 | |
23 | 23 | #include "src/lib/scroll16.h" |
24 | 24 | #include "src/lib/16_timer.h" |
25 | -//#include "src/lib/16_dbg.h" | |
25 | +#include "src/lib/16_dbg.h" | |
26 | 26 | |
27 | 27 | //#define FADE |
28 | 28 | |
29 | 29 | //#define NOMAPLOAD |
30 | 30 | //#define OLDPLAYERSPRITESTUFF |
31 | -#define XC_CTRLTYPE ctrl_Keyboard | |
32 | -//Mouse | |
31 | +#define XC_CTRLTYPE ctrl_Joystick1//ctrl_Mouse//ctrl_Keyboard | |
33 | 32 | #ifdef __DEBUG__ |
34 | 33 | #define SCROLLEXEDEBUG |
35 | -boolean | |
36 | - dbg_nointest=0, | |
37 | - dbg_joymousedelta=0; | |
38 | 34 | #endif |
39 | 35 | |
40 | 36 | //static map_t map; |
@@ -83,6 +79,10 @@ void main(int argc, char *argv[]) | ||
83 | 79 | char bakapee[64] = FILENAME_1; |
84 | 80 | char bakapeep[64] = FILENAME_1P; |
85 | 81 | // char bakapee3[64] = FILENAME_3; |
82 | +#ifdef __DEBUG__ | |
83 | + dbg_nointest=0; | |
84 | + dbg_joymousedelta=0; | |
85 | +#endif | |
86 | 86 | |
87 | 87 | Startup16(&gvar); |
88 | 88 |