Mercurial > hg > dmlib
changeset 2015:c5a88bb4ee3f
Improve unpacked Koala Painter format support for variants that have a
non-standard loading address by implementing variant probing.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Wed, 29 Aug 2018 22:01:29 +0300 |
parents | a49f7e83edcb |
children | 7114ea4c3c42 |
files | tools/lib64fmts.c |
diffstat | 1 files changed, 15 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- 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] },