diff --git a/desmume/src/windows/filter/scanline.cpp b/desmume/src/windows/filter/scanline.cpp index 8d85540d3..cd6e66ea4 100644 --- a/desmume/src/windows/filter/scanline.cpp +++ b/desmume/src/windows/filter/scanline.cpp @@ -4,12 +4,21 @@ #include typedef u64 uint64; + +extern CACHE_ALIGN u16 fadeOutColors[17][0x8000]; // stretches a single line inline void DoubleLine16( uint16 *lpDst, uint16 *lpSrc, unsigned int Width){ while(Width--){ *lpDst++ = *lpSrc; - *lpDst++ = *lpSrc++; + *lpDst++ = fadeOutColors[3][(*lpSrc++)]; + } +} + +inline void DoubleLine16_2( uint16 *lpDst, uint16 *lpSrc, unsigned int Width){ + while(Width--){ + *lpDst++ = fadeOutColors[3][(*lpSrc)]; + *lpDst++ = fadeOutColors[6][(*lpSrc++)]; } } @@ -28,7 +37,8 @@ void RenderScanline( SSurface Src, SSurface Dst) if(Src.Width != 512) for (H = 0; H < srcHeight; H++, lpSrc += srcPitch) DoubleLine16 (lpDst, lpSrc, Src.Width), lpDst += dstPitch, - memset (lpDst, 0, 512*2), lpDst += dstPitch; + DoubleLine16_2 (lpDst, lpSrc, Src.Width), lpDst += dstPitch; + //memset (lpDst, 0, 512*2), lpDst += dstPitch; else for (H = 0; H < srcHeight; H++, lpSrc += srcPitch) memcpy (lpDst, lpSrc, Src.Width << 1), lpDst += dstPitch,