changeset 2540:a60e046b7294

Add read-only support for another unknown unpacked c64 MC format (contains a viewer routine).
author Matti Hamalainen <ccr@tnsp.org>
date Mon, 26 Jul 2021 01:51:13 +0300
parents c6ee41fd98dd
children 671f41166527
files tools/lib64fmts.c
diffstat 1 files changed, 43 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/tools/lib64fmts.c	Sat Jan 02 11:42:17 2021 +0200
+++ b/tools/lib64fmts.c	Mon Jul 26 01:51:13 2021 +0300
@@ -12,6 +12,25 @@
 #define DM_MEMCMP_LEN(mptr, mcmp) memcmp((mptr), (mcmp), strlen(mcmp))
 
 
+static const Uint8 fmtUnknown3_MagicID_1[] =
+{
+    0x01, 0x08, 0x0B, 0x08,  0xF0, 0x02, 0x9E, 0x32,
+    0x30, 0x36, 0x31, 0x00,  0x00, 0x00, 0xA9, 0x14,
+    0x8D, 0x18, 0xD0, 0xA2,  0x00, 0xA9, 0x20, 0x9D,
+    0x00, 0x04, 0x9D, 0x00,  0x05, 0x9D, 0x00, 0x06,
+};
+
+static int fmtProbeUnknown3(const DMGrowBuf *buf, const DMC64ImageFormat *fmt)
+{
+    if (buf->len == fmt->size &&
+        DM_MEMCMP_SIZE(buf->data, fmtUnknown3_MagicID_1) == 0
+        )
+        return DM_PROBE_SCORE_MAX;
+
+    return DM_PROBE_SCORE_FALSE;
+}
+
+
 // Basic probe, but return MAX score for this format
 static int fmtProbeGigapaintHires(const DMGrowBuf *buf, const DMC64ImageFormat *fmt)
 {
@@ -3235,6 +3254,30 @@
         fmtDecodeSupeRes,fmtEncodeSupeRes,
         { }, &dmC64CommonFormats[0]
     },
+
+    {
+        "xx3", "Unknown 3 (unpacked)", 0x0801, 10500, 0, DM_FMT_RD,
+        fmtProbeUnknown3,
+        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  , 0x09f2 - 0x0801, 0,  0,   0, NULL, NULL, DF_NORMAL },
+                { DO_COPY       , DS_SCREEN_RAM  , 0x2932 - 0x0801, 0,  0,   0, NULL, NULL, DF_NORMAL },
+                { DO_SET_MEM_LO , DS_D020        , 0x09e6 - 0x0801, 0,  0,   0, NULL, NULL, DF_NORMAL },
+                { DO_SET_MEM_LO , DS_BGCOL       , 0x09e7 - 0x0801, 0,  0,   0, NULL, NULL, DF_NORMAL },
+                { DO_COPY       , DS_COLOR_RAM   , 0x2d1a - 0x0801, 0,  0,   0, NULL, NULL, DF_NORMAL },
+                { DO_LAST       , 0              , 0     , 0,  0,   0, NULL, NULL, DF_NORMAL },
+            },
+        },
+        NULL
+    },
+
 };
 
 const int ndmC64ImageFormats = sizeof(dmC64ImageFormats) / sizeof(dmC64ImageFormats[0]);