From e286d6389cd9524ef3ecc53cf69d39b0226815aa Mon Sep 17 00:00:00 2001 From: Connor McLaughlin Date: Sat, 5 Oct 2019 23:29:36 +1000 Subject: [PATCH] GPU: Flush rendering when drawing offset changes --- src/core/gpu.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/core/gpu.cpp b/src/core/gpu.cpp index cb9739308..1573756a5 100644 --- a/src/core/gpu.cpp +++ b/src/core/gpu.cpp @@ -482,9 +482,16 @@ void GPU::WriteGP0(u32 value) case 0xE5: // Set drawing offset { - m_drawing_offset.x = SignExtendN<11, u32>(param & UINT32_C(0x7FF)); - m_drawing_offset.y = SignExtendN<11, u32>((param >> 11) & UINT32_C(0x7FF)); + const s32 x = SignExtendN<11, s32>(param & UINT32_C(0x7FF)); + const s32 y = SignExtendN<11, s32>((param >> 11) & UINT32_C(0x7FF)); Log_DebugPrintf("Set drawing offset (%d, %d)", m_drawing_offset.x, m_drawing_offset.y); + if (m_drawing_offset.x != x || m_drawing_offset.y != y) + { + FlushRender(); + + m_drawing_offset.x = x; + m_drawing_offset.y = y; + } } break;