all repos — mgba @ 789a84d2e25b2a6e7df0bb86351ec81726313eed

mGBA Game Boy Advance Emulator

PSP2: Use system enter key by default
Vicki Pfau vi@endrift.com
Sun, 21 Jan 2018 00:45:15 -0800
commit

789a84d2e25b2a6e7df0bb86351ec81726313eed

parent

f6cc37850f5f60ce1a14ae07768c766da3584cee

3 files changed, 35 insertions(+), 3 deletions(-)

jump to
M CHANGESCHANGES

@@ -60,6 +60,7 @@ - GB: Skip BIOS option now works

- Libretro: Add frameskip option - GBA Memory: 64 MiB GBA Video cartridge support - 3DS: Scale font based on glyph heights (fixes mgba.io/i/961) + - PSP2: Use system enter key by default 0.6.1: (2017-10-01) Bugfixes:
M src/platform/psp2/CMakeLists.txtsrc/platform/psp2/CMakeLists.txt

@@ -13,7 +13,21 @@

list(APPEND CORE_VFS_SRC ${CMAKE_CURRENT_SOURCE_DIR}/sce-vfs.c) set(CORE_VFS_SRC ${CORE_VFS_SRC} PARENT_SCOPE) -set(OS_LIB -lvita2d -lSceAppMgr_stub -lSceCtrl_stub -lSceAudio_stub -lSceCamera_stub -lSceCommonDialog_stub -lSceDisplay_stub -lSceGxm_stub -lSceMotion_stub -lScePgf_stub -lScePhotoExport_stub -lScePower_stub -lSceSysmodule_stub -lSceTouch_stub -l${M_LIBRARY}) +set(OS_LIB -lvita2d -l${M_LIBRARY} + -lSceAppMgr_stub + -lSceAppUtil_stub + -lSceAudio_stub + -lSceCamera_stub + -lSceCommonDialog_stub + -lSceCtrl_stub + -lSceDisplay_stub + -lSceGxm_stub + -lSceMotion_stub + -lScePgf_stub + -lScePhotoExport_stub + -lScePower_stub + -lSceSysmodule_stub + -lSceTouch_stub) set(OBJCOPY_CMD ${OBJCOPY} -I binary -O elf32-littlearm -B arm) list(APPEND GUI_SRC ${CMAKE_CURRENT_SOURCE_DIR}/gui-font.c)
M src/platform/psp2/main.csrc/platform/psp2/main.c

@@ -12,12 +12,14 @@ #include <mgba-util/gui/font.h>

#include <mgba-util/gui/file-select.h> #include <mgba-util/gui/menu.h> +#include <psp2/apputil.h> #include <psp2/ctrl.h> #include <psp2/display.h> #include <psp2/kernel/processmgr.h> #include <psp2/kernel/threadmgr.h> #include <psp2/power.h> #include <psp2/sysmodule.h> +#include <psp2/system_param.h> #include <psp2/touch.h> #include <vita2d.h>

@@ -163,11 +165,26 @@

sceTouchSetSamplingState(SCE_TOUCH_PORT_FRONT, SCE_TOUCH_SAMPLING_STATE_START); sceCtrlSetSamplingMode(SCE_CTRL_MODE_ANALOG_WIDE); sceSysmoduleLoadModule(SCE_SYSMODULE_PHOTO_EXPORT); + sceSysmoduleLoadModule(SCE_SYSMODULE_APPUTIL); mGUIInit(&runner, "psvita"); - mPSP2MapKey(&runner.params.keyMap, SCE_CTRL_CROSS, GUI_INPUT_SELECT); - mPSP2MapKey(&runner.params.keyMap, SCE_CTRL_CIRCLE, GUI_INPUT_BACK); + int enterButton; + SceAppUtilInitParam initParam; + SceAppUtilBootParam bootParam; + memset(&initParam, 0, sizeof(SceAppUtilInitParam)); + memset(&bootParam, 0, sizeof(SceAppUtilBootParam)); + sceAppUtilInit(&initParam, &bootParam); + sceAppUtilSystemParamGetInt(SCE_SYSTEM_PARAM_ID_ENTER_BUTTON, &enterButton); + sceAppUtilShutdown(); + + if (enterButton == SCE_SYSTEM_PARAM_ENTER_BUTTON_CIRCLE) { + mPSP2MapKey(&runner.params.keyMap, SCE_CTRL_CROSS, GUI_INPUT_BACK); + mPSP2MapKey(&runner.params.keyMap, SCE_CTRL_CIRCLE, GUI_INPUT_SELECT); + } else { + mPSP2MapKey(&runner.params.keyMap, SCE_CTRL_CROSS, GUI_INPUT_SELECT); + mPSP2MapKey(&runner.params.keyMap, SCE_CTRL_CIRCLE, GUI_INPUT_BACK); + } mPSP2MapKey(&runner.params.keyMap, SCE_CTRL_TRIANGLE, GUI_INPUT_CANCEL); mPSP2MapKey(&runner.params.keyMap, SCE_CTRL_UP, GUI_INPUT_UP); mPSP2MapKey(&runner.params.keyMap, SCE_CTRL_DOWN, GUI_INPUT_DOWN);