From bda121a891067f288014e7976f3541844e0ea6cf Mon Sep 17 00:00:00 2001 From: IanSB Date: Mon, 12 Jul 2021 06:07:11 +0100 Subject: [PATCH] Fix 6847 artifact detection --- src/capture_line_ntsc_8bpp.S | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/src/capture_line_ntsc_8bpp.S b/src/capture_line_ntsc_8bpp.S index f1556db6..187e17bf 100644 --- a/src/capture_line_ntsc_8bpp.S +++ b/src/capture_line_ntsc_8bpp.S @@ -155,9 +155,13 @@ skip_psync_loop_no_old\@: eorne r8, r8, #(0x12 << (PIXEL_BASE + 6)) eor r9, r8, r8, lsr #3 - tst r9, #(0x05 << PIXEL_BASE) - tstne r9, #(0x05 << (PIXEL_BASE + 6)) + and r9, r9, r9, lsr #2 + tst r9, #(0x01 << PIXEL_BASE) + tstne r9, #(0x01 << (PIXEL_BASE + 6)) orreq r3, r3, #BITDUP_LINE_CONDITION_DETECTED //detect if any U/V content + tst r12, #NTSC_IGNORE_FIRST + bicne r3, r3, #BITDUP_LINE_CONDITION_DETECTED + bicne r12, r12, #NTSC_IGNORE_FIRST and r9, r8, #(0x12 << PIXEL_BASE) and r14, r8, #(0x12 << (PIXEL_BASE + 6)) @@ -178,9 +182,13 @@ skip_psync_loop_no_old\@: eorne r8, r8, #(0x12 << (PIXEL_BASE + 6)) eor r9, r8, r8, lsr #3 - tst r9, #(0x05 << PIXEL_BASE) - tstne r9, #(0x05 << (PIXEL_BASE + 6)) + and r9, r9, r9, lsr #2 + tst r9, #(0x01 << PIXEL_BASE) + tstne r9, #(0x01 << (PIXEL_BASE + 6)) orreq r3, r3, #BITDUP_LINE_CONDITION_DETECTED //detect if any U/V content + tst r12, #NTSC_IGNORE_FIRST + bicne r3, r3, #BITDUP_LINE_CONDITION_DETECTED + bicne r12, r12, #NTSC_IGNORE_FIRST and r9, r8, #(0x3f << PIXEL_BASE) and r14, r8, #(0x3f << (PIXEL_BASE + 6)) @@ -1221,6 +1229,7 @@ capture_line_ntsc_sixbits_double_8bpp_mono: push {lr} ldr r12, =ntsc_status ldr r12, [r12] + orr r12, #NTSC_IGNORE_FIRST tst r12, #NTSC_ARTIFACT beq no_ntsc_sixbits_double_8bpp_mono SKIP_PSYNC_NO_OLD_CPLD_NTSC // returns with ntsc_status in r12 @@ -1308,6 +1317,7 @@ capture_line_ntsc_sixbits_double_8bpp_mono_auto: push {lr} ldr r12, =ntsc_status ldr r12, [r12] + orr r12, #NTSC_IGNORE_FIRST tst r12, #NTSC_ARTIFACT beq no_ntsc_sixbits_double_8bpp_mono_auto SKIP_PSYNC_NO_OLD_CPLD_NTSC // returns with ntsc_status in r12