- add handling keypad interrupt (demo http://www.double.co.nz/nintendo_ds/nds_develop8.html)
This commit is contained in:
mtabachenko 2009-11-19 11:43:05 +00:00
parent 9ba8f348ee
commit 9e3ddf7fe7
1 changed files with 30 additions and 0 deletions

View File

@ -2964,6 +2964,36 @@ static void NDS_applyFinalInput()
((u16 *)MMU.ARM9_REG)[0x130>>1] = (u16)pad;
((u16 *)MMU.ARM7_REG)[0x130>>1] = (u16)pad;
u16 k_cnt = ((u16 *)MMU.ARM9_REG)[0x132>>1];
if ( k_cnt & (1<<14))
{
//INFO("ARM9: KeyPad IRQ (pad 0x%04X, cnt 0x%04X (condition %s))\n", pad, k_cnt, k_cnt&(1<<15)?"AND":"OR");
u16 k_cnt_selected = (k_cnt & 0x3F);
if (k_cnt&(1<<15)) // AND
{
if ((~pad & k_cnt_selected) == k_cnt_selected) NDS_makeARM9Int(12);
}
else // OR
{
if (~pad & k_cnt_selected) NDS_makeARM9Int(12);
}
}
k_cnt = ((u16 *)MMU.ARM7_REG)[0x132>>1];
if ( k_cnt & (1<<14))
{
//INFO("ARM7: KeyPad IRQ (pad 0x%04X, cnt 0x%04X (condition %s))\n", pad, k_cnt, k_cnt&(1<<15)?"AND":"OR");
u16 k_cnt_selected = (k_cnt & 0x3F);
if (k_cnt&(1<<15)) // AND
{
if ((~pad & k_cnt_selected) == k_cnt_selected) NDS_makeARM7Int(12);
}
else // OR
{
if (~pad & k_cnt_selected) NDS_makeARM7Int(12);
}
}
if(input.touch.isTouch)
{