mirror of
https://github.com/libretro/RetroArch
synced 2025-02-09 00:40:09 +00:00
(PSL1GHT) Made ps3_input.c PSL1GHT-compatible
This commit is contained in:
parent
b5753c1d8a
commit
4a703f80fb
@ -107,7 +107,7 @@ FONTS
|
||||
/*============================================================
|
||||
INPUT
|
||||
============================================================ */
|
||||
#if defined(__CELLOS_LV2__) && !defined(__PSL1GHT__)
|
||||
#if defined(__CELLOS_LV2__)
|
||||
#include "../../ps3/ps3_input.c"
|
||||
#elif defined(_XBOX360)
|
||||
#include "../../360/xdk360_input.c"
|
||||
|
@ -17,16 +17,29 @@
|
||||
#include <stdint.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#ifdef __PSL1GHT__
|
||||
#include <io/pad.h>
|
||||
#else
|
||||
#include <cell/pad.h>
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_MOUSE
|
||||
#include <cell/mouse.h>
|
||||
#endif
|
||||
|
||||
#ifndef __PSL1GHT__
|
||||
#include <sdk_version.h>
|
||||
#endif
|
||||
|
||||
#include <sys/memory.h>
|
||||
|
||||
#ifdef HAVE_OSKUTIL
|
||||
#include <sysutil/sysutil_oskdialog.h>
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_SYSUTILS
|
||||
#include <sysutil/sysutil_common.h>
|
||||
#endif
|
||||
|
||||
#include "ps3_input.h"
|
||||
#include "../driver.h"
|
||||
@ -70,6 +83,29 @@ CellMouseData ps3_mouse_input_poll_device(uint32_t id)
|
||||
PS3 PAD
|
||||
============================================================ */
|
||||
|
||||
#ifdef __PSL1GHT__
|
||||
#define pPadInfo padInfo2
|
||||
#define pPadData padData
|
||||
#define pPadGetInfo ioPadGetInfo2
|
||||
#define pPadGetData ioPadGetData
|
||||
#define pPadInit ioPadInit
|
||||
#define now_connect connected
|
||||
#else
|
||||
#define pPadData CellPadData
|
||||
#define pPadInit cellPadInit
|
||||
#define pPadGetData cellPadGetData
|
||||
#define pPadInfo CellPadInfo
|
||||
#define pPadGetInfo cellPadGetInfo
|
||||
#endif
|
||||
|
||||
#if(CELL_SDK_VERSION > 0x340000)
|
||||
#undef pPadInfo
|
||||
#undef pPadGetInfo
|
||||
#define pPadInfo CellPadInfo2
|
||||
#define pPadGetInfo cellPadGetInfo2
|
||||
#endif
|
||||
|
||||
|
||||
#define MAP(x) (x & 0xFF)
|
||||
|
||||
static uint64_t state[MAX_PADS];
|
||||
@ -78,23 +114,18 @@ static unsigned mice_connected;
|
||||
|
||||
uint32_t cell_pad_input_pads_connected(void)
|
||||
{
|
||||
#if(CELL_SDK_VERSION > 0x340000)
|
||||
CellPadInfo2 pad_info;
|
||||
cellPadGetInfo2(&pad_info);
|
||||
#else
|
||||
CellPadInfo pad_info;
|
||||
cellPadGetInfo(&pad_info);
|
||||
#endif
|
||||
pPadInfo pad_info;
|
||||
pPadGetInfo(&pad_info);
|
||||
return pad_info.now_connect;
|
||||
}
|
||||
|
||||
uint64_t cell_pad_input_poll_device(uint32_t id)
|
||||
{
|
||||
CellPadData pad_data;
|
||||
pPadData pad_data;
|
||||
static uint64_t ret[MAX_PADS];
|
||||
|
||||
// Get new pad data
|
||||
cellPadGetData(id, &pad_data);
|
||||
pPadGetData(id, &pad_data);
|
||||
|
||||
if (pad_data.len == 0)
|
||||
return ret[id];
|
||||
@ -329,7 +360,7 @@ static void ps3_free_input(void *data)
|
||||
|
||||
static void* ps3_input_initialize(void)
|
||||
{
|
||||
cellPadInit(MAX_PADS);
|
||||
pPadInit(MAX_PADS);
|
||||
#ifdef HAVE_MOUSE
|
||||
cellMouseInit(MAX_MICE);
|
||||
#endif
|
||||
|
@ -28,7 +28,9 @@
|
||||
#include <sysutil/sysutil_common.h>
|
||||
#endif
|
||||
|
||||
#ifndef __PSL1GHT__
|
||||
#define MAX_PADS 7
|
||||
#endif
|
||||
|
||||
#define CTRL_SELECT_MASK 0x01
|
||||
#define CTRL_L3_MASK 0x2
|
||||
|
Loading…
x
Reference in New Issue
Block a user