trying to sync rc1

parent dd63b94a
...@@ -4405,7 +4405,7 @@ void config_check_vsync (void) ...@@ -4405,7 +4405,7 @@ void config_check_vsync (void)
cnt--; cnt--;
if (config_changed) { if (config_changed) {
// if (config_changed == 1) // if (config_changed == 1)
// write_log (L"* configuration check trigger\n"); // write_log ("* configuration check trigger\n");
config_changed++; config_changed++;
if (config_changed > 10) if (config_changed > 10)
config_changed = 0; config_changed = 0;
......
...@@ -1969,7 +1969,7 @@ static void pfield_draw_line (int lineno, int gfx_ypos, int follow_ypos) ...@@ -1969,7 +1969,7 @@ static void pfield_draw_line (int lineno, int gfx_ypos, int follow_ypos)
{ {
case LINE_REMEMBERED_AS_PREVIOUS: case LINE_REMEMBERED_AS_PREVIOUS:
// if (!warned) // happens when program messes up with VPOSW // if (!warned) // happens when program messes up with VPOSW
// write_log (L"Shouldn't get here... this is a bug.\n"), warned++; // write_log ("Shouldn't get here... this is a bug.\n"), warned++;
return; return;
case LINE_BLACK: case LINE_BLACK:
......
...@@ -63,9 +63,9 @@ static struct uniq_head *find_uniq (uniq_list *a, uae_u32 uniq) ...@@ -63,9 +63,9 @@ static struct uniq_head *find_uniq (uniq_list *a, uae_u32 uniq)
{ {
struct uniq_head *b = a->head; struct uniq_head *b = a->head;
while (b && b->uniq != uniq) while (b && b->uniq != uniq)
b = b->next; b = b->next;
if (!b) if (!b)
write_log ("Couldn't find structure. Bad\n"); write_log ("Couldn't find structure. Bad\n");
return b; return b;
} }
...@@ -73,12 +73,12 @@ static struct uniq_head *find_and_rem_uniq (uniq_list *a, uae_u32 uniq) ...@@ -73,12 +73,12 @@ static struct uniq_head *find_and_rem_uniq (uniq_list *a, uae_u32 uniq)
{ {
struct uniq_head **b = &a->head, *c; struct uniq_head **b = &a->head, *c;
while (*b && (*b)->uniq != uniq) while (*b && (*b)->uniq != uniq)
b = &(*b)->next; b = &(*b)->next;
c = *b; c = *b;
if (!c) if (!c)
write_log ("Couldn't find structure. Bad\n"); write_log ("Couldn't find structure. Bad\n");
else else
*b = c->next; *b = c->next;
return c; return c;
} }
...@@ -87,7 +87,7 @@ static void add_uniq (uniq_list *a, struct uniq_head *item, uaecptr amem) ...@@ -87,7 +87,7 @@ static void add_uniq (uniq_list *a, struct uniq_head *item, uaecptr amem)
item->uniq = a->uniq++; item->uniq = a->uniq++;
put_long (amem, item->uniq); put_long (amem, item->uniq);
if (a->uniq == 0) if (a->uniq == 0)
a->uniq++; a->uniq++;
item->next = a->head; item->next = a->head;
a->head = item; a->head = item;
} }
...@@ -131,7 +131,7 @@ static int GFX_PointInRectangle(uaecptr rect, int x, int y) ...@@ -131,7 +131,7 @@ static int GFX_PointInRectangle(uaecptr rect, int x, int y)
uae_s16 maxy = get_word (rect+6); uae_s16 maxy = get_word (rect+6);
if (x < minx || x > maxx || y < miny || y > maxy) if (x < minx || x > maxx || y < miny || y > maxy)
return 0; return 0;
return 1; return 1;
} }
...@@ -164,7 +164,7 @@ static int GFX_Bitmap_WritePixel(uaecptr bitmap, int x, int y, uaecptr rp) ...@@ -164,7 +164,7 @@ static int GFX_Bitmap_WritePixel(uaecptr bitmap, int x, int y, uaecptr rp)
uae_u8 pen = drmd & 4 ? bgpen : fgpen; uae_u8 pen = drmd & 4 ? bgpen : fgpen;
if (x < 0 || y < 0 || x >= 8*bpr || y >= rows) if (x < 0 || y < 0 || x >= 8*bpr || y >= rows)
return -1; return -1;
offs = y*bpr + (x & ~15)/8; offs = y*bpr + (x & ~15)/8;
......
...@@ -477,7 +477,7 @@ void alloc_colors256 (allocfunc_type allocfunc) ...@@ -477,7 +477,7 @@ void alloc_colors256 (allocfunc_type allocfunc)
free (map); free (map);
for (i = 0; i < 4096; i++) for (i = 0; i < 4096; i++)
xcolors[i] = xcolors[i] * 0x01010101; xcolors[i] = xcolors[i] * 0x01010101;
} }
/* /*
...@@ -502,22 +502,22 @@ void setup_greydither_maxcol (int maxcol, allocfunc_type allocfunc) ...@@ -502,22 +502,22 @@ void setup_greydither_maxcol (int maxcol, allocfunc_type allocfunc)
xcolnr *map; xcolnr *map;
for (i = 0; i < 4096; i++) for (i = 0; i < 4096; i++)
xcolors[i] = i << 16 | i; xcolors[i] = i << 16 | i;
map = (xcolnr *)malloc (sizeof(xcolnr) * maxcol); map = (xcolnr *)malloc (sizeof(xcolnr) * maxcol);
if (!map) { if (!map) {
write_log ("Not enough mem for colormap!\n"); write_log ("Not enough mem for colormap!\n");
abort(); abort();
} }
/* /*
* set the colormap * set the colormap
*/ */
for (i = 0; i < maxcol; ++i) { for (i = 0; i < maxcol; ++i) {
int c, result; int c, result;
c = (15 * i + (maxcol-1)/2) / (maxcol - 1); c = (15 * i + (maxcol-1)/2) / (maxcol - 1);
result = allocfunc(c, c, c, map + i); result = allocfunc(c, c, c, map + i);
/* @@@ check for errors */ /* @@@ check for errors */
} }
/* /*
...@@ -529,24 +529,21 @@ void setup_greydither_maxcol (int maxcol, allocfunc_type allocfunc) ...@@ -529,24 +529,21 @@ void setup_greydither_maxcol (int maxcol, allocfunc_type allocfunc)
for (r = 0; r<16; ++r) { for (r = 0; r<16; ++r) {
int g; int g;
for (g = 0; g < 16; ++g) { for (g = 0; g < 16; ++g) {
int b; int b;
for (b = 0; b < 16; ++b) { for (b = 0; b < 16; ++b) {
int rgb = (r << 8) | (g << 4) | b; int rgb = (r << 8) | (g << 4) | b;
int c,p,q; int c,p,q;
c = (77 * r + c = (77 * r + 151 * g + 28 * b) / 15; /* c in 0..256 */
151 * g +
28 * b) / 15; /* c in 0..256 */
k = maxcol-1; k = maxcol-1;
p = (c * k) / 256; p = (c * k) / 256;
q = (c * k) % 256; q = (c * k) % 256;
if (q /*/ k*/> d /*/ k*/ && p < k) ++p; if (q /*/ k*/> d /*/ k*/ && p < k) ++p;
/* sam: ^^^^^^^ */ /* sam: ^^^^^^^ */
/* It seems that produces better output */ /* It seems that produces better output */
cidx[i][rgb + (j+4)*4096] = cidx[i][rgb + (j+4)*4096] = cidx[i][rgb + j*4096] = (uae_u8)map[p];
cidx[i][rgb + j*4096] = (uae_u8)map[p]; }
}
} }
} }
} }
...@@ -570,12 +567,12 @@ void setup_dither (int bits, allocfunc_type allocfunc) ...@@ -570,12 +567,12 @@ void setup_dither (int bits, allocfunc_type allocfunc)
map = (xcolnr *)malloc (sizeof(xcolnr) * maxcol); map = (xcolnr *)malloc (sizeof(xcolnr) * maxcol);
if (!map) { if (!map) {
write_log ("Not enough mem for colormap!\n"); write_log ("Not enough mem for colormap!\n");
abort(); abort();
} }
for (i = 0; i < 4096; i++) for (i = 0; i < 4096; i++)
xcolors[i] = i << 16 | i; xcolors[i] = i << 16 | i;
/* /*
* compute #cols per components * compute #cols per components
...@@ -589,10 +586,10 @@ void setup_dither (int bits, allocfunc_type allocfunc) ...@@ -589,10 +586,10 @@ void setup_dither (int bits, allocfunc_type allocfunc)
nb_cols[BLU] = i; nb_cols[BLU] = i;
if (nb_cols[RED]*(++i)*nb_cols[BLU] <= maxcol) { if (nb_cols[RED]*(++i)*nb_cols[BLU] <= maxcol) {
nb_cols[GRN] = i; nb_cols[GRN] = i;
if ((i)*nb_cols[GRN]*nb_cols[BLU] <= maxcol) if ((i)*nb_cols[GRN]*nb_cols[BLU] <= maxcol)
nb_cols[RED] = i; nb_cols[RED] = i;
} }
redvals = (int *)malloc (sizeof(int) * maxcol); redvals = (int *)malloc (sizeof(int) * maxcol);
grnvals = redvals + nb_cols[RED]; grnvals = redvals + nb_cols[RED];
...@@ -633,39 +630,7 @@ void setup_dither (int bits, allocfunc_type allocfunc) ...@@ -633,39 +630,7 @@ void setup_dither (int bits, allocfunc_type allocfunc)
for (i = 0; i < 4; ++i) for (j = 0; j < 4; ++j) { for (i = 0; i < 4; ++i) for (j = 0; j < 4; ++j) {
int d = dither[i][j]; int d = dither[i][j];
int cr, cg, cb, k, q; int cr, cg, cb, k, q;
#if 0 /* Slightly different algorithm. Needs some tuning. */
int rederr = 0, grnerr = 0, bluerr = 0;
k = nb_cols[RED]-1;
cr = r * k / 15;
q = r * k - 15*cr;
if (cr < 0)
cr = 0;
else if (q / k > d / k && rederr <= 0)
++cr;
if (cr > k) cr = k;
rederr += redvals[cr]-r;
k = nb_cols[GRN]-1;
cg = g * k / 15;
q = g * k - 15*cg;
if (cg < 0)
cg = 0;
else if (q / k > d / k && grnerr <= 0)
++cg;
if (cg > k) cg = k;
grnerr += grnvals[cg]-g;
k = nb_cols[BLU]-1;
cb = b * k / 15;
q = b * k - 15*cb;
if (cb < 0)
cb = 0;
else if (q / k > d / k && bluerr <= 0)
++cb;
if (cb > k) cb = k;
bluerr += bluvals[cb]-b;
#else
k = nb_cols[RED]-1; k = nb_cols[RED]-1;
cr = r * k / 15; cr = r * k / 15;
q = r * k - 15*cr; q = r * k - 15*cr;
...@@ -692,7 +657,7 @@ void setup_dither (int bits, allocfunc_type allocfunc) ...@@ -692,7 +657,7 @@ void setup_dither (int bits, allocfunc_type allocfunc)
else if (q /*/ k*/ > d /*/ k*/) else if (q /*/ k*/ > d /*/ k*/)
++cb; ++cb;
if (cb > k) cb = k; if (cb > k) cb = k;
#endif
cidx[i][rgb + (j+4)*4096] = cidx[i][rgb + j*4096] = (uae_u8)map[(cr*nb_cols[GRN]+cg)*nb_cols[BLU]+cb]; cidx[i][rgb + (j+4)*4096] = cidx[i][rgb + j*4096] = (uae_u8)map[(cr*nb_cols[GRN]+cg)*nb_cols[BLU]+cb];
} }
} }
......
This diff is collapsed.
...@@ -445,7 +445,7 @@ configure:4344: $? = 0 ...@@ -445,7 +445,7 @@ configure:4344: $? = 0
configure:4344: result: yes configure:4344: result: yes
configure:4350: checking for _doprnt configure:4350: checking for _doprnt
configure:4350: gcc -o conftest -g -O2 -Wall -W -Wno-unused conftest.c >&5 configure:4350: gcc -o conftest -g -O2 -Wall -W -Wno-unused conftest.c >&5
/tmp/ccKkOe2m.o: In function `main': /tmp/ccbgMYIz.o: In function `main':
/home/gnostic/puaex/src/tools/conftest.c:67: undefined reference to `_doprnt' /home/gnostic/puaex/src/tools/conftest.c:67: undefined reference to `_doprnt'
collect2: ld returned 1 exit status collect2: ld returned 1 exit status
configure:4350: $? = 1 configure:4350: $? = 1
...@@ -533,7 +533,7 @@ configure:4364: $? = 0 ...@@ -533,7 +533,7 @@ configure:4364: $? = 0
configure:4364: result: yes configure:4364: result: yes
configure:4364: checking for strcmpi configure:4364: checking for strcmpi
configure:4364: gcc -o conftest -g -O2 -Wall -W -Wno-unused conftest.c >&5 configure:4364: gcc -o conftest -g -O2 -Wall -W -Wno-unused conftest.c >&5
/tmp/ccZO2eLu.o: In function `main': /tmp/ccc0XecR.o: In function `main':
/home/gnostic/puaex/src/tools/conftest.c:69: undefined reference to `strcmpi' /home/gnostic/puaex/src/tools/conftest.c:69: undefined reference to `strcmpi'
collect2: ld returned 1 exit status collect2: ld returned 1 exit status
configure:4364: $? = 1 configure:4364: $? = 1
...@@ -613,7 +613,7 @@ configure: failed program was: ...@@ -613,7 +613,7 @@ configure: failed program was:
configure:4364: result: no configure:4364: result: no
configure:4364: checking for stricmp configure:4364: checking for stricmp
configure:4364: gcc -o conftest -g -O2 -Wall -W -Wno-unused conftest.c >&5 configure:4364: gcc -o conftest -g -O2 -Wall -W -Wno-unused conftest.c >&5
/tmp/ccmHyUSz.o: In function `main': /tmp/ccfbSEaY.o: In function `main':
/home/gnostic/puaex/src/tools/conftest.c:69: undefined reference to `stricmp' /home/gnostic/puaex/src/tools/conftest.c:69: undefined reference to `stricmp'
collect2: ld returned 1 exit status collect2: ld returned 1 exit status
configure:4364: $? = 1 configure:4364: $? = 1
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment