From e12c68cf65be9972872d31ff1e07b1d2910653d1 Mon Sep 17 00:00:00 2001 From: Albert Liu <45282415+ggrtk@users.noreply.github.com> Date: Thu, 26 Nov 2020 23:58:06 -0800 Subject: [PATCH] GPU/SW: Fix 16-bit wraparound output crashing --- src/core/gpu_sw.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/core/gpu_sw.cpp b/src/core/gpu_sw.cpp index 5a69c1cb8..a92007a06 100644 --- a/src/core/gpu_sw.cpp +++ b/src/core/gpu_sw.cpp @@ -282,12 +282,12 @@ void GPU_SW::CopyOut15Bit(u32 src_x, u32 src_y, u32 width, u32 height, u32 field { const u16* src_row_ptr = &m_vram_ptr[(src_y % VRAM_HEIGHT) * VRAM_WIDTH]; OutputPixelType* dst_row_ptr = reinterpret_cast(dst_ptr); + for (u32 col = src_x; col < end_x; col++) - { *(dst_row_ptr++) = VRAM16ToOutput(src_row_ptr[col % VRAM_WIDTH]); - src_y += (1 << interleaved_shift); - dst_ptr += dst_stride; - } + + src_y += (1 << interleaved_shift); + dst_ptr += dst_stride; } }