Commited anonymous patch for incorrect x/y buttons on gtk port.

This commit is contained in:
yabause 2007-01-07 01:01:24 +00:00
parent 9964b5ad3e
commit 939b5e7a5b
3 changed files with 10 additions and 9 deletions

View File

@ -61,7 +61,8 @@ void desmume_keypad(u16 k)
{ {
unsigned short k_ext = (k >> 10) & 0x3; unsigned short k_ext = (k >> 10) & 0x3;
unsigned short k_pad = k & 0x3FF; unsigned short k_pad = k & 0x3FF;
((unsigned short *)ARM9Mem.ARM9_REG)[0x130>>1] = ~k_pad; ((unsigned short *)ARM9Mem.ARM9_REG)[0x130>>1] = k_pad;
((unsigned short *)MMU.ARM7_REG)[0x130>>1] = ~k_ext; ((unsigned short *)MMU.ARM7_REG)[0x130>>1] = k_pad;
MMU.ARM7_REG[0x136] = (k_ext & 0x3) | (MMU.ARM7_REG[0x136] & ~0x3);
} }

View File

@ -18,8 +18,8 @@
#define DESMUME_KEY_R 9 #define DESMUME_KEY_R 9
#define DESMUME_KEY_L 10 #define DESMUME_KEY_L 10
#define DESMUME_KEY_Y 11 #define DESMUME_KEY_X 11
#define DESMUME_KEY_X 12 #define DESMUME_KEY_Y 12
#define DESMUME_KEY_DEBUG 13 #define DESMUME_KEY_DEBUG 13
extern void desmume_init(); extern void desmume_init();

View File

@ -57,8 +57,8 @@ const char *Ini_Keypad_Values[DESMUME_NB_KEYS] =
"KEY_DOWN", "KEY_DOWN",
"KEY_R", "KEY_R",
"KEY_L", "KEY_L",
"KEY_Y",
"KEY_X", "KEY_X",
"KEY_Y",
"KEY_DEBUG", "KEY_DEBUG",
}; };
@ -137,8 +137,8 @@ const gint Default_Keypad_Config[DESMUME_NB_KEYS] =
65364, 65364,
65454, // numeric . 65454, // numeric .
65456, // numeric 0 65456, // numeric 0
121, // y
120, // x 120, // x
121, // y
112 112
}; };
@ -407,7 +407,7 @@ static gboolean Stylus_Release(GtkWidget *w, GdkEventButton *e, gpointer data)
return TRUE; return TRUE;
} }
static u16 Cur_Keypad = 0; static u16 Cur_Keypad = 0x00FFF;
static gint Key_Press(GtkWidget *w, GdkEventKey *e) static gint Key_Press(GtkWidget *w, GdkEventKey *e)
{ {
@ -420,7 +420,7 @@ static gint Key_Press(GtkWidget *w, GdkEventKey *e)
if(i < DESMUME_NB_KEYS) if(i < DESMUME_NB_KEYS)
{ {
Key = DESMUME_KEYMASK_(i); Key = DESMUME_KEYMASK_(i);
Cur_Keypad |= Key; Cur_Keypad &= ~Key;
if(desmume_running()) desmume_keypad(Cur_Keypad); if(desmume_running()) desmume_keypad(Cur_Keypad);
} }
@ -438,7 +438,7 @@ static gint Key_Release(GtkWidget *w, GdkEventKey *e)
if(i < DESMUME_NB_KEYS) if(i < DESMUME_NB_KEYS)
{ {
Key = DESMUME_KEYMASK_(i); Key = DESMUME_KEYMASK_(i);
Cur_Keypad &= ~Key; Cur_Keypad |= Key;
if(desmume_running()) desmume_keypad(Cur_Keypad); if(desmume_running()) desmume_keypad(Cur_Keypad);
} }