comparison tools/lib64fmts.c @ 2540:a60e046b7294

Add read-only support for another unknown unpacked c64 MC format (contains a viewer routine).
author Matti Hamalainen <ccr@tnsp.org>
date Mon, 26 Jul 2021 01:51:13 +0300
parents c6ee41fd98dd
children 671f41166527
comparison
equal deleted inserted replaced
2539:c6ee41fd98dd 2540:a60e046b7294
8 */ 8 */
9 #include "lib64gfx.h" 9 #include "lib64gfx.h"
10 10
11 #define DM_MEMCMP_SIZE(mptr, mcmp) memcmp((mptr), (mcmp), sizeof(mcmp)) 11 #define DM_MEMCMP_SIZE(mptr, mcmp) memcmp((mptr), (mcmp), sizeof(mcmp))
12 #define DM_MEMCMP_LEN(mptr, mcmp) memcmp((mptr), (mcmp), strlen(mcmp)) 12 #define DM_MEMCMP_LEN(mptr, mcmp) memcmp((mptr), (mcmp), strlen(mcmp))
13
14
15 static const Uint8 fmtUnknown3_MagicID_1[] =
16 {
17 0x01, 0x08, 0x0B, 0x08, 0xF0, 0x02, 0x9E, 0x32,
18 0x30, 0x36, 0x31, 0x00, 0x00, 0x00, 0xA9, 0x14,
19 0x8D, 0x18, 0xD0, 0xA2, 0x00, 0xA9, 0x20, 0x9D,
20 0x00, 0x04, 0x9D, 0x00, 0x05, 0x9D, 0x00, 0x06,
21 };
22
23 static int fmtProbeUnknown3(const DMGrowBuf *buf, const DMC64ImageFormat *fmt)
24 {
25 if (buf->len == fmt->size &&
26 DM_MEMCMP_SIZE(buf->data, fmtUnknown3_MagicID_1) == 0
27 )
28 return DM_PROBE_SCORE_MAX;
29
30 return DM_PROBE_SCORE_FALSE;
31 }
13 32
14 33
15 // Basic probe, but return MAX score for this format 34 // Basic probe, but return MAX score for this format
16 static int fmtProbeGigapaintHires(const DMGrowBuf *buf, const DMC64ImageFormat *fmt) 35 static int fmtProbeGigapaintHires(const DMGrowBuf *buf, const DMC64ImageFormat *fmt)
17 { 36 {
3233 "supmc2", "SupeRes multicolor [no-clear] (packed)", -1, 0, 0x26, DM_FMT_RDWR, 3252 "supmc2", "SupeRes multicolor [no-clear] (packed)", -1, 0, 0x26, DM_FMT_RDWR,
3234 fmtProbeSupeRes, 3253 fmtProbeSupeRes,
3235 fmtDecodeSupeRes,fmtEncodeSupeRes, 3254 fmtDecodeSupeRes,fmtEncodeSupeRes,
3236 { }, &dmC64CommonFormats[0] 3255 { }, &dmC64CommonFormats[0]
3237 }, 3256 },
3257
3258 {
3259 "xx3", "Unknown 3 (unpacked)", 0x0801, 10500, 0, DM_FMT_RD,
3260 fmtProbeUnknown3,
3261 NULL, NULL,
3262 {
3263 D64_FMT_MC,
3264 D64_SCR_WIDTH / 2, D64_SCR_HEIGHT,
3265 D64_SCR_CH_WIDTH , D64_SCR_CH_HEIGHT,
3266 2, 1,
3267 NULL, NULL,
3268 NULL,
3269 {
3270 { DO_COPY , DS_BITMAP_RAM , 0x09f2 - 0x0801, 0, 0, 0, NULL, NULL, DF_NORMAL },
3271 { DO_COPY , DS_SCREEN_RAM , 0x2932 - 0x0801, 0, 0, 0, NULL, NULL, DF_NORMAL },
3272 { DO_SET_MEM_LO , DS_D020 , 0x09e6 - 0x0801, 0, 0, 0, NULL, NULL, DF_NORMAL },
3273 { DO_SET_MEM_LO , DS_BGCOL , 0x09e7 - 0x0801, 0, 0, 0, NULL, NULL, DF_NORMAL },
3274 { DO_COPY , DS_COLOR_RAM , 0x2d1a - 0x0801, 0, 0, 0, NULL, NULL, DF_NORMAL },
3275 { DO_LAST , 0 , 0 , 0, 0, 0, NULL, NULL, DF_NORMAL },
3276 },
3277 },
3278 NULL
3279 },
3280
3238 }; 3281 };
3239 3282
3240 const int ndmC64ImageFormats = sizeof(dmC64ImageFormats) / sizeof(dmC64ImageFormats[0]); 3283 const int ndmC64ImageFormats = sizeof(dmC64ImageFormats) / sizeof(dmC64ImageFormats[0]);
3241 3284