# HG changeset patch # User Matti Hamalainen # Date 1506282917 -10800 # Node ID aad9d9e7e1d3f6e7ec90e498ddfacb4675712c1f # Parent f3c5f80511aecce2a341f4e2ccbc7586bb6e0ef8 Cleanups, support another variant of FLI Designer format. diff -r f3c5f80511ae -r aad9d9e7e1d3 tools/lib64gfx.c --- a/tools/lib64gfx.c Sun Sep 24 22:26:22 2017 +0300 +++ b/tools/lib64gfx.c Sun Sep 24 22:55:17 2017 +0300 @@ -347,11 +347,10 @@ } -#define AMICA_DM_PROBE_SIZE 2048 static int fmtProbeAmicaPaintPacked(const Uint8 *buf, const size_t len, const DMC64ImageFormat *fmt) { size_t i, n; - if (len < AMICA_DM_PROBE_SIZE || !dmCompareAddr16(buf, 0, fmt->addr)) + if (len < 2048 || !dmCompareAddr16(buf, 0, fmt->addr)) return DM_PROBE_SCORE_FALSE; // Interpaint Hi-Res gives a false positive @@ -389,6 +388,16 @@ } +static int fmtProbeFLIDesigner(const Uint8 *buf, const size_t len, const DMC64ImageFormat *fmt) +{ + if (len == fmt->size && + (dmCompareAddr16(buf, 0, 0x3c00) || dmCompareAddr16(buf, 0, 0x3ff0))) + return DM_PROBE_SCORE_MAX; + + return DM_PROBE_SCORE_FALSE; +} + + static BOOL fmtTruePaintSetLaceType(DMC64Image *img, const struct _DMC64EncDecOp *op, const Uint8 *buf, const size_t len) { (void) op; @@ -440,7 +449,6 @@ } - #define FUNPAINT2_HEADER_SIZE (0x10) static BOOL fmtProbeFunPaint2Header(const Uint8 *buf, const size_t len, const DMC64ImageFormat *fmt) @@ -799,10 +807,10 @@ }, { - D64_FMT_MC | D64_FMT_FLI, "fli", "FLI Designer 1 (unpacked)", 0x3c00, 17409, + D64_FMT_MC | D64_FMT_FLI, "fli", "FLI Designer (unpacked)", 0, 17409, C64_SCR_WIDTH / 2, C64_SCR_HEIGHT, C64_SCR_CH_WIDTH , C64_SCR_CH_HEIGHT, - NULL, NULL, + fmtProbeFLIDesigner, NULL, NULL, NULL, NULL, fmtGetPixelFLIDesigner, { { DT_COLOR_RAM, 0x0000, 0, 0, NULL, NULL },