Mercurial > hg > dmlib
comparison tools/lib64fmts.c @ 2583:b0fc26d9fc26
Add read support for unknown $0801 viewer format XX7.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Sun, 20 Mar 2022 23:30:23 +0200 |
parents | 880aa08c6aed |
children | 9807ae37ad69 |
comparison
equal
deleted
inserted
replaced
2582:880aa08c6aed | 2583:b0fc26d9fc26 |
---|---|
1493 static int fmtProbeFormatXX6(const DMGrowBuf *buf, const DMC64ImageFormat *fmt) | 1493 static int fmtProbeFormatXX6(const DMGrowBuf *buf, const DMC64ImageFormat *fmt) |
1494 { | 1494 { |
1495 if (buf->len == fmt->size && | 1495 if (buf->len == fmt->size && |
1496 DM_MEMCMP_SIZE(buf->data + 0x0000, fmtFormatXX6_MagicID_1) == 0 && | 1496 DM_MEMCMP_SIZE(buf->data + 0x0000, fmtFormatXX6_MagicID_1) == 0 && |
1497 DM_MEMCMP_SIZE(buf->data + 0x0800, fmtFormatXX6_MagicID_2) == 0 | 1497 DM_MEMCMP_SIZE(buf->data + 0x0800, fmtFormatXX6_MagicID_2) == 0 |
1498 ) | |
1499 return DM_PROBE_SCORE_MAX; | |
1500 | |
1501 return DM_PROBE_SCORE_FALSE; | |
1502 } | |
1503 | |
1504 | |
1505 static const Uint8 fmtFormatXX7_MagicID_1[] = | |
1506 { | |
1507 0x01, 0x08, 0x0b, 0x08, 0xe0, 0x02, 0x9e, 0x32, | |
1508 0x30, 0x36, 0x31, 0x00, 0x00, 0x00, 0xa2, 0x19, | |
1509 }; | |
1510 | |
1511 static const Uint8 fmtFormatXX7_MagicID_2[] = | |
1512 { | |
1513 0xa2, 0x60, 0xa9, 0x00, 0x20, 0x10, 0x0a, 0xa9, | |
1514 0x26, 0xa2, 0x0a, 0x20, 0x10, 0x0a, 0xa2, 0x1f, | |
1515 }; | |
1516 | |
1517 static int fmtProbeFormatXX7(const DMGrowBuf *buf, const DMC64ImageFormat *fmt) | |
1518 { | |
1519 if (buf->len == fmt->size && | |
1520 DM_MEMCMP_SIZE(buf->data + 0x0000, fmtFormatXX7_MagicID_1) == 0 && | |
1521 DM_MEMCMP_SIZE(buf->data + 0x0100, fmtFormatXX7_MagicID_2) == 0 | |
1498 ) | 1522 ) |
1499 return DM_PROBE_SCORE_MAX; | 1523 return DM_PROBE_SCORE_MAX; |
1500 | 1524 |
1501 return DM_PROBE_SCORE_FALSE; | 1525 return DM_PROBE_SCORE_FALSE; |
1502 } | 1526 } |
3092 { DO_COPY , DS_COLOR_RAM , 0x4328 - 0x0801, 0, 0, 0, NULL, NULL, DF_NORMAL }, | 3116 { DO_COPY , DS_COLOR_RAM , 0x4328 - 0x0801, 0, 0, 0, NULL, NULL, DF_NORMAL }, |
3093 { DO_SET_OP , DS_D020 , 0x00 , 0, 0, 0, NULL, NULL, DF_NORMAL }, | 3117 { DO_SET_OP , DS_D020 , 0x00 , 0, 0, 0, NULL, NULL, DF_NORMAL }, |
3094 { DO_SET_MEM_LO , DS_BGCOL , 0x4710 - 0x0801, 0, 0, 0, NULL, NULL, DF_NORMAL }, | 3118 { DO_SET_MEM_LO , DS_BGCOL , 0x4710 - 0x0801, 0, 0, 0, NULL, NULL, DF_NORMAL }, |
3095 { DO_LAST , 0 , 0 , 0, 0, 0, NULL, NULL, DF_NORMAL }, | 3119 { DO_LAST , 0 , 0 , 0, 0, 0, NULL, NULL, DF_NORMAL }, |
3096 }, | 3120 }, |
3121 }, | |
3122 NULL | |
3123 }, | |
3124 | |
3125 { | |
3126 "xx7", "Unknown $0801 format (viewer) (unpacked)", 0x0801, 9590, 0, DM_FMT_RD, | |
3127 fmtProbeFormatXX7, | |
3128 NULL, NULL, | |
3129 { | |
3130 D64_FMT_HIRES, | |
3131 D64_SCR_WIDTH , D64_SCR_HEIGHT, | |
3132 D64_SCR_CH_WIDTH, D64_SCR_CH_HEIGHT, | |
3133 1, 1, | |
3134 NULL, NULL, | |
3135 NULL, | |
3136 { | |
3137 { DO_COPY , DS_BITMAP_RAM , 0x0a26 - 0x0801, 0, 0, 0, NULL, NULL, DF_NORMAL }, | |
3138 { DO_COPY , DS_SCREEN_RAM , 0x2968 - 0x0801, 0, 0, 0, NULL, NULL, DF_NORMAL }, | |
3139 { DO_SET_MEM_LO , DS_D020 , 0x2966 - 0x0801, 0, 0, 0, NULL, NULL, DF_NORMAL }, | |
3140 { DO_SET_MEM_LO , DS_BGCOL , 0x2967 - 0x0801, 0, 0, 0, NULL, NULL, DF_NORMAL }, | |
3141 { DO_LAST , 0 , 0 , 0, 0, 0, NULL, NULL, DF_NORMAL }, | |
3142 } | |
3097 }, | 3143 }, |
3098 NULL | 3144 NULL |
3099 }, | 3145 }, |
3100 | 3146 |
3101 { | 3147 { |