Mercurial > hg > dmlib
comparison tools/lib64fmts.c @ 1983:214c7bd8692f
Rename "MIL" to "Micro Illustrator" and improve probing of that format, at
least based on the few samples I have.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Sun, 01 Jul 2018 06:18:55 +0300 |
parents | 6af47b1009ba |
children | e7f2ddaf94a6 |
comparison
equal
deleted
inserted
replaced
1982:6af47b1009ba | 1983:214c7bd8692f |
---|---|
11 | 11 |
12 static int fmtProbeGigapaintHires(const DMGrowBuf *buf, const DMC64ImageFormat *fmt) | 12 static int fmtProbeGigapaintHires(const DMGrowBuf *buf, const DMC64ImageFormat *fmt) |
13 { | 13 { |
14 if (buf->len == fmt->size && | 14 if (buf->len == fmt->size && |
15 dmCompareAddr16(buf, 0, fmt->addr)) | 15 dmCompareAddr16(buf, 0, fmt->addr)) |
16 return DM_PROBE_SCORE_MAX; | |
17 | |
18 return DM_PROBE_SCORE_FALSE; | |
19 } | |
20 | |
21 | |
22 // XXX TODO: Research what these values actually mean. It would seem probable | |
23 // that these may not be static values at all, as there are 8 more that change | |
24 // before actual image data, but do not seem to be used in the image itself. | |
25 static const Uint8 fmtMicroIllustratorMagicID_1[] = | |
26 { | |
27 0xff, 0x80, 0x69, 0x67, 0x14, 0x00, | |
28 }; | |
29 | |
30 static const Uint8 fmtMicroIllustratorMagicID_2[] = | |
31 { | |
32 0xe8, 0x03, 0xe8, 0x03, 0x40, 0x1f, | |
33 }; | |
34 | |
35 static int fmtProbeMicroIllustrator(const DMGrowBuf *buf, const DMC64ImageFormat *fmt) | |
36 { | |
37 if (buf->len == fmt->size && | |
38 memcmp(buf->data + 2, fmtMicroIllustratorMagicID_1, sizeof(fmtMicroIllustratorMagicID_1)) == 0 | |
39 && | |
40 memcmp(buf->data + 9, fmtMicroIllustratorMagicID_2, sizeof(fmtMicroIllustratorMagicID_2)) == 0 | |
41 ) | |
16 return DM_PROBE_SCORE_MAX; | 42 return DM_PROBE_SCORE_MAX; |
17 | 43 |
18 return DM_PROBE_SCORE_FALSE; | 44 return DM_PROBE_SCORE_FALSE; |
19 } | 45 } |
20 | 46 |
1372 }, | 1398 }, |
1373 NULL | 1399 NULL |
1374 }, | 1400 }, |
1375 | 1401 |
1376 { | 1402 { |
1377 "mil", "MIL (unpacked)", 0x18dc, 10022, DM_FMT_RDWR | DM_FMT_BROKEN, | 1403 "mil", "Micro Illustrator (unpacked)", 0x18dc, 10022, DM_FMT_RDWR, |
1378 NULL, | 1404 fmtProbeMicroIllustrator, |
1379 NULL, NULL, | 1405 NULL, NULL, |
1380 { | 1406 { |
1381 D64_FMT_MC, | 1407 D64_FMT_MC, |
1382 C64_SCR_WIDTH / 2, C64_SCR_HEIGHT, | 1408 C64_SCR_WIDTH / 2, C64_SCR_HEIGHT, |
1383 C64_SCR_CH_WIDTH , C64_SCR_CH_HEIGHT, | 1409 C64_SCR_CH_WIDTH , C64_SCR_CH_HEIGHT, |
1384 NULL, NULL, | 1410 NULL, NULL, |
1385 NULL, | 1411 NULL, |
1386 { | 1412 { |
1387 { DO_COPY , DS_SCREEN_RAM , 20 + 0 , 0, 0, 0, NULL, NULL }, | 1413 { DO_COPY , DS_SCREEN_RAM , 20 + 0 , 0, 0, 0, NULL, NULL }, |
1388 { DO_COPY , DS_COLOR_RAM , 20 + 1000, 0, 0, 0, NULL, NULL }, | 1414 { DO_COPY , DS_COLOR_RAM , 20 + 1000 , 0, 0, 0, NULL, NULL }, |
1389 { DO_COPY , DS_BITMAP_RAM , 20 + 2000, 0, 0, 0, NULL, NULL }, | 1415 { DO_COPY , DS_BITMAP_RAM , 20 + 2000 , 0, 0, 0, NULL, NULL }, |
1390 // XXX TODO: Unknown where the background color is set, so default to 0x01 | 1416 // XXX TODO: Unknown where the background color is set, so default to 0x01 |
1391 //{ DO_SET_MEM , DS_BGCOL , 0x23ff, 0, 0, 0, NULL, NULL }, | 1417 //{ DO_SET_MEM_LO , DS_BGCOL , 20 + 0x3e8 , 0, 0, 0, NULL, NULL }, |
1392 { DO_SET_OP , DS_BGCOL , 0x01 , 0, 0, 0, NULL, NULL }, | 1418 { DO_SET_OP , DS_BGCOL , 0x01 , 0, 0, 0, NULL, NULL }, |
1393 { DO_LAST , 0 , 0 , 0, 0, 0, NULL, NULL }, | 1419 { DO_LAST , 0 , 0 , 0, 0, 0, NULL, NULL }, |
1394 } | 1420 } |
1395 }, | 1421 }, |
1396 NULL | 1422 NULL |
1397 }, | 1423 }, |
1398 | 1424 |