changeset 1985:5817e3335f53

Allow saving of Micro Illustrator format, but mark it "broken" again due to the unknown state of background color.
author Matti Hamalainen <ccr@tnsp.org>
date Sun, 01 Jul 2018 07:03:22 +0300
parents e7f2ddaf94a6
children 5b8e707fb11b
files tools/lib64fmts.c
diffstat 1 files changed, 18 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/tools/lib64fmts.c	Sun Jul 01 07:00:38 2018 +0300
+++ b/tools/lib64fmts.c	Sun Jul 01 07:03:22 2018 +0300
@@ -45,6 +45,20 @@
 }
 
 
+static BOOL fmtEncodeMicroIllustrator(const DMC64EncDecOp *op, DMGrowBuf *buf,
+    const DMC64Image *img, const DMC64ImageCommonFormat *fmt)
+{
+    (void) op;
+    (void) img;
+    (void) fmt;
+
+    memcpy(buf->data + 2, fmtMicroIllustratorMagicID_1, sizeof(fmtMicroIllustratorMagicID_1));
+    memcpy(buf->data + 9, fmtMicroIllustratorMagicID_2, sizeof(fmtMicroIllustratorMagicID_2));
+
+    return TRUE;
+}
+
+
 static int fmtProbeKoalaPainterPacked(const DMGrowBuf *buf, const DMC64ImageFormat *fmt)
 {
     // Attempt to prevent misprobes of unpacked Koala and Run Paint
@@ -1400,7 +1414,7 @@
     },
 
     {
-        "mil", "Micro Illustrator (unpacked)", 0x18dc, 10022, DM_FMT_RDWR,
+        "mil", "Micro Illustrator (unpacked)", 0x18dc, 10022, DM_FMT_RDWR | DM_FMT_BROKEN,
         fmtProbeMicroIllustrator,
         NULL, NULL,
         {
@@ -1413,9 +1427,9 @@
                 { DO_COPY       , DS_SCREEN_RAM  , 20 + 0     , 0,  0,   0, NULL, NULL },
                 { DO_COPY       , DS_COLOR_RAM   , 20 + 1000  , 0,  0,   0, NULL, NULL },
                 { DO_COPY       , DS_BITMAP_RAM  , 20 + 2000  , 0,  0,   0, NULL, NULL },
-                // XXX TODO: Unknown where the background color is set, so default to 0x01
-                //{ DO_SET_MEM_LO , DS_BGCOL       , 20 + 0x3e8 , 0,  0,   0, NULL, NULL },
-                { DO_SET_OP     , DS_BGCOL       , 0x01       , 0,  0,   0, NULL, NULL },
+                // XXX TODO: Unknown where the background color is set, so default to 0x00
+                { DO_SET_OP     , DS_BGCOL       , 0x00       , 0,  0,   0, NULL, NULL },
+                { DO_FUNC       , 0              , 0          , 0,  0,   0, NULL, fmtEncodeMicroIllustrator },
                 { DO_LAST       , 0              , 0          , 0,  0,   0, NULL, NULL },
             }
         },