Skip to content

Commit

Permalink
Update artifact line count
Browse files Browse the repository at this point in the history
  • Loading branch information
IanSB committed May 28, 2021
1 parent 9686dd8 commit 756c7c3
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
7 changes: 5 additions & 2 deletions src/defs.h
Expand Up @@ -437,9 +437,13 @@ typedef struct {
#define PIXEL_ORDER 3 // ABGR

#define GREY_PIXELS 0xaaa
#define DETECTED_LINE_COUNT 200
#define GREY_DETECTED_LINE_COUNT 200
#define ARTIFACT_DETECTED_LINE_COUNT 100
#define DPMS_FRAME_COUNT 200

#define SIZEX2_DOUBLE_HEIGHT 1
#define SIZEX2_DOUBLE_WIDTH 2
#define SIZEX2_BASIC_SCANLINES 4

// can't use enums in assembler
#define PALETTECONTROL_OFF 0
Expand Down Expand Up @@ -470,5 +474,4 @@ typedef struct {
#define SAMPLE_WIDTH_9HI 4
#define SAMPLE_WIDTH_12 5


#endif
9 changes: 7 additions & 2 deletions src/rgb_to_fb.S
Expand Up @@ -823,9 +823,14 @@ skip_all_lines:
cmp r9, #PALETTECONTROL_NTSCARTIFACT_BW_AUTO
bne check_dpms

ldr r8, param_fb_sizex2
tst r8, #2
moveq r8, #ARTIFACT_DETECTED_LINE_COUNT
movne r8, #(ARTIFACT_DETECTED_LINE_COUNT << 1)

ldr r9, ntsc_status
mov r11, r9
cmp r7, #DETECTED_LINE_COUNT
cmp r7, r8
bic r9, r9, #NTSC_ARTIFACT_REQUIRED
orrge r9, r9, #NTSC_ARTIFACT_REQUIRED

Expand All @@ -845,7 +850,7 @@ check_dpms:
tst r3, #BIT_OSD //if osd on then disable grey screen
movne r8, #0
ldr r9, dpms_state
cmp r7, #DETECTED_LINE_COUNT
cmp r7, #GREY_DETECTED_LINE_COUNT
movlt r8, #0
addge r8, r8, #1
cmp r8, #DPMS_FRAME_COUNT
Expand Down

0 comments on commit 756c7c3

Please sign in to comment.