Skip to content

Commit

Permalink
Ignore cyan on first couple of pixels in coco artifact mode
Browse files Browse the repository at this point in the history
  • Loading branch information
IanSB committed Jul 15, 2021
1 parent 2ea5e73 commit 0d2550e
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 9 deletions.
36 changes: 28 additions & 8 deletions src/capture_line_ntsc_8bpp.S
Expand Up @@ -154,14 +154,24 @@ skip_psync_loop_no_old\@:
eorne r8, r8, #(0x12 << PIXEL_BASE)
eorne r8, r8, #(0x12 << (PIXEL_BASE + 6))

tst r12, #NTSC_DONE_FIRST
andeq r9, r8, #(0x2d << PIXEL_BASE)
cmpeq r9, #(0x20 << PIXEL_BASE) //cyan
orreq r8, r8, #(0x08 << PIXEL_BASE) //makes it mono

tst r12, #NTSC_DONE_FIRST
andeq r9, r8, #(0x2d << (PIXEL_BASE + 6))
cmpeq r9, #(0x20 << (PIXEL_BASE + 6)) //cyan
orreq r8, r8, #(0x08 << (PIXEL_BASE + 6)) //makes it mono

eor r9, r8, r8, lsr #3
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
tst r12, #NTSC_DONE_FIRST
biceq r3, r3, #BITDUP_LINE_CONDITION_DETECTED
orreq r12, r12, #NTSC_DONE_FIRST

and r9, r8, #(0x12 << PIXEL_BASE)
and r14, r8, #(0x12 << (PIXEL_BASE + 6))
Expand All @@ -181,14 +191,24 @@ skip_psync_loop_no_old\@:
eorne r8, r8, #(0x12 << PIXEL_BASE)
eorne r8, r8, #(0x12 << (PIXEL_BASE + 6))

tst r12, #NTSC_DONE_FIRST
andeq r9, r8, #(0x2d << PIXEL_BASE)
cmpeq r9, #(0x20 << PIXEL_BASE) //cyan
orreq r8, r8, #(0x08 << PIXEL_BASE) //makes it mono

tst r12, #NTSC_DONE_FIRST
andeq r9, r8, #(0x2d << (PIXEL_BASE + 6))
cmpeq r9, #(0x20 << (PIXEL_BASE + 6)) //cyan
orreq r8, r8, #(0x08 << (PIXEL_BASE + 6)) //makes it mono

eor r9, r8, r8, lsr #3
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
tst r12, #NTSC_DONE_FIRST
biceq r3, r3, #BITDUP_LINE_CONDITION_DETECTED
orreq r12, r12, #NTSC_DONE_FIRST

and r9, r8, #(0x3f << PIXEL_BASE)
and r14, r8, #(0x3f << (PIXEL_BASE + 6))
Expand Down Expand Up @@ -1229,7 +1249,7 @@ capture_line_ntsc_sixbits_double_8bpp_mono:
push {lr}
ldr r12, =ntsc_status
ldr r12, [r12]
orr r12, #NTSC_IGNORE_FIRST
bic r12, #NTSC_DONE_FIRST
tst r12, #NTSC_ARTIFACT
beq no_ntsc_sixbits_double_8bpp_mono
SKIP_PSYNC_NO_OLD_CPLD_NTSC // returns with ntsc_status in r12
Expand Down Expand Up @@ -1317,7 +1337,7 @@ capture_line_ntsc_sixbits_double_8bpp_mono_auto:
push {lr}
ldr r12, =ntsc_status
ldr r12, [r12]
orr r12, #NTSC_IGNORE_FIRST
bic r12, #NTSC_DONE_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
Expand Down
2 changes: 1 addition & 1 deletion src/defs.h
Expand Up @@ -300,7 +300,7 @@ typedef struct {
#define NTSC_LAST_IIGS 0x100 //not actually ntsc but uses a spare bit
#define NTSC_LAST_IIGS_SHIFT 8
#define NTSC_FFOSD_ENABLE 0x200 //not actually ntsc but uses a spare bit
#define NTSC_IGNORE_FIRST 0x400
#define NTSC_DONE_FIRST 0x400


#define BBC_VERSION 0x79
Expand Down

0 comments on commit 0d2550e

Please sign in to comment.