comparison tools/lib64fmts.c @ 2627:262395b86b7c

Add support for unknown plain multicolor viewer format XX9.
author Matti Hamalainen <ccr@tnsp.org>
date Wed, 29 Nov 2023 20:54:49 +0200
parents 4fc62ffe1969
children 00b21276f2c0
comparison
equal deleted inserted replaced
2626:4fc62ffe1969 2627:262395b86b7c
170 static int fmtProbeFormatXX7(const DMGrowBuf *buf, const DMC64ImageFormat *fmt) 170 static int fmtProbeFormatXX7(const DMGrowBuf *buf, const DMC64ImageFormat *fmt)
171 { 171 {
172 if (buf->len == fmt->size && 172 if (buf->len == fmt->size &&
173 DM_MEMCMP_SIZE(buf->data + 0x0000, fmtFormatXX7_MagicID_1) == 0 && 173 DM_MEMCMP_SIZE(buf->data + 0x0000, fmtFormatXX7_MagicID_1) == 0 &&
174 DM_MEMCMP_SIZE(buf->data + 0x0100, fmtFormatXX7_MagicID_2) == 0 174 DM_MEMCMP_SIZE(buf->data + 0x0100, fmtFormatXX7_MagicID_2) == 0
175 )
176 return DM_PROBE_SCORE_MAX;
177
178 return DM_PROBE_SCORE_FALSE;
179 }
180
181
182 static const Uint8 fmtFormatXX9_MagicID_1[] =
183 {
184 0x01, 0x08, 0x0b, 0x08, 0xe0, 0x02, 0x9e, 0x32,
185 0x30, 0x36, 0x31, 0x00, 0x00, 0x00, 0xa2, 0x19,
186 0xb5, 0x02, 0x9d, 0x6f, 0x31, 0xca, 0x10, 0xf8,
187 0xa9, 0x0e, 0x20, 0xd2, 0xff, 0xa5, 0x01, 0x48,
188 0x29, 0xf8, 0x09, 0x06, 0x85, 0x01, 0x20, 0x65,
189 0x08, 0x68, 0x8d, 0x8e, 0x31, 0xba, 0x8e, 0x8d,
190 };
191
192 static int fmtProbeFormatXX9(const DMGrowBuf *buf, const DMC64ImageFormat *fmt)
193 {
194 if (buf->len == fmt->size &&
195 DM_MEMCMP_SIZE(buf->data, fmtFormatXX9_MagicID_1) == 0
175 ) 196 )
176 return DM_PROBE_SCORE_MAX; 197 return DM_PROBE_SCORE_MAX;
177 198
178 return DM_PROBE_SCORE_FALSE; 199 return DM_PROBE_SCORE_FALSE;
179 } 200 }
3680 } 3701 }
3681 }, 3702 },
3682 NULL 3703 NULL
3683 }, 3704 },
3684 3705
3706 {
3707 "xx9", "Unknown $0801 format (viewer) (unpacked)", 0x0801, 10608, 0, DM_FMT_RD,
3708 fmtProbeFormatXX9,
3709 NULL, NULL,
3710 {
3711 D64_FMT_MC,
3712 D64_SCR_WIDTH / 2, D64_SCR_HEIGHT,
3713 D64_SCR_CH_WIDTH , D64_SCR_CH_HEIGHT,
3714 2, 1,
3715 NULL, NULL,
3716 NULL,
3717 {
3718 { DO_COPY , DS_BITMAP_RAM , 0x0a38 - 0x0801, 0, 0, 0, NULL, NULL, DF_NORMAL },
3719 { DO_COPY , DS_SCREEN_RAM , 0x297a - 0x0801, 0, 0, 0, NULL, NULL, DF_NORMAL },
3720 { DO_COPY , DS_COLOR_RAM , 0x2d62 - 0x0801, 0, 0, 0, NULL, NULL, DF_NORMAL },
3721 { DO_SET_MEM_LO, DS_BGCOL , 0x2979 - 0x0801, 0, 0, 0, NULL, NULL, DF_NORMAL },
3722 { DO_SET_MEM_LO, DS_D020 , 0x2978 - 0x0801, 0, 0, 0, NULL, NULL, DF_NORMAL },
3723 { DO_LAST , 0 , 0 , 0, 0, 0, NULL, NULL, DF_NORMAL },
3724 }
3725 },
3726 NULL
3727 },
3728
3729
3685 }; 3730 };
3686 3731
3687 const int ndmC64ImageFormats = sizeof(dmC64ImageFormats) / sizeof(dmC64ImageFormats[0]); 3732 const int ndmC64ImageFormats = sizeof(dmC64ImageFormats) / sizeof(dmC64ImageFormats[0]);
3688 3733