More HLE stuff and fixes (#273)

* sceKernelOpen truncate is not neccesary

* fixup scePthreadCondSignal

* dummy error , ime dialogs stubbed

* sceErrorDialog implemenation (no ui)

* small fix in sceSaveDataGetEventResult and sceAppContentTemporaryDataMount2.

* ime dialog structs and functions definations

* added stubbed avplayer

* Open folder should be first on context menu

---------

Co-authored-by: raziel1000 <ckraziel@gmail.com>
This commit is contained in:
georgemoralis 2024-07-10 19:20:19 +03:00 committed by GitHub
parent d156dda7b6
commit 5beb607435
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
16 changed files with 701 additions and 14 deletions

View file

@ -0,0 +1,12 @@
// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later
#pragma once
constexpr int ORBIS_ERROR_DIALOG_ERROR_NOT_INITIALIZED = 0x80ED0001; // not initialized
constexpr int ORBIS_ERROR_DIALOG_ERROR_ALREADY_INITIALIZED = 0x80ED0002; // already initialized
constexpr int ORBIS_ERROR_DIALOG_ERROR_PARAM_INVALID = 0x80ED0003; // Parameter is invalid
constexpr int ORBIS_ERROR_DIALOG_ERROR_UNEXPECTED_FATAL = 0x80ED0004; // Unexpected fatal error
constexpr int ORBIS_ERROR_DIALOG_ERROR_INVALID_STATE = 0x80ED0005; // not in a callable state
constexpr int ORBIS_ERROR_DIALOG_ERROR_SERVICE_BUSY = 0x80ED0006; // Process is busy
constexpr int ORBIS_ERROR_DIALOG_ERROR_INVALID_USER_ID = 0x80ED0007; // Invalid user ID

View file

@ -0,0 +1,86 @@
// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later
// Generated By moduleGenerator
#include "common/logging/log.h"
#include "core/libraries/error_codes.h"
#include "core/libraries/libs.h"
#include "error_codes.h"
#include "error_dialog.h"
namespace Libraries::ErrorDialog {
static OrbisErrorDialogStatus g_error_dlg_status =
OrbisErrorDialogStatus::ORBIS_ERROR_DIALOG_STATUS_NONE;
int PS4_SYSV_ABI sceErrorDialogClose() {
g_error_dlg_status = OrbisErrorDialogStatus::ORBIS_ERROR_DIALOG_STATUS_FINISHED;
return ORBIS_OK;
}
OrbisErrorDialogStatus PS4_SYSV_ABI sceErrorDialogGetStatus() {
return g_error_dlg_status;
}
int PS4_SYSV_ABI sceErrorDialogInitialize(OrbisErrorDialogParam* param) {
if (g_error_dlg_status == OrbisErrorDialogStatus::ORBIS_ERROR_DIALOG_STATUS_INITIALIZED) {
LOG_ERROR(Lib_ErrorDialog, "Error dialog is already at init mode");
return ORBIS_ERROR_DIALOG_ERROR_ALREADY_INITIALIZED;
}
g_error_dlg_status = OrbisErrorDialogStatus::ORBIS_ERROR_DIALOG_STATUS_INITIALIZED;
return ORBIS_OK;
}
int PS4_SYSV_ABI sceErrorDialogOpen(OrbisErrorDialogParam* param) {
LOG_ERROR(Lib_ErrorDialog, "size = {} errorcode = {:#x} userid = {}", param->size,
param->errorCode, param->userId);
g_error_dlg_status = OrbisErrorDialogStatus::ORBIS_ERROR_DIALOG_STATUS_RUNNING;
return ORBIS_OK;
}
int PS4_SYSV_ABI sceErrorDialogOpenDetail() {
LOG_ERROR(Lib_ErrorDialog, "(STUBBED) called");
return ORBIS_OK;
}
int PS4_SYSV_ABI sceErrorDialogOpenWithReport() {
LOG_ERROR(Lib_ErrorDialog, "(STUBBED) called");
return ORBIS_OK;
}
int PS4_SYSV_ABI sceErrorDialogTerminate() {
if (g_error_dlg_status == OrbisErrorDialogStatus::ORBIS_ERROR_DIALOG_STATUS_NONE) {
LOG_ERROR(Lib_ErrorDialog, "Error dialog hasn't initialized");
return ORBIS_ERROR_DIALOG_ERROR_NOT_INITIALIZED;
}
g_error_dlg_status = OrbisErrorDialogStatus::ORBIS_ERROR_DIALOG_STATUS_NONE;
return ORBIS_OK;
}
OrbisErrorDialogStatus PS4_SYSV_ABI sceErrorDialogUpdateStatus() {
// TODO when imgui dialog is done this will loop until ORBIS_ERROR_DIALOG_STATUS_FINISHED
// This should be done calling sceErrorDialogClose but since we don't have a dialog we finish it
// here
return OrbisErrorDialogStatus::ORBIS_ERROR_DIALOG_STATUS_FINISHED;
}
void RegisterlibSceErrorDialog(Core::Loader::SymbolsResolver* sym) {
LIB_FUNCTION("ekXHb1kDBl0", "libSceErrorDialog", 1, "libSceErrorDialog", 1, 1,
sceErrorDialogClose);
LIB_FUNCTION("t2FvHRXzgqk", "libSceErrorDialog", 1, "libSceErrorDialog", 1, 1,
sceErrorDialogGetStatus);
LIB_FUNCTION("I88KChlynSs", "libSceErrorDialog", 1, "libSceErrorDialog", 1, 1,
sceErrorDialogInitialize);
LIB_FUNCTION("M2ZF-ClLhgY", "libSceErrorDialog", 1, "libSceErrorDialog", 1, 1,
sceErrorDialogOpen);
LIB_FUNCTION("jrpnVQfJYgQ", "libSceErrorDialog", 1, "libSceErrorDialog", 1, 1,
sceErrorDialogOpenDetail);
LIB_FUNCTION("wktCiyWoDTI", "libSceErrorDialog", 1, "libSceErrorDialog", 1, 1,
sceErrorDialogOpenWithReport);
LIB_FUNCTION("9XAxK2PMwk8", "libSceErrorDialog", 1, "libSceErrorDialog", 1, 1,
sceErrorDialogTerminate);
LIB_FUNCTION("WWiGuh9XfgQ", "libSceErrorDialog", 1, "libSceErrorDialog", 1, 1,
sceErrorDialogUpdateStatus);
};
} // namespace Libraries::ErrorDialog

View file

@ -0,0 +1,37 @@
// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later
#pragma once
#include "common/types.h"
namespace Core::Loader {
class SymbolsResolver;
}
namespace Libraries::ErrorDialog {
enum OrbisErrorDialogStatus {
ORBIS_ERROR_DIALOG_STATUS_NONE = 0,
ORBIS_ERROR_DIALOG_STATUS_INITIALIZED = 1,
ORBIS_ERROR_DIALOG_STATUS_RUNNING = 2,
ORBIS_ERROR_DIALOG_STATUS_FINISHED = 3
};
struct OrbisErrorDialogParam {
s32 size;
u32 errorCode;
s32 userId;
s32 reserved;
};
int PS4_SYSV_ABI sceErrorDialogClose();
OrbisErrorDialogStatus PS4_SYSV_ABI sceErrorDialogGetStatus();
int PS4_SYSV_ABI sceErrorDialogInitialize(OrbisErrorDialogParam* param);
int PS4_SYSV_ABI sceErrorDialogOpen(OrbisErrorDialogParam* param);
int PS4_SYSV_ABI sceErrorDialogOpenDetail();
int PS4_SYSV_ABI sceErrorDialogOpenWithReport();
int PS4_SYSV_ABI sceErrorDialogTerminate();
OrbisErrorDialogStatus PS4_SYSV_ABI sceErrorDialogUpdateStatus();
void RegisterlibSceErrorDialog(Core::Loader::SymbolsResolver* sym);
} // namespace Libraries::ErrorDialog

View file

@ -0,0 +1,118 @@
// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later
// Generated By moduleGenerator
#include "common/logging/log.h"
#include "core/libraries/error_codes.h"
#include "core/libraries/libs.h"
#include "ime_dialog.h"
namespace Libraries::ImeDialog {
int PS4_SYSV_ABI sceImeDialogAbort() {
LOG_ERROR(Lib_ImeDialog, "(STUBBED) called");
return ORBIS_OK;
}
int PS4_SYSV_ABI sceImeDialogForceClose() {
LOG_ERROR(Lib_ImeDialog, "(STUBBED) called");
return ORBIS_OK;
}
int PS4_SYSV_ABI sceImeDialogForTestFunction() {
LOG_ERROR(Lib_ImeDialog, "(STUBBED) called");
return ORBIS_OK;
}
int PS4_SYSV_ABI sceImeDialogGetCurrentStarState() {
LOG_ERROR(Lib_ImeDialog, "(STUBBED) called");
return ORBIS_OK;
}
int PS4_SYSV_ABI sceImeDialogGetPanelPositionAndForm() {
LOG_ERROR(Lib_ImeDialog, "(STUBBED) called");
return ORBIS_OK;
}
int PS4_SYSV_ABI sceImeDialogGetPanelSize() {
LOG_ERROR(Lib_ImeDialog, "(STUBBED) called");
return ORBIS_OK;
}
int PS4_SYSV_ABI sceImeDialogGetPanelSizeExtended() {
LOG_ERROR(Lib_ImeDialog, "(STUBBED) called");
return ORBIS_OK;
}
int PS4_SYSV_ABI sceImeDialogGetResult(OrbisImeDialogResult* result) {
LOG_ERROR(Lib_ImeDialog, "(STUBBED) called");
return ORBIS_OK;
}
int PS4_SYSV_ABI sceImeDialogGetStatus() {
LOG_ERROR(Lib_ImeDialog, "(STUBBED) called");
return ORBIS_OK;
}
int PS4_SYSV_ABI sceImeDialogInit(const OrbisImeDialogParam* param,
const OrbisImeParamExtended* extended) {
LOG_ERROR(Lib_ImeDialog, "(STUBBED) called");
return ORBIS_OK;
}
int PS4_SYSV_ABI sceImeDialogInitInternal() {
LOG_ERROR(Lib_ImeDialog, "(STUBBED) called");
return ORBIS_OK;
}
int PS4_SYSV_ABI sceImeDialogInitInternal2() {
LOG_ERROR(Lib_ImeDialog, "(STUBBED) called");
return ORBIS_OK;
}
int PS4_SYSV_ABI sceImeDialogInitInternal3() {
LOG_ERROR(Lib_ImeDialog, "(STUBBED) called");
return ORBIS_OK;
}
int PS4_SYSV_ABI sceImeDialogSetPanelPosition() {
LOG_ERROR(Lib_ImeDialog, "(STUBBED) called");
return ORBIS_OK;
}
int PS4_SYSV_ABI sceImeDialogTerm() {
LOG_ERROR(Lib_ImeDialog, "(STUBBED) called");
return ORBIS_OK;
}
void RegisterlibSceImeDialog(Core::Loader::SymbolsResolver* sym) {
LIB_FUNCTION("oBmw4xrmfKs", "libSceImeDialog", 1, "libSceImeDialog", 1, 1, sceImeDialogAbort);
LIB_FUNCTION("bX4H+sxPI-o", "libSceImeDialog", 1, "libSceImeDialog", 1, 1,
sceImeDialogForceClose);
LIB_FUNCTION("UFcyYDf+e88", "libSceImeDialog", 1, "libSceImeDialog", 1, 1,
sceImeDialogForTestFunction);
LIB_FUNCTION("fy6ntM25pEc", "libSceImeDialog", 1, "libSceImeDialog", 1, 1,
sceImeDialogGetCurrentStarState);
LIB_FUNCTION("8jqzzPioYl8", "libSceImeDialog", 1, "libSceImeDialog", 1, 1,
sceImeDialogGetPanelPositionAndForm);
LIB_FUNCTION("wqsJvRXwl58", "libSceImeDialog", 1, "libSceImeDialog", 1, 1,
sceImeDialogGetPanelSize);
LIB_FUNCTION("CRD+jSErEJQ", "libSceImeDialog", 1, "libSceImeDialog", 1, 1,
sceImeDialogGetPanelSizeExtended);
LIB_FUNCTION("x01jxu+vxlc", "libSceImeDialog", 1, "libSceImeDialog", 1, 1,
sceImeDialogGetResult);
LIB_FUNCTION("IADmD4tScBY", "libSceImeDialog", 1, "libSceImeDialog", 1, 1,
sceImeDialogGetStatus);
LIB_FUNCTION("NUeBrN7hzf0", "libSceImeDialog", 1, "libSceImeDialog", 1, 1, sceImeDialogInit);
LIB_FUNCTION("KR6QDasuKco", "libSceImeDialog", 1, "libSceImeDialog", 1, 1,
sceImeDialogInitInternal);
LIB_FUNCTION("oe92cnJQ9HE", "libSceImeDialog", 1, "libSceImeDialog", 1, 1,
sceImeDialogInitInternal2);
LIB_FUNCTION("IoKIpNf9EK0", "libSceImeDialog", 1, "libSceImeDialog", 1, 1,
sceImeDialogInitInternal3);
LIB_FUNCTION("-2WqB87KKGg", "libSceImeDialog", 1, "libSceImeDialog", 1, 1,
sceImeDialogSetPanelPosition);
LIB_FUNCTION("gyTyVn+bXMw", "libSceImeDialog", 1, "libSceImeDialog", 1, 1, sceImeDialogTerm);
};
} // namespace Libraries::ImeDialog

View file

@ -0,0 +1,186 @@
// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later
#pragma once
#include "common/types.h"
namespace Core::Loader {
class SymbolsResolver;
}
namespace Libraries::ImeDialog {
enum OrbisImeDialogStatus {
ORBIS_IME_DIALOG_STATUS_NONE = 0,
ORBIS_IME_DIALOG_STATUS_RUNNING = 1,
ORBIS_IME_DIALOG_STATUS_FINISHED = 2
};
enum OrbisImeDialogEndStatus {
ORBIS_IME_DIALOG_END_STATUS_OK = 0,
ORBIS_IME_DIALOG_END_STATUS_USER_CANCELED = 1,
ORBIS_IME_DIALOG_END_STATUS_ABORTED = 2
};
struct OrbisImeDialogResult {
OrbisImeDialogEndStatus endstatus;
s32 reserved[12];
};
enum OrbisImeType {
ORBIS_IME_TYPE_DEFAULT = 0,
ORBIS_IME_TYPE_BASIC_LATIN = 1,
ORBIS_IME_TYPE_URL = 2,
ORBIS_IME_TYPE_MAIL = 3,
ORBIS_IME_TYPE_NUMBER = 4
};
enum OrbisImeEnterLabel {
ORBIS_IME_ENTER_LABEL_DEFAULT = 0,
ORBIS_IME_ENTER_LABEL_SEND = 1,
ORBIS_IME_ENTER_LABEL_SEARCH = 2,
ORBIS_IME_ENTER_LABEL_GO = 3
};
enum OrbiImeInputMethod { ORBIS_IME_INPUT_METHOD_DEFAULT = 0 };
typedef int (*OrbisImeTextFilter)(wchar_t* outText, u32* outTextLength, const wchar_t* srcText,
u32 srcTextLength);
enum OrbisImeHorizontalAlignment {
ORBIS_IME_HALIGN_LEFT = 0,
ORBIS_IME_HALIGN_CENTER = 1,
ORBIS_IME_HALIGN_RIGHT = 2
};
enum OrbisImeVerticalAlignment {
ORBIS_IME_VALIGN_TOP = 0,
ORBIS_IME_VALIGN_CENTER = 1,
ORBIS_IME_VALIGN_BOTTOM = 2
};
struct OrbisImeDialogParam {
s32 userId;
OrbisImeType type;
u64 supportedLanguages;
OrbisImeEnterLabel enterLabel;
OrbiImeInputMethod inputMethod;
OrbisImeTextFilter filter;
u32 option;
u32 maxTextLength;
wchar_t* inputTextBuffer;
float posx;
float posy;
OrbisImeHorizontalAlignment horizontalAlignment;
OrbisImeVerticalAlignment verticalAlignment;
const wchar_t* placeholder;
const wchar_t* title;
s8 reserved[16];
};
struct OrbisImeColor {
u8 r;
u8 g;
u8 b;
u8 a;
};
enum OrbisImePanelPriority {
ORBIS_IME_PANEL_PRIORITY_DEFAULT = 0,
ORBIS_IME_PANEL_PRIORITY_ALPHABET = 1,
ORBIS_IME_PANEL_PRIORITY_SYMBOL = 2,
ORBIS_IME_PANEL_PRIORITY_ACCENT = 3
};
enum OrbisImeKeyboardType {
ORBIS_IME_KEYBOARD_TYPE_NONE = 0,
ORBIS_IME_KEYBOARD_TYPE_DANISH = 1,
ORBIS_IME_KEYBOARD_TYPE_GERMAN = 2,
ORBIS_IME_KEYBOARD_TYPE_GERMAN_SW = 3,
ORBIS_IME_KEYBOARD_TYPE_ENGLISH_US = 4,
ORBIS_IME_KEYBOARD_TYPE_ENGLISH_GB = 5,
ORBIS_IME_KEYBOARD_TYPE_SPANISH = 6,
ORBIS_IME_KEYBOARD_TYPE_SPANISH_LA = 7,
ORBIS_IME_KEYBOARD_TYPE_FINNISH = 8,
ORBIS_IME_KEYBOARD_TYPE_FRENCH = 9,
ORBIS_IME_KEYBOARD_TYPE_FRENCH_BR = 10,
ORBIS_IME_KEYBOARD_TYPE_FRENCH_CA = 11,
ORBIS_IME_KEYBOARD_TYPE_FRENCH_SW = 12,
ORBIS_IME_KEYBOARD_TYPE_ITALIAN = 13,
ORBIS_IME_KEYBOARD_TYPE_DUTCH = 14,
ORBIS_IME_KEYBOARD_TYPE_NORWEGIAN = 15,
ORBIS_IME_KEYBOARD_TYPE_POLISH = 16,
ORBIS_IME_KEYBOARD_TYPE_PORTUGUESE_BR = 17,
ORBIS_IME_KEYBOARD_TYPE_PORTUGUESE_PT = 18,
ORBIS_IME_KEYBOARD_TYPE_RUSSIAN = 19,
ORBIS_IME_KEYBOARD_TYPE_SWEDISH = 20,
ORBIS_IME_KEYBOARD_TYPE_TURKISH = 21,
ORBIS_IME_KEYBOARD_TYPE_JAPANESE_ROMAN = 22,
ORBIS_IME_KEYBOARD_TYPE_JAPANESE_KANA = 23,
ORBIS_IME_KEYBOARD_TYPE_KOREAN = 24,
ORBIS_IME_KEYBOARD_TYPE_SM_CHINESE = 25,
ORBIS_IME_KEYBOARD_TYPE_TR_CHINESE_ZY = 26,
ORBIS_IME_KEYBOARD_TYPE_TR_CHINESE_PY_HK = 27,
ORBIS_IME_KEYBOARD_TYPE_TR_CHINESE_PY_TW = 28,
ORBIS_IME_KEYBOARD_TYPE_TR_CHINESE_CG = 29,
ORBIS_IME_KEYBOARD_TYPE_ARABIC_AR = 30,
ORBIS_IME_KEYBOARD_TYPE_THAI = 31,
ORBIS_IME_KEYBOARD_TYPE_CZECH = 32,
ORBIS_IME_KEYBOARD_TYPE_GREEK = 33,
ORBIS_IME_KEYBOARD_TYPE_INDONESIAN = 34,
ORBIS_IME_KEYBOARD_TYPE_VIETNAMESE = 35,
ORBIS_IME_KEYBOARD_TYPE_ROMANIAN = 36,
ORBIS_IME_KEYBOARD_TYPE_HUNGARIAN = 37
};
struct OrbisImeKeycode {
u16 keycode;
wchar_t character;
u32 status;
OrbisImeKeyboardType type;
s32 userId;
u32 resourceId;
u64 timestamp;
};
typedef int (*OrbisImeExtKeyboardFilter)(const OrbisImeKeycode* srcKeycode, u16* outKeycode,
u32* outStatus, void* reserved);
struct OrbisImeParamExtended {
u32 option;
OrbisImeColor colorBase;
OrbisImeColor colorLine;
OrbisImeColor colorTextField;
OrbisImeColor colorPreedit;
OrbisImeColor colorButtonDefault;
OrbisImeColor colorButtonFunction;
OrbisImeColor colorButtonSymbol;
OrbisImeColor colorText;
OrbisImeColor colorSpecial;
OrbisImePanelPriority priority;
char* additionalDictionaryPath;
OrbisImeExtKeyboardFilter extKeyboardFilter;
uint32_t disableDevice;
uint32_t extKeyboardMode;
int8_t reserved[60];
};
int PS4_SYSV_ABI sceImeDialogAbort();
int PS4_SYSV_ABI sceImeDialogForceClose();
int PS4_SYSV_ABI sceImeDialogForTestFunction();
int PS4_SYSV_ABI sceImeDialogGetCurrentStarState();
int PS4_SYSV_ABI sceImeDialogGetPanelPositionAndForm();
int PS4_SYSV_ABI sceImeDialogGetPanelSize();
int PS4_SYSV_ABI sceImeDialogGetPanelSizeExtended();
int PS4_SYSV_ABI sceImeDialogGetResult(OrbisImeDialogResult* result);
/*OrbisImeDialogStatus*/ int PS4_SYSV_ABI sceImeDialogGetStatus();
int PS4_SYSV_ABI sceImeDialogInit(const OrbisImeDialogParam* param,
const OrbisImeParamExtended* extended);
int PS4_SYSV_ABI sceImeDialogInitInternal();
int PS4_SYSV_ABI sceImeDialogInitInternal2();
int PS4_SYSV_ABI sceImeDialogInitInternal3();
int PS4_SYSV_ABI sceImeDialogSetPanelPosition();
int PS4_SYSV_ABI sceImeDialogTerm();
void RegisterlibSceImeDialog(Core::Loader::SymbolsResolver* sym);
} // namespace Libraries::ImeDialog