changeset 1772:5d7c89ad0bb4

Improve Saracen Paint support by adding a probe function that accounts for some variance in the file sizes.
author Matti Hamalainen <ccr@tnsp.org>
date Tue, 12 Jun 2018 13:56:37 +0300
parents c261db6e39aa
children 9336bfb5b6d1
files tools/lib64fmts.c
diffstat 1 files changed, 11 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- 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,