From 8530c099bca52e95a3ee5da12c43fc57b944bf5e Mon Sep 17 00:00:00 2001 From: Arisotura Date: Thu, 10 Dec 2020 19:34:31 +0100 Subject: GPU: make sure to always pass BG0HOFS to the 3D engine, even if the 2D engine is disabled. --- src/GPU2D.cpp | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) (limited to 'src') diff --git a/src/GPU2D.cpp b/src/GPU2D.cpp index eb160d8..fa05e79 100644 --- a/src/GPU2D.cpp +++ b/src/GPU2D.cpp @@ -288,6 +288,13 @@ void GPU2D::Write8(u32 addr, u8 val) DispCnt = (DispCnt & 0x00FFFFFF) | (val << 24); if (Num) DispCnt &= 0xC0B1FFF7; return; + + case 0x10: + if (!Num) GPU3D::SetRenderXPos((GPU3D::RenderXPos & 0xFF00) | val); + break; + case 0x11: + if (!Num) GPU3D::SetRenderXPos((GPU3D::RenderXPos & 0x00FF) | (val << 8)); + break; } if (!Enabled) return; @@ -303,14 +310,8 @@ void GPU2D::Write8(u32 addr, u8 val) case 0x00E: BGCnt[3] = (BGCnt[3] & 0xFF00) | val; return; case 0x00F: BGCnt[3] = (BGCnt[3] & 0x00FF) | (val << 8); return; - case 0x010: - BGXPos[0] = (BGXPos[0] & 0xFF00) | val; - if (Num == 0) GPU3D::SetRenderXPos(BGXPos[0]); - return; - case 0x011: - BGXPos[0] = (BGXPos[0] & 0x00FF) | (val << 8); - if (Num == 0) GPU3D::SetRenderXPos(BGXPos[0]); - return; + case 0x010: BGXPos[0] = (BGXPos[0] & 0xFF00) | val; return; + case 0x011: BGXPos[0] = (BGXPos[0] & 0x00FF) | (val << 8); return; case 0x012: BGYPos[0] = (BGYPos[0] & 0xFF00) | val; return; case 0x013: BGYPos[0] = (BGYPos[0] & 0x00FF) | (val << 8); return; case 0x014: BGXPos[1] = (BGXPos[1] & 0xFF00) | val; return; @@ -386,6 +387,10 @@ void GPU2D::Write16(u32 addr, u16 val) if (Num) DispCnt &= 0xC0B1FFF7; return; + case 0x010: + if (!Num) GPU3D::SetRenderXPos(val); + break; + case 0x068: DispFIFO[DispFIFOWritePtr] = val; return; @@ -407,10 +412,7 @@ void GPU2D::Write16(u32 addr, u16 val) case 0x00C: BGCnt[2] = val; return; case 0x00E: BGCnt[3] = val; return; - case 0x010: - BGXPos[0] = val; - if (Num == 0) GPU3D::SetRenderXPos(BGXPos[0]); - return; + case 0x010: BGXPos[0] = val; return; case 0x012: BGYPos[0] = val; return; case 0x014: BGXPos[1] = val; return; case 0x016: BGYPos[1] = val; return; -- cgit v1.2.3