changeset 2581:60ffbddedd07

Add read support for unknown $0801 viewer format XX6.
author Matti Hamalainen <ccr@tnsp.org>
date Sun, 20 Mar 2022 14:53:51 +0200
parents 317d2f4b322c
children 880aa08c6aed
files tools/lib64fmts.c
diffstat 1 files changed, 47 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/tools/lib64fmts.c	Sun Mar 20 14:50:13 2022 +0200
+++ b/tools/lib64fmts.c	Sun Mar 20 14:53:51 2022 +0200
@@ -1478,6 +1478,30 @@
 }
 
 
+static const Uint8 fmtFormatXX6_MagicID_1[] =
+{
+    0x01, 0x08, 0x0b, 0x08,  0xd5, 0x07, 0x9e, 0x34,
+    0x30, 0x39, 0x36, 0x00,  0x00, 0x00, 0x00, 0x00,
+};
+
+static const Uint8 fmtFormatXX6_MagicID_2[] =
+{
+    0x00, 0xAD, 0x10, 0x47,  0x8D, 0x21, 0xD0, 0xA9,
+    0x00, 0x8D, 0x20, 0xD0,  0xA2, 0x00, 0xBD, 0x40,
+};
+
+static int fmtProbeFormatXX6(const DMGrowBuf *buf, const DMC64ImageFormat *fmt)
+{
+    if (buf->len == fmt->size &&
+        DM_MEMCMP_SIZE(buf->data + 0x0000, fmtFormatXX6_MagicID_1) == 0 &&
+        DM_MEMCMP_SIZE(buf->data + 0x0800, fmtFormatXX6_MagicID_2) == 0
+        )
+        return DM_PROBE_SCORE_MAX;
+
+    return DM_PROBE_SCORE_FALSE;
+}
+
+
 static int fmtProbeCosmosDesignsHiresManager(const DMGrowBuf *buf, const DMC64ImageFormat *fmt)
 {
     if (buf->len > 32 && dmCompareAddr16(buf, 0, fmt->addr))
@@ -3052,6 +3076,29 @@
     },
 
     {
+        "xx6", "Unknown $0801 format (viewer) (unpacked)", 0x0801, 16148, 0, DM_FMT_RD,
+        fmtProbeFormatXX6,
+        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 - 0x0801, 0,  0,   0, NULL, NULL, DF_NORMAL },
+                { DO_COPY       , DS_SCREEN_RAM  , 0x3f40 - 0x0801, 0,  0,   0, NULL, NULL, DF_NORMAL },
+                { DO_COPY       , DS_COLOR_RAM   , 0x4328 - 0x0801, 0,  0,   0, NULL, NULL, DF_NORMAL },
+                { DO_SET_OP     , DS_D020        , 0x00           , 0,  0,   0, NULL, NULL, DF_NORMAL },
+                { DO_SET_MEM_LO , DS_BGCOL       , 0x4710 - 0x0801, 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,
         fmtDecodeFunPaint2, fmtEncodeFunPaint2Unpacked,