changeset 2521:b19535da15e9

Add new field 'size_t extra' to DMC64ImageFormat for certain image format data for which size field was previously abused for.
author Matti Hamalainen <ccr@tnsp.org>
date Fri, 15 May 2020 03:06:48 +0300
parents 4e7d9fd9b7e4
children 27271f2afa7c
files tools/lib64fmts.c tools/lib64gfx.h
diffstat 2 files changed, 68 insertions(+), 68 deletions(-) [+]
line wrap: on
line diff
--- a/tools/lib64fmts.c	Fri May 15 02:55:31 2020 +0300
+++ b/tools/lib64fmts.c	Fri May 15 03:06:48 2020 +0300
@@ -74,7 +74,7 @@
     if (buf->len > 12 &&
         DM_MEMCMP_SIZE(buf->data, fmtSupeRes_MagicID_1) == 0)
     {
-        if (buf->data[3] == fmt->size)
+        if (buf->data[3] == fmt->extra)
             return DM_PROBE_SCORE_MAX;
     }
 
@@ -237,7 +237,7 @@
             "Could not allocate memory for decoding buffer.\n");
     }
 
-    switch (fmt->size)
+    switch (fmt->extra)
     {
         case 0x23:
         case 0x25:
@@ -526,13 +526,12 @@
         (dmCompareAddr16(buf, 0, 0x1c00) || dmCompareAddr16(buf, 0, 0x5c00)))
     {
         // Packed variant
-        if (fmt->size == 0xfe &&
-            buf->len != fmt->size &&
+        if (fmt->extra == 0xfe &&
             buf->len != 10242) // Attempt to avoid misprobes of "Rainbow Painter (unpacked)"
             return DM_PROBE_SCORE_MAX;
 
         // Unpacked variant
-        if (fmt->size != 0xfe && buf->len == fmt->size)
+        if (fmt->extra != 0xfe && buf->len == fmt->size)
             return DM_PROBE_SCORE_MAX;
     }
 
@@ -559,7 +558,7 @@
     cfg.func         = fmt->name;
     cfg.type         = DM_COMP_RLE_MARKER;
     cfg.flags        = DM_RLE_BYTE_RUNS | DM_RLE_ORDER_2;
-    cfg.rleMarkerB   = fmt->size;
+    cfg.rleMarkerB   = fmt->extra;
 
     if ((res = dmDecodeGenericRLEAlloc(&mem, buf, &cfg)) != DMERR_OK)
         goto out;
@@ -586,7 +585,7 @@
     cfg.func         = fmt->name;
     cfg.type         = DM_COMP_RLE_MARKER;
     cfg.flags        = DM_RLE_BYTE_RUNS | DM_RLE_ORDER_2;
-    cfg.rleMarkerB   = fmt->size;
+    cfg.rleMarkerB   = fmt->extra;
     cfg.rleMinCountB = 4;
     cfg.rleMaxCountB = 255;
     res = dmEncodeGenericRLE(buf, &tmp, &cfg);
@@ -2214,42 +2213,42 @@
 DMC64ImageFormat dmC64ImageFormats[] =
 {
     {
-        "d2p", "DrazPaint 1.4/2.0 (packed)", 0x5800, 0, DM_FMT_RDWR,
+        "d2p", "DrazPaint 1.4/2.0 (packed)", 0x5800, 0, 0, DM_FMT_RDWR,
         fmtProbeDrazPaint20Packed,
         fmtDecodeDrazPaintPacked, fmtEncodeDrazPaintPacked,
         { }, &dmC64CommonFormats[4]
     },
 
     {
-        "drp", "DrazPaint (unpacked)", 0x5800, 10051, DM_FMT_RDWR,
+        "drp", "DrazPaint (unpacked)", 0x5800, 10051, 0, DM_FMT_RDWR,
         NULL,
         NULL, NULL,
         { }, &dmC64CommonFormats[4]
     },
 
     {
-        "dlp", "DrazLace 1.0 (packed)", 0x5800, 0, DM_FMT_RDWR,
+        "dlp", "DrazLace 1.0 (packed)", 0x5800, 0, 0, DM_FMT_RDWR,
         fmtProbeDrazLace10Packed,
         fmtDecodeDrazPaintPacked, fmtEncodeDrazPaintPacked,
         { }, &dmC64CommonFormats[5]
     },
 
     {
-        "drl", "DrazLace 1.0 (unpacked)", 0x5800, 18242, DM_FMT_RDWR,
+        "drl", "DrazLace 1.0 (unpacked)", 0x5800, 18242, 0, DM_FMT_RDWR,
         NULL,
         NULL, NULL,
         { }, &dmC64CommonFormats[5]
     },
 
     {
-        "bdp5", "Boogie Down Paint 5 (packed)", 0x5000, 0, DM_FMT_RDWR,
+        "bdp5", "Boogie Down Paint 5 (packed)", 0x5000, 0, 0, DM_FMT_RDWR,
         fmtProbeBDP5Packed,
         fmtDecodeBDP5Packed, fmtEncodeBDP5Packed,
         { }, &dmC64CommonFormats[0] // Memory format is same as Koala
     },
 
     {
-        "vid", "Vidcom 64 (unpacked)", 0x5800, 10050, DM_FMT_RDWR,
+        "vid", "Vidcom 64 (unpacked)", 0x5800, 10050, 0, DM_FMT_RDWR,
         NULL,
         NULL, NULL,
         {
@@ -2271,7 +2270,7 @@
     },
 
     {
-        "p64", "Picasso 64 (unpacked)", 0x1800, 10050, DM_FMT_RDWR,
+        "p64", "Picasso 64 (unpacked)", 0x1800, 10050, 0, DM_FMT_RDWR,
         NULL,
         NULL, NULL,
         {
@@ -2293,35 +2292,35 @@
     },
 
     {
-        "mci", "Truepaint (unpacked)", 0x9c00, 19434, DM_FMT_RDWR,
+        "mci", "Truepaint (unpacked)", 0x9c00, 19434, 0, DM_FMT_RDWR,
         NULL,
         NULL, NULL,
         { }, &dmC64CommonFormats[6]
     },
 
     {
-        "mcip", "Truepaint (packed)", 0x0801, 0, DM_FMT_RD,
+        "mcip", "Truepaint (packed)", 0x0801, 0, 0, DM_FMT_RD,
         fmtProbeTruePaintPacked,
         fmtDecodeTruePaintPacked, NULL,
         { }, &dmC64CommonFormats[6]
     },
 
     {
-        "kla", "Koala Painter (unpacked)", 0x6000, 10003, DM_FMT_RDWR,
+        "kla", "Koala Painter (unpacked)", 0x6000, 10003, 0, DM_FMT_RDWR,
         fmtProbeKoalaPainter,
         NULL, NULL,
         { }, &dmC64CommonFormats[0]
     },
 
     {
-        "klp", "Koala Painter (packed)", 0x6000, 0xfe, DM_FMT_RDWR, // size is abused for RLE marker byte
+        "klp", "Koala Painter (packed)", 0x6000, 0, 0xfe, DM_FMT_RDWR,
         fmtProbeKoalaPainterPacked,
         fmtDecodeStaticRLEMarkerMode2, fmtEncodeStaticRLEMarkerMode2,
         { }, &dmC64CommonFormats[0]
     },
 
     {
-        "aas", "Advanced Art Studio (unpacked)", 0x2000, 10018, DM_FMT_RDWR,
+        "aas", "Advanced Art Studio (unpacked)", 0x2000, 10018, 0, DM_FMT_RDWR,
         NULL,
         NULL, NULL,
         {
@@ -2344,7 +2343,7 @@
     },
 
     {
-        "ims", "Image System MC (unpacked)", 0x3c00, 10218, DM_FMT_RDWR,
+        "ims", "Image System MC (unpacked)", 0x3c00, 10218, 0, DM_FMT_RDWR,
         NULL,
         NULL, NULL,
         {
@@ -2366,7 +2365,7 @@
     },
 
     {
-        "mil", "Micro Illustrator (unpacked)", 0x18dc, 10022, DM_FMT_RDWR | DM_FMT_BROKEN,
+        "mil", "Micro Illustrator (unpacked)", 0x18dc, 10022, 0, DM_FMT_RDWR | DM_FMT_BROKEN,
         fmtProbeMicroIllustrator,
         NULL, NULL,
         {
@@ -2394,7 +2393,7 @@
     },
 
     {
-        "cdu", "CDU-Paint (unpacked)", 0x7eef, 10277, DM_FMT_RDWR,
+        "cdu", "CDU-Paint (unpacked)", 0x7eef, 10277, 0, DM_FMT_RDWR,
         NULL,
         NULL, NULL,
         {
@@ -2416,7 +2415,7 @@
     },
 
     {
-        "rbp", "Rainbow Painter (unpacked)", 0x5c00, 10242, DM_FMT_RDWR | DM_FMT_BROKEN,
+        "rbp", "Rainbow Painter (unpacked)", 0x5c00, 10242, 0, DM_FMT_RDWR | DM_FMT_BROKEN,
         NULL,
         NULL, NULL,
         {
@@ -2439,7 +2438,7 @@
     },
 
     {
-        "sar", "Saracen Paint (unpacked)", 0x7800, 10219, DM_FMT_RDWR,
+        "sar", "Saracen Paint (unpacked)", 0x7800, 10219, 0, DM_FMT_RDWR,
         fmtProbeSaracenPaint,
         NULL, NULL,
         {
@@ -2461,7 +2460,7 @@
     },
 
     {
-        "blp", "Blazing Paddles (unpacked)", 0xA000, 10242, DM_FMT_RDWR,
+        "blp", "Blazing Paddles (unpacked)", 0xA000, 10242, 0, DM_FMT_RDWR,
         NULL,
         NULL, NULL,
         {
@@ -2485,7 +2484,7 @@
     },
 
     {
-        "pmg", "Paint Magic crippled MC (unpacked)", 0x3f8e, 9332, DM_FMT_RDWR,
+        "pmg", "Paint Magic crippled MC (unpacked)", 0x3f8e, 9332, 0, DM_FMT_RDWR,
         NULL,
         NULL, NULL,
         {
@@ -2508,7 +2507,7 @@
     },
 
     {
-        "a64", "Wigmore Artist 64 (unpacked)", 0x4000, 10242, DM_FMT_RDWR,
+        "a64", "Wigmore Artist 64 (unpacked)", 0x4000, 10242, 0, DM_FMT_RDWR,
         NULL,
         NULL, NULL,
         {
@@ -2531,56 +2530,56 @@
     },
 
     {
-        "ami", "Amica Paint (packed)", 0x4000, 0, DM_FMT_RDWR,
+        "ami", "Amica Paint (packed)", 0x4000, 0, 0, DM_FMT_RDWR,
         fmtProbeAmicaPaintPacked,
         fmtDecodeAmicaPaintPacked, fmtEncodeAmicaPaintPacked,
         { }, &dmC64CommonFormats[0]
     },
 
     {
-        "rpm", "Run Paint (unpacked)", 0x6000, 10006, DM_FMT_RDWR,
+        "rpm", "Run Paint (unpacked)", 0x6000, 10006, 0, DM_FMT_RDWR,
         NULL,
         NULL, NULL,
         { }, &dmC64CommonFormats[0]
     },
 
     {
-        "ipc", "Interpaint MC (unpacked)", 0x4000, 10003, DM_FMT_RDWR,
+        "ipc", "Interpaint MC (unpacked)", 0x4000, 10003, 0, DM_FMT_RDWR,
         NULL,
         NULL, NULL,
         { }, &dmC64CommonFormats[0]
     },
 
     {
-        "art", "Art Studio (unpacked)", 0x2000, 9009, DM_FMT_RDWR,
+        "art", "Art Studio (unpacked)", 0x2000, 9009, 0, DM_FMT_RDWR,
         fmtProbeArtStudio,
         NULL, NULL,
         { }, &dmC64CommonFormats[2]
     },
 
     {
-        "iph", "Interpaint (unpacked)", 0x4000, 9002, DM_FMT_RDWR,
+        "iph", "Interpaint (unpacked)", 0x4000, 9002, 0, DM_FMT_RDWR,
         NULL,
         NULL, NULL,
         { }, &dmC64CommonFormats[2]
     },
 
     {
-        "dd", "Doodle (unpacked)", 0x1c00, 9218, DM_FMT_RDWR,
+        "dd", "Doodle (unpacked)", 0x1c00, 9218, 0, DM_FMT_RDWR,
         fmtProbeDoodle,
         NULL, NULL,
         { }, &dmC64CommonFormats[10]
     },
 
     {
-        "jj", "Doodle (packed)", 0x5c00, 0xfe, DM_FMT_RDWR, // size is abused for RLE marker byte
+        "jj", "Doodle (packed)", 0x5c00, 0, 0xfe, DM_FMT_RDWR,
         fmtProbeDoodle,
         fmtDecodeStaticRLEMarkerMode2, fmtEncodeStaticRLEMarkerMode2,
         { }, &dmC64CommonFormats[10]
     },
 
     {
-        "mon", "Monomagic (unpacked)", 0x2000, 8194, DM_FMT_RDWR,
+        "mon", "Monomagic (unpacked)", 0x2000, 8194, 0, DM_FMT_RDWR,
         NULL,
         NULL, NULL,
         {
@@ -2601,7 +2600,7 @@
     },
 
     {
-        "hir", "Plain hires (unpacked)", 0x2000, 8002, DM_FMT_RDWR,
+        "hir", "Plain hires (unpacked)", 0x2000, 8002, 0, DM_FMT_RDWR,
         NULL,
         NULL, NULL,
         {
@@ -2621,7 +2620,7 @@
     },
 
     {
-        "gih", "Gigapaint hires (unpacked)", 0x6000, 8002, DM_FMT_RDWR,
+        "gih", "Gigapaint hires (unpacked)", 0x6000, 8002, 0, DM_FMT_RDWR,
         fmtProbeGigapaintHires,
         NULL, NULL,
         {
@@ -2641,7 +2640,7 @@
     },
 
     {
-        "bfli", "Pu-239 Big FLI/BFLI (unpacked)", 0x3bff, 33795, DM_FMT_RD,
+        "bfli", "Pu-239 Big FLI/BFLI (unpacked)", 0x3bff, 33795, 0, DM_FMT_RD,
         NULL,
         NULL, NULL,
         {
@@ -2665,42 +2664,42 @@
     },
 
     {
-        "bml", "Black Mail FLI (unpacked)", 0x3b00, 17474, DM_FMT_RDWR,
+        "bml", "Black Mail FLI (unpacked)", 0x3b00, 17474, 0, DM_FMT_RDWR,
         NULL,
         NULL, NULL,
         { }, &dmC64CommonFormats[1]
     },
 
     {
-        "bmlp", "Black Mail FLI (packed)", 0x38f0, 0, DM_FMT_RDWR,
+        "bmlp", "Black Mail FLI (packed)", 0x38f0, 0, 0, DM_FMT_RDWR,
         fmtProbeBlackMailFLIPacked,
         fmtDecodeBlackMailFLIPacked, fmtEncodeBlackMailFLIPacked,
         { }, &dmC64CommonFormats[1]
     },
 
     {
-        "dfed", "Dolphins FLI Editor v3.2 (unpacked)", 0x3b00, 17665, DM_FMT_RDWR,
+        "dfed", "Dolphins FLI Editor v3.2 (unpacked)", 0x3b00, 17665, 0, DM_FMT_RDWR,
         NULL,
         NULL, NULL,
         { }, &dmC64CommonFormats[1]
     },
 
     {
-        "fd1", "FBI Crew FLI Designer 1.1 (unpacked)", 0x3c00, 17409, DM_FMT_RDWR,
+        "fd1", "FBI Crew FLI Designer 1.1 (unpacked)", 0x3c00, 17409, 0, DM_FMT_RDWR,
         NULL,
         NULL, NULL,
         { }, &dmC64CommonFormats[9]
     },
 
     {
-        "fd2", "FLI Designer 2 (unpacked)", 0x3ff0, 17409, DM_FMT_RDWR,
+        "fd2", "FLI Designer 2 (unpacked)", 0x3ff0, 17409, 0, DM_FMT_RDWR,
         NULL,
         NULL, NULL,
         { }, &dmC64CommonFormats[9]
     },
 
     {
-        "flnt", "Flinterlazer 1.0 (unpacked)", 0x284e, 38812, DM_FMT_RD | DM_FMT_BROKEN,
+        "flnt", "Flinterlazer 1.0 (unpacked)", 0x284e, 38812, 0, DM_FMT_RD | DM_FMT_BROKEN,
         NULL,
         NULL, NULL,
         {
@@ -2730,21 +2729,21 @@
     },
 
     {
-        "eci", "ECI Graphic Editor 1.0 (unpacked)", 0x4000, 32770, DM_FMT_RDWR,
+        "eci", "ECI Graphic Editor 1.0 (unpacked)", 0x4000, 32770, 0, DM_FMT_RDWR,
         NULL,
         NULL, NULL,
         { }, &dmC64CommonFormats[7]
     },
 
     {
-        "ecip", "ECI Graphic Editor 1.0 (packed)", 0x4000, 0, DM_FMT_RDWR,
+        "ecip", "ECI Graphic Editor 1.0 (packed)", 0x4000, 0, 0, DM_FMT_RDWR,
         fmtProbeECIPacked,
         fmtDecodeECIPacked, fmtEncodeECIPacked,
         { }, &dmC64CommonFormats[7]
     },
 
     {
-        "fpt", "Face Painter (unpacked)", 0x4000, 10004, DM_FMT_RDWR,
+        "fpt", "Face Painter (unpacked)", 0x4000, 10004, 0, DM_FMT_RDWR,
         NULL,
         NULL, NULL,
         { // Almost same layout as Koala Painter, but FPT has D020
@@ -2767,7 +2766,7 @@
     },
 
     {
-        "xx1", "Unknown $2000 format (unpacked)", 0x2000, 10242, DM_FMT_RDWR,
+        "xx1", "Unknown $2000 format (unpacked)", 0x2000, 10242, 0, DM_FMT_RDWR,
         NULL,
         NULL, NULL,
         {
@@ -2789,7 +2788,7 @@
     },
 
     {
-        "xx2", "Unknown $2000 format (unpacked)", 0x2000, 0, DM_FMT_RDWR,
+        "xx2", "Unknown $2000 format (unpacked)", 0x2000, 0, 0, DM_FMT_RDWR,
         fmtProbeFormatXX2,
         fmtDecodeFormatXX2, NULL,
         {
@@ -2811,21 +2810,21 @@
     },
 
     {
-        "fp2", "FunPaint II (unpacked)", 0x3ff0, 33694, DM_FMT_RDWR,
+        "fp2", "FunPaint II (unpacked)", 0x3ff0, 33694, 0, DM_FMT_RDWR,
         fmtProbeFunPaint2,
         fmtDecodeFunPaint2, fmtEncodeFunPaint2Unpacked,
         { }, &dmC64CommonFormats[3]
     },
 
     {
-        "fp2p", "FunPaint II (packed)", 0x3ff0, 0, DM_FMT_RDWR,
+        "fp2p", "FunPaint II (packed)", 0x3ff0, 0, 0, DM_FMT_RDWR,
         fmtProbeFunPaint2,
         fmtDecodeFunPaint2, fmtEncodeFunPaint2Packed,
         { }, &dmC64CommonFormats[3]
     },
 
     {
-        "gun", "GunPaint 1.1 (unpacked)", 0x4000, 33603, DM_FMT_RDWR,
+        "gun", "GunPaint 1.1 (unpacked)", 0x4000, 33603, 0, DM_FMT_RDWR,
         fmtProbeGunPaint,
         NULL, NULL,
         {
@@ -2855,7 +2854,7 @@
     },
 
     {
-        "hcb", "Half Char Bitmap (unpacked)", 0x5000, 12148, DM_FMT_RDWR,
+        "hcb", "Half Char Bitmap (unpacked)", 0x5000, 12148, 0, DM_FMT_RDWR,
         NULL,
         NULL, NULL,
         {
@@ -2880,7 +2879,7 @@
     },
 
     {
-        "pen", "Pentel Paint (unpacked)", 0x4800, 19845, DM_FMT_RD | DM_FMT_BROKEN,
+        "pen", "Pentel Paint (unpacked)", 0x4800, 19845, 0, DM_FMT_RD | DM_FMT_BROKEN,
         NULL,
         NULL, NULL,
         {
@@ -2905,7 +2904,7 @@
     },
 
     {
-        "chfd", "Crest Hires FLI Designer (unpacked)", 0x4000, 16386, DM_FMT_RDWR,
+        "chfd", "Crest Hires FLI Designer (unpacked)", 0x4000, 16386, 0, DM_FMT_RDWR,
         NULL,
         NULL, NULL,
         {
@@ -2926,35 +2925,35 @@
     },
 
     {
-        "cshf", "Crest Super Hires FLI Editor v1.0 (unpacked)", 0x4000, 15874, DM_FMT_RDWR,
+        "cshf", "Crest Super Hires FLI Editor v1.0 (unpacked)", 0x4000, 15874, 0, DM_FMT_RDWR,
         fmtProbeCrestSHFLI,
         NULL, NULL,
         { }, &dmC64CommonFormats[11]
     },
 
     {
-        "cshfp", "Crest Super Hires FLI Editor v1.0 (packed)", 0xa000, 0, DM_FMT_RD,
+        "cshfp", "Crest Super Hires FLI Editor v1.0 (packed)", 0xa000, 0, 0, DM_FMT_RD,
         fmtProbeCrestSHFLI,
         fmtDecodeCrestSHFLIPacked, NULL,
         { }, &dmC64CommonFormats[11]
     },
 
     {
-        "cdhm", "Cosmos Designs Hires Manager (unpacked)", 0x4000, 16385, DM_FMT_RDWR,
+        "cdhm", "Cosmos Designs Hires Manager (unpacked)", 0x4000, 16385, 0, DM_FMT_RDWR,
         fmtProbeCosmosDesignsHiresManager,
         NULL, NULL,
         { }, &dmC64CommonFormats[8]
     },
 
     {
-        "cdhp", "Cosmos Designs Hires Manager (packed)", 0x4000, 0, DM_FMT_RD,
+        "cdhp", "Cosmos Designs Hires Manager (packed)", 0x4000, 0, 0, DM_FMT_RD,
         fmtProbeCosmosDesignsHiresManager,
         fmtDecodeCosmosDesignsHiresManagerPacked, NULL,
         { }, &dmC64CommonFormats[8]
     },
 
     {
-        "mrqp", "Marq's PETSCII editor (new format) (unpacked)", 0x0801, 0, DM_FMT_RDWR,
+        "mrqp", "Marq's PETSCII editor (new format) (unpacked)", 0x0801, 0, 0, DM_FMT_RDWR,
         fmtProbeMarqPETSCII,
         NULL, NULL,
         {
@@ -2980,7 +2979,7 @@
     },
 
     {
-        "mqpo", "Marq's PETSCII editor (old format) (unpacked)", 0x0801, 2499, DM_FMT_RD,
+        "mqpo", "Marq's PETSCII editor (old format) (unpacked)", 0x0801, 2499, 0, DM_FMT_RD,
         NULL,
         NULL, NULL,
         {
@@ -3005,7 +3004,7 @@
     },
 
     {
-        "pkhu", "petscii.krissz.hu editor (unpacked)", 0x0801, 0, DM_FMT_RD,
+        "pkhu", "petscii.krissz.hu editor (unpacked)", 0x0801, 0, 0, DM_FMT_RD,
         fmtProbePetsciiKrisszHu,
         NULL, NULL,
         {
@@ -3030,7 +3029,7 @@
     },
 
     {
-        "poca", "Petscii Coca editor (unpacked)", 0x0801, 0, DM_FMT_RDWR,
+        "poca", "Petscii Coca editor (unpacked)", 0x0801, 0, 0, DM_FMT_RDWR,
         fmtProbeCocaPETSCII,
         NULL, NULL,
         {
@@ -3056,7 +3055,7 @@
     },
 
     {
-        "acpe", "Abyss Connection PETSCII-Editor 4.61 (unpacked)", 0x3000, 2026, DM_FMT_RDWR,
+        "acpe", "Abyss Connection PETSCII-Editor 4.61 (unpacked)", 0x3000, 2026, 0, DM_FMT_RDWR,
         NULL,
         NULL, NULL,
         {
@@ -3082,28 +3081,28 @@
     },
 
     {
-        "suphi1", "SupeRes hires [clear] (packed)", -1, 0x23, DM_FMT_RD,
+        "suphi1", "SupeRes hires [clear] (packed)", -1, 0, 0x23, DM_FMT_RD,
         fmtProbeSupeRes,
         fmtDecodeSupeRes, NULL,
         { }, &dmC64CommonFormats[10]
     },
 
     {
-        "suphi2", "SupeRes hires [no-clear] (packed)", -1, 0x25, DM_FMT_RD,
+        "suphi2", "SupeRes hires [no-clear] (packed)", -1, 0, 0x25, DM_FMT_RD,
         fmtProbeSupeRes,
         fmtDecodeSupeRes, NULL,
         { }, &dmC64CommonFormats[10]
     },
 
     {
-        "supmc1", "SupeRes multicolor [clear] (packed)", -1, 0x24, DM_FMT_RD,
+        "supmc1", "SupeRes multicolor [clear] (packed)", -1, 0, 0x24, DM_FMT_RD,
         fmtProbeSupeRes,
         fmtDecodeSupeRes, NULL,
         { }, &dmC64CommonFormats[0]
     },
 
     {
-        "supmc2", "SupeRes multicolor [no-clear] (packed)", -1, 0x26, DM_FMT_RD,
+        "supmc2", "SupeRes multicolor [no-clear] (packed)", -1, 0, 0x26, DM_FMT_RD,
         fmtProbeSupeRes,
         fmtDecodeSupeRes, NULL,
         { }, &dmC64CommonFormats[0]
--- a/tools/lib64gfx.h	Fri May 15 02:55:31 2020 +0300
+++ b/tools/lib64gfx.h	Fri May 15 03:06:48 2020 +0300
@@ -299,6 +299,7 @@
 
     ssize_t addr;  // Loading address ( -2 if no loading address, -1 if loading address not known)
     size_t size;   // Size, including loading address. Only used in probing and encoding.
+    size_t extra;  // Extra data used for some formats
 
     int  flags;    // DM_FMT_* flags (read/write/broken/etc.), see libgfx.h