Mercurial > hg > dmlib
diff tools/lib64gfx.h @ 2222:75b5bb490f38
Add & 15 to deeper helper functions and remove it from unnecessary places.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Fri, 14 Jun 2019 12:08:59 +0300 |
parents | 90ec1ec89c56 |
children | 5477e792def3 |
line wrap: on
line diff
--- 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;