X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=input.c;h=cfaff69d1ae2c636b93c457483a673b77c7edd99;hb=4cdfc0bc7b3dd2051b8027da4e2f35bbb9897307;hp=be00c60e5911c94917a31e644497c402c5e07019;hpb=2823a4c8196a02da86ee180cf55586d4e8c91a2f;p=gpsp.git diff --git a/input.c b/input.c index be00c60..cfaff69 100644 --- a/input.c +++ b/input.c @@ -375,23 +375,7 @@ u32 gamepad_config_map[16] = }; extern u32 gp2x_fps_debug; - -u32 gpsp_gp2x_joystick_read(void) -{ - u32 value = (gpsp_gp2x_memregs[0x1198 >> 1] & 0x00FF); - - if(value == 0xFD) - value = 0xFA; - if(value == 0xF7) - value = 0xEB; - if(value == 0xDF) - value = 0xAF; - if(value == 0x7F) - value = 0xBE; - - return ~((gpsp_gp2x_memregs[0x1184 >> 1] & 0xFF00) | value | - (gpsp_gp2x_memregs[0x1186 >> 1] << 16)); -} +extern u32 gpsp_gp2x_joystick_read(void); gui_action_type get_gui_input() { @@ -513,7 +497,7 @@ u32 update_input() { static u32 rapidfire_flag = 1; static u32 last_buttons; - u32 non_repeat_buttons; + u32 handled_buttons; u32 button_id; u32 new_key = 0; u32 buttons = gpsp_gp2x_joystick_read(); @@ -525,12 +509,19 @@ u32 update_input() buttons |= GP2X_VOL_MIDDLE; } - non_repeat_buttons = (last_buttons ^ buttons) & buttons; + /* for Wiz */ + if((buttons & GP2X_VOL_DOWN) && (buttons & GP2X_SELECT)) + { + buttons &= ~(GP2X_VOL_DOWN | GP2X_SELECT); + buttons |= GP2X_VOL_MIDDLE; + } + + handled_buttons = ((last_buttons ^ buttons) | GP2X_VOL_DOWN | GP2X_VOL_UP) & buttons; last_buttons = buttons; for(i = 0; i < 16; i++) { - if(non_repeat_buttons & button_gp2x_mask_to_config[i]) + if(handled_buttons & button_gp2x_mask_to_config[i]) button_id = gamepad_config_map[i]; else button_id = BUTTON_ID_NONE;