changeset 2121:f12ac487954b

Rename the "shift" variable/function argument used for bitshift of c64 bitmap/char pixels.
author Matti Hamalainen <ccr@tnsp.org>
date Mon, 27 May 2019 00:04:02 +0300
parents 88d37ec1b4d6
children 59bde9a7220d
files tools/lib64fmts.c tools/lib64gfx.c tools/lib64gfx.h
diffstat 3 files changed, 42 insertions(+), 42 deletions(-) [+]
line wrap: on
line diff
--- a/tools/lib64fmts.c	Sun May 26 18:40:45 2019 +0300
+++ b/tools/lib64fmts.c	Mon May 27 00:04:02 2019 +0300
@@ -476,10 +476,10 @@
 
 static Uint8 fmtGetPixelFLIDesigner(
     const DMC64Image *img, const int bmoffs, const int scroffs,
-    const int shift, const int bitmap, const int rasterX, const int rasterY)
+    const int shiftX, const int bitmap, const int rasterX, const int rasterY)
 {
     (void) rasterX;
-    return dmC64GetGenericMCPixel(img, bmoffs, scroffs, shift, rasterY & 7, bitmap, 0, img->bgcolor);
+    return dmC64GetGenericMCPixel(img, bmoffs, scroffs, shiftX, rasterY & 7, bitmap, 0, img->bgcolor);
 }
 
 
@@ -567,13 +567,13 @@
 
 static Uint8 fmtGetPixelBlackMailFLI(
     const DMC64Image *img, const int bmoffs, const int scroffs,
-    const int shift, const int bitmap, const int rasterX, const int rasterY)
+    const int shiftX, const int bitmap, const int rasterX, const int rasterY)
 {
     const int vbank = rasterY & 7;
     (void) rasterX;
 
     return dmC64GetGenericMCPixel(
-        img, bmoffs, scroffs, shift,
+        img, bmoffs, scroffs, shiftX,
         vbank, bitmap, 0,
         img->extraData[0].data[rasterY] & 15);
 }
@@ -592,11 +592,11 @@
 
 static Uint8 fmtGetPixelTruePaint(
     const DMC64Image *img, const int bmoffs, const int scroffs,
-    const int shift, const int bitmap, const int rasterX, const int rasterY)
+    const int shiftX, const int bitmap, const int rasterX, const int rasterY)
 {
     (void) rasterX;
     (void) rasterY;
-    return dmC64GetGenericMCPixel(img, bmoffs, scroffs, shift, 0, bitmap, 0, img->bgcolor);
+    return dmC64GetGenericMCPixel(img, bmoffs, scroffs, shiftX, 0, bitmap, 0, img->bgcolor);
 }
 
 
@@ -893,13 +893,13 @@
 
 static Uint8 fmtGetPixelFunPaint2(
     const DMC64Image *img, const int bmoffs, const int scroffs,
-    const int shift, const int bitmap, const int rasterX, const int rasterY)
+    const int shiftX, const int bitmap, const int rasterX, const int rasterY)
 {
     const int vbank = (rasterY & 7) + (bitmap * 8);
     (void) rasterX;
 
     return dmC64GetGenericMCPixel(
-        img, bmoffs, scroffs, shift,
+        img, bmoffs, scroffs, shiftX,
         vbank, bitmap, 0,
         img->extraData[0].data[rasterY] & 15);
 }
@@ -907,7 +907,7 @@
 
 static Uint8 fmtGetPixelBFLI(
     const DMC64Image *img, const int bmoffs, const int scroffs,
-    const int shift, const int bitmap, const int rasterX, const int rasterY)
+    const int shiftX, const int bitmap, const int rasterX, const int rasterY)
 {
     const int vbb = rasterY < 200 ? 0 : 1;
     const int vbank = (rasterY & 7) + (vbb * 8);
@@ -916,13 +916,13 @@
 
     return dmC64GetGenericMCPixel(
         img, bmoffs & 0x1fff, scroffs & 0x3ff,
-        shift, vbank, vbb, 0, img->bgcolor);
+        shiftX, vbank, vbb, 0, img->bgcolor);
 }
 
 
 static Uint8 fmtGetPixelPentelPaint(
     const DMC64Image *img, const int bmoffs, const int scroffs,
-    const int shift, const int bitmap, const int rasterX, const int rasterY)
+    const int shiftX, const int bitmap, const int rasterX, const int rasterY)
 {
     const int ry = rasterY / C64_SPR_HEIGHT_PX;
     const int yd = rasterY % C64_SPR_HEIGHT_PX;
@@ -931,7 +931,7 @@
     const int offs = (ry * 8 + rx) * C64_SPR_SIZE + (yd * C64_SPR_WIDTH_UT) + (xd / 8);
     const int mask = 1 << (7 - (rasterX & 7));
 
-    Uint8 color1 = dmC64GetGenericSCPixel(img, bmoffs, scroffs, shift, 0, bitmap, 0);
+    Uint8 color1 = dmC64GetGenericSCPixel(img, bmoffs, scroffs, shiftX, 0, bitmap, 0);
     Uint8 color2 = img->extraData[0].data[offs] & mask ? 0x0f : 0;
     Uint8 color3 = img->extraData[0].data[offs + C64_SPR_SIZE * 155] & mask ? img->d022 : 0;
 
@@ -941,7 +941,7 @@
 
 static Uint8 fmtGetPixelHCB(
     const DMC64Image *img, const int bmoffs, const int scroffs,
-    const int shift, const int bitmap, const int rasterX, const int rasterY)
+    const int shiftX, const int bitmap, const int rasterX, const int rasterY)
 {
     const int vbank = (rasterY / 4) & 1;
     (void) bitmap;
@@ -949,17 +949,17 @@
 
     return dmC64GetGenericMCPixel(
         img, bmoffs, scroffs,
-        shift, vbank, 0, vbank,
+        shiftX, vbank, 0, vbank,
         img->extraData[0].data[rasterY / 5] & 15);
 }
 
 
 static Uint8 fmtGetPixelCrestHIFLIorCDHM(
     const DMC64Image *img, const int bmoffs, const int scroffs,
-    const int shift, const int bitmap, const int rasterX, const int rasterY)
+    const int shiftX, const int bitmap, const int rasterX, const int rasterY)
 {
     (void) rasterX;
-    return dmC64GetGenericSCPixel(img, bmoffs, scroffs, shift, rasterY & 7, bitmap, 0);
+    return dmC64GetGenericSCPixel(img, bmoffs, scroffs, shiftX, rasterY & 7, bitmap, 0);
 }
 
 
@@ -976,12 +976,12 @@
 
 static Uint8 fmtGetPixelECI(
     const DMC64Image *img, const int bmoffs, const int scroffs,
-    const int shift, const int bitmap, const int rasterX, const int rasterY)
+    const int shiftX, const int bitmap, const int rasterX, const int rasterY)
 {
     const int vbank = rasterY & 7;
     Uint8
-        c1 = dmC64GetGenericSCPixel(img, bmoffs, scroffs, shift, vbank    , 0, 0),
-        c2 = dmC64GetGenericSCPixel(img, bmoffs, scroffs, shift, vbank + 8, 1, 0);
+        c1 = dmC64GetGenericSCPixel(img, bmoffs, scroffs, shiftX, vbank    , 0, 0),
+        c2 = dmC64GetGenericSCPixel(img, bmoffs, scroffs, shiftX, vbank + 8, 1, 0);
 
     (void) bitmap;
     (void) rasterX;
--- a/tools/lib64gfx.c	Sun May 26 18:40:45 2019 +0300
+++ b/tools/lib64gfx.c	Mon May 27 00:04:02 2019 +0300
@@ -1315,10 +1315,10 @@
                 // Hi-res charmap
                 const int x = xc / 8;
                 const int scroffs = scroffsy + x;
-                const int vshift = 7 - (xc & 7);
+                const int xshift = 7 - (xc & 7);
                 const int chr = src->screen[0].data[scroffs];
 
-                if ((src->charData[0].data[chr * C64_CHR_SIZE + yb] >> vshift) & 1)
+                if ((src->charData[0].data[chr * C64_CHR_SIZE + yb] >> xshift) & 1)
                     *dp++ = src->color[0].data[scroffs];
                 else
                     *dp++ = src->bgcolor;
@@ -1329,10 +1329,10 @@
                 // Hi-res ECM charmap
                 const int x = xc / 8;
                 const int scroffs = scroffsy + x;
-                const int vshift = 7 - (xc & 7);
+                const int xshift = 7 - (xc & 7);
                 const int chr = src->screen[0].data[scroffs];
 
-                if ((src->charData[0].data[(chr & 0x3f) * C64_CHR_SIZE + yb] >> vshift) & 1)
+                if ((src->charData[0].data[(chr & 0x3f) * C64_CHR_SIZE + yb] >> xshift) & 1)
                     *dp++ = src->color[0].data[scroffs] & 15;
                 else
                 switch ((chr >> 6) & 3)
@@ -1354,8 +1354,8 @@
 
                 if (col & 8)
                 {
-                    const int vshift = 6 - ((xc * 2) & 6);
-                    switch ((src->charData[0].data[chr * C64_CHR_SIZE + yb] >> vshift) & 3)
+                    const int xshift = 6 - ((xc * 2) & 6);
+                    switch ((src->charData[0].data[chr * C64_CHR_SIZE + yb] >> xshift) & 3)
                     {
                         case 0: *dp++ = src->bgcolor; break;
                         case 1: *dp++ = src->d022; break;
@@ -1365,8 +1365,8 @@
                 }
                 else
                 {
-                    const int vshift = 7 - (xc & 7);
-                    if ((src->charData[0].data[chr * C64_CHR_SIZE + yb] >> vshift) & 1)
+                    const int xshift = 7 - (xc & 7);
+                    if ((src->charData[0].data[chr * C64_CHR_SIZE + yb] >> xshift) & 1)
                         *dp++ = col & 7;
                     else
                         *dp++ = src->bgcolor;
@@ -1382,9 +1382,9 @@
                 const int x = xc / 8;
                 const int scroffs = scroffsy + x;
                 const int bmoffs = bmoffsy + (x * 8);
-                const int vshift = 7 - (xc & 7);
+                const int xshift = 7 - (xc & 7);
 
-                *dp++ = getPixel(src, bmoffs, scroffs, vshift, 0, xc, yc);
+                *dp++ = getPixel(src, bmoffs, scroffs, xshift, 0, xc, yc);
             }
             else
             {
@@ -1392,15 +1392,15 @@
                 const int x = xc / 4;
                 const int scroffs = scroffsy + x;
                 const int bmoffs = bmoffsy + (x * 8);
-                const int vshift = 6 - ((xc * 2) & 6);
+                const int xshift = 6 - ((xc * 2) & 6);
 
                 if (src->fmt->type & D64_FMT_ILACE)
                 {
                     switch (src->laceType)
                     {
                         case D64_ILACE_RES:
-                            *dp++ = getPixel(src, bmoffs, scroffs, vshift, 0, xc, yc);
-                            *dp++ = getPixel(src, bmoffs, scroffs, vshift, 1, xc, yc);
+                            *dp++ = getPixel(src, bmoffs, scroffs, xshift, 0, xc, yc);
+                            *dp++ = getPixel(src, bmoffs, scroffs, xshift, 1, xc, yc);
                             break;
 
                         default:
@@ -1409,7 +1409,7 @@
                 }
                 else
                 {
-                    const Uint8 col = getPixel(src, bmoffs, scroffs, vshift, 0, xc, yc);
+                    const Uint8 col = getPixel(src, bmoffs, scroffs, xshift, 0, xc, yc);
                     *dp++ = col;
                     if (spec->aspect)
                         *dp++ = col;
--- a/tools/lib64gfx.h	Sun May 26 18:40:45 2019 +0300
+++ b/tools/lib64gfx.h	Mon May 27 00:04:02 2019 +0300
@@ -204,7 +204,7 @@
 
 typedef Uint8 (*DMC64GetPixelFunc)(
     const DMC64Image *img, const int bmoffs, const int scroffs,
-    const int vshift, const int vbitmap, const int rasterX, const int rasterY);
+    const int shiftX, const int bitmap, const int rasterX, const int rasterY);
 
 
 typedef struct _DMC64ImageCommonFormat
@@ -374,10 +374,10 @@
 //
 static inline Uint8 dmC64GetGenericSCPixel(
     const DMC64Image *img, const int bmoffs, const int scroffs,
-    const int vshift, const int vbank, const int vbitmap, const int cbank)
+    const int shiftX, const int vbank, const int bitmap, const int cbank)
 {
     (void) cbank;
-    if ((img->bitmap[vbitmap].data[bmoffs] >> vshift) & 1)
+    if ((img->bitmap[bitmap].data[bmoffs] >> shiftX) & 1)
         return img->screen[vbank].data[scroffs] >> 4;
     else
         return img->screen[vbank].data[scroffs] & 15;
@@ -386,9 +386,9 @@
 
 static inline Uint8 dmC64GetGenericMCPixel(
     const DMC64Image *img, const int bmoffs, const int scroffs,
-    const int vshift, const int vbank, const int vbitmap, const int cbank, const int bgcolor)
+    const int shiftX, const int vbank, const int bitmap, const int cbank, const int bgcolor)
 {
-    switch ((img->bitmap[vbitmap].data[bmoffs] >> vshift) & 3)
+    switch ((img->bitmap[bitmap].data[bmoffs] >> shiftX) & 3)
     {
         case  0: return bgcolor;
         case  1: return img->screen[vbank].data[scroffs] >> 4;
@@ -400,21 +400,21 @@
 
 static inline Uint8 fmtGetGenericSCPixel(
     const DMC64Image *img, const int bmoffs, const int scroffs,
-    const int vshift, const int vbitmap, const int rasterX, const int rasterY)
+    const int shiftX, const int bitmap, const int rasterX, const int rasterY)
 {
     (void) rasterX;
     (void) rasterY;
-    return dmC64GetGenericSCPixel(img, bmoffs, scroffs, vshift, 0, vbitmap, 0);
+    return dmC64GetGenericSCPixel(img, bmoffs, scroffs, shiftX, 0, bitmap, 0);
 }
 
 
 static inline Uint8 fmtGetGenericMCPixel(
     const DMC64Image *img, const int bmoffs, const int scroffs,
-    const int vshift, const int vbitmap, const int rasterX, const int rasterY)
+    const int shiftX, const int bitmap, const int rasterX, const int rasterY)
 {
     (void) rasterX;
     (void) rasterY;
-    return dmC64GetGenericMCPixel(img, bmoffs, scroffs, vshift, 0, vbitmap, 0, img->bgcolor);
+    return dmC64GetGenericMCPixel(img, bmoffs, scroffs, shiftX, 0, bitmap, 0, img->bgcolor);
 }