# HG changeset patch # User Matti Hamalainen # Date 1560221113 -10800 # Node ID 9d362ea1a6062acb9675be746a3ef464d67e56df # Parent 4c3fdc9c005654cdee6b97f351e6058c1b3e7c08 Add probe function for Crest Super Hires FLI Editor v1.0 (unpacked). diff -r 4c3fdc9c0056 -r 9d362ea1a606 tools/lib64fmts.c --- a/tools/lib64fmts.c Tue Jun 11 05:44:22 2019 +0300 +++ b/tools/lib64fmts.c Tue Jun 11 05:45:13 2019 +0300 @@ -1244,6 +1244,27 @@ } +static const Uint8 fmtCrestSHFLI_MagicID_1[] = +{ + 0x80, 0x84, 0x85, 0x89, 0x8A, 0x8E, 0x8F, 0x93 +}; + + +static int fmtProbeCrestSHFLI(const DMGrowBuf *buf, const DMC64ImageFormat *fmt) +{ + if (buf->len == fmt->size && + dmCompareAddr16(buf, 0, fmt->addr)) + { + if (DM_MEMCMP_SIZE(buf->data + 0x03f8 + 2, fmtCrestSHFLI_MagicID_1) == 0) + return DM_PROBE_SCORE_MAX; + else + return DM_PROBE_SCORE_MAYBE; + } + + return DM_PROBE_SCORE_FALSE; +} + + static int fmtGetSpritePixelCrestSHFLI(Uint8 *col, const DMC64Image *img, const int sindex, const int cindex, const int spr_xd, const int spr_yd, const int mask) @@ -2339,7 +2360,7 @@ { "cshf", "Crest Super Hires FLI Editor v1.0 (unpacked)", 0x4000, 15874, DM_FMT_RD, - NULL, + fmtProbeCrestSHFLI, NULL, NULL, { D64_FMT_HIRES | D64_FMT_FLI,