mirror of
https://github.com/hrydgard/ppsspp.git
synced 2024-11-22 21:09:52 +00:00
Fix the Retroid controller defaults for the latest firmware. More standard now.
This commit is contained in:
parent
c1d6b62625
commit
da2e5e76c4
@ -726,6 +726,19 @@ static bool DefaultShowTouchControls() {
|
||||
}
|
||||
}
|
||||
|
||||
static bool DefaultShowPauseButton() {
|
||||
switch (System_GetPropertyInt(SYSPROP_DEVICE_TYPE)) {
|
||||
case DEVICE_TYPE_MOBILE:
|
||||
case DEVICE_TYPE_DESKTOP:
|
||||
return true;
|
||||
case DEVICE_TYPE_VR:
|
||||
case DEVICE_TYPE_TV:
|
||||
return false;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
static const float defaultControlScale = 1.15f;
|
||||
static const ConfigTouchPos defaultTouchPosShow = { -1.0f, -1.0f, defaultControlScale, true };
|
||||
static const ConfigTouchPos defaultTouchPosHide = { -1.0f, -1.0f, defaultControlScale, false };
|
||||
@ -779,13 +792,9 @@ static const ConfigSetting controlSettings[] = {
|
||||
ConfigSetting("fcombo18X", "fcombo18Y", "comboKeyScale18", "ShowComboKey18", &g_Config.touchCustom[18], defaultTouchPosHide, CfgFlag::PER_GAME),
|
||||
ConfigSetting("fcombo19X", "fcombo19Y", "comboKeyScale19", "ShowComboKey19", &g_Config.touchCustom[19], defaultTouchPosHide, CfgFlag::PER_GAME),
|
||||
|
||||
#if defined(_WIN32)
|
||||
// A win32 user seeing touch controls is likely using PPSSPP on a tablet. There it makes
|
||||
// sense to default this to on.
|
||||
ConfigSetting("ShowTouchPause", &g_Config.bShowTouchPause, true, CfgFlag::DEFAULT),
|
||||
#else
|
||||
ConfigSetting("ShowTouchPause", &g_Config.bShowTouchPause, false, CfgFlag::DEFAULT),
|
||||
#endif
|
||||
ConfigSetting("ShowTouchPause", &g_Config.bShowTouchPause, &DefaultShowPauseButton, CfgFlag::DEFAULT),
|
||||
#if defined(USING_WIN_UI)
|
||||
ConfigSetting("IgnoreWindowsKey", &g_Config.bIgnoreWindowsKey, false, CfgFlag::PER_GAME),
|
||||
#endif
|
||||
|
@ -418,11 +418,11 @@ const KeyMap_IntStrPair psp_button_names[] = {
|
||||
{VIRTKEY_AXIS_SWAP, "AxisSwap"},
|
||||
|
||||
{VIRTKEY_FASTFORWARD, "Fast-forward"},
|
||||
{VIRTKEY_PAUSE, "Pause"},
|
||||
{VIRTKEY_SPEED_TOGGLE, "SpeedToggle"},
|
||||
{VIRTKEY_SPEED_CUSTOM1, "Alt speed 1"},
|
||||
{VIRTKEY_SPEED_CUSTOM2, "Alt speed 2"},
|
||||
{VIRTKEY_SPEED_ANALOG, "Analog speed"},
|
||||
{VIRTKEY_PAUSE, "Pause"},
|
||||
{VIRTKEY_RESET_EMULATION, "Reset"},
|
||||
{VIRTKEY_FRAME_ADVANCE, "Frame Advance"},
|
||||
#if !defined(MOBILE_DEVICE)
|
||||
@ -734,7 +734,7 @@ void RestoreDefault() {
|
||||
} else if (IsMOQII7S(name)) {
|
||||
SetDefaultKeyMap(DEFAULT_MAPPING_MOQI_I7S, false);
|
||||
} else if (IsRetroid(name)) {
|
||||
SetDefaultKeyMap(DEFAULT_MAPPING_RETRO_STATION_CONTROLLER, false);
|
||||
SetDefaultKeyMap(DEFAULT_MAPPING_RETROID_CONTROLLER, false);
|
||||
} else {
|
||||
SetDefaultKeyMap(DEFAULT_MAPPING_ANDROID_PAD, false);
|
||||
}
|
||||
@ -855,7 +855,7 @@ void AutoConfForPad(const std::string &name) {
|
||||
if (name.find("Xbox") != std::string::npos) {
|
||||
SetDefaultKeyMap(DEFAULT_MAPPING_ANDROID_XBOX, false);
|
||||
} else if (name == "Retro Station Controller") {
|
||||
SetDefaultKeyMap(DEFAULT_MAPPING_RETRO_STATION_CONTROLLER, false);
|
||||
SetDefaultKeyMap(DEFAULT_MAPPING_RETROID_CONTROLLER, false);
|
||||
} else {
|
||||
SetDefaultKeyMap(DEFAULT_MAPPING_ANDROID_PAD, false);
|
||||
}
|
||||
|
@ -200,21 +200,26 @@ static const DefMappingStruct defaultAndroidXboxControllerMap[] = {
|
||||
|
||||
// Retroid reports its controller as "Retro Station Controller".
|
||||
// It's very similar to the Android Xbox mapping, just with main buttons swapped around.
|
||||
static const DefMappingStruct defaultRetroStationControllerMap[] = {
|
||||
static const DefMappingStruct defaultRetroidControllerMap[] = {
|
||||
{CTRL_CROSS , NKCODE_BUTTON_B},
|
||||
{CTRL_CIRCLE , NKCODE_BUTTON_A},
|
||||
{CTRL_SQUARE , NKCODE_BUTTON_Y},
|
||||
{CTRL_TRIANGLE , NKCODE_BUTTON_X},
|
||||
// The hat for DPAD is standard for bluetooth pads, which is the most likely pads on Android I think.
|
||||
{CTRL_LEFT , JOYSTICK_AXIS_HAT_X, -1},
|
||||
{CTRL_LEFT , NKCODE_DPAD_LEFT},
|
||||
{CTRL_RIGHT , JOYSTICK_AXIS_HAT_X, +1},
|
||||
{CTRL_RIGHT , NKCODE_DPAD_RIGHT},
|
||||
{CTRL_UP , JOYSTICK_AXIS_HAT_Y, -1},
|
||||
{CTRL_UP , NKCODE_DPAD_UP},
|
||||
{CTRL_DOWN , JOYSTICK_AXIS_HAT_Y, +1},
|
||||
{CTRL_DOWN , NKCODE_DPAD_DOWN},
|
||||
{CTRL_START , NKCODE_BUTTON_START},
|
||||
{CTRL_SELECT , NKCODE_BACK},
|
||||
{CTRL_SELECT , NKCODE_BUTTON_SELECT},
|
||||
{CTRL_LTRIGGER , NKCODE_BUTTON_L1},
|
||||
{CTRL_RTRIGGER , NKCODE_BUTTON_R1},
|
||||
{VIRTKEY_FASTFORWARD , NKCODE_BUTTON_R2},
|
||||
{VIRTKEY_FASTFORWARD , JOYSTICK_AXIS_RTRIGGER, +1},
|
||||
{VIRTKEY_PAUSE , NKCODE_BUTTON_L2},
|
||||
{VIRTKEY_PAUSE , JOYSTICK_AXIS_LTRIGGER, +1},
|
||||
{VIRTKEY_AXIS_X_MIN, JOYSTICK_AXIS_X, -1},
|
||||
{VIRTKEY_AXIS_X_MAX, JOYSTICK_AXIS_X, +1},
|
||||
@ -222,7 +227,6 @@ static const DefMappingStruct defaultRetroStationControllerMap[] = {
|
||||
{VIRTKEY_AXIS_Y_MAX, JOYSTICK_AXIS_Y, -1},
|
||||
};
|
||||
|
||||
|
||||
static const DefMappingStruct defaultPadMapAndroid[] = {
|
||||
{CTRL_CROSS , NKCODE_BUTTON_A},
|
||||
{CTRL_CIRCLE , NKCODE_BUTTON_B},
|
||||
@ -415,8 +419,8 @@ void SetDefaultKeyMap(DefaultMaps dmap, bool replace) {
|
||||
case DEFAULT_MAPPING_ANDROID_XBOX:
|
||||
SetDefaultKeyMap(DEVICE_ID_PAD_0, defaultAndroidXboxControllerMap, ARRAY_SIZE(defaultAndroidXboxControllerMap), replace);
|
||||
break;
|
||||
case DEFAULT_MAPPING_RETRO_STATION_CONTROLLER:
|
||||
SetDefaultKeyMap(DEVICE_ID_PAD_0, defaultRetroStationControllerMap, ARRAY_SIZE(defaultRetroStationControllerMap), replace);
|
||||
case DEFAULT_MAPPING_RETROID_CONTROLLER:
|
||||
SetDefaultKeyMap(DEVICE_ID_PAD_0, defaultRetroidControllerMap, ARRAY_SIZE(defaultRetroidControllerMap), replace);
|
||||
break;
|
||||
case DEFAULT_MAPPING_VR_HEADSET:
|
||||
SetDefaultKeyMap(DEVICE_ID_XR_CONTROLLER_LEFT, defaultVRLeftController, ARRAY_SIZE(defaultVRLeftController), replace);
|
||||
|
@ -13,7 +13,7 @@ enum DefaultMaps {
|
||||
DEFAULT_MAPPING_OUYA,
|
||||
DEFAULT_MAPPING_XPERIA_PLAY,
|
||||
DEFAULT_MAPPING_MOQI_I7S,
|
||||
DEFAULT_MAPPING_RETRO_STATION_CONTROLLER,
|
||||
DEFAULT_MAPPING_RETROID_CONTROLLER,
|
||||
DEFAULT_MAPPING_VR_HEADSET,
|
||||
};
|
||||
|
||||
|
@ -794,7 +794,9 @@ void GameBrowser::Refresh() {
|
||||
topBar->Add(new Choice(ImageID("I_FOLDER_OPEN"), new LayoutParams(WRAP_CONTENT, 64.0f)))->OnClick.Handle(this, &GameBrowser::BrowseClick);
|
||||
#else
|
||||
if ((browseFlags_ & BrowseFlags::BROWSE) && System_GetPropertyBool(SYSPROP_HAS_FOLDER_BROWSER)) {
|
||||
topBar->Add(new Choice(mm->T("Browse"), ImageID("I_FOLDER_OPEN"), new LayoutParams(WRAP_CONTENT, 64.0f)))->OnClick.Handle(this, &GameBrowser::BrowseClick);
|
||||
// Collapse the button title on very small screens (Retroid Pocket).
|
||||
std::string_view browseTitle = g_display.pixel_xres <= 640 ? "" : mm->T("Browse");
|
||||
topBar->Add(new Choice(browseTitle, ImageID("I_FOLDER_OPEN"), new LayoutParams(WRAP_CONTENT, 64.0f)))->OnClick.Handle(this, &GameBrowser::BrowseClick);
|
||||
}
|
||||
if (System_GetPropertyInt(SYSPROP_DEVICE_TYPE) == DEVICE_TYPE_TV) {
|
||||
topBar->Add(new Choice(mm->T("Enter Path"), new LayoutParams(WRAP_CONTENT, 64.0f)))->OnClick.Add([=](UI::EventParams &) {
|
||||
|
Loading…
Reference in New Issue
Block a user