comparison tools/lib64fmts.c @ 2167:9d362ea1a606

Add probe function for Crest Super Hires FLI Editor v1.0 (unpacked).
author Matti Hamalainen <ccr@tnsp.org>
date Tue, 11 Jun 2019 05:45:13 +0300
parents 4c3fdc9c0056
children b4f4251eaaae
comparison
equal deleted inserted replaced
2166:4c3fdc9c0056 2167:9d362ea1a606
1239 if ((res = dmC64GetGenericSCPixel(&color1, img, bmoffs, scroffs, vshift, 0, 0)) != DMERR_OK) 1239 if ((res = dmC64GetGenericSCPixel(&color1, img, bmoffs, scroffs, vshift, 0, 0)) != DMERR_OK)
1240 return res; 1240 return res;
1241 1241
1242 *col = color3 ? color3 : ( color2 ? color2 : color1 ); 1242 *col = color3 ? color3 : ( color2 ? color2 : color1 );
1243 return DMERR_OK; 1243 return DMERR_OK;
1244 }
1245
1246
1247 static const Uint8 fmtCrestSHFLI_MagicID_1[] =
1248 {
1249 0x80, 0x84, 0x85, 0x89, 0x8A, 0x8E, 0x8F, 0x93
1250 };
1251
1252
1253 static int fmtProbeCrestSHFLI(const DMGrowBuf *buf, const DMC64ImageFormat *fmt)
1254 {
1255 if (buf->len == fmt->size &&
1256 dmCompareAddr16(buf, 0, fmt->addr))
1257 {
1258 if (DM_MEMCMP_SIZE(buf->data + 0x03f8 + 2, fmtCrestSHFLI_MagicID_1) == 0)
1259 return DM_PROBE_SCORE_MAX;
1260 else
1261 return DM_PROBE_SCORE_MAYBE;
1262 }
1263
1264 return DM_PROBE_SCORE_FALSE;
1244 } 1265 }
1245 1266
1246 1267
1247 static int fmtGetSpritePixelCrestSHFLI(Uint8 *col, 1268 static int fmtGetSpritePixelCrestSHFLI(Uint8 *col,
1248 const DMC64Image *img, const int sindex, const int cindex, 1269 const DMC64Image *img, const int sindex, const int cindex,
2337 NULL 2358 NULL
2338 }, 2359 },
2339 2360
2340 { 2361 {
2341 "cshf", "Crest Super Hires FLI Editor v1.0 (unpacked)", 0x4000, 15874, DM_FMT_RD, 2362 "cshf", "Crest Super Hires FLI Editor v1.0 (unpacked)", 0x4000, 15874, DM_FMT_RD,
2342 NULL, 2363 fmtProbeCrestSHFLI,
2343 NULL, NULL, 2364 NULL, NULL,
2344 { 2365 {
2345 D64_FMT_HIRES | D64_FMT_FLI, 2366 D64_FMT_HIRES | D64_FMT_FLI,
2346 D64_SCR_WIDTH, D64_SCR_HEIGHT, 2367 D64_SCR_WIDTH, D64_SCR_HEIGHT,
2347 D64_SCR_CH_WIDTH, 21, 2368 D64_SCR_CH_WIDTH, 21,