(PSL1GHT) Add compatibility for mouse code
This commit is contained in:
parent
51600c82d1
commit
de972fd0a3
|
@ -35,7 +35,7 @@ ifeq ($(HAVE_FILE_LOGGER), 1)
|
||||||
CFLAGS += -DHAVE_FILE_LOGGER
|
CFLAGS += -DHAVE_FILE_LOGGER
|
||||||
endif
|
endif
|
||||||
|
|
||||||
CFLAGS += -std=gnu99 -DHAVE_FILEBROWSER -DHAVE_DEFAULT_RETROPAD_INPUT -DRARCH_CONSOLE -DHAVE_CONFIGFILE=1 -DHAVE_ZLIB -DHAVE_RARCH_MAIN_WRAP -DHAVE_GRIFFIN=1 -DPACKAGE_VERSION=\"0.9.6\" -Dmain=rarch_main -Wno-char-subscripts
|
CFLAGS += -std=gnu99 -DHAVE_FILEBROWSER -DHAVE_MOUSE -DHAVE_DEFAULT_RETROPAD_INPUT -DRARCH_CONSOLE -DHAVE_CONFIGFILE=1 -DHAVE_ZLIB -DHAVE_RARCH_MAIN_WRAP -DHAVE_GRIFFIN=1 -DPACKAGE_VERSION=\"0.9.6\" -Dmain=rarch_main -Wno-char-subscripts
|
||||||
|
|
||||||
ifeq ($(DEBUG), 1)
|
ifeq ($(DEBUG), 1)
|
||||||
CFLAGS += -O0 -g
|
CFLAGS += -O0 -g
|
||||||
|
|
|
@ -63,26 +63,28 @@
|
||||||
|
|
||||||
#ifdef HAVE_MOUSE
|
#ifdef HAVE_MOUSE
|
||||||
|
|
||||||
|
#ifndef __PSL1GHT__
|
||||||
#define MAX_MICE 7
|
#define MAX_MICE 7
|
||||||
|
#endif
|
||||||
|
|
||||||
static void ps3_mouse_input_deinit(void)
|
static void ps3_mouse_input_deinit(void)
|
||||||
{
|
{
|
||||||
cellMouseEnd();
|
pMouseEnd();
|
||||||
}
|
}
|
||||||
|
|
||||||
static uint32_t ps3_mouse_input_mice_connected(void)
|
static uint32_t ps3_mouse_input_mice_connected(void)
|
||||||
{
|
{
|
||||||
CellMouseInfo mouse_info;
|
pMouseInfo mouse_info;
|
||||||
cellMouseGetInfo(&mouse_info);
|
pMouseGetInfo(&mouse_info);
|
||||||
return mouse_info.now_connect;
|
return mouse_info.now_connect;
|
||||||
}
|
}
|
||||||
|
|
||||||
CellMouseData ps3_mouse_input_poll_device(uint32_t id)
|
pMouseData ps3_mouse_input_poll_device(uint32_t id)
|
||||||
{
|
{
|
||||||
CellMouseData mouse_data;
|
pMouseData mouse_data;
|
||||||
|
|
||||||
// Get new pad data
|
// Get new pad data
|
||||||
cellMouseGetData(id, &mouse_data);
|
pMouseGetData(id, &mouse_data);
|
||||||
|
|
||||||
return mouse_data;
|
return mouse_data;
|
||||||
}
|
}
|
||||||
|
@ -160,7 +162,7 @@ static void ps3_input_poll(void *data)
|
||||||
|
|
||||||
static int16_t ps3_mouse_device_state(void *data, unsigned player, unsigned id)
|
static int16_t ps3_mouse_device_state(void *data, unsigned player, unsigned id)
|
||||||
{
|
{
|
||||||
CellMouseData mouse_state = ps3_mouse_input_poll_device(player);
|
pMouseData mouse_state = ps3_mouse_input_poll_device(player);
|
||||||
|
|
||||||
switch (id)
|
switch (id)
|
||||||
{
|
{
|
||||||
|
@ -351,7 +353,7 @@ static void* ps3_input_initialize(void)
|
||||||
{
|
{
|
||||||
pPadInit(MAX_PADS);
|
pPadInit(MAX_PADS);
|
||||||
#ifdef HAVE_MOUSE
|
#ifdef HAVE_MOUSE
|
||||||
cellMouseInit(MAX_MICE);
|
pMouseInit(MAX_MICE);
|
||||||
#endif
|
#endif
|
||||||
for(unsigned i = 0; i < MAX_PADS; i++)
|
for(unsigned i = 0; i < MAX_PADS; i++)
|
||||||
ps3_input_map_dpad_to_stick(g_settings.input.dpad_emulation[i], i);
|
ps3_input_map_dpad_to_stick(g_settings.input.dpad_emulation[i], i);
|
||||||
|
|
|
@ -129,6 +129,44 @@
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef HAVE_MOUSE
|
||||||
|
|
||||||
|
|
||||||
|
#ifdef __PSL1GHT__
|
||||||
|
/* define ps3 mouse structs */
|
||||||
|
#define pMouseInfo mouseInfo
|
||||||
|
#define pMouseData mouseData
|
||||||
|
|
||||||
|
/* define all the ps3 mouse functions */
|
||||||
|
#define pMouseInit ioMouseInit
|
||||||
|
#define pMouseGetData ioMouseGetData
|
||||||
|
#define pMouseEnd ioMouseEnd
|
||||||
|
#define pMouseGetInfo ioMouseGetInfo
|
||||||
|
|
||||||
|
/* PSL1GHT does not define these in its header */
|
||||||
|
#define CELL_MOUSE_BUTTON_1 (1 << 0) /* Button 1 */
|
||||||
|
#define CELL_MOUSE_BUTTON_2 (1 << 1) /* Button 2 */
|
||||||
|
#define CELL_MOUSE_BUTTON_3 (1 << 2) /* Button 3 */
|
||||||
|
#define CELL_MOUSE_BUTTON_4 (1 << 3) /* Button 4 */
|
||||||
|
#define CELL_MOUSE_BUTTON_5 (1 << 4) /* Button 5 */
|
||||||
|
#define CELL_MOUSE_BUTTON_6 (1 << 5) /* Button 6 */
|
||||||
|
#define CELL_MOUSE_BUTTON_7 (1 << 6) /* Button 7 */
|
||||||
|
#define CELL_MOUSE_BUTTON_8 (1 << 7) /* Button 8 */
|
||||||
|
|
||||||
|
#else
|
||||||
|
/* define ps3 mouse structs */
|
||||||
|
#define pMouseInfo CellMouseInfo
|
||||||
|
#define pMouseData CellMouseData
|
||||||
|
|
||||||
|
/* define all the ps3 mouse functions */
|
||||||
|
#define pMouseInit cellMouseInit
|
||||||
|
#define pMouseGetData cellMouseGetData
|
||||||
|
#define pMouseEnd cellMouseEnd
|
||||||
|
#define pMouseGetInfo cellMouseGetInfo
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
/*============================================================
|
/*============================================================
|
||||||
JPEG/PNG DECODING/ENCODING PROTOTYPES
|
JPEG/PNG DECODING/ENCODING PROTOTYPES
|
||||||
============================================================ */
|
============================================================ */
|
||||||
|
|
Loading…
Reference in New Issue