# HG changeset patch # User Matti Hamalainen # Date 1530417802 -10800 # Node ID 5817e3335f53a484095c1d5b0825136987062ade # Parent e7f2ddaf94a6b7293f97bb976eb3730cbaa002bb Allow saving of Micro Illustrator format, but mark it "broken" again due to the unknown state of background color. diff -r e7f2ddaf94a6 -r 5817e3335f53 tools/lib64fmts.c --- 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 }, } },