--- /dev/null
+\r
+qqqqqqqq\r
+\r
+Project 16 test.exe. This is just a test file!\r
+version Feb 10 2017 09:14:32\r
+VL_PrintmodexmemInfo:\r
+ Virtual Screen: 352x272 Tile: 22x17=((Virtual Screen)/16)\r
+ Screen: 320x240 Tile: 20x15=((Screen)/16)\r
+ Free Video Memory: 767\r
+ page [0]=(a000:0000) size=23936 w=352 h=272 sw=320 sh=240 pi=1408\r
+ [1]=(a000:5d80) size=23936 w=352 h=272 sw=320 sh=240 pi=1408\r
+ [2]=(a000:bb00) size=8448 w=352 h=96 sw=352 sh=96 pi=1408\r
+ [3]=(a000:dc00) size=8448 w=352 h=96 sw=352 sh=96 pi=1408\r
+tx=1 ty=1 player.d=2\r
+\r
+====\r
+0 paloffset= 8\r
+====\r
+\r
outp(PAL_DATA_REG, col);\r
}\r
\r
-//color checker~\r
-//i want to make another vesion that checks the palette when the palette is being appened~\r
-void modexchkcolor(bitmap_t *bmp, word *q, word *a, word *aa, word *z, word *i/*, word *offset*/)\r
-{\r
- byte *pal;\r
- word zz=0;\r
- pal = modexNewPal();\r
- modexPalSave(pal);\r
- //printf("q: %02d\n", (*q));\r
- printf("chkcolor start~\n");\r
- printf("1 (*z): %d\n", (*z)/3);\r
- printf("1 (*i): %d\n", (*i)/3);\r
-// printf("1 offset of color in palette (*q): %d\n", (*q)/3);\r
- printf("wwwwwwwwwwwwwwww\n");\r
- //check palette for dups\r
- for(; (*z)<PAL_SIZE; (*z)+=3)\r
- {\r
- //printf("\n z: %d\n", (*z));\r
- //printf(" q: %d\n", (*q));\r
- //printf(" z+q: %d\n\n", ((*z)+(*q)));\r
- //if((*z)%3==0)\r
- //{\r
-//---- if(pal[(*z)]==pal[(*z)+3] && pal[(*z)+1]==pal[(*z)+4] && pal[(*z)+2]==pal[(*z)+5])\r
- if((*z)==(*i))\r
- {\r
-// printf("\n%d [%02d][%02d][%02d]\n", (*z), pal[(*z)], pal[(*z)+1], pal[(*z)+2]);\r
-// printf("%d [%02d][%02d][%02d]\n\n", (*z)+3, pal[(*z)+3], pal[(*z)+4], pal[(*z)+5]);\r
-//0000 (*z)-=3;\r
- break;\r
- }\r
- else for(zz=0; zz<(*q); zz+=3)\r
- {\r
- //printf("zz: %02d\n", zz/3);\r
- if(zz%3==0)\r
- {\r
- if(pal[((*z)+(*q))]==pal[((*z)+(*q))+3] && pal[((*z)+(*q))+1]==pal[((*z)+(*q))+4] && pal[((*z)+(*q))+2]==pal[((*z)+(*q))+5]) //break if duplicate colors found in palette because it have reached the end of the current data of the palette\r
- {\r
-// (*z)-=3;\r
-// (*i)-=3;\r
-// printf("\nzq1:%d[%02d][%02d][%02d]\n", (zz+q), pal[(zz+q)], pal[(zz+q)+1], pal[(zz+q)+2]);\r
-// printf("zq2:%d[%02d][%02d][%02d]\n\n", (zz+q)+3, pal[(zz+q)+3], pal[(zz+q)+4], pal[(zz+q)+5]);\r
- break;\r
- }\r
- else if(pal[zz]==pal[((*z)+(*q))] && pal[zz+1]==pal[((*z)+(*q))+1] && pal[zz+2]==pal[((*z)+(*q))+2])\r
- {\r
-// printf("\n\nwwwwwwwwwwwwwwww\n");\r
-// printf(" zq: %d [%02d][%02d][%02d] value that is needing to be changed~\n", ((*z)+(*q))/3, pal[((*z)+(*q))], pal[((*z)+(*q))+1], pal[((*z)+(*q))+2]);\r
-// printf(" zz: %d [%02d][%02d][%02d] value that the previous value is going to change to~\n", (zz)/3, pal[zz], pal[zz+1], pal[zz+2]);\r
-// //printf(" zv: %d [%02d][%02d][%02d] wwww\n", (zz-z+q)/3, pal[(zz-z+q)], pal[(zz-z+q)+1], pal[(zz-z+q)+2]);\r
-// printf(" z : %d [%02d][%02d][%02d] offset value~\n", (*z)/3, pal[(*z)], pal[(*z)+1], pal[(*z)+2]);\r
-//++++ (*i)--;\r
-// (*z)--;\r
- //expand dong here\r
-/*\r
-planned features that i plan to implement~\r
-image that has values on the pallete list!\r
-wwww\r
-no... wait.... no wwww\r
-*/\r
- //for(zzii=0; zzii<3; zzii++)\r
- //{\r
- //printf("z+q: %d\n\n", ((*z)+(*q)));\r
- a[(((*z)+(*q)))]=zz;\r
- //}\r
- (*aa)=(((*z)+(*q)));\r
- printf("!! a[%02d]: %d\n", (((*z)+(*q))/3), zz/3);\r
-// printf("\n aa: %d\n\n", (*aa));\r
-// printf(" a[%02d]=(%02d) offset array i think the palette should be updated again~\n", ((*z)+(*q))/3, a[((*z)+(*q))/3]);\r
-// printf("wwwwwwwwwwwwwwww\n\n");\r
- }\r
- /*else\r
- {\r
- printf("================\n");\r
- printf("zq: %d [%02d][%02d][%02d]\n", ((*z)+(*q))/3, pal[((*z)+(*q))], pal[((*z)+(*q))+1], pal[((*z)+(*q))+2]);\r
- printf("zz: %d [%02d][%02d][%02d]\n", (zz)/3, pal[zz], pal[zz+1], pal[zz+2]);\r
- printf("z : %d [%02d][%02d][%02d]\n", (*z)/3, pal[(*z)], pal[(*z)+1], pal[(*z)+2]);\r
- printf("================\n");\r
- }*/\r
- //printf("[%d]", (zz+q));\r
- }\r
- }\r
- }\r
- printf("wwwwwwwwwwwwwwww\n");\r
- printf("2 (*z): %d\n", (*z)/3);\r
- printf("2 (*i): %d\n", (*i)/3);\r
-// printf("2 offset of color in palette (*q): %d\n", (*q)/3);\r
- printf("chkcolor end~\n");\r
- free(pal);\r
-}\r
-\r
void modexputPixel(page_t *page, int x, int y, byte color)\r
{\r
word pageOff = (word) page->data;\r
void modexPalUpdate(byte *p);\r
void modexPalUpdate0(byte *p);\r
void modexPalOverscan(word col);\r
-void modexchkcolor(bitmap_t *bmp, word *q, word *a, word *aa, word *z, word *i/*, word *offset*/);\r
void modexputPixel(page_t *page, int x, int y, byte color);\r
byte modexgetPixel(page_t *page, int x, int y);\r
\r
\r
#include "src/lib/16_vlpal.h"\r
\r
-void VL_palette(bitmap_t *bmp, word *i, word qp, word aqoffset)\r
+//color checker~\r
+//i want to make another vesion that checks the palette when the palette is being appened~\r
+void modexchkcolor(imgtestpal_t *bmp, word *q, word *a, word *aa, word *z, word *i/*, word *offset*/)\r
{\r
- byte *p = bmp->palette;\r
+ byte *pal;\r
+ word zz=0;\r
+ pal = modexNewPal();\r
+ modexPalSave(pal);\r
+ //printf("q: %02d\n", (*q));\r
+ printf("chkcolor start~\n");\r
+ printf("1 (*z): %d\n", (*z)/3);\r
+ printf("1 (*i): %d\n", (*i)/3);\r
+// printf("1 offset of color in palette (*q): %d\n", (*q)/3);\r
+ printf("wwwwwwwwwwwwwwww\n");\r
+ //check palette for dups\r
+ for(; (*z)<PAL_SIZE; (*z)+=3)\r
+ {\r
+ //printf("\n z: %d\n", (*z));\r
+ //printf(" q: %d\n", (*q));\r
+ //printf(" z+q: %d\n\n", ((*z)+(*q)));\r
+ //if((*z)%3==0)\r
+ //{\r
+//---- if(pal[(*z)]==pal[(*z)+3] && pal[(*z)+1]==pal[(*z)+4] && pal[(*z)+2]==pal[(*z)+5])\r
+ if((*z)==(*i))\r
+ {\r
+// printf("\n%d [%02d][%02d][%02d]\n", (*z), pal[(*z)], pal[(*z)+1], pal[(*z)+2]);\r
+// printf("%d [%02d][%02d][%02d]\n\n", (*z)+3, pal[(*z)+3], pal[(*z)+4], pal[(*z)+5]);\r
+//0000 (*z)-=3;\r
+ break;\r
+ }\r
+ else for(zz=0; zz<(*q); zz+=3)\r
+ {\r
+ //printf("zz: %02d\n", zz/3);\r
+ if(zz%3==0)\r
+ {\r
+ if(pal[((*z)+(*q))]==pal[((*z)+(*q))+3] && pal[((*z)+(*q))+1]==pal[((*z)+(*q))+4] && pal[((*z)+(*q))+2]==pal[((*z)+(*q))+5]) //break if duplicate colors found in palette because it have reached the end of the current data of the palette\r
+ {\r
+// (*z)-=3;\r
+// (*i)-=3;\r
+// printf("\nzq1:%d[%02d][%02d][%02d]\n", (zz+q), pal[(zz+q)], pal[(zz+q)+1], pal[(zz+q)+2]);\r
+// printf("zq2:%d[%02d][%02d][%02d]\n\n", (zz+q)+3, pal[(zz+q)+3], pal[(zz+q)+4], pal[(zz+q)+5]);\r
+ break;\r
+ }\r
+ else if(pal[zz]==pal[((*z)+(*q))] && pal[zz+1]==pal[((*z)+(*q))+1] && pal[zz+2]==pal[((*z)+(*q))+2])\r
+ {\r
+// printf("\n\nwwwwwwwwwwwwwwww\n");\r
+// printf(" zq: %d [%02d][%02d][%02d] value that is needing to be changed~\n", ((*z)+(*q))/3, pal[((*z)+(*q))], pal[((*z)+(*q))+1], pal[((*z)+(*q))+2]);\r
+// printf(" zz: %d [%02d][%02d][%02d] value that the previous value is going to change to~\n", (zz)/3, pal[zz], pal[zz+1], pal[zz+2]);\r
+// //printf(" zv: %d [%02d][%02d][%02d] wwww\n", (zz-z+q)/3, pal[(zz-z+q)], pal[(zz-z+q)+1], pal[(zz-z+q)+2]);\r
+// printf(" z : %d [%02d][%02d][%02d] offset value~\n", (*z)/3, pal[(*z)], pal[(*z)+1], pal[(*z)+2]);\r
+//++++ (*i)--;\r
+// (*z)--;\r
+ //expand dong here\r
+/*\r
+planned features that i plan to implement~\r
+image that has values on the pallete list!\r
+wwww\r
+no... wait.... no wwww\r
+*/\r
+ //for(zzii=0; zzii<3; zzii++)\r
+ //{\r
+ //printf("z+q: %d\n\n", ((*z)+(*q)));\r
+ a[(((*z)+(*q)))]=zz;\r
+ //}\r
+ (*aa)=(((*z)+(*q)));\r
+ printf("!! a[%02d]: %d\n", (((*z)+(*q))/3), zz/3);\r
+// printf("\n aa: %d\n\n", (*aa));\r
+// printf(" a[%02d]=(%02d) offset array i think the palette should be updated again~\n", ((*z)+(*q))/3, a[((*z)+(*q))/3]);\r
+// printf("wwwwwwwwwwwwwwww\n\n");\r
+ }\r
+ /*else\r
+ {\r
+ printf("================\n");\r
+ printf("zq: %d [%02d][%02d][%02d]\n", ((*z)+(*q))/3, pal[((*z)+(*q))], pal[((*z)+(*q))+1], pal[((*z)+(*q))+2]);\r
+ printf("zz: %d [%02d][%02d][%02d]\n", (zz)/3, pal[zz], pal[zz+1], pal[zz+2]);\r
+ printf("z : %d [%02d][%02d][%02d]\n", (*z)/3, pal[(*z)], pal[(*z)+1], pal[(*z)+2]);\r
+ printf("================\n");\r
+ }*/\r
+ //printf("[%d]", (zz+q));\r
+ }\r
+ }\r
+ }\r
+ printf("wwwwwwwwwwwwwwww\n");\r
+ printf("2 (*z): %d\n", (*z)/3);\r
+ printf("2 (*i): %d\n", (*i)/3);\r
+// printf("2 offset of color in palette (*q): %d\n", (*q)/3);\r
+ printf("chkcolor end~\n");\r
+ free(pal);\r
+}\r
+\r
+void\r
+VL_palette(imgtestpal_t *bmp, byte *p, word *i, word qp, word aqoffset)\r
+{\r
+ //byte *p = bmp->palette;\r
word w=0;\r
word q=0;\r
word qq=0;\r
//printf(" aa=%02d\n", aa);\r
\r
//update the palette~\r
- VL_palette(bmp, &pp, aq, aqoffset);\r
+ VL_palette(bmp, p, &pp, aq, aqoffset);\r
(*i)=pp;\r
\r
if(aq<aa){ pp=q; aq++; goto aqpee; }\r
\r
#include "src/lib/16_vl.h"\r
\r
-void VL_palette(bitmap_t *bmp, word *i, word qp, word aqoffset);\r
+#define BEVERBOSEPALCHECK\r
+\r
+typedef struct\r
+{\r
+ word width;\r
+ word height;\r
+ word offset;\r
+} imgtestpal_t;\r
+\r
+void VL_palette(imgtestpal_t *bmp, byte *p, word *i, word qp, word aqoffset);\r
\r
#endif //__16_VLPAL_H__\r
-Subproject commit 9fa1754125e085f823438c4ac18378b385a5dd0c
+Subproject commit a4ede8f20a10d3406aa898874b672960e4bb202e
/* the position within the map array */\r
i=ty * mv->map->width + tx;\r
for( mv->dx=poopoffset; mv->dx<(mv->page->sw+mv->dxThresh)/(poopoffset+1) && tx < mv->map->width; mv->dx+=mv->map->tiles->tileWidth, tx++) {\r
- if(i>=0) /* we are in the map, so copy away! */\r
+ if(i>=0)\r
mapDrawTile(mv->map->tiles, mv->map->data[i], mv->page, mv->dx, y);\r
i++; /* next! */\r
}\r
-//if(pagedelayrendermap) delay(200);\r
+if(pagedelayrendermap) delay(200);\r
}\r
\r
void near mapDrawCol(map_view_t *mv, int tx, int ty, word x, player_t *player, word poopoffset)\r
/* We'll copy all of the columns in the screen,\r
i + 1 row above and one below */\r
for( mv->dy=poopoffset; mv->dy<(mv->page->sh+mv->dyThresh)/(poopoffset+1) && ty < mv->map->height; mv->dy+=mv->map->tiles->tileHeight, ty++) {\r
- if(i>=0) /* we are in the map, so copy away! */\r
+ if(i>=0)\r
mapDrawTile(mv->map->tiles, mv->map->data[i], mv->page, x, mv->dy);\r
i += mv->map->width;\r
}\r
-//if(pagedelayrendermap) delay(200);\r
+if(pagedelayrendermap) delay(200);\r
}\r
\r
void mapDrawWRow(map_view_t *mv, int tx, int ty, word y)\r
\r
#include <stdio.h>\r
#include "src/lib/16_vl.h"\r
+#include "src/lib/16_vlpal.h"\r
#include "src/lib/16_in.h"\r
#include "src/lib/scroll16.h"\r
\r
\r
void main(int argc, char *argv[])\r
{\r
+ static word paloffset=0;\r
static global_game_variables_t gvar;\r
static player_t player[MaxPlayers];\r
\r
int i, j;\r
word startclk, endclk;\r
word k;\r
+\r
+ imgtestpal_t bmp1, bmp2;\r
+ bmp1.width=bmp2.width= 40;\r
+ bmp1.width=bmp2.height= 30;\r
//====byte *pal, *pal2;\r
\r
//====word colo=LGQ;\r
//====modexPalBlack();\r
\r
/* load our palette */\r
+ VL_LoadPalFile("data/16.pal", &gvar.video.palette);\r
+ bmp1.offset=(paloffset/3);\r
+ VL_palette(&bmp1, &gvar.video.palette, &paloffset, 0, 0);\r
//====modexLoadPalFile("data/default.pal", &pal2);\r
\r
/* overscan show */\r
modexShowPage(&gvar.video.page[0]);*/\r
\r
\r
- modexClearRegion(&gvar.video.page[0], 0, 0, gvar.video.page[0].width, gvar.video.page[0].height, 15);\r
- modexClearRegion(&gvar.video.page[0], 16, 16, gvar.video.page[0].sw, gvar.video.page[0].sh, 128);\r
- modexClearRegion(&gvar.video.page[0], 32, 32, gvar.video.page[0].sw-32, gvar.video.page[0].sh-32, 42);\r
- modexClearRegion(&gvar.video.page[0], 48, 48, gvar.video.page[0].sw-64, gvar.video.page[0].sh-64, 128);\r
+ modexClearRegion(&gvar.video.page[0], 0, 0, gvar.video.page[0].width, gvar.video.page[0].height, 1);\r
+ modexClearRegion(&gvar.video.page[0], 16, 16, gvar.video.page[0].sw, gvar.video.page[0].sh, 2);\r
+ modexClearRegion(&gvar.video.page[0], 32, 32, gvar.video.page[0].sw-32, gvar.video.page[0].sh-32, 3);\r
+ modexClearRegion(&gvar.video.page[0], 48, 48, gvar.video.page[0].sw-64, gvar.video.page[0].sh-64, 2);\r
modexCopyPageRegion(&gvar.video.page[1], &gvar.video.page[0], 0, 0, 0, 0, gvar.video.page[0].width, gvar.video.page[0].height);\r
- modexClearRegion(&gvar.video.page[2], 0, 0, gvar.video.page[2].sw, gvar.video.page[2].sh, 47);\r
- modexClearRegion(&gvar.video.page[3], 0, 0, gvar.video.page[3].sw, gvar.video.page[3].sh, 45);\r
+ modexClearRegion(&gvar.video.page[2], 0, 0, gvar.video.page[2].sw, gvar.video.page[2].sh, 4);\r
+ modexClearRegion(&gvar.video.page[3], 0, 0, gvar.video.page[3].sw, gvar.video.page[3].sh, 6);\r
\r
\r
/* fade in */\r
printf("version %s\n", VERSION);\r
VL_PrintmodexmemInfo(&gvar.video);\r
printf("tx=%d ", mv[gvar.video.sp].tx); printf("ty=%d ", mv[gvar.video.sp].ty); printf("player.d=%d\n", player[0].enti.d);\r
+ printf("\n====\n");\r
+ printf("0 paloffset= %d\n", paloffset/3);\r
+ printf("====\n\n");\r
//IN_Shutdown();\r
//====modexPalBlack();\r
//====modexFadeOn(1, pal);\r