comparison tools/lib64gfx.c @ 2599:c3c1d3c75f53

s/DM_PROBE_SCORE_false/DM_PROBE_SCORE_FALSE/g
author Matti Hamalainen <ccr@tnsp.org>
date Sun, 19 Nov 2023 18:33:52 +0200
parents 9807ae37ad69
children d3bdaaae624f
comparison
equal deleted inserted replaced
2598:bf43bf9d6556 2599:c3c1d3c75f53
1531 1531
1532 if ((size_t) probeOffs >= buf->len) 1532 if ((size_t) probeOffs >= buf->len)
1533 return DMERR_OUT_OF_DATA; 1533 return DMERR_OUT_OF_DATA;
1534 1534
1535 dmGrowBufConstCopyOffs(&tmp, buf, probeOffs); 1535 dmGrowBufConstCopyOffs(&tmp, buf, probeOffs);
1536 if (dmC64ProbeBMP(&tmp, fmt) == DM_PROBE_SCORE_false) 1536 if (dmC64ProbeBMP(&tmp, fmt) == DM_PROBE_SCORE_FALSE)
1537 return DMERR_NOT_SUPPORTED; 1537 return DMERR_NOT_SUPPORTED;
1538 } 1538 }
1539 1539
1540 if (*fmt == NULL) 1540 if (*fmt == NULL)
1541 return DMERR_NOT_SUPPORTED; 1541 return DMERR_NOT_SUPPORTED;
1671 // if it contains a supported "C64" image format. Returns the 1671 // if it contains a supported "C64" image format. Returns the
1672 // "probe score", see libgfx.h for list of values. If a match 1672 // "probe score", see libgfx.h for list of values. If a match
1673 // is found, pointer to format description is set to *pfmt. 1673 // is found, pointer to format description is set to *pfmt.
1674 int dmC64ProbeBMP(const DMGrowBuf *buf, const DMC64ImageFormat **pfmt) 1674 int dmC64ProbeBMP(const DMGrowBuf *buf, const DMC64ImageFormat **pfmt)
1675 { 1675 {
1676 int scoreMax = DM_PROBE_SCORE_false, scoreIndex = -1; 1676 int scoreMax = DM_PROBE_SCORE_FALSE, scoreIndex = -1;
1677 1677
1678 for (int i = 0; i < ndmC64ImageFormats; i++) 1678 for (int i = 0; i < ndmC64ImageFormats; i++)
1679 { 1679 {
1680 const DMC64ImageFormat *fmt = &dmC64ImageFormats[i]; 1680 const DMC64ImageFormat *fmt = &dmC64ImageFormats[i];
1681 int score = DM_PROBE_SCORE_false; 1681 int score = DM_PROBE_SCORE_FALSE;
1682 if (fmt->probe == NULL && fmt->size > 0 && fmt->addr > 0) 1682 if (fmt->probe == NULL && fmt->size > 0 && fmt->addr > 0)
1683 { 1683 {
1684 // Generic probe just checks matching size and load address 1684 // Generic probe just checks matching size and load address
1685 if (buf->len == fmt->size && dmCompareAddr16(buf, 0, fmt->addr)) 1685 if (buf->len == fmt->size && dmCompareAddr16(buf, 0, fmt->addr))
1686 score = DM_PROBE_SCORE_GOOD; 1686 score = DM_PROBE_SCORE_GOOD;
1700 { 1700 {
1701 *pfmt = &dmC64ImageFormats[scoreIndex]; 1701 *pfmt = &dmC64ImageFormats[scoreIndex];
1702 return scoreMax; 1702 return scoreMax;
1703 } 1703 }
1704 else 1704 else
1705 return DM_PROBE_SCORE_false; 1705 return DM_PROBE_SCORE_FALSE;
1706 } 1706 }
1707 1707
1708 1708
1709 bool dmLib64GFXInitialized = false; 1709 bool dmLib64GFXInitialized = false;
1710 DMC64ImageFormat **dmC64ImageFormatsSorted = NULL; 1710 DMC64ImageFormat **dmC64ImageFormatsSorted = NULL;