# HG changeset patch # User Matti Hamalainen # Date 1535569289 -10800 # Node ID c5a88bb4ee3f5133e6004f1f55d75a51b1748069 # Parent a49f7e83edcb97f1bbff684f20abda5518866bc2 Improve unpacked Koala Painter format support for variants that have a non-standard loading address by implementing variant probing. diff -r a49f7e83edcb -r c5a88bb4ee3f tools/lib64fmts.c --- a/tools/lib64fmts.c Wed Aug 29 19:57:31 2018 +0300 +++ b/tools/lib64fmts.c Wed Aug 29 22:01:29 2018 +0300 @@ -59,6 +59,20 @@ } +static int fmtProbeKoalaPainter(const DMGrowBuf *buf, const DMC64ImageFormat *fmt) +{ + int score = DM_PROBE_SCORE_FALSE; + + if (buf->len == 10003) + score += DM_PROBE_SCORE_MAYBE; + + if (dmCompareAddr16(buf, 0, fmt->addr)) + score += DM_PROBE_SCORE_MAYBE; + + return score; +} + + static int fmtProbeKoalaPainterPacked(const DMGrowBuf *buf, const DMC64ImageFormat *fmt) { // Attempt to prevent misprobes of unpacked Koala and Run Paint @@ -1358,7 +1372,7 @@ { "kla", "Koala Painter (unpacked)", 0x6000, 10003, DM_FMT_RDWR, - NULL, + fmtProbeKoalaPainter, NULL, NULL, { }, &dmC64CommonFormats[0] },