changeset 2544:0b1e73d49503

Add support for another unknown MC bitmap format.
author Matti Hamalainen <ccr@tnsp.org>
date Mon, 18 Oct 2021 06:39:33 +0300
parents dea1001eb4e8
children e028058648ea
files tools/lib64fmts.c
diffstat 1 files changed, 41 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/tools/lib64fmts.c	Mon Oct 18 02:35:53 2021 +0300
+++ b/tools/lib64fmts.c	Mon Oct 18 06:39:33 2021 +0300
@@ -1393,6 +1393,23 @@
 }
 
 
+static const Uint8 fmtFormatXX4_MagicID_1[] =
+{
+    0x00, 0x1f, 0x78, 0xa9, 0x3b, 0x8d, 0x11, 0xd0,
+    0xa9, 0x18, 0x8d, 0x16, 0xd0, 0xa9, 0x18, 0x8d,
+};
+
+static int fmtProbeFormatXX4(const DMGrowBuf *buf, const DMC64ImageFormat *fmt)
+{
+    if (buf->len >= fmt->size &&
+        DM_MEMCMP_SIZE(buf->data, fmtFormatXX4_MagicID_1) == 0
+        )
+        return DM_PROBE_SCORE_MAX;
+
+    return DM_PROBE_SCORE_FALSE;
+}
+
+
 #define XX2_MIN_SIZE   4000
 #define XX2_WIDTH_CH   40
 #define XX2_HEIGHT_CH  10
@@ -2978,6 +2995,30 @@
         },
         NULL
     },
+
+    {
+        "xx4", "Unknown $1f00 format (unpacked)", 0x1f00, 10260, 0, DM_FMT_RD,
+        fmtProbeFormatXX4,
+        NULL, NULL,
+        {
+            D64_FMT_MC,
+            D64_SCR_WIDTH / 2, D64_SCR_HEIGHT,
+            D64_SCR_CH_WIDTH , D64_SCR_CH_HEIGHT,
+            2, 1,
+            NULL, NULL,
+            NULL,
+            {
+                { DO_COPY      , DS_BITMAP_RAM  , 0x2000 - 0x1f00, 0,  0,   0, NULL, NULL, DF_NORMAL },
+                { DO_COPY      , DS_SCREEN_RAM  , 0x3f40 - 0x1f00, 0,  0,   0, NULL, NULL, DF_NORMAL },
+                { DO_COPY      , DS_COLOR_RAM   , 0x4328 - 0x1f00, 0,  0,   0, NULL, NULL, DF_NORMAL },
+                { DO_SET_OP    , DS_BGCOL       , 0x4710 - 0x1f00, 0,  0,   0, NULL, NULL, DF_NORMAL },
+                { DO_SET_OP    , DS_D020        , 0x4711 - 0x1f00, 0,  0,   0, NULL, NULL, DF_NORMAL },
+                { DO_LAST      , 0              , 0     , 0,  0,   0, NULL, NULL, DF_NORMAL },
+            }
+         },
+        NULL
+    },
+
     {
         "fp2", "FunPaint II (unpacked)", 0x3ff0, 33694, 0, DM_FMT_RDWR,
         fmtProbeFunPaint2,