From 3cf5ec430adfcd027f86bf0e39a2a2ec7f55977e Mon Sep 17 00:00:00 2001 From: zeromus Date: Tue, 9 Jun 2009 23:14:26 +0000 Subject: [PATCH] fix a certain pattern of ipc register writes which was breaking devkitpro touch input --- desmume/src/MMU.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/desmume/src/MMU.cpp b/desmume/src/MMU.cpp index ab7bf6cdf..0c9ea35f2 100644 --- a/desmume/src/MMU.cpp +++ b/desmume/src/MMU.cpp @@ -1302,13 +1302,15 @@ static INLINE void MMU_IPCSync(u8 proc, u32 val) u32 sync_l = T1ReadLong(MMU.MMU_MEM[proc][0x40], 0x180) & 0xFFFF; u32 sync_r = T1ReadLong(MMU.MMU_MEM[proc^1][0x40], 0x180) & 0xFFFF; - sync_l = ( sync_l & 0x600F ) | ( val & 0x0F00 ); + sync_l = ( sync_l & 0x000F ) | ( val & 0x0F00 ); sync_r = ( sync_r & 0x6F00 ) | ( (val >> 8) & 0x000F ); + sync_l |= val & 0x6000; + T1WriteLong(MMU.MMU_MEM[proc][0x40], 0x180, sync_l); T1WriteLong(MMU.MMU_MEM[proc^1][0x40], 0x180, sync_r); - if ((val & 0x2000) && (sync_r & 0x4000)) + if ((sync_l & 0x2000) && (sync_r & 0x4000)) setIF(proc^1, ( 1 << 16 )); }