From d9c7d9f9bd0e80a182ee8e30ddf652ffd5761f46 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Wed, 4 Jun 2014 02:52:29 +0200 Subject: [PATCH] (PSP) Add HAVE_KERNEL_PRX ifdef --- Makefile.psp1 | 5 +++++ frontend/platform/platform_psp.c | 2 ++ input/psp_input.c | 13 +++++++++++++ 3 files changed, 20 insertions(+) diff --git a/Makefile.psp1 b/Makefile.psp1 index 11aed52dff..4ada315639 100644 --- a/Makefile.psp1 +++ b/Makefile.psp1 @@ -1,5 +1,6 @@ BUILD_PRX = 1 DEBUG = 0 +HAVE_KERNEL_PRX = 1 HAVE_FILE_LOGGER = 0 HAVE_THREADS = 0 @@ -30,6 +31,10 @@ ifeq ($(HAVE_FILE_LOGGER), 1) CFLAGS += -DHAVE_FILE_LOGGER endif +ifeq ($(HAVE_KERNEL_RX), 1) +CFLAGS += -DHAVE_KERNEL_PRX +endif + CFLAGS += $(RARCH_DEFINES) diff --git a/frontend/platform/platform_psp.c b/frontend/platform/platform_psp.c index 5dc9761665..1193f4389e 100644 --- a/frontend/platform/platform_psp.c +++ b/frontend/platform/platform_psp.c @@ -128,7 +128,9 @@ static void frontend_psp_init(void *data) pspFpuSetEnable(0);//disable FPU exceptions scePowerSetClockFrequency(333,333,166); +#ifdef HAVE_KERNEL_PRX pspSdkLoadStartModule("kernelFunctions.prx", PSP_MEMORY_PARTITION_KERNEL); +#endif } static void frontend_psp_deinit(void *data) diff --git a/input/psp_input.c b/input/psp_input.c index ee130877c5..ed9e0d06aa 100644 --- a/input/psp_input.c +++ b/input/psp_input.c @@ -30,7 +30,9 @@ #include "../driver.h" #include "../libretro.h" #include "../general.h" +#ifdef HAVE_KERNEL_PRX #include "../psp1/kernelFunctions.h" +#endif enum { PSP_GAMEPAD_CROSS = 1ULL << 0, @@ -129,7 +131,9 @@ static void psp_input_poll(void *data) #endif sceCtrlSetSamplingMode(DEFAULT_SAMPLING_MODE); ret = CtrlPeekBufferPositive(0, &state_tmp, 1); +#ifdef HAVE_KERNEL_PRX state_tmp.Buttons = (state_tmp.Buttons&0x0000FFFF)|(readSystemButtons()&0xFFFF0000); +#endif (void)ret; psp->analog_state[0][0][0] = psp->analog_state[0][0][1] = psp->analog_state[0][1][0] = psp->analog_state[0][1][1] = 0; @@ -161,7 +165,16 @@ static void psp_input_poll(void *data) *lifecycle_state &= ~((1ULL << RARCH_MENU_TOGGLE)); +#ifdef HAVE_KERNEL_PRX if (STATE_BUTTON(state_tmp) & PSP_CTRL_NOTE) +#else + if ( + (psp->pad_state & (1ULL << RETRO_DEVICE_ID_JOYPAD_L)) + && (psp->pad_state & (1ULL << RETRO_DEVICE_ID_JOYPAD_R)) + && (psp->pad_state & (1ULL << RETRO_DEVICE_ID_JOYPAD_SELECT)) + && (psp->pad_state & (1ULL << RETRO_DEVICE_ID_JOYPAD_START)) + ) +#endif *lifecycle_state |= (1ULL << RARCH_MENU_TOGGLE); if (g_settings.input.autodetect_enable)