Pi Firmware: made diff_N_frames cursor skipping aware of v_offset

Change-Id: Ib36a3b2fc7140b3056134efad03a0c9808e871af
pull/11/head
David Banks 2018-11-11 20:01:57 +00:00
rodzic 88f402c335
commit 4c73fe6c82
1 zmienionych plików z 33 dodań i 28 usunięć

Wyświetl plik

@ -561,41 +561,46 @@ int *diff_N_frames_by_sample(capture_info_t *capinfo, int n, int mode7, int elk)
// Compare the frames
uint32_t *fbp = (uint32_t *)(capinfo->fb + ((ret >> OFFSET_LAST_BUFFER) & 3) * capinfo->height * capinfo->pitch);
uint32_t *lastp = (uint32_t *)last;
for (int line = 0; line < capinfo->height; line++) {
for (int y = 0; y < capinfo->height; y++) {
int skip = 0;
// As v_offset increases, e.g. by one, the screen image moves up one scan line, which is two frame buffer lines
// So line N in the framebuffer corresponds to line N + 2 in the image
int line = y + (capinfo->v_offset - 21) * 2;
// Skip lines that might contain flashing cursor
// (the cursor rows were determined empirically)
if (elk) {
// Eliminate cursor lines in 32 row modes (0,1,2,4,5)
if (!mode7 && ((line >> 1) % 8) == 5) {
skip = 1;
}
// Eliminate cursor lines in 25 row modes (3, 6)
if (!mode7 && ((line >> 1) % 10) == 3) {
skip = 1;
}
// Eliminate cursor lines in mode 7
// (this case is untested as I don't have a Jafa board)
if (mode7 && ((line % 20) == 13 || (line % 20) == 14)) {
skip = 1;
}
} else {
// Eliminate cursor lines in 32 row modes (0,1,2,4,5)
if (!mode7 && ((line >> 1) % 8) == 7) {
skip = 1;
}
// Eliminate cursor lines in 25 row modes (3, 6)
if (!mode7 && ((line >> 1) % 10) >= 5 && ((line >> 1) % 10) <= 7) {
skip = 1;
}
// Eliminate cursor lines in mode 7
if (mode7 && ((line % 20) == 13 || (line % 20) == 14)) {
skip = 1;
if (line >= 0) {
if (elk) {
// Eliminate cursor lines in 32 row modes (0,1,2,4,5)
if (!mode7 && ((line >> 1) % 8) == 5) {
skip = 1;
}
// Eliminate cursor lines in 25 row modes (3, 6)
if (!mode7 && ((line >> 1) % 10) == 3) {
skip = 1;
}
// Eliminate cursor lines in mode 7
// (this case is untested as I don't have a Jafa board)
if (mode7 && ((line % 20) == 13 || (line % 20) == 14)) {
skip = 1;
}
} else {
// Eliminate cursor lines in 32 row modes (0,1,2,4,5)
if (!mode7 && ((line >> 1) % 8) == 7) {
skip = 1;
}
// Eliminate cursor lines in 25 row modes (3, 6)
if (!mode7 && ((line >> 1) % 10) >= 5 && ((line >> 1) % 10) <= 7) {
skip = 1;
}
// Eliminate cursor lines in mode 7
if (mode7 && ((line % 20) == 13 || (line % 20) == 14)) {
skip = 1;
}
}
}
if (skip) {
// For debugging it's useful to see if the lines being eliminated align with the cursor
// for (int x = 0; x < pitch; x += 4) {
// for (int x = 0; x < capinfo->pitch; x += 4) {
// *fbp++ = 0x11111111;
// }
fbp += capinfo->pitch >> 2;