From 80e807c6da0fc1b070aa4fc56ca9d23c5358f342 Mon Sep 17 00:00:00 2001 From: zeromus Date: Wed, 14 Apr 2010 06:12:19 +0000 Subject: [PATCH] return Z1 and Z2 from TSC (fix scummvm mouse); and fix a creepy looking bug with IME setting in swi intrWaitARM --- desmume/src/MMU.cpp | 13 ++++++++----- desmume/src/bios.cpp | 1 + 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/desmume/src/MMU.cpp b/desmume/src/MMU.cpp index d2051a19c..bf111e5cb 100644 --- a/desmume/src/MMU.cpp +++ b/desmume/src/MMU.cpp @@ -3897,13 +3897,16 @@ void FASTCALL _MMU_ARM7_write16(u32 adr, u16 val) case 0x20 : val = 0; break; - case 0x30 : - val = 0; + case 0x30: //Z1 + //used for pressure calculation - must be nonzero or else some softwares will think the stylus is up. + if(nds.isTouch) val = 2048; + else val = 0; break; - case 0x40 : - val = 0; + case 0x40: //Z2 + //used for pressure calculation. we dont support pressure calculation so just return something. + val = 2048; break; - case 0x50 : + case 0x50: if(spicnt & 0x800) { if(partie) diff --git a/desmume/src/bios.cpp b/desmume/src/bios.cpp index f37af78ab..a20dccead 100644 --- a/desmume/src/bios.cpp +++ b/desmume/src/bios.cpp @@ -256,6 +256,7 @@ TEMPLATE u32 intrWaitARM() //if(!noDiscard) // intrFlag &= cpu->newIrqFlags; + MMU.reg_IME[PROCNUM] = 1; _MMU_write32(0x04000208, 1); // set IME=1 if (intrFlag)