- Centralized NDS keypad update.

- Fixed X and Y keys.
This commit is contained in:
evilynux 2007-01-14 21:33:03 +00:00
parent ce213dde54
commit 4658a6cd2c
4 changed files with 11 additions and 15 deletions

View File

@ -36,8 +36,8 @@ const u16 Default_Joypad_Config[NB_KEYS] =
23, // Down -- End of cheating.
7, // R
6, // L
3, // Y
4, // X
3, // Y
-1, // BOOST
-1 // DEBUG
};
@ -107,11 +107,7 @@ int main(int argc, char ** argv) {
mouse.click = FALSE;
}
/* Update keypad */
((unsigned short *)ARM9Mem.ARM9_REG)[0x130>>1] = ~(keypad & 0x3FF);
((unsigned short *)MMU.ARM7_REG)[0x130>>1] = ~((keypad >> 10) & 0x3);
/* NDS_exec(1120380, FALSE); */
update_keypad(keypad); /* Update keypad */
last_cycle = NDS_exec((560190 << 1) - last_cycle, FALSE);
SPU_Emulate();
Draw();

View File

@ -53,7 +53,7 @@ gboolean on_wMainW_key_press_event (GtkWidget *widget, GdkEventKey *event, g
}
else if (Key != 0) {
Cur_Keypad |= Key;
if(desmume_running()) desmume_keypad(Cur_Keypad);
if(desmume_running()) update_keypad(Cur_Keypad);
}
return 1;
}
@ -62,7 +62,7 @@ gboolean on_wMainW_key_release_event (GtkWidget *widget, GdkEventKey *event, g
u16 Key = lookup_key(event->keyval);
if (Key != 0) {
Cur_Keypad &= ~Key;
if(desmume_running()) desmume_keypad(Cur_Keypad);
if(desmume_running()) update_keypad(Cur_Keypad);
}
return 1;
}
@ -255,7 +255,7 @@ const char * DESMUME_KEY_NAMES[DESMUME_NB_KEYS]={
"A", "B",
"Select", "Start",
"Right", "Left", "Up", "Down",
"R", "L", "Y", "X", "DEBUG", "Boost"
"R", "L", "X", "Y", "DEBUG", "Boost"
};
gint Keypad_Temp[DESMUME_NB_KEYS];
guint temp_Key=0;

View File

@ -74,8 +74,8 @@ const u16 Default_Joypad_Config[DESMUME_NB_KEYS] =
23, // Down -- End of cheating.
7, // R
6, // L
3, // Y
4, // X
3, // Y
-1, // DEBUG
-1 // BOOST
};
@ -92,8 +92,8 @@ const char *Ini_Keypad_Values[DESMUME_NB_KEYS] =
"KEY_DOWN",
"KEY_R",
"KEY_L",
"KEY_Y",
"KEY_X",
"KEY_Y",
"KEY_DEBUG",
"KEY_BOOST"
};
@ -110,8 +110,8 @@ const gint Default_Keypad_Config[DESMUME_NB_KEYS] =
GDK_Down,
GDK_KP_Decimal,
GDK_KP_0,
GDK_y,
GDK_x,
GDK_y,
GDK_p,
GDK_o
};

View File

@ -137,8 +137,8 @@ const u16 Default_Joypad_Config[DESMUME_NB_KEYS] =
23, // Down -- End of cheating.
7, // R
6, // L
3, // Y
4, // X
3, // Y
-1 // DEBUG
};
@ -421,7 +421,7 @@ static gint Key_Press(GtkWidget *w, GdkEventKey *e)
{
Key = DESMUME_KEYMASK_(i);
Cur_Keypad &= ~Key;
if(desmume_running()) desmume_keypad(~Cur_Keypad);
if(desmume_running()) update_keypad(~Cur_Keypad);
}
//fprintf(stderr,"P:%d(%d)->%X => [%X]\n", e->keyval, e->hardware_keycode, Key, Cur_Keypad);
@ -439,7 +439,7 @@ static gint Key_Release(GtkWidget *w, GdkEventKey *e)
{
Key = DESMUME_KEYMASK_(i);
Cur_Keypad |= Key;
if(desmume_running()) desmume_keypad(~Cur_Keypad);
if(desmume_running()) update_keypad(~Cur_Keypad);
}
//fprintf(stderr,"R:%d(%d)->%X => [%X]\n", e->keyval, e->hardware_keycode, Key, Cur_Keypad);