# HG changeset patch # User Matti Hamalainen # Date 1560503339 -10800 # Node ID 75b5bb490f38f4210fb0ada5bc68ad5318632501 # Parent b858ade0fb0b88da2d1ecd529656b60b9616aa97 Add & 15 to deeper helper functions and remove it from unnecessary places. diff -r b858ade0fb0b -r 75b5bb490f38 tools/lib64fmts.c --- a/tools/lib64fmts.c Fri Jun 14 09:04:15 2019 +0300 +++ b/tools/lib64fmts.c Fri Jun 14 12:08:59 2019 +0300 @@ -741,7 +741,7 @@ return dmC64GetGenericMCPixel(col, img, bmoffs, scroffs, vshift, rasterY & 7, - 0, 0, bgcol & 15); + 0, 0, bgcol); } @@ -1179,7 +1179,7 @@ return dmC64GetGenericMCPixel(col, img, bmoffs, scroffs, vshift, vbank, - bitmap, 0, bgcol & 15); + bitmap, 0, bgcol); } @@ -1497,7 +1497,7 @@ return dmC64GetGenericMCPixel(col, img, bmoffs, scroffs, vshift, vbank, - 0, vbank, bgcol & 15); + 0, vbank, bgcol); } diff -r b858ade0fb0b -r 75b5bb490f38 tools/lib64gfx.h --- a/tools/lib64gfx.h Fri Jun 14 09:04:15 2019 +0300 +++ b/tools/lib64gfx.h Fri Jun 14 12:08:59 2019 +0300 @@ -460,7 +460,7 @@ { switch ((img->bitmap[bitmap].data[bmoffs] >> vshift) & 3) { - case 0: *col = bgcolor; break; + case 0: *col = bgcolor & 15; break; case 1: *col = img->screen[vbank].data[scroffs] >> 4; break; case 2: *col = img->screen[vbank].data[scroffs] & 15; break; default: *col = img->color[cbank].data[scroffs] & 15; break; @@ -484,9 +484,9 @@ const int vshift = 7 - (rasterX & 7); if ((img->charData[chrbank].data[chroffs] >> vshift) & 1) - *col = img->color[cbank].data[scroffs]; + *col = img->color[cbank].data[scroffs] & 15; else - *col = bgcolor; + *col = bgcolor & 15; return DMERR_OK; } @@ -511,9 +511,9 @@ const int vshift = 6 - (rasterX & 6); switch ((img->charData[chrbank].data[chroffs] >> vshift) & 3) { - case 0: *col = bgcolor; break; - case 1: *col = bgd022; break; - case 2: *col = bgd023; break; + case 0: *col = bgcolor & 15; break; + case 1: *col = bgd022 & 15; break; + case 2: *col = bgd023 & 15; break; case 3: *col = ccol & 7; } } @@ -523,7 +523,7 @@ if ((img->charData[chrbank].data[chroffs] >> vshift) & 1) *col = ccol & 7; else - *col = bgcolor; + *col = bgcolor & 15; } return DMERR_OK; @@ -549,10 +549,10 @@ else switch ((chr >> 6) & 3) { - case 0: *col = bgcolor; break; - case 1: *col = bgd022; break; - case 2: *col = bgd023; break; - case 3: *col = bgd024; break; + case 0: *col = bgcolor & 15; break; + case 1: *col = bgd022 & 15; break; + case 2: *col = bgd023 & 15; break; + case 3: *col = bgd024 & 15; break; } return DMERR_OK;