make EXTKEYIN register emulation more sensible, and possibly fix "0x04000134 activator" AR codes (due to the register formerly being readable only from 0x04000136 as a halfword)

This commit is contained in:
zeromus 2016-12-05 21:27:33 -06:00
parent bdf580036c
commit bcc7421be4
2 changed files with 7 additions and 19 deletions

View File

@ -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 //since the arm7 polls this (and EXTKEYIN) every frame, we shouldnt count this as an input check
//LagFrameFlag=0; //LagFrameFlag=0;
break; 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]); return T1ReadWord_guaranteedAligned(MMU.MMU_MEM[ARMCPU_ARM7][adr>>20], adr & MMU.MMU_MASK[ARMCPU_ARM7][adr>>20]);
} }

View File

@ -2881,16 +2881,14 @@ static void NDS_applyFinalInput()
countLid--; countLid--;
} }
u16 padExt = ((input.buttons.X ? 0 : 0x80) >> 7) | u16 padExt = (1<<2)|(1<<4)|(1<<5);
((input.buttons.Y ? 0 : 0x80) >> 6) | if(input.buttons.X) padExt |= 1<<0;
((input.buttons.G ? 0 : 0x80) >> 4) | if(input.buttons.Y) padExt |= 1<<1;
((LidClosed) << 7) | if(input.buttons.G) padExt |= 1<<3; //debug button
0x0034; if(!nds.isTouch) padExt |= 1<<6; //~touch
if(LidClosed) padExt |= 1<<7;
padExt = LOCAL_TO_LE_16(padExt); ((u16 *)MMU.ARM7_REG)[0x136>>1] = padExt;
padExt |= (((u16 *)MMU.ARM7_REG)[0x136>>1] & 0x0070);
((u16 *)MMU.ARM7_REG)[0x136>>1] = (u16)padExt;
InputDisplayString=MakeInputDisplayString(padExt, pad); InputDisplayString=MakeInputDisplayString(padExt, pad);