diff --git a/desmume/src/MMU.cpp b/desmume/src/MMU.cpp index 4300ee5f5..b4e308d07 100644 --- a/desmume/src/MMU.cpp +++ b/desmume/src/MMU.cpp @@ -5643,16 +5643,6 @@ u16 FASTCALL _MMU_ARM7_read16(u32 adr) //since the arm7 polls this (and EXTKEYIN) every frame, we shouldnt count this as an input check //LagFrameFlag=0; break; - - case REG_EXTKEYIN: - { - //this is gross. we should generate this whole reg instead of poking it in ndssystem - u16 ret = MMU.ARM7_REG[0x136]; - if(nds.isTouch) - ret &= ~64; - else ret |= 64; - return ret; - } } return T1ReadWord_guaranteedAligned(MMU.MMU_MEM[ARMCPU_ARM7][adr>>20], adr & MMU.MMU_MASK[ARMCPU_ARM7][adr>>20]); } diff --git a/desmume/src/NDSSystem.cpp b/desmume/src/NDSSystem.cpp index e920511ca..727d9056b 100644 --- a/desmume/src/NDSSystem.cpp +++ b/desmume/src/NDSSystem.cpp @@ -2881,16 +2881,14 @@ static void NDS_applyFinalInput() countLid--; } - u16 padExt = ((input.buttons.X ? 0 : 0x80) >> 7) | - ((input.buttons.Y ? 0 : 0x80) >> 6) | - ((input.buttons.G ? 0 : 0x80) >> 4) | - ((LidClosed) << 7) | - 0x0034; - - padExt = LOCAL_TO_LE_16(padExt); - padExt |= (((u16 *)MMU.ARM7_REG)[0x136>>1] & 0x0070); + u16 padExt = (1<<2)|(1<<4)|(1<<5); + if(input.buttons.X) padExt |= 1<<0; + if(input.buttons.Y) padExt |= 1<<1; + if(input.buttons.G) padExt |= 1<<3; //debug button + if(!nds.isTouch) padExt |= 1<<6; //~touch + if(LidClosed) padExt |= 1<<7; - ((u16 *)MMU.ARM7_REG)[0x136>>1] = (u16)padExt; + ((u16 *)MMU.ARM7_REG)[0x136>>1] = padExt; InputDisplayString=MakeInputDisplayString(padExt, pad);