notaz.gp2x.de
/
gpsp.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
move platform-independent stuff out of /gp2x.
[gpsp.git]
/
input.c
diff --git
a/input.c
b/input.c
index
be00c60
..
94c561d
100644
(file)
--- a/
input.c
+++ b/
input.c
@@
-364,10
+364,10
@@
u32 gamepad_config_map[16] =
BUTTON_ID_SELECT, // Select
BUTTON_ID_L, // Ltrigger
BUTTON_ID_R, // Rtrigger
BUTTON_ID_SELECT, // Select
BUTTON_ID_L, // Ltrigger
BUTTON_ID_R, // Rtrigger
- BUTTON_ID_
NONE,
// A
+ BUTTON_ID_
FPS,
// A
BUTTON_ID_A, // B
BUTTON_ID_B, // X
BUTTON_ID_A, // B
BUTTON_ID_B, // X
- BUTTON_ID_
NONE
, // Y
+ BUTTON_ID_
MENU
, // Y
BUTTON_ID_VOLDOWN, // Vol down
BUTTON_ID_VOLUP, // Vol up
BUTTON_ID_FPS, // Push
BUTTON_ID_VOLDOWN, // Vol down
BUTTON_ID_VOLUP, // Vol up
BUTTON_ID_FPS, // Push
@@
-375,23
+375,7
@@
u32 gamepad_config_map[16] =
};
extern u32 gp2x_fps_debug;
};
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()
{
gui_action_type get_gui_input()
{
@@
-428,6
+412,12
@@
gui_action_type get_gui_input()
if(new_buttons & GP2X_RIGHT)
new_button = CURSOR_RIGHT;
if(new_buttons & GP2X_RIGHT)
new_button = CURSOR_RIGHT;
+ if(new_buttons & GP2X_L)
+ new_button = CURSOR_L;
+
+ if(new_buttons & GP2X_R)
+ new_button = CURSOR_R;
+
if(new_button != CURSOR_NONE)
{
if(new_button != CURSOR_NONE)
{
@@
-513,7
+503,7
@@
u32 update_input()
{
static u32 rapidfire_flag = 1;
static u32 last_buttons;
{
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();
u32 button_id;
u32 new_key = 0;
u32 buttons = gpsp_gp2x_joystick_read();
@@
-525,12
+515,19
@@
u32 update_input()
buttons |= GP2X_VOL_MIDDLE;
}
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++)
{
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;
button_id = gamepad_config_map[i];
else
button_id = BUTTON_ID_NONE;