diff --git a/src/common/tv_filters/AtariNTSC.cxx b/src/common/tv_filters/AtariNTSC.cxx index fdb47c4f4..6ee4c1353 100644 --- a/src/common/tv_filters/AtariNTSC.cxx +++ b/src/common/tv_filters/AtariNTSC.cxx @@ -129,7 +129,7 @@ void AtariNTSC::renderThread(const uInt8* atari_in, const uInt32 in_width, { const uInt8* line_in = atari_in; ATARI_NTSC_BEGIN_ROW(NTSC_black, line_in[0]); - uInt32* restrict line_out = static_cast(rgb_out); + uInt32* restrict line_out = static_cast(rgb_out) + 2; // shift right by 2 pixel ++line_in; for(uInt32 n = chunk_count; n; --n) @@ -202,7 +202,7 @@ void AtariNTSC::renderWithPhosphorThread(const uInt8* atari_in, const uInt32 in_ { const uInt8* line_in = atari_in; ATARI_NTSC_BEGIN_ROW(NTSC_black, line_in[0]); - uInt32* restrict line_out = static_cast(rgb_out); + uInt32* restrict line_out = static_cast(rgb_out) + 2; // shift right by 2 pixel ++line_in; for(uInt32 n = chunk_count; n; --n) @@ -252,8 +252,9 @@ void AtariNTSC::renderWithPhosphorThread(const uInt8* atari_in, const uInt32 in_ #endif // Do phosphor mode (blend the resulting frames) - // Note: The code assumes that AtariNTSC::outWidth(kTIAW) == outPitch == 565 - for (uInt32 x = AtariNTSC::outWidth(in_width) / 8; x; --x) + // Note: The code assumed that AtariNTSC::outWidth(kTIAW) == outPitch == 565 + // Now this got changed to 568 which affects unrolling (thus "- 8") + for (uInt32 x = AtariNTSC::outWidth(in_width - 8) / 8; x; --x) { // Store back into displayed frame buffer (for next frame) rgb_in[bufofs] = getRGBPhosphor(out[bufofs], rgb_in[bufofs]); diff --git a/src/common/tv_filters/AtariNTSC.hxx b/src/common/tv_filters/AtariNTSC.hxx index 447a9e5fd..e8f299c43 100644 --- a/src/common/tv_filters/AtariNTSC.hxx +++ b/src/common/tv_filters/AtariNTSC.hxx @@ -100,15 +100,15 @@ class AtariNTSC // Number of input pixels that will fit within given output width. // Might be rounded down slightly; use outWidth() on result to find // rounded value. - static constexpr uInt32 inWidth( uInt32 out_width ) { - return (((out_width-5) / PIXEL_out_chunk - 1) * PIXEL_in_chunk + 1); - } + /*static constexpr uInt32 inWidth( uInt32 out_width ) { + return (((out_width - 8) / PIXEL_out_chunk - 1) * PIXEL_in_chunk + 1); + }*/ // Number of output pixels written by blitter for given input width. // Width might be rounded down slightly; use inWidth() on result to // find rounded value. Guaranteed not to round 160 down at all. static constexpr uInt32 outWidth(uInt32 in_width) { - return ((((in_width) - 1) / PIXEL_in_chunk + 1)* PIXEL_out_chunk) + 5; + return ((((in_width) - 1) / PIXEL_in_chunk + 1)* PIXEL_out_chunk) + 8; } private: