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

@ -161,6 +161,8 @@ set(SYSTEM_LIBS src/core/libraries/system/commondialog.cpp
src/core/libraries/disc_map/disc_map.cpp src/core/libraries/disc_map/disc_map.cpp
src/core/libraries/disc_map/disc_map.h src/core/libraries/disc_map/disc_map.h
src/core/libraries/disc_map/disc_map_codes.h src/core/libraries/disc_map/disc_map_codes.h
src/core/libraries/avplayer/avplayer.cpp
src/core/libraries/avplayer/avplayer.h
) )
set(VIDEOOUT_LIB src/core/libraries/videoout/buffer.h set(VIDEOOUT_LIB src/core/libraries/videoout/buffer.h
@ -188,6 +190,13 @@ set(LIBC_SOURCES src/core/libraries/libc/libc.cpp
src/core/libraries/libc_internal/libc_internal.h src/core/libraries/libc_internal/libc_internal.h
) )
set(DIALOGS_LIB src/core/libraries/dialogs/error_dialog.cpp
src/core/libraries/dialogs/error_dialog.h
src/core/libraries/dialogs/ime_dialog.cpp
src/core/libraries/dialogs/ime_dialog.h
src/core/libraries/dialogs/error_codes.h
)
set(PAD_LIB src/core/libraries/pad/pad.cpp set(PAD_LIB src/core/libraries/pad/pad.cpp
src/core/libraries/pad/pad.h src/core/libraries/pad/pad.h
) )
@ -309,6 +318,7 @@ set(CORE src/core/aerolib/stubs.cpp
${PLAYGO_LIB} ${PLAYGO_LIB}
${USBD_LIB} ${USBD_LIB}
${MISC_LIBS} ${MISC_LIBS}
${DIALOGS_LIB}
src/core/linker.cpp src/core/linker.cpp
src/core/linker.h src/core/linker.h
src/core/memory.cpp src/core/memory.cpp

View File

@ -108,6 +108,9 @@ bool ParseFilterRule(Filter& instance, Iterator begin, Iterator end) {
SUB(Lib, PlayGo) \ SUB(Lib, PlayGo) \
SUB(Lib, Usbd) \ SUB(Lib, Usbd) \
SUB(Lib, Ajm) \ SUB(Lib, Ajm) \
SUB(Lib, ErrorDialog) \
SUB(Lib, ImeDialog) \
SUB(Lib, AvPlayer) \
CLS(Frontend) \ CLS(Frontend) \
CLS(Render) \ CLS(Render) \
SUB(Render, Vulkan) \ SUB(Render, Vulkan) \

View File

@ -75,6 +75,9 @@ enum class Class : u8 {
Lib_PlayGo, ///< The LibScePlayGo implementation. Lib_PlayGo, ///< The LibScePlayGo implementation.
Lib_Usbd, ///< The LibSceUsbd implementation. Lib_Usbd, ///< The LibSceUsbd implementation.
Lib_Ajm, ///< The LibSceAjm implementation. Lib_Ajm, ///< The LibSceAjm implementation.
Lib_ErrorDialog, ///< The LibSceErrorDialog implementation.
Lib_ImeDialog, ///< The LibSceImeDialog implementation.
Lib_AvPlayer, ///< The LibSceAvPlayer implementation.
Frontend, ///< Emulator UI Frontend, ///< Emulator UI
Render, ///< Video Core Render, ///< Video Core
Render_Vulkan, ///< Vulkan backend Render_Vulkan, ///< Vulkan backend

View File

@ -198,6 +198,8 @@ int PS4_SYSV_ABI sceAppContentTemporaryDataMount() {
int PS4_SYSV_ABI sceAppContentTemporaryDataMount2(OrbisAppContentTemporaryDataOption option, int PS4_SYSV_ABI sceAppContentTemporaryDataMount2(OrbisAppContentTemporaryDataOption option,
OrbisAppContentMountPoint* mountPoint) { OrbisAppContentMountPoint* mountPoint) {
if (std::string_view(mountPoint->data).empty()) // causing issues with save_data.
return ORBIS_APP_CONTENT_ERROR_PARAMETER;
auto* param_sfo = Common::Singleton<PSF>::Instance(); auto* param_sfo = Common::Singleton<PSF>::Instance();
std::string id(param_sfo->GetString("CONTENT_ID"), 7, 9); std::string id(param_sfo->GetString("CONTENT_ID"), 7, 9);
const auto& mount_dir = Common::FS::GetUserPath(Common::FS::PathType::TempDataDir) / id; const auto& mount_dir = Common::FS::GetUserPath(Common::FS::PathType::TempDataDir) / id;

View File

@ -0,0 +1,190 @@
// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later
// Generated By moduleGenerator
#include "avplayer.h"
#include "common/logging/log.h"
#include "core/libraries/error_codes.h"
#include "core/libraries/libs.h"
namespace Libraries::AvPlayer {
int PS4_SYSV_ABI sceAvPlayerAddSource() {
LOG_ERROR(Lib_AvPlayer, "(STUBBED) called");
return ORBIS_OK;
}
int PS4_SYSV_ABI sceAvPlayerAddSourceEx() {
LOG_ERROR(Lib_AvPlayer, "(STUBBED) called");
return ORBIS_OK;
}
int PS4_SYSV_ABI sceAvPlayerChangeStream() {
LOG_ERROR(Lib_AvPlayer, "(STUBBED) called");
return ORBIS_OK;
}
int PS4_SYSV_ABI sceAvPlayerClose() {
LOG_ERROR(Lib_AvPlayer, "(STUBBED) called");
return ORBIS_OK;
}
int PS4_SYSV_ABI sceAvPlayerCurrentTime() {
LOG_ERROR(Lib_AvPlayer, "(STUBBED) called");
return ORBIS_OK;
}
int PS4_SYSV_ABI sceAvPlayerDisableStream() {
LOG_ERROR(Lib_AvPlayer, "(STUBBED) called");
return ORBIS_OK;
}
int PS4_SYSV_ABI sceAvPlayerEnableStream() {
LOG_ERROR(Lib_AvPlayer, "(STUBBED) called");
return ORBIS_OK;
}
int PS4_SYSV_ABI sceAvPlayerGetAudioData() {
LOG_ERROR(Lib_AvPlayer, "(STUBBED) called");
return ORBIS_OK;
}
int PS4_SYSV_ABI sceAvPlayerGetStreamInfo() {
LOG_ERROR(Lib_AvPlayer, "(STUBBED) called");
return ORBIS_OK;
}
int PS4_SYSV_ABI sceAvPlayerGetVideoData() {
LOG_ERROR(Lib_AvPlayer, "(STUBBED) called");
return ORBIS_OK;
}
int PS4_SYSV_ABI sceAvPlayerGetVideoDataEx() {
LOG_ERROR(Lib_AvPlayer, "(STUBBED) called");
return ORBIS_OK;
}
int PS4_SYSV_ABI sceAvPlayerInit() {
LOG_ERROR(Lib_AvPlayer, "(STUBBED) called");
return ORBIS_OK;
}
int PS4_SYSV_ABI sceAvPlayerInitEx() {
LOG_ERROR(Lib_AvPlayer, "(STUBBED) called");
return ORBIS_OK;
}
int PS4_SYSV_ABI sceAvPlayerIsActive() {
LOG_ERROR(Lib_AvPlayer, "(STUBBED) called");
return ORBIS_OK;
}
int PS4_SYSV_ABI sceAvPlayerJumpToTime() {
LOG_ERROR(Lib_AvPlayer, "(STUBBED) called");
return ORBIS_OK;
}
int PS4_SYSV_ABI sceAvPlayerPause() {
LOG_ERROR(Lib_AvPlayer, "(STUBBED) called");
return ORBIS_OK;
}
int PS4_SYSV_ABI sceAvPlayerPostInit() {
LOG_ERROR(Lib_AvPlayer, "(STUBBED) called");
return ORBIS_OK;
}
int PS4_SYSV_ABI sceAvPlayerPrintf() {
LOG_ERROR(Lib_AvPlayer, "(STUBBED) called");
return ORBIS_OK;
}
int PS4_SYSV_ABI sceAvPlayerResume() {
LOG_ERROR(Lib_AvPlayer, "(STUBBED) called");
return ORBIS_OK;
}
int PS4_SYSV_ABI sceAvPlayerSetAvSyncMode() {
LOG_ERROR(Lib_AvPlayer, "(STUBBED) called");
return ORBIS_OK;
}
int PS4_SYSV_ABI sceAvPlayerSetLogCallback() {
LOG_ERROR(Lib_AvPlayer, "(STUBBED) called");
return ORBIS_OK;
}
int PS4_SYSV_ABI sceAvPlayerSetLooping() {
LOG_ERROR(Lib_AvPlayer, "(STUBBED) called");
return ORBIS_OK;
}
int PS4_SYSV_ABI sceAvPlayerSetTrickSpeed() {
LOG_ERROR(Lib_AvPlayer, "(STUBBED) called");
return ORBIS_OK;
}
int PS4_SYSV_ABI sceAvPlayerStart() {
LOG_ERROR(Lib_AvPlayer, "(STUBBED) called");
return ORBIS_OK;
}
int PS4_SYSV_ABI sceAvPlayerStop() {
LOG_ERROR(Lib_AvPlayer, "(STUBBED) called");
return ORBIS_OK;
}
int PS4_SYSV_ABI sceAvPlayerStreamCount() {
LOG_ERROR(Lib_AvPlayer, "(STUBBED) called");
return ORBIS_OK;
}
int PS4_SYSV_ABI sceAvPlayerVprintf() {
LOG_ERROR(Lib_AvPlayer, "(STUBBED) called");
return ORBIS_OK;
}
void RegisterlibSceAvPlayer(Core::Loader::SymbolsResolver* sym) {
LIB_FUNCTION("KMcEa+rHsIo", "libSceAvPlayer", 1, "libSceAvPlayer", 1, 0, sceAvPlayerAddSource);
LIB_FUNCTION("x8uvuFOPZhU", "libSceAvPlayer", 1, "libSceAvPlayer", 1, 0,
sceAvPlayerAddSourceEx);
LIB_FUNCTION("buMCiJftcfw", "libSceAvPlayer", 1, "libSceAvPlayer", 1, 0,
sceAvPlayerChangeStream);
LIB_FUNCTION("NkJwDzKmIlw", "libSceAvPlayer", 1, "libSceAvPlayer", 1, 0, sceAvPlayerClose);
LIB_FUNCTION("wwM99gjFf1Y", "libSceAvPlayer", 1, "libSceAvPlayer", 1, 0,
sceAvPlayerCurrentTime);
LIB_FUNCTION("BOVKAzRmuTQ", "libSceAvPlayer", 1, "libSceAvPlayer", 1, 0,
sceAvPlayerDisableStream);
LIB_FUNCTION("ODJK2sn9w4A", "libSceAvPlayer", 1, "libSceAvPlayer", 1, 0,
sceAvPlayerEnableStream);
LIB_FUNCTION("Wnp1OVcrZgk", "libSceAvPlayer", 1, "libSceAvPlayer", 1, 0,
sceAvPlayerGetAudioData);
LIB_FUNCTION("d8FcbzfAdQw", "libSceAvPlayer", 1, "libSceAvPlayer", 1, 0,
sceAvPlayerGetStreamInfo);
LIB_FUNCTION("o3+RWnHViSg", "libSceAvPlayer", 1, "libSceAvPlayer", 1, 0,
sceAvPlayerGetVideoData);
LIB_FUNCTION("JdksQu8pNdQ", "libSceAvPlayer", 1, "libSceAvPlayer", 1, 0,
sceAvPlayerGetVideoDataEx);
LIB_FUNCTION("aS66RI0gGgo", "libSceAvPlayer", 1, "libSceAvPlayer", 1, 0, sceAvPlayerInit);
LIB_FUNCTION("o9eWRkSL+M4", "libSceAvPlayer", 1, "libSceAvPlayer", 1, 0, sceAvPlayerInitEx);
LIB_FUNCTION("UbQoYawOsfY", "libSceAvPlayer", 1, "libSceAvPlayer", 1, 0, sceAvPlayerIsActive);
LIB_FUNCTION("XC9wM+xULz8", "libSceAvPlayer", 1, "libSceAvPlayer", 1, 0, sceAvPlayerJumpToTime);
LIB_FUNCTION("9y5v+fGN4Wk", "libSceAvPlayer", 1, "libSceAvPlayer", 1, 0, sceAvPlayerPause);
LIB_FUNCTION("HD1YKVU26-M", "libSceAvPlayer", 1, "libSceAvPlayer", 1, 0, sceAvPlayerPostInit);
LIB_FUNCTION("agig-iDRrTE", "libSceAvPlayer", 1, "libSceAvPlayer", 1, 0, sceAvPlayerPrintf);
LIB_FUNCTION("w5moABNwnRY", "libSceAvPlayer", 1, "libSceAvPlayer", 1, 0, sceAvPlayerResume);
LIB_FUNCTION("k-q+xOxdc3E", "libSceAvPlayer", 1, "libSceAvPlayer", 1, 0,
sceAvPlayerSetAvSyncMode);
LIB_FUNCTION("eBTreZ84JFY", "libSceAvPlayer", 1, "libSceAvPlayer", 1, 0,
sceAvPlayerSetLogCallback);
LIB_FUNCTION("OVths0xGfho", "libSceAvPlayer", 1, "libSceAvPlayer", 1, 0, sceAvPlayerSetLooping);
LIB_FUNCTION("av8Z++94rs0", "libSceAvPlayer", 1, "libSceAvPlayer", 1, 0,
sceAvPlayerSetTrickSpeed);
LIB_FUNCTION("ET4Gr-Uu07s", "libSceAvPlayer", 1, "libSceAvPlayer", 1, 0, sceAvPlayerStart);
LIB_FUNCTION("ZC17w3vB5Lo", "libSceAvPlayer", 1, "libSceAvPlayer", 1, 0, sceAvPlayerStop);
LIB_FUNCTION("hdTyRzCXQeQ", "libSceAvPlayer", 1, "libSceAvPlayer", 1, 0,
sceAvPlayerStreamCount);
LIB_FUNCTION("yN7Jhuv8g24", "libSceAvPlayer", 1, "libSceAvPlayer", 1, 0, sceAvPlayerVprintf);
};
} // namespace Libraries::AvPlayer

View File

@ -0,0 +1,43 @@
// 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::AvPlayer {
int PS4_SYSV_ABI sceAvPlayerAddSource();
int PS4_SYSV_ABI sceAvPlayerAddSourceEx();
int PS4_SYSV_ABI sceAvPlayerChangeStream();
int PS4_SYSV_ABI sceAvPlayerClose();
int PS4_SYSV_ABI sceAvPlayerCurrentTime();
int PS4_SYSV_ABI sceAvPlayerDisableStream();
int PS4_SYSV_ABI sceAvPlayerEnableStream();
int PS4_SYSV_ABI sceAvPlayerGetAudioData();
int PS4_SYSV_ABI sceAvPlayerGetStreamInfo();
int PS4_SYSV_ABI sceAvPlayerGetVideoData();
int PS4_SYSV_ABI sceAvPlayerGetVideoDataEx();
int PS4_SYSV_ABI sceAvPlayerInit();
int PS4_SYSV_ABI sceAvPlayerInitEx();
int PS4_SYSV_ABI sceAvPlayerIsActive();
int PS4_SYSV_ABI sceAvPlayerJumpToTime();
int PS4_SYSV_ABI sceAvPlayerPause();
int PS4_SYSV_ABI sceAvPlayerPostInit();
int PS4_SYSV_ABI sceAvPlayerPrintf();
int PS4_SYSV_ABI sceAvPlayerResume();
int PS4_SYSV_ABI sceAvPlayerSetAvSyncMode();
int PS4_SYSV_ABI sceAvPlayerSetLogCallback();
int PS4_SYSV_ABI sceAvPlayerSetLooping();
int PS4_SYSV_ABI sceAvPlayerSetTrickSpeed();
int PS4_SYSV_ABI sceAvPlayerStart();
int PS4_SYSV_ABI sceAvPlayerStop();
int PS4_SYSV_ABI sceAvPlayerStreamCount();
int PS4_SYSV_ABI sceAvPlayerVprintf();
void RegisterlibSceAvPlayer(Core::Loader::SymbolsResolver* sym);
} // namespace Libraries::AvPlayer

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

View File

@ -75,7 +75,7 @@ int PS4_SYSV_ABI sceKernelOpen(const char* path, int flags, u16 mode) {
file->m_host_name = mnt->GetHostFile(file->m_guest_name); file->m_host_name = mnt->GetHostFile(file->m_guest_name);
if (read) { if (read) {
file->f.Open(file->m_host_name, Common::FS::FileAccessMode::Read); file->f.Open(file->m_host_name, Common::FS::FileAccessMode::Read);
} else if (write && create && truncate) { } else if (write && create) {
file->f.Open(file->m_host_name, Common::FS::FileAccessMode::Write); file->f.Open(file->m_host_name, Common::FS::FileAccessMode::Write);
} else if (write && create && append) { // CUSA04729 (appends app0/shaderlist.txt) } else if (write && create && append) { // CUSA04729 (appends app0/shaderlist.txt)
file->f.Open(file->m_host_name, Common::FS::FileAccessMode::Append); file->f.Open(file->m_host_name, Common::FS::FileAccessMode::Append);

View File

@ -1067,6 +1067,7 @@ ScePthread PS4_SYSV_ABI posix_pthread_self() {
} }
int PS4_SYSV_ABI scePthreadCondSignal(ScePthreadCond* cond) { int PS4_SYSV_ABI scePthreadCondSignal(ScePthreadCond* cond) {
cond = createCond(cond);
if (cond == nullptr) { if (cond == nullptr) {
return SCE_KERNEL_ERROR_EINVAL; return SCE_KERNEL_ERROR_EINVAL;
} }

View File

@ -33,6 +33,8 @@
#include "core/libraries/usbd/usbd.h" #include "core/libraries/usbd/usbd.h"
#include "core/libraries/videoout/video_out.h" #include "core/libraries/videoout/video_out.h"
#include "src/core/libraries/ajm/ajm.h" #include "src/core/libraries/ajm/ajm.h"
#include "src/core/libraries/dialogs/error_dialog.h"
#include "src/core/libraries/dialogs/ime_dialog.h"
#include "src/core/libraries/libpng/pngdec.h" #include "src/core/libraries/libpng/pngdec.h"
namespace Libraries { namespace Libraries {
@ -71,6 +73,8 @@ void InitHLELibs(Core::Loader::SymbolsResolver* sym) {
Libraries::Usbd::RegisterlibSceUsbd(sym); Libraries::Usbd::RegisterlibSceUsbd(sym);
Libraries::Pad::RegisterlibScePad(sym); Libraries::Pad::RegisterlibScePad(sym);
Libraries::Ajm::RegisterlibSceAjm(sym); Libraries::Ajm::RegisterlibSceAjm(sym);
Libraries::ErrorDialog::RegisterlibSceErrorDialog(sym);
Libraries::ImeDialog::RegisterlibSceImeDialog(sym);
} }
} // namespace Libraries } // namespace Libraries

View File

@ -248,20 +248,12 @@ int PS4_SYSV_ABI sceSaveDataGetEventInfo() {
int PS4_SYSV_ABI sceSaveDataGetEventResult(const OrbisSaveDataEventParam* eventParam, int PS4_SYSV_ABI sceSaveDataGetEventResult(const OrbisSaveDataEventParam* eventParam,
OrbisSaveDataEvent* event) { OrbisSaveDataEvent* event) {
LOG_INFO(Lib_SaveData, "called sceSaveDataGetEventResult : null = {}", (eventParam == nullptr)); // eventParam can be 0/null.
if (eventParam == nullptr) if (event == nullptr)
return ORBIS_SAVE_DATA_ERROR_PARAMETER; return ORBIS_SAVE_DATA_ERROR_NOT_INITIALIZED;
const auto& mount_dir = Common::FS::GetUserPath(Common::FS::PathType::SaveDataDir) / LOG_INFO(Lib_SaveData, "called: Todo.");
std::to_string(1) / game_serial; // fix me
Common::FS::IOFile file(mount_dir / "param.txt", Common::FS::FileAccessMode::Read);
OrbisSaveDataParam* param = new OrbisSaveDataParam{};
file.ReadRaw<u8>(param, sizeof(OrbisSaveDataParam));
LOG_INFO(Lib_SaveData, "called");
event->userId = 1; event->userId = 1;
return ORBIS_OK; return ORBIS_OK;
} }

View File

@ -48,8 +48,8 @@ public:
QAction openSfoViewer("SFO Viewer", widget); QAction openSfoViewer("SFO Viewer", widget);
QAction openTrophyViewer("Trophy Viewer", widget); QAction openTrophyViewer("Trophy Viewer", widget);
menu.addAction(&createShortcut);
menu.addAction(&openFolder); menu.addAction(&openFolder);
menu.addAction(&createShortcut);
menu.addAction(&openSfoViewer); menu.addAction(&openSfoViewer);
menu.addAction(&openTrophyViewer); menu.addAction(&openTrophyViewer);