From 1e0b55f95b1c4b604a401cb6c8cecb5774b13fe0 Mon Sep 17 00:00:00 2001 From: Sour Date: Sat, 6 Jan 2018 08:07:16 -0500 Subject: [PATCH] Video: Fixed red line at bottom of screen with NTSC filter --- Core/NtscFilter.cpp | 2 +- Utilities/nes_ntsc.h | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/Core/NtscFilter.cpp b/Core/NtscFilter.cpp index a0f39ef7..84a27786 100644 --- a/Core/NtscFilter.cpp +++ b/Core/NtscFilter.cpp @@ -92,7 +92,7 @@ void NtscFilter::DoubleOutputHeight(uint32_t *ntscBuffer) uint32_t prev = in[overscanLeft]; uint32_t next = y < 239 ? in[overscanLeft + rowWidth] : 0; - *out = prev; + *out = 0xFF000000 | prev; /* mix 24-bit rgb without losing low bits */ uint32_t mixed = (prev + next + ((prev ^ next) & 0x030303)) >> 1; diff --git a/Utilities/nes_ntsc.h b/Utilities/nes_ntsc.h index c01d9c51..dd55f0f7 100644 --- a/Utilities/nes_ntsc.h +++ b/Utilities/nes_ntsc.h @@ -184,9 +184,7 @@ enum { nes_ntsc_full_overscan_right = nes_ntsc_full_in_width - 256 - nes_ntsc_fu #define NES_NTSC_RGB_OUT_( rgb_out, bits, x ) {\ if ( bits == 16 )\ rgb_out = (raw_>>(13-x)& 0xF800)|(raw_>>(8-x)&0x07E0)|(raw_>>(4-x)&0x001F);\ - if ( bits == 32 )\ - rgb_out = 0xFF000000 | (raw_ >> (5 - x) & 0xFF0000) | (raw_ >> (3 - x) & 0xFF00) | (raw_ >> (1 - x) & 0xFF); \ - if ( bits == 24 )\ + if ( bits == 32 || bits == 24 )\ rgb_out = (raw_>>(5-x)&0xFF0000)|(raw_>>(3-x)&0xFF00)|(raw_>>(1-x)&0xFF);\ if ( bits == 15 )\ rgb_out = (raw_>>(14-x)& 0x7C00)|(raw_>>(9-x)&0x03E0)|(raw_>>(4-x)&0x001F);\