Cleanup
This commit is contained in:
@@ -11,27 +11,63 @@
|
||||
// #define INPUT_PSP_GAMEPAD_BUTTON_CANCEL INPUT_SDL2_GAMEPAD_BUTTON_CUSTOM
|
||||
|
||||
inputbuttondata_t INPUT_BUTTON_DATA[] = {
|
||||
{ .name = "triangle", { .type = INPUT_BUTTON_TYPE_GAMEPAD, .gpButton = SDL_CONTROLLER_BUTTON_Y } },
|
||||
{ .name = "cross", { .type = INPUT_BUTTON_TYPE_GAMEPAD, .gpButton = SDL_CONTROLLER_BUTTON_A } },
|
||||
{ .name = "circle", { .type = INPUT_BUTTON_TYPE_GAMEPAD, .gpButton = SDL_CONTROLLER_BUTTON_B } },
|
||||
{ .name = "square", { .type = INPUT_BUTTON_TYPE_GAMEPAD, .gpButton = SDL_CONTROLLER_BUTTON_X } },
|
||||
{ .name = "start", { .type = INPUT_BUTTON_TYPE_GAMEPAD, .gpButton = SDL_CONTROLLER_BUTTON_START } },
|
||||
{ .name = "select", { .type = INPUT_BUTTON_TYPE_GAMEPAD, .gpButton = SDL_CONTROLLER_BUTTON_BACK } },
|
||||
{ .name = "up", { .type = INPUT_BUTTON_TYPE_GAMEPAD, .gpButton = SDL_CONTROLLER_BUTTON_DPAD_UP } },
|
||||
{ .name = "down", { .type = INPUT_BUTTON_TYPE_GAMEPAD, .gpButton = SDL_CONTROLLER_BUTTON_DPAD_DOWN } },
|
||||
{ .name = "left", { .type = INPUT_BUTTON_TYPE_GAMEPAD, .gpButton = SDL_CONTROLLER_BUTTON_DPAD_LEFT } },
|
||||
{ .name = "right", { .type = INPUT_BUTTON_TYPE_GAMEPAD, .gpButton = SDL_CONTROLLER_BUTTON_DPAD_RIGHT } },
|
||||
{ .name = "l", { .type = INPUT_BUTTON_TYPE_GAMEPAD, .gpButton = SDL_CONTROLLER_BUTTON_LEFTSHOULDER } },
|
||||
{ .name = "r", { .type = INPUT_BUTTON_TYPE_GAMEPAD, .gpButton = SDL_CONTROLLER_BUTTON_RIGHTSHOULDER } },
|
||||
{ .name = "triangle", {
|
||||
.type = INPUT_BUTTON_TYPE_GAMEPAD,
|
||||
.gpButton = SDL_CONTROLLER_BUTTON_Y } },
|
||||
{ .name = "cross", {
|
||||
.type = INPUT_BUTTON_TYPE_GAMEPAD,
|
||||
.gpButton = SDL_CONTROLLER_BUTTON_A } },
|
||||
{ .name = "circle", {
|
||||
.type = INPUT_BUTTON_TYPE_GAMEPAD,
|
||||
.gpButton = SDL_CONTROLLER_BUTTON_B } },
|
||||
{ .name = "square", {
|
||||
.type = INPUT_BUTTON_TYPE_GAMEPAD,
|
||||
.gpButton = SDL_CONTROLLER_BUTTON_X } },
|
||||
{ .name = "start", {
|
||||
.type = INPUT_BUTTON_TYPE_GAMEPAD,
|
||||
.gpButton = SDL_CONTROLLER_BUTTON_START } },
|
||||
{ .name = "select", {
|
||||
.type = INPUT_BUTTON_TYPE_GAMEPAD,
|
||||
.gpButton = SDL_CONTROLLER_BUTTON_BACK } },
|
||||
{ .name = "up", {
|
||||
.type = INPUT_BUTTON_TYPE_GAMEPAD,
|
||||
.gpButton = SDL_CONTROLLER_BUTTON_DPAD_UP } },
|
||||
{ .name = "down", {
|
||||
.type = INPUT_BUTTON_TYPE_GAMEPAD,
|
||||
.gpButton = SDL_CONTROLLER_BUTTON_DPAD_DOWN } },
|
||||
{ .name = "left", {
|
||||
.type = INPUT_BUTTON_TYPE_GAMEPAD,
|
||||
.gpButton = SDL_CONTROLLER_BUTTON_DPAD_LEFT } },
|
||||
{ .name = "right", {
|
||||
.type = INPUT_BUTTON_TYPE_GAMEPAD,
|
||||
.gpButton = SDL_CONTROLLER_BUTTON_DPAD_RIGHT } },
|
||||
{ .name = "l", {
|
||||
.type = INPUT_BUTTON_TYPE_GAMEPAD,
|
||||
.gpButton = SDL_CONTROLLER_BUTTON_LEFTSHOULDER } },
|
||||
{ .name = "r", {
|
||||
.type = INPUT_BUTTON_TYPE_GAMEPAD,
|
||||
.gpButton = SDL_CONTROLLER_BUTTON_RIGHTSHOULDER } },
|
||||
|
||||
// Refer to systempsp.c for some extra info.
|
||||
{ .name = "accept", { .type = INPUT_BUTTON_TYPE_GAMEPAD, .gpButton = SDL_CONTROLLER_BUTTON_A } },
|
||||
{ .name = "cancel", { .type = INPUT_BUTTON_TYPE_GAMEPAD, .gpButton = SDL_CONTROLLER_BUTTON_B } },
|
||||
{ .name = "accept", {
|
||||
.type = INPUT_BUTTON_TYPE_GAMEPAD,
|
||||
.gpButton = SDL_CONTROLLER_BUTTON_A } },
|
||||
{ .name = "cancel", {
|
||||
.type = INPUT_BUTTON_TYPE_GAMEPAD,
|
||||
.gpButton = SDL_CONTROLLER_BUTTON_B } },
|
||||
|
||||
{ .name = "lstick_down", { .type = INPUT_BUTTON_TYPE_GAMEPAD_AXIS, .gpAxis = { .axis = SDL_CONTROLLER_AXIS_LEFTY, .positive = true } } },
|
||||
{ .name = "lstick_up", { .type = INPUT_BUTTON_TYPE_GAMEPAD_AXIS, .gpAxis = { .axis = SDL_CONTROLLER_AXIS_LEFTY, .positive = false } } },
|
||||
{ .name = "lstick_right", { .type = INPUT_BUTTON_TYPE_GAMEPAD_AXIS, .gpAxis = { .axis = SDL_CONTROLLER_AXIS_LEFTX, .positive = true } } },
|
||||
{ .name = "lstick_left", { .type = INPUT_BUTTON_TYPE_GAMEPAD_AXIS, .gpAxis = { .axis = SDL_CONTROLLER_AXIS_LEFTX, .positive = false } } },
|
||||
{ .name = "lstick_down", {
|
||||
.type = INPUT_BUTTON_TYPE_GAMEPAD_AXIS,
|
||||
.gpAxis = { .axis = SDL_CONTROLLER_AXIS_LEFTY, .positive = true } } },
|
||||
{ .name = "lstick_up", {
|
||||
.type = INPUT_BUTTON_TYPE_GAMEPAD_AXIS,
|
||||
.gpAxis = { .axis = SDL_CONTROLLER_AXIS_LEFTY, .positive = false } } },
|
||||
{ .name = "lstick_right", {
|
||||
.type = INPUT_BUTTON_TYPE_GAMEPAD_AXIS,
|
||||
.gpAxis = { .axis = SDL_CONTROLLER_AXIS_LEFTX, .positive = true } } },
|
||||
{ .name = "lstick_left", {
|
||||
.type = INPUT_BUTTON_TYPE_GAMEPAD_AXIS,
|
||||
.gpAxis = { .axis = SDL_CONTROLLER_AXIS_LEFTX, .positive = false } } },
|
||||
|
||||
{ .name = NULL }
|
||||
};
|
||||
|
||||
@@ -175,11 +175,14 @@ void networkPSPRequestConnection(
|
||||
// https://github.com/joel16/CMFileManager-PSP/blob/00dab16c64cd48bf6452fc274a3b898d77c39a8d/app/source/net.cpp#L97
|
||||
// since I follow this implementation closely.
|
||||
memoryZero(&NETWORK.platform.dialogData, sizeof(NETWORK.platform.dialogData));
|
||||
memoryZero(&NETWORK.platform.dialogAdhoc, sizeof(NETWORK.platform.dialogAdhoc));
|
||||
memoryZero(
|
||||
&NETWORK.platform.dialogAdhoc, sizeof(NETWORK.platform.dialogAdhoc)
|
||||
);
|
||||
|
||||
NETWORK.platform.dialogData.base.size = sizeof(pspUtilityNetconfData);
|
||||
NETWORK.platform.dialogData.base.language = systemPSPGetLanguage();
|
||||
NETWORK.platform.dialogData.base.buttonSwap = systemPSPGetCrossButtonSetting();
|
||||
NETWORK.platform.dialogData.base.buttonSwap =
|
||||
systemPSPGetCrossButtonSetting();
|
||||
NETWORK.platform.dialogData.base.graphicsThread = 17;
|
||||
NETWORK.platform.dialogData.base.accessThread = 19;
|
||||
NETWORK.platform.dialogData.base.fontThread = 18;
|
||||
@@ -212,7 +215,7 @@ void networkPSPRequestDisconnection(
|
||||
}
|
||||
|
||||
errorret_t networkPSPTerm() {
|
||||
int ret;
|
||||
int_t ret;
|
||||
ret = sceNetApctlTerm();
|
||||
if(ret < 0) {
|
||||
errorThrow("Failed to terminate netctl: 0x%08X", ret);
|
||||
|
||||
@@ -48,14 +48,14 @@ systemdialogtype_t systemGetActiveDialogTypePSP() {
|
||||
return SYSTEM_DIALOG_TYPE_NONE;
|
||||
}
|
||||
|
||||
int systemPSPGetLanguage() {
|
||||
int ret;
|
||||
int_t systemPSPGetLanguage() {
|
||||
int_t ret;
|
||||
sceUtilityGetSystemParamInt(PSP_SYSTEMPARAM_ID_INT_LANGUAGE, &ret);
|
||||
return ret;
|
||||
}
|
||||
|
||||
int systemPSPGetCrossButtonSetting() {
|
||||
int ret;
|
||||
int_t systemPSPGetCrossButtonSetting() {
|
||||
int_t ret;
|
||||
// See: https://pspdev.github.io/pspsdk/psputility__sysparam_8h.html#ab588fd5a14adc025f065e09325ffe729
|
||||
sceUtilityGetSystemParamInt(PSP_SYSTEMPARAM_ID_INT_UNKNOWN, &ret);
|
||||
return (
|
||||
|
||||
@@ -28,7 +28,7 @@ systemdialogtype_t systemGetActiveDialogTypePSP();
|
||||
*
|
||||
* @return PSP_SYSTEMPARAM language value.
|
||||
*/
|
||||
int systemPSPGetLanguage();
|
||||
int_t systemPSPGetLanguage();
|
||||
|
||||
/**
|
||||
* Returns the user's setting for the PSP "Cross Button" configuration, which
|
||||
@@ -37,4 +37,4 @@ int systemPSPGetLanguage();
|
||||
*
|
||||
* @return PSP_UTILITY_ACCEPT_CROSS or PSP_UTILITY_ACCEPT_CIRCLE.
|
||||
*/
|
||||
int systemPSPGetCrossButtonSetting();
|
||||
int_t systemPSPGetCrossButtonSetting();
|
||||
Reference in New Issue
Block a user