# HG changeset patch # User Matti Hamalainen # Date 1528800997 -10800 # Node ID 5d7c89ad0bb439e724ef0ed653228ffceb6e53f0 # Parent c261db6e39aa8b8834879edb77b398508e74304e Improve Saracen Paint support by adding a probe function that accounts for some variance in the file sizes. diff -r c261db6e39aa -r 5d7c89ad0bb4 tools/lib64fmts.c --- a/tools/lib64fmts.c Tue Jun 12 13:55:58 2018 +0300 +++ b/tools/lib64fmts.c Tue Jun 12 13:56:37 2018 +0300 @@ -346,6 +346,16 @@ } +static int fmtProbeSaracenPaint(const Uint8 *buf, const size_t len, const DMC64ImageFormat *fmt) +{ + if ((len == 10219 || len == 10220) && + dmCompareAddr16(buf, 0, fmt->addr)) + return DM_PROBE_SCORE_GOOD; + + return DM_PROBE_SCORE_FALSE; +} + + static int fmtProbeFLIDesigner(const Uint8 *buf, const size_t len, const DMC64ImageFormat *fmt) { if (len == fmt->size && @@ -1153,7 +1163,7 @@ D64_FMT_MC, "sar", "Saracen Paint (unpacked)", 0x7800, 10219, DM_FMT_RDWR, C64_SCR_WIDTH / 2, C64_SCR_HEIGHT, C64_SCR_CH_WIDTH , C64_SCR_CH_HEIGHT, - NULL, + fmtProbeSaracenPaint, NULL, NULL, NULL, NULL, NULL,