changeset 2135:cb4689d9ceed

Add initial (and incomplete) support for petscii.krissz.hu PETSCII editor PRG export files.
author Matti Hamalainen <ccr@tnsp.org>
date Wed, 29 May 2019 06:14:46 +0300
parents 5daed72fd211
children bc2ccc575430
files tools/lib64fmts.c
diffstat 1 files changed, 45 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/tools/lib64fmts.c	Tue May 28 10:50:50 2019 +0300
+++ b/tools/lib64fmts.c	Wed May 29 06:14:46 2019 +0300
@@ -112,6 +112,27 @@
 }
 
 
+static const Uint8 fmtPetsciiKrisszHu_ID1[] =
+{
+    0x01, 0x08, 0x0b, 0x08, 0x0A, 0x00, 0x9E, 0x32, 0x30, 0x36,
+    0x31, 0x00, 0x00, 0x00, 0xA9, 0x1B, 0x8D, 0x11, 0xD0, 0xA9,
+    0x80, 0x8D, 0x91, 0x02, 0xA9,
+};
+
+
+static int fmtProbePetsciiKrisszHu(const DMGrowBuf *buf, const DMC64ImageFormat *fmt)
+{
+    (void) fmt;
+
+    if (buf->len == 10193 &&
+        DM_MEMCMP_SIZE(buf->data, fmtPetsciiKrisszHu_ID1) == 0
+        )
+        return DM_PROBE_SCORE_MAX;
+
+    return DM_PROBE_SCORE_FALSE;
+}
+
+
 static int fmtProbeKoalaPainter(const DMGrowBuf *buf, const DMC64ImageFormat *fmt)
 {
     int score = DM_PROBE_SCORE_FALSE;
@@ -2095,6 +2116,30 @@
         },
         NULL
     },
+
+    {
+        "pkhu", "petscii.krissz.hu (unpacked)", 0x0801, 0, DM_FMT_RD,
+        fmtProbePetsciiKrisszHu,
+        NULL, NULL,
+        {
+            D64_FMT_HIRES | D64_FMT_CHAR,
+            D64_SCR_WIDTH   , D64_SCR_HEIGHT,
+            D64_SCR_CH_WIDTH, D64_SCR_CH_HEIGHT,
+            1, 1,
+            NULL, NULL,
+            NULL,
+            {
+                { DO_COPY       , DS_SCREEN_RAM  , 0x2001 - 2, 0, 0,   0, NULL, NULL },
+                { DO_COPY       , DS_COLOR_RAM   , 0x23e9 - 2, 0, 0,   0, NULL, NULL },
+
+                { DO_SET_MEM_LO , DS_D020        , 0x001e - 2, 0,  0,   0, NULL, NULL },
+                { DO_SET_MEM_LO , DS_BGCOL       , 0x0023 - 2, 0,  0,   0, NULL, NULL },
+
+                { DO_LAST       , 0              , 0     , 0,  0,   0, NULL, NULL },
+            }
+        },
+        NULL
+    },
 };
 
 const int ndmC64ImageFormats = sizeof(dmC64ImageFormats) / sizeof(dmC64ImageFormats[0]);