# HG changeset patch # User Matti Hamalainen # Date 1701284089 -7200 # Node ID 262395b86b7cacbb00e19bf291e9d190ec84cace # Parent 4fc62ffe19691ecd7e9477e2070b4ac8c755d92e Add support for unknown plain multicolor viewer format XX9. diff -r 4fc62ffe1969 -r 262395b86b7c tools/lib64fmts.c --- a/tools/lib64fmts.c Wed Nov 29 20:54:04 2023 +0200 +++ b/tools/lib64fmts.c Wed Nov 29 20:54:49 2023 +0200 @@ -179,6 +179,27 @@ } +static const Uint8 fmtFormatXX9_MagicID_1[] = +{ + 0x01, 0x08, 0x0b, 0x08, 0xe0, 0x02, 0x9e, 0x32, + 0x30, 0x36, 0x31, 0x00, 0x00, 0x00, 0xa2, 0x19, + 0xb5, 0x02, 0x9d, 0x6f, 0x31, 0xca, 0x10, 0xf8, + 0xa9, 0x0e, 0x20, 0xd2, 0xff, 0xa5, 0x01, 0x48, + 0x29, 0xf8, 0x09, 0x06, 0x85, 0x01, 0x20, 0x65, + 0x08, 0x68, 0x8d, 0x8e, 0x31, 0xba, 0x8e, 0x8d, +}; + +static int fmtProbeFormatXX9(const DMGrowBuf *buf, const DMC64ImageFormat *fmt) +{ + if (buf->len == fmt->size && + DM_MEMCMP_SIZE(buf->data, fmtFormatXX9_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) { @@ -3682,6 +3703,30 @@ NULL }, + { + "xx9", "Unknown $0801 format (viewer) (unpacked)", 0x0801, 10608, 0, DM_FMT_RD, + fmtProbeFormatXX9, + 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 , 0x0a38 - 0x0801, 0, 0, 0, NULL, NULL, DF_NORMAL }, + { DO_COPY , DS_SCREEN_RAM , 0x297a - 0x0801, 0, 0, 0, NULL, NULL, DF_NORMAL }, + { DO_COPY , DS_COLOR_RAM , 0x2d62 - 0x0801, 0, 0, 0, NULL, NULL, DF_NORMAL }, + { DO_SET_MEM_LO, DS_BGCOL , 0x2979 - 0x0801, 0, 0, 0, NULL, NULL, DF_NORMAL }, + { DO_SET_MEM_LO, DS_D020 , 0x2978 - 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]);