# HG changeset patch # User Matti Hamalainen # Date 1627253473 -10800 # Node ID a60e046b72942029a736d39361cdec8fd9c05f5c # Parent c6ee41fd98dd1abb0fdf6f0b111d84822e1eb6ec Add read-only support for another unknown unpacked c64 MC format (contains a viewer routine). diff -r c6ee41fd98dd -r a60e046b7294 tools/lib64fmts.c --- a/tools/lib64fmts.c Sat Jan 02 11:42:17 2021 +0200 +++ b/tools/lib64fmts.c Mon Jul 26 01:51:13 2021 +0300 @@ -12,6 +12,25 @@ #define DM_MEMCMP_LEN(mptr, mcmp) memcmp((mptr), (mcmp), strlen(mcmp)) +static const Uint8 fmtUnknown3_MagicID_1[] = +{ + 0x01, 0x08, 0x0B, 0x08, 0xF0, 0x02, 0x9E, 0x32, + 0x30, 0x36, 0x31, 0x00, 0x00, 0x00, 0xA9, 0x14, + 0x8D, 0x18, 0xD0, 0xA2, 0x00, 0xA9, 0x20, 0x9D, + 0x00, 0x04, 0x9D, 0x00, 0x05, 0x9D, 0x00, 0x06, +}; + +static int fmtProbeUnknown3(const DMGrowBuf *buf, const DMC64ImageFormat *fmt) +{ + if (buf->len == fmt->size && + DM_MEMCMP_SIZE(buf->data, fmtUnknown3_MagicID_1) == 0 + ) + return DM_PROBE_SCORE_MAX; + + return DM_PROBE_SCORE_FALSE; +} + + // Basic probe, but return MAX score for this format static int fmtProbeGigapaintHires(const DMGrowBuf *buf, const DMC64ImageFormat *fmt) { @@ -3235,6 +3254,30 @@ fmtDecodeSupeRes,fmtEncodeSupeRes, { }, &dmC64CommonFormats[0] }, + + { + "xx3", "Unknown 3 (unpacked)", 0x0801, 10500, 0, DM_FMT_RD, + fmtProbeUnknown3, + NULL, NULL, + { + D64_FMT_MC, + D64_SCR_WIDTH / 2, D64_SCR_HEIGHT, + D64_SCR_CH_WIDTH , D64_SCR_CH_HEIGHT, + 2, 1, + NULL, NULL, + NULL, + { + { DO_COPY , DS_BITMAP_RAM , 0x09f2 - 0x0801, 0, 0, 0, NULL, NULL, DF_NORMAL }, + { DO_COPY , DS_SCREEN_RAM , 0x2932 - 0x0801, 0, 0, 0, NULL, NULL, DF_NORMAL }, + { DO_SET_MEM_LO , DS_D020 , 0x09e6 - 0x0801, 0, 0, 0, NULL, NULL, DF_NORMAL }, + { DO_SET_MEM_LO , DS_BGCOL , 0x09e7 - 0x0801, 0, 0, 0, NULL, NULL, DF_NORMAL }, + { DO_COPY , DS_COLOR_RAM , 0x2d1a - 0x0801, 0, 0, 0, NULL, NULL, DF_NORMAL }, + { DO_LAST , 0 , 0 , 0, 0, 0, NULL, NULL, DF_NORMAL }, + }, + }, + NULL + }, + }; const int ndmC64ImageFormats = sizeof(dmC64ImageFormats) / sizeof(dmC64ImageFormats[0]);