changeset 2583:b0fc26d9fc26

Add read support for unknown $0801 viewer format XX7.
author Matti Hamalainen <ccr@tnsp.org>
date Sun, 20 Mar 2022 23:30:23 +0200
parents 880aa08c6aed
children 9f26a93d7e70
files tools/lib64fmts.c
diffstat 1 files changed, 46 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/tools/lib64fmts.c	Sun Mar 20 23:19:16 2022 +0200
+++ b/tools/lib64fmts.c	Sun Mar 20 23:30:23 2022 +0200
@@ -1502,6 +1502,30 @@
 }
 
 
+static const Uint8 fmtFormatXX7_MagicID_1[] =
+{
+    0x01, 0x08, 0x0b, 0x08,  0xe0, 0x02, 0x9e, 0x32,
+    0x30, 0x36, 0x31, 0x00,  0x00, 0x00, 0xa2, 0x19,
+};
+
+static const Uint8 fmtFormatXX7_MagicID_2[] =
+{
+    0xa2, 0x60, 0xa9, 0x00,  0x20, 0x10, 0x0a, 0xa9,
+    0x26, 0xa2, 0x0a, 0x20,  0x10, 0x0a, 0xa2, 0x1f,
+};
+
+static int fmtProbeFormatXX7(const DMGrowBuf *buf, const DMC64ImageFormat *fmt)
+{
+    if (buf->len == fmt->size &&
+        DM_MEMCMP_SIZE(buf->data + 0x0000, fmtFormatXX7_MagicID_1) == 0 &&
+        DM_MEMCMP_SIZE(buf->data + 0x0100, fmtFormatXX7_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))
@@ -3099,6 +3123,28 @@
     },
 
     {
+        "xx7", "Unknown $0801 format (viewer) (unpacked)", 0x0801, 9590, 0, DM_FMT_RD,
+        fmtProbeFormatXX7,
+        NULL, NULL,
+        {
+            D64_FMT_HIRES,
+            D64_SCR_WIDTH   , D64_SCR_HEIGHT,
+            D64_SCR_CH_WIDTH, D64_SCR_CH_HEIGHT,
+            1, 1,
+            NULL, NULL,
+            NULL,
+            {
+                { DO_COPY       , DS_BITMAP_RAM  , 0x0a26 - 0x0801, 0,  0,   0, NULL, NULL, DF_NORMAL },
+                { DO_COPY       , DS_SCREEN_RAM  , 0x2968 - 0x0801, 0,  0,   0, NULL, NULL, DF_NORMAL },
+                { DO_SET_MEM_LO , DS_D020        , 0x2966 - 0x0801, 0,  0,   0, NULL, NULL, DF_NORMAL },
+                { DO_SET_MEM_LO , DS_BGCOL       , 0x2967 - 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,