Commit MetaInfo

Revisãob8c9d5fcb2b66420bc673f54b14cc5d0ea5283ed (tree)
Hora2017-11-10 03:46:58
Autorsparky4 <sparky4@cock...>
Commitersparky4

Mensagem de Log

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

Mudança Sumário

Diff

Binary files a/src/.xcroll.c.kate-swp and /dev/null differ
--- a/src/lib/16_vl.h
+++ b/src/lib/16_vl.h
@@ -209,7 +209,7 @@ void modexLoadPalFile(char *filename, byte *palette);
209209 void VL_LoadPalFile(const char *filename, byte *palette, global_game_variables_t *gvar);
210210 void VL_LoadPalFileCore(byte *palette, global_game_variables_t *gvar);
211211 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);
213213 void VL_UpdatePaletteWrite(byte *palette, word o, word palsize, global_game_variables_t *gvar);
214214 void VL_PaletteSync(global_game_variables_t *gvar);
215215 void modexSavePalFile(char *filename, byte *palette);
--- a/src/lib/16_vlpal.c
+++ b/src/lib/16_vlpal.c
@@ -189,7 +189,7 @@ aqpee:
189189 while(aq<=aa)
190190 {
191191 #ifdef BEVERBOSEPALCHECK
192- printf("a[%02d]=(%d)\n", aq, a[aq]);//
192+// printf("a[%02d]=(%d)\n", aq, a[aq]);//0000
193193 #endif
194194 if(a[aq]==-1) aq++;
195195 else { aqoffset++; break; }
--- a/src/lib/16_vlpld.h
+++ b/src/lib/16_vlpld.h
@@ -2,8 +2,10 @@
22 #define __16_VLPALD_H__
33
44 #define BEVERBOSEPALCHECK
5+//#define BEVERBOSECOLORCHECK
6+//#define DONOTPALCHECK
57
6-#ifdef BEVERBOSEPALCHECK
8+#ifdef BEVERBOSECOLORCHECK
79 #define CHKCOLDBGOUT1 \
810 printf("q: %02d\n", (*q));\
911 printf("chkcolor start~\n");\
@@ -44,6 +46,17 @@
4446 printf("2 (*i): %d\n", (*i)/3); \
4547 printf("2 offset of color in palette (*q): %d\n", (*q)/3); \
4648 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
4760 #endif
4861 //======//
4962
--- a/src/lib/doslib
+++ b/src/lib/doslib
@@ -1 +1 @@
1-Subproject commit 9f68b899de82e9ed49cf03bd617820f98db034c3
1+Subproject commit 2b7b2ed6b38382723b80be134cb5d22284de2eb4
--- a/src/palllist.c
+++ b/src/palllist.c
@@ -165,19 +165,18 @@ void main()
165165 Created linked list will be 11->11->11->13->13->20 */
166166 pushll(&head, 20);
167167 pushll(&head, 13);
168- pushll(&head, 13);
168+ pushll(&head, 13);
169+ pushll(&head, 11);
169170 pushll(&head, 11);
170171 pushll(&head, 11);
171- pushll(&head, 11);
172-
172+
173173 printf("\n Linked list before duplicate removal ");
174- printList(head);
175-
174+ printList(head);
175+
176176 /* 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);
182181 }
183182 #endif
--- a/src/paltest.c
+++ b/src/paltest.c
@@ -29,7 +29,7 @@
2929 #define LGQ 32
3030 #define HGQ 55
3131
32-static word far* clockw= (word far*) 0x046C; /* 18.2hz clock */
32+static word far* clockw= (word far*) 0x046C; // 18.2hz clock //
3333
3434 void drawboxesmodex(page_t *pg)
3535 {
@@ -47,102 +47,63 @@ void copyboxesmodex(page_t *page, boolean pn)
4747 void main(int argc, char *argv[])
4848 {
4949 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;
5451
5552 int i, j;
5653 word startclk, endclk;
5754 word k;
5855
56+#ifndef DONOTPALCHECK
5957 imgtestpal_t bmp1, bmp2;
60-
61-
6258 bmp1.width=bmp2.width= 40;
6359 bmp1.width=bmp2.height= 30;
60+#endif
6461
6562 //====word colo=LGQ;
6663
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);*/
9564 Startup16(&gvar);
9665
97- /* save the palette */
66+ // save the palette //
9867 //====modexPalSave(pal);
9968 //====modexFadeOff(1, pal);
10069 //====modexPalBlack();
10170
102- //IN_Startup();
10371 IN_Default(0,&gvar.player[0],ctrl_Keyboard1, &gvar);
10472 EN_initPlayer(&gvar.player[0], &gvar.video);
10573
106- VGAmodeX(1, 1, &gvar);
107- modexPalBlack();
74+ VL_Startup(&gvar);//VGAmodeX(1, 1, &gvar);
75+ modexPalBlack(); VL_PaletteSync(&gvar);
10876
109- /* load our palette */
77+ // load our palette //
11078 VL_LoadPalFile("data/16.pal", &gvar.video.palette, &gvar);
79+#ifndef DONOTPALCHECK
11180 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);
11382
11483 //VL_LoadPalFilewithoffset("data/default.pal", &palette, paloffset);
11584 modexLoadPalFile("data/16t.pal", &gvar.video.dpal);
85+ //VLL_LoadPalFilewithoffset("data/16t.pal", &gvar.video.palette, paloffset, 8, &gvar);
11686 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);
11888 //====modexLoadPalFile("data/default.pal", &pal2);
89+#endif
90+ VL_PaletteSync(&gvar);
11991
120- /* overscan show */
92+ // overscan show //
12193 //modexPalOverscan(44+1);
12294
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 //
12496 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);
13898
99+ // fill the page with one color, but with a black border //
139100 drawboxesmodex(&gvar.video.page[0]);
140101 copyboxesmodex(&gvar.video.page, 1);
141102 modexClearRegion(&gvar.video.page[2], 0, 0, gvar.video.page[2].sw, gvar.video.page[2].sh, 4);
142103 modexClearRegion(&gvar.video.page[3], 0, 0, gvar.video.page[3].sw, gvar.video.page[3].sh, 6);
143104
144105
145- /* fade in */
106+ // fade in //
146107 //====modexFadeOn(1, pal2);
147108
148109 i=0,k=0,j=0;
@@ -160,7 +121,8 @@ void main(int argc, char *argv[])
160121 TAIL_PANKEYFUN;
161122 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);
162123 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)){
164126 for(i=0;i<3;i++)
165127 {
166128 pal2[i] = rand()%64;
@@ -169,7 +131,8 @@ void main(int argc, char *argv[])
169131 if(colo>HGQ) colo=LGQ;
170132 }
171133 // if(i>PAL_SIZE) i=0;
172- }//9*/
134+ }//9
135+#endif
173136 if(gvar.in.inst->Keyboard[25]){ modexpdump(gvar.video.sp, &gvar); IN_UserInput(1, &gvar); }//p
174137 if(gvar.in.inst->Keyboard[sc_I]){ drawboxesmodex(&gvar.video.page[gvar.video.sp]); IN_UserInput(1, &gvar); }//i
175138 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[])
179142
180143 endclk = *clockw;
181144
182- /* fade back to text mode */
145+ // fade back to text mode //
183146 //====modexFadeOff(1, pal2);
184147 //====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");
188150 printf("version %s\n", VERSION);
189151 VL_PrintmodexmemInfo(&gvar.video);
190152 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);
191153 printf("\n====\n");
192154 printf("0 paloffset= %d\n", paloffset/3);
193155 printf("====\n\n");
194- //IN_Shutdown();
195156 //====modexPalBlack();
196157 //====modexFadeOn(1, pal);
197158 }
--- a/src/ps.c
+++ b/src/ps.c
@@ -15,6 +15,11 @@ void main()
1515 PRINT_OPAQUE_STRUCT(&gvar.mm);
1616 printf("mmi:\n");
1717 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));
1823 printf("sizeof gvar=%d\n", sizeof(gvar));
1924 // handle
2025 // kurokku
--- a/src/vidtest.c
+++ b/src/vidtest.c
@@ -29,7 +29,7 @@
2929 #define LGQ 32
3030 #define HGQ 55
3131
32-static word far* clockw= (word far*) 0x046C; /* 18.2hz clock */
32+static word far* clockw= (word far*) 0x046C; // 18.2hz clock //
3333
3434 void drawboxesmodex(page_t *pg)
3535 {
@@ -47,44 +47,44 @@ void copyboxesmodex(page_t *page, boolean pn)
4747 void main(int argc, char *argv[])
4848 {
4949 static global_game_variables_t gvar;
50- map_t map;
5150
5251 int i, j;
5352 word startclk, endclk;
5453 word k;
5554
55+ //====word colo=LGQ;
56+
5657 Startup16(&gvar);
5758
58- /* save the palette */
59+ // save the palette //
5960 //====modexPalSave(pal);
6061 //====modexFadeOff(1, pal);
6162 //====modexPalBlack();
6263
63- //IN_Startup();
6464 IN_Default(0,&gvar.player[0],ctrl_Keyboard1, &gvar);
6565 EN_initPlayer(&gvar.player[0], &gvar.video);
6666
67- VGAmodeX(1, 1, &gvar);
67+ VL_Startup(&gvar);//VGAmodeX(1, 1, &gvar);
6868 modexPalBlack();
6969
70- /* load our palette */
70+ // load our palette //
7171 VL_LoadPalFile("data/16.pal", &gvar.video.palette, &gvar);
7272
73- /* overscan show */
73+ // overscan show //
7474 //modexPalOverscan(44+1);
7575
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 //
7777 modexHiganbanaPageSetup(&gvar);
78- ZC_MVSetup(&gvar.mv, &map, &gvar);
78+ ZC_MVSetup(&gvar.mv, &gvar.map, &gvar);
7979
80- /* fill the page with one color, but with a black border */
80+ // fill the page with one color, but with a black border //
8181 drawboxesmodex(&gvar.video.page[0]);
8282 copyboxesmodex(&gvar.video.page, 1);
8383 modexClearRegion(&gvar.video.page[2], 0, 0, gvar.video.page[2].sw, gvar.video.page[2].sh, 4);
8484 modexClearRegion(&gvar.video.page[3], 0, 0, gvar.video.page[3].sw, gvar.video.page[3].sh, 6);
8585
8686
87- /* fade in */
87+ // fade in //
8888 //====modexFadeOn(1, pal2);
8989
9090 i=0,k=0,j=0;
@@ -112,16 +112,14 @@ void main(int argc, char *argv[])
112112
113113 endclk = *clockw;
114114
115- /* fade back to text mode */
115+ // fade back to text mode //
116116 //====modexFadeOff(1, pal2);
117117 //====modexPalBlack();
118- VGAmodeX(0, 1, &gvar);
119- Shutdown16(&gvar);
118+ Shutdown16(&gvar);//VGAmodeX(0, 1, &gvar);
120119 printf("Project 16 vidtest.exe. This is just a test file!\n");
121120 printf("version %s\n", VERSION);
122121 VL_PrintmodexmemInfo(&gvar.video);
123122 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();
125123 //====modexPalBlack();
126124 //====modexFadeOn(1, pal);
127125 }
--- a/src/xcroll.c
+++ b/src/xcroll.c
@@ -22,19 +22,15 @@
2222
2323 #include "src/lib/scroll16.h"
2424 #include "src/lib/16_timer.h"
25-//#include "src/lib/16_dbg.h"
25+#include "src/lib/16_dbg.h"
2626
2727 //#define FADE
2828
2929 //#define NOMAPLOAD
3030 //#define OLDPLAYERSPRITESTUFF
31-#define XC_CTRLTYPE ctrl_Keyboard
32-//Mouse
31+#define XC_CTRLTYPE ctrl_Joystick1//ctrl_Mouse//ctrl_Keyboard
3332 #ifdef __DEBUG__
3433 #define SCROLLEXEDEBUG
35-boolean
36- dbg_nointest=0,
37- dbg_joymousedelta=0;
3834 #endif
3935
4036 //static map_t map;
@@ -83,6 +79,10 @@ void main(int argc, char *argv[])
8379 char bakapee[64] = FILENAME_1;
8480 char bakapeep[64] = FILENAME_1P;
8581 // char bakapee3[64] = FILENAME_3;
82+#ifdef __DEBUG__
83+ dbg_nointest=0;
84+ dbg_joymousedelta=0;
85+#endif
8686
8787 Startup16(&gvar);
8888
Show on old repository browser