diff tools/lib64fmts.c @ 1850:3d6917948061

Backed out changeset 914dbb50139f
author Matti Hamalainen <ccr@tnsp.org>
date Fri, 22 Jun 2018 23:10:20 +0300
parents 914dbb50139f
children 31c9884321b1
line wrap: on
line diff
--- a/tools/lib64fmts.c	Fri Jun 22 23:06:32 2018 +0300
+++ b/tools/lib64fmts.c	Fri Jun 22 23:10:20 2018 +0300
@@ -711,17 +711,15 @@
 }
 
 
+#define FUNPAINT2_HEADER_SIZE (0x10)
+static const char *fmtFunPaint2MagicID = "FUNPAINT (MT) ";
 
 
-#define FUNPAINTER2_HEADER_SIZE (0x10)
-static const char *fmtFunPainter2MagicID = "FUNPAINT (MT) ";
-
-
-static int fmtProbeFunPainter2(const DMGrowBuf *buf, const DMC64ImageFormat *fmt)
+static int fmtProbeFunPaint2(const DMGrowBuf *buf, const DMC64ImageFormat *fmt)
 {
     if (buf->len > 30 &&
         dmCompareAddr16(buf, 0, fmt->addr) &&
-        memcmp(buf->data + 2, fmtFunPainter2MagicID, strlen(fmtFunPainter2MagicID)) == 0)
+        memcmp(buf->data + 2, fmtFunPaint2MagicID, strlen(fmtFunPaint2MagicID)) == 0)
     {
         // Unpacked variant
         if (fmt->size != 0 && buf->data[14 + 2] == 0)
@@ -736,7 +734,7 @@
 }
 
 
-static int fmtDecodeFunPainter2(DMC64Image *img, const DMGrowBuf *buf, const DMC64ImageFormat *fmt)
+static int fmtDecodeFunPaint2(DMC64Image *img, const DMGrowBuf *buf, const DMC64ImageFormat *fmt)
 {
     int res;
     DMGrowBuf tmp;
@@ -752,7 +750,7 @@
         cfg.flags        = DM_RLE_BYTE_RUNS | DM_RLE_ORDER_1;
         cfg.rleMarkerB   = buf->data[15];
 
-        dmGrowBufCopyOffs(&tmp, buf, FUNPAINTER2_HEADER_SIZE, 1);
+        dmGrowBufCopyOffs(&tmp, buf, FUNPAINT2_HEADER_SIZE, 1);
         tmp.len = tmp.size;
 
         if ((res = dmDecodeGenericRLEAlloc(
@@ -764,17 +762,17 @@
     }
     else
     {
-        res = dmC64DecodeGenericBMP(img, dmGrowBufConstCopyOffs(&tmp, buf, FUNPAINTER2_HEADER_SIZE), fmt);
+        res = dmC64DecodeGenericBMP(img, dmGrowBufConstCopyOffs(&tmp, buf, FUNPAINT2_HEADER_SIZE), fmt);
     }
 
     return res;
 }
 
 
-static int fmtEncodeFunPainter2Unpacked(DMGrowBuf *buf, const DMC64Image *img, const DMC64ImageFormat *fmt)
+static int fmtEncodeFunPaint2Unpacked(DMGrowBuf *buf, const DMC64Image *img, const DMC64ImageFormat *fmt)
 {
     // Add the header bits
-    if (!dmGrowBufPut(buf, (Uint8 *) fmtFunPainter2MagicID, strlen(fmtFunPainter2MagicID)) ||
+    if (!dmGrowBufPut(buf, (Uint8 *) fmtFunPaint2MagicID, strlen(fmtFunPaint2MagicID)) ||
         !dmGrowBufPutU8(buf, 0) || // 0 == unpacked variant
         !dmGrowBufPutU8(buf, 0))   // RLE marker byte (not used in unpacked)
         return DMERR_MALLOC;
@@ -783,7 +781,7 @@
 }
 
 
-static int fmtEncodeFunPainter2Packed(DMGrowBuf *buf, const DMC64Image *img, const DMC64ImageFormat *fmt)
+static int fmtEncodeFunPaint2Packed(DMGrowBuf *buf, const DMC64Image *img, const DMC64ImageFormat *fmt)
 {
     int res;
     DMGrowBuf mem;
@@ -803,7 +801,7 @@
     dmGenericRLEAnalyze(&mem, &cfg);
 
     // Add the header bits
-    if (!dmGrowBufPut(buf, (Uint8 *) fmtFunPainter2MagicID, strlen(fmtFunPainter2MagicID)) ||
+    if (!dmGrowBufPut(buf, (Uint8 *) fmtFunPaint2MagicID, strlen(fmtFunPaint2MagicID)) ||
         !dmGrowBufPutU8(buf, 1) || // non-zero == packed variant
         !dmGrowBufPutU8(buf, cfg.rleMarkerB))
     {
@@ -820,7 +818,7 @@
 }
 
 
-static Uint8 fmtGetPixelFunPainter2(
+static Uint8 fmtGetPixelFunPaint2(
     const DMC64Image *img, const int bmoffs, const int scroffs,
     const int shift, const int bitmap, const int rasterX, const int rasterY)
 {
@@ -1024,12 +1022,12 @@
         }
     },
 
-    { // #3: FunPainter II
+    { // #3: FunPaint II
         D64_FMT_MC | D64_FMT_FLI | D64_FMT_ILACE,
         C64_SCR_WIDTH, C64_SCR_HEIGHT,
         C64_SCR_CH_WIDTH , C64_SCR_CH_HEIGHT,
         NULL, NULL,
-        fmtGetPixelFunPainter2,
+        fmtGetPixelFunPaint2,
         {
             DEF_SCREEN_RAMS_8(0x0000, 0, 0x400),
             { DO_COPY       , DS_BITMAP_RAM  , 0x2000, 0,  0  , 0, NULL, NULL },
@@ -1654,16 +1652,16 @@
     },
 
     {
-        "fp2", "FunPainter II (unpacked)", 0x3ff0, 33694, DM_FMT_RDWR,
-        fmtProbeFunPainter2,
-        fmtDecodeFunPainter2, fmtEncodeFunPainter2Unpacked,
+        "fp2", "FunPaint II (unpacked)", 0x3ff0, 33694, DM_FMT_RDWR,
+        fmtProbeFunPaint2,
+        fmtDecodeFunPaint2, fmtEncodeFunPaint2Unpacked,
         { }, &dmC64CommonFormats[3]
     },
 
     {
-        "fp2p", "FunPainter II (packed)", 0x3ff0, 0, DM_FMT_RDWR,
-        fmtProbeFunPainter2,
-        fmtDecodeFunPainter2, fmtEncodeFunPainter2Packed,
+        "fp2p", "FunPaint II (packed)", 0x3ff0, 0, DM_FMT_RDWR,
+        fmtProbeFunPaint2,
+        fmtDecodeFunPaint2, fmtEncodeFunPaint2Packed,
         { }, &dmC64CommonFormats[3]
     },
 
@@ -1676,7 +1674,7 @@
             C64_SCR_WIDTH, C64_SCR_HEIGHT,
             C64_SCR_CH_WIDTH , C64_SCR_CH_HEIGHT,
             NULL, NULL,
-            fmtGetPixelFunPainter2, // The format is essentially same as FP2
+            fmtGetPixelFunPaint2, // The format is essentially same as FP2
             {
                 DEF_SCREEN_RAMS_8(0x0000, 0, 0x400),
                 { DO_COPY       , DS_BITMAP_RAM  , 0x2000, 0,  0  , 0, NULL, NULL },