OSDN Git Service
(root)
/
proj16
/
16.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
updating copy left. i am super fuckin busy with school, and trying to get life back...
[proj16/16.git]
/
src
/
lib
/
16_vlpal.c
diff --git
a/src/lib/16_vlpal.c
b/src/lib/16_vlpal.c
index
2f155f0
..
f8d193f
100755
(executable)
--- a/
src/lib/16_vlpal.c
+++ b/
src/lib/16_vlpal.c
@@
-1,5
+1,5
@@
/* Project 16 Source Code~
\r
/* Project 16 Source Code~
\r
- * Copyright (C) 2012-201
7
sparky4 & pngwen & andrius4669 & joncampbell123 & yakui-lover
\r
+ * Copyright (C) 2012-201
9
sparky4 & pngwen & andrius4669 & joncampbell123 & yakui-lover
\r
*
\r
* This file is part of Project 16.
\r
*
\r
*
\r
* This file is part of Project 16.
\r
*
\r
@@
-24,12
+24,12
@@
\r
//color checker~
\r
//i want to make another vesion that checks the palette when the palette is being appened~
\r
\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
+void modexchkcolor(imgtestpal_t *bmp, word *q, word *a, word *aa, word *z, word *i/*, word *offset*/
, global_game_variables_t *gv
)
\r
{
\r
{
\r
- byte *pal;
\r
+ byte *pal
=&(gv->video.palette)
;
\r
word zz=0;
\r
word zz=0;
\r
- pal = modexNewPal();
\r
-
modexPalSave(pal);
\r
+
//
pal = modexNewPal();
\r
+
//
modexPalSave(pal);
\r
CHKCOLDBGOUT1
\r
//check palette for dups
\r
for(; (*z)<PAL_SIZE; (*z)+=3)
\r
CHKCOLDBGOUT1
\r
//check palette for dups
\r
for(; (*z)<PAL_SIZE; (*z)+=3)
\r
@@
-92,15
+92,18
@@
no... wait.... no wwww
//free(pal);
\r
}
\r
\r
//free(pal);
\r
}
\r
\r
+//what is *i, w, q, qq, z, aq, aa, pp, qp, and aqoffset...
\r
+//pp is related to i
\r
+
\r
void
\r
void
\r
-VL_palette(imgtestpal_t *bmp, byte *p, word *i, word qp, word aqoffset)
\r
+VL_palette(imgtestpal_t *bmp, byte *p, word *i, word qp, word aqoffset
, word *apal, global_game_variables_t *gv
)
\r
{
\r
//byte *p = bmp->palette;
\r
word w=0;
\r
word q=0;
\r
word qq=0;
\r
{
\r
//byte *p = bmp->palette;
\r
word w=0;
\r
word q=0;
\r
word qq=0;
\r
-
static word a[PAL_SIZE];
//palette array of change values!
\r
- word z=0, aq=0, aa=0, pp=0
;
\r
+
word a[PAL_SIZE];
//palette array of change values!
\r
+ word z=0, aq=0, aa=0, pp=0
, iq=0;//iq=(*i)-q
\r
\r
//modexWaitBorder();
\r
vga_wait_for_vsync();
\r
\r
//modexWaitBorder();
\r
vga_wait_for_vsync();
\r
@@
-124,13
+127,14
@@
VL_palette(imgtestpal_t *bmp, byte *p, word *i, word qp, word aqoffset)
#endif
\r
outp(PAL_WRITE_REG, qq); /* start at the beginning of palette */
\r
}
\r
#endif
\r
outp(PAL_WRITE_REG, qq); /* start at the beginning of palette */
\r
}
\r
+ iq=(*i)-q;
\r
if((*i)<PAL_SIZE && w==0)
\r
{
\r
for(; (*i)<PAL_SIZE; (*i)++)
\r
{
\r
//if(i%3==0 && (p[i+5]==p[i+4] && p[i+4]==p[i+3] && p[i+3]==p[i+2] && p[i+2]==p[i+1] && p[i+1]==p[i] && p[i+5]==p[i]))
\r
if((*i)<PAL_SIZE && w==0)
\r
{
\r
for(; (*i)<PAL_SIZE; (*i)++)
\r
{
\r
//if(i%3==0 && (p[i+5]==p[i+4] && p[i+4]==p[i+3] && p[i+3]==p[i+2] && p[i+2]==p[i+1] && p[i+1]==p[i] && p[i+5]==p[i]))
\r
-//____ if((qp>0)&&(
(*i)-q)%3==0 && (p[((*i)-q)]==p[((*i)-q)+3] && p[((*i)-q)+1]==p[((*i)-q)+4] && p[((*i)-q)+2]==p[((*i)-q)+5])) outp(PAL_DATA_REG, p[(*i)-
q]); else
\r
- if((((
(*i)-q)%3==0)) && (p[((*i)-q)]==p[((*i)-q)+3] && p[((*i)-q)+1]==p[((*i)-q)+4] && p[((*i)-q)+2]==p[((*i)-
q)+5]))
\r
+//____ if((qp>0)&&(
iq)%3==0 && (p[(iq)]==p[(iq)+3] && p[(iq)+1]==p[(iq)+4] && p[(iq)+2]==p[(iq)+5])) outp(PAL_DATA_REG, p[i
q]); else
\r
+ if((((
iq)%3==0)) && (p[(iq)]==p[(iq)+3] && p[(iq)+1]==p[(iq)+4] && p[(iq)+2]==p[(i
q)+5]))
\r
{
\r
w++;
\r
break;
\r
{
\r
w++;
\r
break;
\r
@@
-149,7
+153,7
@@
VL_palette(imgtestpal_t *bmp, byte *p, word *i, word qp, word aqoffset)
{
\r
if(bmp->offset==0 && (*i)<3 && q==0) outp(PAL_DATA_REG, 0);
\r
else
\r
{
\r
if(bmp->offset==0 && (*i)<3 && q==0) outp(PAL_DATA_REG, 0);
\r
else
\r
- if(qp==0) outp(PAL_DATA_REG, p[
(*i)-
q]);
\r
+ if(qp==0) outp(PAL_DATA_REG, p[
i
q]);
\r
else
\r
{ outp(PAL_DATA_REG, p[((*i)-(bmp->offset*3)+qp)]);
\r
#ifdef BEVERBOSEPALCHECK
\r
else
\r
{ outp(PAL_DATA_REG, p[((*i)-(bmp->offset*3)+qp)]);
\r
#ifdef BEVERBOSEPALCHECK
\r
@@
-179,7
+183,7
@@
VL_palette(imgtestpal_t *bmp, byte *p, word *i, word qp, word aqoffset)
printf("1(*i)=%02d\n", (*i)/3);//
\r
printf("1z=%02d\n", z/3);//
\r
#endif
\r
printf("1(*i)=%02d\n", (*i)/3);//
\r
printf("1z=%02d\n", z/3);//
\r
#endif
\r
- modexchkcolor(bmp, &q, &a, &aa, &z, i);
\r
+ modexchkcolor(bmp, &q, &a, &aa, &z, i
, gv
);
\r
#ifdef BEVERBOSEPALCHECK
\r
printf("2(*i)=%02d\n", (*i)/3);
\r
printf("2z=%02d\n", z/3);
\r
#ifdef BEVERBOSEPALCHECK
\r
printf("2(*i)=%02d\n", (*i)/3);
\r
printf("2z=%02d\n", z/3);
\r
@@
-189,7
+193,7
@@
aqpee:
while(aq<=aa)
\r
{
\r
#ifdef BEVERBOSEPALCHECK
\r
while(aq<=aa)
\r
{
\r
#ifdef BEVERBOSEPALCHECK
\r
- printf("a[%02d]=(%d)\n", aq, a[aq]);//
\r
+// printf("a[%02d]=(%d)\n", aq, a[aq]);//0000
\r
#endif
\r
if(a[aq]==-1) aq++;
\r
else { aqoffset++; break; }
\r
#endif
\r
if(a[aq]==-1) aq++;
\r
else { aqoffset++; break; }
\r
@@
-253,7
+257,7
@@
printf(" aq=%02d\n", aq);//
printf(" aa=%02d\n", aa);//
\r
#endif
\r
//update the palette~
\r
printf(" aa=%02d\n", aa);//
\r
#endif
\r
//update the palette~
\r
- VL_palette(bmp, p, &pp, aq, aqoffset);
\r
+ VL_palette(bmp, p, &pp, aq, aqoffset
, &a, gv
);
\r
(*i)=pp;
\r
\r
if(aq<aa){ pp=q; aq++; goto aqpee; }
\r
(*i)=pp;
\r
\r
if(aq<aa){ pp=q; aq++; goto aqpee; }
\r