comparison tools/lib64fmts.c @ 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 a49f7e83edcb
comparison
equal deleted inserted replaced
1984:e7f2ddaf94a6 1985:5817e3335f53
40 memcmp(buf->data + 9, fmtMicroIllustratorMagicID_2, sizeof(fmtMicroIllustratorMagicID_2)) == 0 40 memcmp(buf->data + 9, fmtMicroIllustratorMagicID_2, sizeof(fmtMicroIllustratorMagicID_2)) == 0
41 ) 41 )
42 return DM_PROBE_SCORE_MAX; 42 return DM_PROBE_SCORE_MAX;
43 43
44 return DM_PROBE_SCORE_FALSE; 44 return DM_PROBE_SCORE_FALSE;
45 }
46
47
48 static BOOL fmtEncodeMicroIllustrator(const DMC64EncDecOp *op, DMGrowBuf *buf,
49 const DMC64Image *img, const DMC64ImageCommonFormat *fmt)
50 {
51 (void) op;
52 (void) img;
53 (void) fmt;
54
55 memcpy(buf->data + 2, fmtMicroIllustratorMagicID_1, sizeof(fmtMicroIllustratorMagicID_1));
56 memcpy(buf->data + 9, fmtMicroIllustratorMagicID_2, sizeof(fmtMicroIllustratorMagicID_2));
57
58 return TRUE;
45 } 59 }
46 60
47 61
48 static int fmtProbeKoalaPainterPacked(const DMGrowBuf *buf, const DMC64ImageFormat *fmt) 62 static int fmtProbeKoalaPainterPacked(const DMGrowBuf *buf, const DMC64ImageFormat *fmt)
49 { 63 {
1398 }, 1412 },
1399 NULL 1413 NULL
1400 }, 1414 },
1401 1415
1402 { 1416 {
1403 "mil", "Micro Illustrator (unpacked)", 0x18dc, 10022, DM_FMT_RDWR, 1417 "mil", "Micro Illustrator (unpacked)", 0x18dc, 10022, DM_FMT_RDWR | DM_FMT_BROKEN,
1404 fmtProbeMicroIllustrator, 1418 fmtProbeMicroIllustrator,
1405 NULL, NULL, 1419 NULL, NULL,
1406 { 1420 {
1407 D64_FMT_MC, 1421 D64_FMT_MC,
1408 C64_SCR_WIDTH / 2, C64_SCR_HEIGHT, 1422 C64_SCR_WIDTH / 2, C64_SCR_HEIGHT,
1411 NULL, 1425 NULL,
1412 { 1426 {
1413 { DO_COPY , DS_SCREEN_RAM , 20 + 0 , 0, 0, 0, NULL, NULL }, 1427 { DO_COPY , DS_SCREEN_RAM , 20 + 0 , 0, 0, 0, NULL, NULL },
1414 { DO_COPY , DS_COLOR_RAM , 20 + 1000 , 0, 0, 0, NULL, NULL }, 1428 { DO_COPY , DS_COLOR_RAM , 20 + 1000 , 0, 0, 0, NULL, NULL },
1415 { DO_COPY , DS_BITMAP_RAM , 20 + 2000 , 0, 0, 0, NULL, NULL }, 1429 { DO_COPY , DS_BITMAP_RAM , 20 + 2000 , 0, 0, 0, NULL, NULL },
1416 // XXX TODO: Unknown where the background color is set, so default to 0x01 1430 // XXX TODO: Unknown where the background color is set, so default to 0x00
1417 //{ DO_SET_MEM_LO , DS_BGCOL , 20 + 0x3e8 , 0, 0, 0, NULL, NULL }, 1431 { DO_SET_OP , DS_BGCOL , 0x00 , 0, 0, 0, NULL, NULL },
1418 { DO_SET_OP , DS_BGCOL , 0x01 , 0, 0, 0, NULL, NULL }, 1432 { DO_FUNC , 0 , 0 , 0, 0, 0, NULL, fmtEncodeMicroIllustrator },
1419 { DO_LAST , 0 , 0 , 0, 0, 0, NULL, NULL }, 1433 { DO_LAST , 0 , 0 , 0, 0, 0, NULL, NULL },
1420 } 1434 }
1421 }, 1435 },
1422 NULL 1436 NULL
1423 }, 1437 },