mirror of
https://github.com/libretro/RetroArch
synced 2025-01-29 18:32:44 +00:00
(PSP1/PSP2) Refactor psp_input.c - should now work for both PSP1
and PSP2
This commit is contained in:
parent
e85d3ae995
commit
3b6fffa9f9
@ -66,7 +66,7 @@ enum
|
||||
INPUT_X,
|
||||
INPUT_DINPUT,
|
||||
INPUT_PS3,
|
||||
INPUT_PSP2,
|
||||
INPUT_PSP,
|
||||
INPUT_XENON360,
|
||||
INPUT_WII,
|
||||
INPUT_XINPUT,
|
||||
@ -146,8 +146,8 @@ enum
|
||||
#define INPUT_DEFAULT_DRIVER INPUT_SDL
|
||||
#elif defined(__CELLOS_LV2__)
|
||||
#define INPUT_DEFAULT_DRIVER INPUT_PS3
|
||||
#elif defined(SN_TARGET_PSP2)
|
||||
#define INPUT_DEFAULT_DRIVER INPUT_PSP2
|
||||
#elif defined(SN_TARGET_PSP2) || defined(PSP)
|
||||
#define INPUT_DEFAULT_DRIVER INPUT_PSP
|
||||
#elif defined(GEKKO)
|
||||
#define INPUT_DEFAULT_DRIVER INPUT_WII
|
||||
#elif defined(HAVE_XVIDEO)
|
||||
|
@ -205,8 +205,8 @@ INPUT
|
||||
============================================================ */
|
||||
#if defined(__CELLOS_LV2__)
|
||||
#include "../../ps3/ps3_input.c"
|
||||
#elif defined(SN_TARGET_PSP2)
|
||||
#include "../../psp2/psp2_input.c"
|
||||
#elif defined(SN_TARGET_PSP2) || defined(PSP)
|
||||
#include "../../psp/psp_input.c"
|
||||
#elif defined(GEKKO)
|
||||
#include "../../gx/gx_input.c"
|
||||
#elif defined(_XBOX)
|
||||
|
4
driver.c
4
driver.c
@ -123,8 +123,8 @@ static const input_driver_t *input_drivers[] = {
|
||||
#ifdef __CELLOS_LV2__
|
||||
&input_ps3,
|
||||
#endif
|
||||
#ifdef SN_TARGET_PSP2
|
||||
&input_psp2,
|
||||
#if defined(SN_TARGET_PSP2) || defined(PSP)
|
||||
&input_psp,
|
||||
#endif
|
||||
#ifdef HAVE_SDL
|
||||
&input_sdl,
|
||||
|
2
driver.h
2
driver.h
@ -305,7 +305,7 @@ extern const input_driver_t input_sdl;
|
||||
extern const input_driver_t input_dinput;
|
||||
extern const input_driver_t input_x;
|
||||
extern const input_driver_t input_ps3;
|
||||
extern const input_driver_t input_psp2;
|
||||
extern const input_driver_t input_psp;
|
||||
extern const input_driver_t input_xenon360;
|
||||
extern const input_driver_t input_gx;
|
||||
extern const input_driver_t input_xinput;
|
||||
|
144
psp/psp_input.c
Normal file
144
psp/psp_input.c
Normal file
@ -0,0 +1,144 @@
|
||||
/* RetroArch - A frontend for libretro.
|
||||
* Copyright (C) 2010-2012 - Hans-Kristian Arntzen
|
||||
* Copyright (C) 2011-2012 - Daniel De Matteis
|
||||
*
|
||||
* RetroArch is free software: you can redistribute it and/or modify it under the terms
|
||||
* of the GNU General Public License as published by the Free Software Found-
|
||||
* ation, either version 3 of the License, or (at your option) any later version.
|
||||
*
|
||||
* RetroArch is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
||||
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
|
||||
* PURPOSE. See the GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along with RetroArch.
|
||||
* If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#if defined(SN_TARGET_PSP2)
|
||||
#include <sceerror.h>
|
||||
#include <kernel.h>
|
||||
#include <ctrl.h>
|
||||
#elif defined(PSP)
|
||||
#include <pspctrl.h>
|
||||
#endif
|
||||
|
||||
#include "psp_input.h"
|
||||
|
||||
#include "../driver.h"
|
||||
#include "../libretro.h"
|
||||
#include "../general.h"
|
||||
|
||||
#define ANALOGSTICK_DEADZONE_LOW (0x40)
|
||||
#define ANALOGSTICK_DEADZONE_HIGH (0xc0)
|
||||
|
||||
static uint64_t state;
|
||||
|
||||
static void psp_input_poll(void *data)
|
||||
{
|
||||
(void)data;
|
||||
|
||||
SceCtrlData state_tmp;
|
||||
int ret = sceCtrlReadBufferPositive(0, &state_tmp, 1);
|
||||
|
||||
if (ret == SCE_OK)
|
||||
{
|
||||
state = 0;
|
||||
state |= (STATE_BUTTON(state_tmp) & PSP_CTRL_LEFT) ? PSP_GAMEPAD_DPAD_LEFT : 0;
|
||||
state |= (STATE_BUTTON(state_tmp) & PSP_CTRL_DOWN) ? PSP_GAMEPAD_DPAD_DOWN : 0;
|
||||
state |= (STATE_BUTTON(state_tmp) & PSP_CTRL_RIGHT) ? PSP_GAMEPAD_DPAD_RIGHT : 0;
|
||||
state |= (STATE_BUTTON(state_tmp) & PSP_CTRL_UP) ? PSP_GAMEPAD_DPAD_UP : 0;
|
||||
state |= (STATE_BUTTON(state_tmp) & PSP_CTRL_START) ? PSP_GAMEPAD_START : 0;
|
||||
state |= (STATE_BUTTON(state_tmp) & PSP_CTRL_SELECT) ? PSP_GAMEPAD_SELECT : 0;
|
||||
state |= (STATE_BUTTON(state_tmp) & PSP_CTRL_TRIANGLE) ? PSP_GAMEPAD_TRIANGLE : 0;
|
||||
state |= (STATE_BUTTON(state_tmp) & PSP_CTRL_SQUARE) ? PSP_GAMEPAD_SQUARE : 0;
|
||||
state |= (STATE_BUTTON(state_tmp) & PSP_CTRL_CROSS) ? PSP_GAMEPAD_CROSS : 0;
|
||||
state |= (STATE_BUTTON(state_tmp) & PSP_CTRL_CIRCLE) ? PSP_GAMEPAD_CIRCLE : 0;
|
||||
state |= (STATE_BUTTON(state_tmp) & PSP_CTRL_R) ? PSP_GAMEPAD_R : 0;
|
||||
state |= (STATE_BUTTON(state_tmp) & PSP_CTRL_L) ? PSP_GAMEPAD_L : 0;
|
||||
state |= (STATE_ANALOGLX(state_tmp) < ANALOGSTICK_DEADZONE_LOW) ? PSP_GAMEPAD_LSTICK_LEFT_MASK : 0;
|
||||
state |= (STATE_ANALOGLX(state_tmp) > ANALOGSTICK_DEADZONE_HIGH) ? PSP_GAMEPAD_LSTICK_RIGHT_MASK : 0;
|
||||
state |= (STATE_ANALOGLY(state_tmp) < ANALOGSTICK_DEADZONE_LOW) ? PSP_GAMEPAD_LSTICK_UP_MASK : 0;
|
||||
state |= (STATE_ANALOGLY(state_tmp) > ANALOGSTICK_DEADZONE_HIGH) ? PSP_GAMEPAD_LSTICK_DOWN_MASK : 0;
|
||||
#ifdef SN_TARGET_PSP2
|
||||
state |= (STATE_ANALOGRX(state_tmp) < ANALOGSTICK_DEADZONE_LOW) ? PSP_GAMEPAD_RSTICK_LEFT_MASK : 0;
|
||||
state |= (STATE_ANALOGRX(state_tmp) > ANALOGSTICK_DEADZONE_HIGH) ? PSP_GAMEPAD_RSTICK_RIGHT_MASK : 0;
|
||||
state |= (STATE_ANALOGRY(state_tmp) < ANALOGSTICK_DEADZONE_LOW) ? PSP_GAMEPAD_RSTICK_UP_MASK : 0;
|
||||
state |= (STATE_ANALOGRY(state_tmp) > ANALOGSTICK_DEADZONE_HIGH) ? PSP_GAMEPAD_RSTICK_DOWN_MASK : 0;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
static int16_t psp_input_state(void *data, const struct retro_keybind **binds,
|
||||
unsigned port, unsigned device,
|
||||
unsigned index, unsigned id)
|
||||
{
|
||||
(void)data;
|
||||
|
||||
uint64_t button = binds[0][id].joykey;
|
||||
int16_t retval = 0;
|
||||
|
||||
switch (device)
|
||||
{
|
||||
case RETRO_DEVICE_JOYPAD:
|
||||
retval = (state & button) ? 1 : 0;
|
||||
break;
|
||||
}
|
||||
|
||||
return retval;
|
||||
}
|
||||
|
||||
static void psp_input_set_analog_dpad_mapping(unsigned device, unsigned map_dpad_enum, unsigned controller_id)
|
||||
{
|
||||
(void)device;
|
||||
}
|
||||
|
||||
static void psp_free_input(void *data)
|
||||
{
|
||||
(void)data;
|
||||
}
|
||||
|
||||
static void* psp_input_initialize(void)
|
||||
{
|
||||
#ifdef PSP
|
||||
sceCtrlSetSamplingCycle(0);
|
||||
#endif
|
||||
sceCtrlSetSamplingMode(DEFAULT_SAMPLING_MODE);
|
||||
return (void*)-1;
|
||||
}
|
||||
|
||||
static void psp_input_post_init(void)
|
||||
{
|
||||
}
|
||||
|
||||
static bool psp_key_pressed(void *data, int key)
|
||||
{
|
||||
(void)data;
|
||||
|
||||
switch (key)
|
||||
{
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
static void psp_set_default_keybind_lut(unsigned device, unsigned port)
|
||||
{
|
||||
(void)device;
|
||||
(void)port;
|
||||
}
|
||||
|
||||
const input_driver_t input_psp = {
|
||||
.init = psp_input_initialize,
|
||||
.poll = psp_input_poll,
|
||||
.input_state = psp_input_state,
|
||||
.key_pressed = psp_key_pressed,
|
||||
.free = psp_free_input,
|
||||
.set_default_keybind_lut = psp_set_default_keybind_lut,
|
||||
.set_analog_dpad_mapping = psp_input_set_analog_dpad_mapping,
|
||||
.post_init = psp_input_post_init,
|
||||
.max_pads = MAX_PADS,
|
||||
.ident = "psp",
|
||||
};
|
79
psp/psp_input.h
Normal file
79
psp/psp_input.h
Normal file
@ -0,0 +1,79 @@
|
||||
/* RetroArch - A frontend for libretro.
|
||||
* Copyright (C) 2010-2012 - Hans-Kristian Arntzen
|
||||
* Copyright (C) 2011-2012 - Daniel De Matteis
|
||||
*
|
||||
* RetroArch is free software: you can redistribute it and/or modify it under the terms
|
||||
* of the GNU General Public License as published by the Free Software Found-
|
||||
* ation, either version 3 of the License, or (at your option) any later version.
|
||||
*
|
||||
* RetroArch is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
||||
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
|
||||
* PURPOSE. See the GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along with RetroArch.
|
||||
* If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef _PSP_INPUT_H_
|
||||
#define _PSP_INPUT_H_
|
||||
|
||||
enum {
|
||||
PSP_GAMEPAD_CROSS = 1 << 0,
|
||||
PSP_GAMEPAD_SQUARE = 1 << 1,
|
||||
PSP_GAMEPAD_SELECT = 1 << 2,
|
||||
PSP_GAMEPAD_START = 1 << 3,
|
||||
PSP_GAMEPAD_DPAD_UP = 1 << 4,
|
||||
PSP_GAMEPAD_DPAD_DOWN = 1 << 5,
|
||||
PSP_GAMEPAD_DPAD_LEFT = 1 << 6,
|
||||
PSP_GAMEPAD_DPAD_RIGHT = 1 << 7,
|
||||
PSP_GAMEPAD_CIRCLE = 1 << 8,
|
||||
PSP_GAMEPAD_TRIANGLE = 1 << 9,
|
||||
PSP_GAMEPAD_L = 1 << 10,
|
||||
PSP_GAMEPAD_R = 1 << 11,
|
||||
PSP_GAMEPAD_LSTICK_LEFT_MASK = 1 << 16,
|
||||
PSP_GAMEPAD_LSTICK_RIGHT_MASK = 1 << 17,
|
||||
PSP_GAMEPAD_LSTICK_UP_MASK = 1 << 18,
|
||||
PSP_GAMEPAD_LSTICK_DOWN_MASK = 1 << 19,
|
||||
#ifdef SN_TARGET_PSP2
|
||||
PSP_GAMEPAD_RSTICK_LEFT_MASK = 1 << 20,
|
||||
PSP_GAMEPAD_RSTICK_RIGHT_MASK = 1 << 21,
|
||||
PSP_GAMEPAD_RSTICK_UP_MASK = 1 << 22,
|
||||
PSP_GAMEPAD_RSTICK_DOWN_MASK = 1 << 23,
|
||||
#endif
|
||||
};
|
||||
|
||||
#ifdef SN_TARGET_PSP2
|
||||
#define STATE_BUTTON(state) ((state).buttons)
|
||||
#define STATE_ANALOGLX(state) ((state).lx)
|
||||
#define STATE_ANALOGLY(state) ((state).ly)
|
||||
#define STATE_ANALOGRX(state) ((state).rx)
|
||||
#define STATE_ANALOGRY(state) ((state).ry)
|
||||
#define DEFAULT_SAMPLING_MODE (SCE_CTRL_MODE_DIGITALANALOG)
|
||||
|
||||
#define PSP_CTRL_LEFT SCE_CTRL_LEFT
|
||||
#define PSP_CTRL_DOWN SCE_CTRL_DOWN
|
||||
#define PSP_CTRL_RIGHT SCE_CTRL_RIGHT
|
||||
#define PSP_CTRL_UP SCE_CTRL_UP
|
||||
#define PSP_CTRL_START SCE_CTRL_START
|
||||
#define PSP_CTRL_SELECT SCE_CTRL_SELECT
|
||||
#define PSP_CTRL_TRIANGLE SCE_CTRL_TRIANGLE
|
||||
#define PSP_CTRL_SQUARE SCE_CTRL_SQUARE
|
||||
#define PSP_CTRL_CROSS SCE_CTRL_CROSS
|
||||
#define PSP_CTRL_CIRCLE SCE_CTRL_CIRCLE
|
||||
#define PSP_CTRL_L SCE_CTRL_L
|
||||
#define PSP_CTRL_R SCE_CTRL_R
|
||||
|
||||
#define sceCtrlReadBufferPositive(port, pad_data, bufs) sceCtrlReadBufferPositive(port, pad_data, bufs)
|
||||
#else
|
||||
#define STATE_BUTTON(state) ((state).Buttons)
|
||||
#define STATE_ANALOGLX(state) ((state).Lx)
|
||||
#define STATE_ANALOGLX(state) ((state).Ly)
|
||||
#define STATE_ANALOGRX(state) ((state).Rx)
|
||||
#define STATE_ANALOGRY(state) ((state).Ry)
|
||||
|
||||
#define DEFAULT_SAMPLING_MODE (PSP_CTRL_MODE_ANALOG)
|
||||
|
||||
#define sceCtrlReadBufferPositive(port, pad_data, bufs) sceCtrlReadBufferPositive(pad_data, bufs)
|
||||
#endif
|
||||
|
||||
#endif
|
@ -1,140 +0,0 @@
|
||||
/* RetroArch - A frontend for libretro.
|
||||
* Copyright (C) 2010-2012 - Hans-Kristian Arntzen
|
||||
* Copyright (C) 2011-2012 - Daniel De Matteis
|
||||
*
|
||||
* RetroArch is free software: you can redistribute it and/or modify it under the terms
|
||||
* of the GNU General Public License as published by the Free Software Found-
|
||||
* ation, either version 3 of the License, or (at your option) any later version.
|
||||
*
|
||||
* RetroArch is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
||||
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
|
||||
* PURPOSE. See the GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along with RetroArch.
|
||||
* If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#include <sceerror.h>
|
||||
#include <kernel.h>
|
||||
#include <ctrl.h>
|
||||
|
||||
#include "../driver.h"
|
||||
#include "../libretro.h"
|
||||
#include "../general.h"
|
||||
|
||||
#define ANALOGSTICK_DEADZONE_LOW (0x40)
|
||||
#define ANALOGSTICK_DEADZONE_HIGH (0xc0
|
||||
|
||||
static uint64_t state;
|
||||
|
||||
static void psp2_input_poll(void *data)
|
||||
{
|
||||
CellPadInfo2 pad_info;
|
||||
(void)data;
|
||||
|
||||
for (unsigned i = 0; i < MAX_PADS; i++)
|
||||
{
|
||||
SceCtrlData state_tmp;
|
||||
int ret = sceCtrlReadBufferPositive(0, &state_tmp, 1);
|
||||
|
||||
if (ret == SCE_OK)
|
||||
{
|
||||
state = 0;
|
||||
state |= (state_tmp.buttons & SCE_CTRL_LEFT) ? PSP2_GAMEPAD_DPAD_LEFT : 0;
|
||||
state |= (state_tmp.buttons & SCE_CTRL_DOWN) ? PSP2_GAMEPAD_DPAD_DOWN : 0;
|
||||
state |= (state_tmp.buttons & SCE_CTRL_RIGHT) ? PSP2_GAMEPAD_DPAD_RIGHT : 0;
|
||||
state |= (state_tmp.buttons & SCE_CTRL_UP) ? PSP2_GAMEPAD_DPAD_UP : 0;
|
||||
state |= (state_tmp.buttons & SCE_CTRL_START) ? PSP2_GAMEPAD_START : 0;
|
||||
state |= (state_tmp.buttons & SCE_CTRL_SELECT) ? PSP2_GAMEPAD_SELECT : 0;
|
||||
state |= (state_tmp.buttons & SCE_CTRL_TRIANGLE) ? PSP2_GAMEPAD_TRIANGLE : 0;
|
||||
state |= (state_tmp.buttons & SCE_CTRL_SQUARE) ? PSP2_GAMEPAD_SQUARE : 0;
|
||||
state |= (state_tmp.buttons & SCE_CTRL_CROSS) ? PSP2_GAMEPAD_CROSS : 0;
|
||||
state |= (state_tmp.buttons & SCE_CTRL_CIRCLE) ? PSP2_GAMEPAD_CIRCLE : 0;
|
||||
state |= (state_tmp.buttons & SCE_CTRL_R) ? PSP2_GAMEPAD_R : 0;
|
||||
state |= (state_tmp.buttons & SCE_CTRL_L) ? PSP2_GAMEPAD_L : 0;
|
||||
state |= (state_tmp.lx < ANALOGSTICK_DEADZONE_LOW) ? PSP2_GAMEPAD_LSTICK_LEFT_MASK : 0;
|
||||
state |= (state_tmp.lx > ANALOGSTICK_DEADZONE_HIGH) ? PSP2_GAMEPAD_LSTICK_RIGHT_MASK : 0;
|
||||
state |= (state_tmp.ly < ANALOGSTICK_DEADZONE_LOW) ? PSP2_GAMEPAD_LSTICK_UP_MASK : 0;
|
||||
state |= (state_tmp.ly > ANALOGSTICK_DEADZONE_HIGH) ? PSP2_GAMEPAD_LSTICK_DOWN_MASK : 0;
|
||||
state |= (state_tmp.rx < ANALOGSTICK_DEADZONE_LOW) ? PSP2_GAMEPAD_RSTICK_LEFT_MASK : 0;
|
||||
state |= (state_tmp.rx > ANALOGSTICK_DEADZONE_HIGH) ? PSP2_GAMEPAD_RSTICK_RIGHT_MASK : 0;
|
||||
state |= (state_tmp.ry < ANALOGSTICK_DEADZONE_LOW) ? PSP2_GAMEPAD_RSTICK_UP_MASK : 0;
|
||||
state |= (state_tmp.ry > ANALOGSTICK_DEADZONE_HIGH) ? PSP2_GAMEPAD_RSTICK_DOWN_MASK : 0;
|
||||
}
|
||||
}
|
||||
|
||||
cellPadGetInfo2(&pad_info);
|
||||
}
|
||||
|
||||
static int16_t psp2_input_state(void *data, const struct retro_keybind **binds,
|
||||
unsigned port, unsigned device,
|
||||
unsigned index, unsigned id)
|
||||
{
|
||||
(void)data;
|
||||
|
||||
uint64_t button = binds[0][id].joykey;
|
||||
int16_t retval = 0;
|
||||
|
||||
switch (device)
|
||||
{
|
||||
case RETRO_DEVICE_JOYPAD:
|
||||
retval = (state & button) ? 1 : 0;
|
||||
break;
|
||||
}
|
||||
|
||||
return retval;
|
||||
}
|
||||
|
||||
static void psp2_input_set_analog_dpad_mapping(unsigned device, unsigned map_dpad_enum, unsigned controller_id)
|
||||
{
|
||||
(void)device;
|
||||
}
|
||||
|
||||
static void psp2_free_input(void *data)
|
||||
{
|
||||
(void)data;
|
||||
}
|
||||
|
||||
static void* psp2_input_initialize(void)
|
||||
{
|
||||
sceCtrlSetSamplingMode(SCE_CTRL_MODE_DIGITALANALOG);
|
||||
return (void*)-1;
|
||||
}
|
||||
|
||||
static void psp2_input_post_init(void)
|
||||
{
|
||||
}
|
||||
|
||||
static bool psp2_key_pressed(void *data, int key)
|
||||
{
|
||||
(void)data;
|
||||
|
||||
switch (key)
|
||||
{
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
static void psp2_set_default_keybind_lut(unsigned device, unsigned port)
|
||||
{
|
||||
(void)device;
|
||||
(void)port;
|
||||
}
|
||||
|
||||
const input_driver_t input_psp2 = {
|
||||
.init = psp2_input_initialize,
|
||||
.poll = psp2_input_poll,
|
||||
.input_state = psp2_input_state,
|
||||
.key_pressed = psp2_key_pressed,
|
||||
.free = psp2_free_input,
|
||||
.set_default_keybind_lut = psp2_set_default_keybind_lut,
|
||||
.set_analog_dpad_mapping = psp2_input_set_analog_dpad_mapping,
|
||||
.post_init = psp2_input_post_init,
|
||||
.max_pads = MAX_PADS,
|
||||
.ident = "psp2",
|
||||
};
|
||||
|
@ -1,43 +0,0 @@
|
||||
/* RetroArch - A frontend for libretro.
|
||||
* Copyright (C) 2010-2012 - Hans-Kristian Arntzen
|
||||
* Copyright (C) 2011-2012 - Daniel De Matteis
|
||||
*
|
||||
* RetroArch is free software: you can redistribute it and/or modify it under the terms
|
||||
* of the GNU General Public License as published by the Free Software Found-
|
||||
* ation, either version 3 of the License, or (at your option) any later version.
|
||||
*
|
||||
* RetroArch is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
||||
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
|
||||
* PURPOSE. See the GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along with RetroArch.
|
||||
* If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef _PSP2_INPUT_H_
|
||||
#define _PSP2_INPUT_H_
|
||||
|
||||
enum {
|
||||
PSP2_GAMEPAD_CROSS = 1 << 0,
|
||||
PSP2_GAMEPAD_SQUARE = 1 << 1,
|
||||
PSP2_GAMEPAD_SELECT = 1 << 2,
|
||||
PSP2_GAMEPAD_START = 1 << 3,
|
||||
PSP2_GAMEPAD_DPAD_UP = 1 << 4,
|
||||
PSP2_GAMEPAD_DPAD_DOWN = 1 << 5,
|
||||
PSP2_GAMEPAD_DPAD_LEFT = 1 << 6,
|
||||
PSP2_GAMEPAD_DPAD_RIGHT = 1 << 7,
|
||||
PSP2_GAMEPAD_CIRCLE = 1 << 8,
|
||||
PSP2_GAMEPAD_TRIANGLE = 1 << 9,
|
||||
PSP2_GAMEPAD_L = 1 << 10,
|
||||
PSP2_GAMEPAD_R = 1 << 11,
|
||||
PSP2_GAMEPAD_LSTICK_LEFT_MASK = 1 << 16,
|
||||
PSP2_GAMEPAD_LSTICK_RIGHT_MASK = 1 << 17,
|
||||
PSP2_GAMEPAD_LSTICK_UP_MASK = 1 << 18,
|
||||
PSP2_GAMEPAD_LSTICK_DOWN_MASK = 1 << 19,
|
||||
PSP2_GAMEPAD_RSTICK_LEFT_MASK = 1 << 20,
|
||||
PSP2_GAMEPAD_RSTICK_RIGHT_MASK = 1 << 21,
|
||||
PSP2_GAMEPAD_RSTICK_UP_MASK = 1 << 22,
|
||||
PSP2_GAMEPAD_RSTICK_DOWN_MASK = 1 << 23,
|
||||
};
|
||||
|
||||
#endif
|
@ -115,8 +115,8 @@ const char *config_get_default_input(void)
|
||||
return "android_input";
|
||||
case INPUT_PS3:
|
||||
return "ps3";
|
||||
case INPUT_PSP2:
|
||||
return "psp2";
|
||||
case INPUT_PSP:
|
||||
return "psp";
|
||||
case INPUT_SDL:
|
||||
return "sdl";
|
||||
case INPUT_DINPUT:
|
||||
|
Loading…
x
Reference in New Issue
Block a user