Skip to content

Commit 78870bf

Browse files
committed
exclude black bytes from the comaprison for CAPCOM
1 parent fc938dc commit 78870bf

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/dmdreader.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -381,6 +381,11 @@ bool matchGroupsAtLeastBytes(const uint8_t *a, const uint8_t *b,
381381

382382
std::size_t ok = 0;
383383
for (std::size_t i = 0; i < bytes; ++i) {
384+
// exclude bytes that are black in both screen
385+
if (0 == a[i] && 0 == b[i]) {
386+
minMatchingBytes--;
387+
continue;
388+
}
384389
ok += (LUT[a[i]] == LUT[b[i]]);
385390
if (ok >= minMatchingBytes) return true; // early success
386391
if (ok + (bytes - (i + 1)) < minMatchingBytes) // early fail

0 commit comments

Comments
 (0)