From 34ec6bb98534a9bbb4b56c6cae2393ba867a5770 Mon Sep 17 00:00:00 2001 From: rogerman Date: Wed, 2 Mar 2016 21:01:00 +0000 Subject: [PATCH] =?UTF-8?q?MMU:=20-=20HACK:=20Drop=20the=20acknowledgment?= =?UTF-8?q?=20bits=20when=20writing=20the=20DISP3DCNT=20register.=20Fixes?= =?UTF-8?q?=20the=20title=20screen=20in=20=E2=80=9CPlanet=20Rescue:=20Anim?= =?UTF-8?q?al=20Emergency=E2=80=9D.=20(Regression=20from=20r5259.=20Fixes?= =?UTF-8?q?=20bug=20#1538.)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- desmume/src/MMU.cpp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/desmume/src/MMU.cpp b/desmume/src/MMU.cpp index f86bcc7f4..d1bf36714 100644 --- a/desmume/src/MMU.cpp +++ b/desmume/src/MMU.cpp @@ -3384,7 +3384,9 @@ void FASTCALL _MMU_ARM9_write08(u32 adr, u8 val) ParseReg_DISP3DCNT(); return; case REG_DISPA_DISP3DCNT+1: - T1WriteByte(MMU.ARM9_REG, 0x0061, val); + // TODO: We need to handle acknowledgement flags properly. But for now, just drop the bits. + // Test case: The "Planet Rescue: Animal Emergency" title screen will check these flags. + T1WriteByte(MMU.ARM9_REG, 0x0061, val & 0xCF); ParseReg_DISP3DCNT(); return; @@ -3876,7 +3878,9 @@ void FASTCALL _MMU_ARM9_write16(u32 adr, u16 val) return; case REG_DISPA_DISP3DCNT: - T1WriteLong(MMU.ARM9_REG, 0x0060, val); + // TODO: We need to handle acknowledgement flags properly. But for now, just drop the bits. + // Test case: The "Planet Rescue: Animal Emergency" title screen will check these flags. + T1WriteWord(MMU.ARM9_REG, 0x0060, val & 0xCFFF); ParseReg_DISP3DCNT(); return; @@ -4439,7 +4443,9 @@ void FASTCALL _MMU_ARM9_write32(u32 adr, u32 val) return; case REG_DISPA_DISP3DCNT: - T1WriteLong(MMU.ARM9_REG, 0x0060, val); + // TODO: We need to handle acknowledgement flags properly. But for now, just drop the bits. + // Test case: The "Planet Rescue: Animal Emergency" title screen will check these flags. + T1WriteLong(MMU.ARM9_REG, 0x0060, val & 0xFFFFCFFF); ParseReg_DISP3DCNT(); return;