mirror of
https://github.com/libretro/RetroArch
synced 2025-02-07 03:40:24 +00:00
commit
899da1b87c
@ -34,6 +34,7 @@
|
|||||||
#include <psp2/ctrl.h>
|
#include <psp2/ctrl.h>
|
||||||
#include <psp2/touch.h>
|
#include <psp2/touch.h>
|
||||||
#define PSP_MAX_PADS 4
|
#define PSP_MAX_PADS 4
|
||||||
|
static int psp2_model;
|
||||||
static SceCtrlPortInfo old_ctrl_info, curr_ctrl_info;
|
static SceCtrlPortInfo old_ctrl_info, curr_ctrl_info;
|
||||||
static SceCtrlActuator actuators[PSP_MAX_PADS] = {0};
|
static SceCtrlActuator actuators[PSP_MAX_PADS] = {0};
|
||||||
|
|
||||||
@ -63,7 +64,7 @@ extern uint64_t lifecycle_state;
|
|||||||
static const char *psp_joypad_name(unsigned pad)
|
static const char *psp_joypad_name(unsigned pad)
|
||||||
{
|
{
|
||||||
#ifdef VITA
|
#ifdef VITA
|
||||||
if (!sceCtrlIsMultiControllerSupported())
|
if (psp2_model != SCE_KERNEL_MODEL_VITATV)
|
||||||
return "Vita Controller";
|
return "Vita Controller";
|
||||||
|
|
||||||
switch (curr_ctrl_info.port[pad + 1])
|
switch (curr_ctrl_info.port[pad + 1])
|
||||||
@ -88,7 +89,8 @@ static bool psp_joypad_init(void *data)
|
|||||||
(void)data;
|
(void)data;
|
||||||
|
|
||||||
#if defined(VITA)
|
#if defined(VITA)
|
||||||
if (!sceCtrlIsMultiControllerSupported())
|
psp2_model = sceKernelGetModelForCDialog();
|
||||||
|
if (psp2_model != SCE_KERNEL_MODEL_VITATV)
|
||||||
{
|
{
|
||||||
sceTouchSetSamplingState(SCE_TOUCH_PORT_BACK, SCE_TOUCH_SAMPLING_STATE_START);
|
sceTouchSetSamplingState(SCE_TOUCH_PORT_BACK, SCE_TOUCH_SAMPLING_STATE_START);
|
||||||
sceTouchSetSamplingState(SCE_TOUCH_PORT_FRONT, SCE_TOUCH_SAMPLING_STATE_START);
|
sceTouchSetSamplingState(SCE_TOUCH_PORT_FRONT, SCE_TOUCH_SAMPLING_STATE_START);
|
||||||
@ -190,7 +192,7 @@ static void psp_joypad_poll(void)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef VITA
|
#ifdef VITA
|
||||||
if (!sceCtrlIsMultiControllerSupported())
|
if (psp2_model != SCE_KERNEL_MODEL_VITATV)
|
||||||
players_count = 1;
|
players_count = 1;
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -235,7 +237,7 @@ static void psp_joypad_poll(void)
|
|||||||
SceCtrlData state_tmp;
|
SceCtrlData state_tmp;
|
||||||
unsigned i = player;
|
unsigned i = player;
|
||||||
#if defined(VITA)
|
#if defined(VITA)
|
||||||
unsigned p = (sceCtrlIsMultiControllerSupported()) ? player + 1 : player;
|
unsigned p = (psp2_model == SCE_KERNEL_MODEL_VITATV) ? player + 1 : player;
|
||||||
if (curr_ctrl_info.port[p] == SCE_CTRL_TYPE_UNPAIRED)
|
if (curr_ctrl_info.port[p] == SCE_CTRL_TYPE_UNPAIRED)
|
||||||
continue;
|
continue;
|
||||||
#elif defined(SN_TARGET_PSP2)
|
#elif defined(SN_TARGET_PSP2)
|
||||||
@ -259,7 +261,7 @@ static void psp_joypad_poll(void)
|
|||||||
continue;
|
continue;
|
||||||
#endif
|
#endif
|
||||||
#if defined(VITA)
|
#if defined(VITA)
|
||||||
if (!sceCtrlIsMultiControllerSupported()
|
if (psp2_model == SCE_KERNEL_MODEL_VITA
|
||||||
&& settings->bools.input_backtouch_enable)
|
&& settings->bools.input_backtouch_enable)
|
||||||
{
|
{
|
||||||
unsigned i;
|
unsigned i;
|
||||||
@ -330,7 +332,7 @@ static bool psp_joypad_rumble(unsigned pad,
|
|||||||
enum retro_rumble_effect effect, uint16_t strength)
|
enum retro_rumble_effect effect, uint16_t strength)
|
||||||
{
|
{
|
||||||
#ifdef VITA
|
#ifdef VITA
|
||||||
if (!sceCtrlIsMultiControllerSupported())
|
if (psp2_model != SCE_KERNEL_MODEL_VITATV)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
switch (effect)
|
switch (effect)
|
||||||
|
@ -88,11 +88,17 @@ static void app_terminate(void)
|
|||||||
{
|
{
|
||||||
[[NSApplication sharedApplication] terminate:nil];
|
[[NSApplication sharedApplication] terminate:nil];
|
||||||
}
|
}
|
||||||
|
#ifdef HAVE_METAL
|
||||||
@interface RAWindow : NSWindow
|
@interface RAWindow : NSWindow
|
||||||
@end
|
@end
|
||||||
|
|
||||||
@implementation RAWindow
|
@implementation RAWindow
|
||||||
|
#else
|
||||||
|
@interface RApplication : NSApplication
|
||||||
|
@end
|
||||||
|
|
||||||
|
@implementation RApplication
|
||||||
|
#endif
|
||||||
|
|
||||||
#if MAC_OS_X_VERSION_MAX_ALLOWED < 101200
|
#if MAC_OS_X_VERSION_MAX_ALLOWED < 101200
|
||||||
#define NSEventTypeKeyDown NSKeyDown
|
#define NSEventTypeKeyDown NSKeyDown
|
||||||
|
Loading…
x
Reference in New Issue
Block a user