comparison tools/lib64fmts.c @ 2629:07c85fffd805

Add support for unknown hires format XX10.
author Matti Hamalainen <ccr@tnsp.org>
date Thu, 30 Nov 2023 01:52:51 +0200
parents 00b21276f2c0
children ca617d635fce
comparison
equal deleted inserted replaced
2628:00b21276f2c0 2629:07c85fffd805
177 177
178 return DM_PROBE_SCORE_FALSE; 178 return DM_PROBE_SCORE_FALSE;
179 } 179 }
180 180
181 181
182 static const Uint8 fmtFormatXX9_MagicID_1[] = 182 static const Uint8 fmtFormatXX9_MagicID[] =
183 { 183 {
184 0x01, 0x08, 0x0b, 0x08, 0xe0, 0x02, 0x9e, 0x32, 184 0x01, 0x08, 0x0b, 0x08, 0xe0, 0x02, 0x9e, 0x32,
185 0x30, 0x36, 0x31, 0x00, 0x00, 0x00, 0xa2, 0x19, 185 0x30, 0x36, 0x31, 0x00, 0x00, 0x00, 0xa2, 0x19,
186 0xb5, 0x02, 0x9d, 0x6f, 0x31, 0xca, 0x10, 0xf8, 186 0xb5, 0x02, 0x9d, 0x6f, 0x31, 0xca, 0x10, 0xf8,
187 0xa9, 0x0e, 0x20, 0xd2, 0xff, 0xa5, 0x01, 0x48, 187 0xa9, 0x0e, 0x20, 0xd2, 0xff, 0xa5, 0x01, 0x48,
190 }; 190 };
191 191
192 static int fmtProbeFormatXX9(const DMGrowBuf *buf, const DMC64ImageFormat *fmt) 192 static int fmtProbeFormatXX9(const DMGrowBuf *buf, const DMC64ImageFormat *fmt)
193 { 193 {
194 if (buf->len == fmt->size && 194 if (buf->len == fmt->size &&
195 DM_MEMCMP_SIZE(buf->data, fmtFormatXX9_MagicID_1) == 0 195 DM_MEMCMP_SIZE(buf->data, fmtFormatXX9_MagicID) == 0
196 )
197 return DM_PROBE_SCORE_MAX;
198
199 return DM_PROBE_SCORE_FALSE;
200 }
201
202
203 static const Uint8 fmtFormatXX10_MagicID[] =
204 {
205 0x01, 0x08, 0x0B, 0x08 , 0x20, 0x03, 0x9E, 0x32,
206 0x30, 0x36, 0x31, 0x00 , 0x00, 0x00, 0xA2, 0x00,
207 0xBD, 0x77, 0x28, 0x9D , 0x00, 0x40, 0xBD, 0x77,
208 0x29, 0x9D, 0x00, 0x41 , 0xBD, 0x77, 0x2A, 0x9D,
209 0x00, 0x42, 0xBD, 0x5F , 0x2B, 0x9D, 0xE8, 0x42,
210 0xCA, 0xD0, 0xE5, 0xA2 , 0x00, 0xBD, 0x37, 0x09,
211 0x9D, 0x00, 0x60, 0xBD , 0x37, 0x0A, 0x9D, 0x00,
212 };
213
214 static int fmtProbeFormatXX10(const DMGrowBuf *buf, const DMC64ImageFormat *fmt)
215 {
216 if (buf->len == fmt->size &&
217 DM_MEMCMP_SIZE(buf->data, fmtFormatXX10_MagicID) == 0
196 ) 218 )
197 return DM_PROBE_SCORE_MAX; 219 return DM_PROBE_SCORE_MAX;
198 220
199 return DM_PROBE_SCORE_FALSE; 221 return DM_PROBE_SCORE_FALSE;
200 } 222 }
3724 } 3746 }
3725 }, 3747 },
3726 NULL 3748 NULL
3727 }, 3749 },
3728 3750
3751 {
3752 "xx10", "Unknown $0801 format (viewer) (unpacked)", 0x0801, 9312, 0, DM_FMT_RD,
3753 fmtProbeFormatXX10,
3754 NULL, NULL,
3755 {
3756 D64_FMT_HIRES,
3757 D64_SCR_WIDTH , D64_SCR_HEIGHT,
3758 D64_SCR_CH_WIDTH, D64_SCR_CH_HEIGHT,
3759 1, 1,
3760 NULL, NULL,
3761 NULL,
3762 {
3763 { DO_COPY , DS_BITMAP_RAM , 0x0937 - 0x0801, 0, 0, 0, NULL, NULL, DF_NORMAL },
3764 { DO_COPY , DS_SCREEN_RAM , 0x2877 - 0x0801, 0, 0, 0, NULL, NULL, DF_NORMAL },
3765 { DO_SET_MEM_LO , DS_D020 , 0x0934 - 0x0801, 0, 0, 0, NULL, NULL, DF_NORMAL },
3766 { DO_SET_MEM_LO , DS_BGCOL , 0x0934 - 0x0801, 0, 0, 0, NULL, NULL, DF_NORMAL },
3767 { DO_LAST , 0 , 0 , 0, 0, 0, NULL, NULL, DF_NORMAL },
3768 }
3769 },
3770 NULL
3771 },
3729 3772
3730 }; 3773 };
3731 3774
3732 const int ndmC64ImageFormats = sizeof(dmC64ImageFormats) / sizeof(dmC64ImageFormats[0]); 3775 const int ndmC64ImageFormats = sizeof(dmC64ImageFormats) / sizeof(dmC64ImageFormats[0]);
3733 3776