# HG changeset patch # User Matti Hamalainen # Date 1647780831 -7200 # Node ID 60ffbddedd072b57f3e356110fd549bb7f1a3cd1 # Parent 317d2f4b322c79e977a2898701eb538a41480632 Add read support for unknown $0801 viewer format XX6. diff -r 317d2f4b322c -r 60ffbddedd07 tools/lib64fmts.c --- a/tools/lib64fmts.c Sun Mar 20 14:50:13 2022 +0200 +++ b/tools/lib64fmts.c Sun Mar 20 14:53:51 2022 +0200 @@ -1478,6 +1478,30 @@ } +static const Uint8 fmtFormatXX6_MagicID_1[] = +{ + 0x01, 0x08, 0x0b, 0x08, 0xd5, 0x07, 0x9e, 0x34, + 0x30, 0x39, 0x36, 0x00, 0x00, 0x00, 0x00, 0x00, +}; + +static const Uint8 fmtFormatXX6_MagicID_2[] = +{ + 0x00, 0xAD, 0x10, 0x47, 0x8D, 0x21, 0xD0, 0xA9, + 0x00, 0x8D, 0x20, 0xD0, 0xA2, 0x00, 0xBD, 0x40, +}; + +static int fmtProbeFormatXX6(const DMGrowBuf *buf, const DMC64ImageFormat *fmt) +{ + if (buf->len == fmt->size && + DM_MEMCMP_SIZE(buf->data + 0x0000, fmtFormatXX6_MagicID_1) == 0 && + DM_MEMCMP_SIZE(buf->data + 0x0800, fmtFormatXX6_MagicID_2) == 0 + ) + return DM_PROBE_SCORE_MAX; + + return DM_PROBE_SCORE_FALSE; +} + + static int fmtProbeCosmosDesignsHiresManager(const DMGrowBuf *buf, const DMC64ImageFormat *fmt) { if (buf->len > 32 && dmCompareAddr16(buf, 0, fmt->addr)) @@ -3052,6 +3076,29 @@ }, { + "xx6", "Unknown $0801 format (viewer) (unpacked)", 0x0801, 16148, 0, DM_FMT_RD, + fmtProbeFormatXX6, + 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 , 0x2000 - 0x0801, 0, 0, 0, NULL, NULL, DF_NORMAL }, + { DO_COPY , DS_SCREEN_RAM , 0x3f40 - 0x0801, 0, 0, 0, NULL, NULL, DF_NORMAL }, + { DO_COPY , DS_COLOR_RAM , 0x4328 - 0x0801, 0, 0, 0, NULL, NULL, DF_NORMAL }, + { DO_SET_OP , DS_D020 , 0x00 , 0, 0, 0, NULL, NULL, DF_NORMAL }, + { DO_SET_MEM_LO , DS_BGCOL , 0x4710 - 0x0801, 0, 0, 0, NULL, NULL, DF_NORMAL }, + { DO_LAST , 0 , 0 , 0, 0, 0, NULL, NULL, DF_NORMAL }, + }, + }, + NULL + }, + + { "fp2", "FunPaint II (unpacked)", 0x3ff0, 33694, 0, DM_FMT_RDWR, fmtProbeFunPaint2, fmtDecodeFunPaint2, fmtEncodeFunPaint2Unpacked,