From 0ed9ea5b859a76f72623ecf64d79e9449fb06c44 Mon Sep 17 00:00:00 2001 From: georgemoralis Date: Wed, 17 Jul 2024 20:32:14 +0300 Subject: [PATCH] force imedialog to input "shadps4" as name . That way we can pass games that want username . temp solution till imgui dialog prepared --- src/core/libraries/dialogs/ime_dialog.cpp | 18 ++++++++++++++---- src/core/libraries/dialogs/ime_dialog.h | 3 +-- 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/src/core/libraries/dialogs/ime_dialog.cpp b/src/core/libraries/dialogs/ime_dialog.cpp index 89136a03..3fa35c2c 100644 --- a/src/core/libraries/dialogs/ime_dialog.cpp +++ b/src/core/libraries/dialogs/ime_dialog.cpp @@ -9,6 +9,8 @@ namespace Libraries::ImeDialog { +static OrbisImeDialogStatus g_ime_dlg_status = OrbisImeDialogStatus::ORBIS_IME_DIALOG_STATUS_NONE; + int PS4_SYSV_ABI sceImeDialogAbort() { LOG_ERROR(Lib_ImeDialog, "(STUBBED) called"); return ORBIS_OK; @@ -45,18 +47,25 @@ int PS4_SYSV_ABI sceImeDialogGetPanelSizeExtended() { } int PS4_SYSV_ABI sceImeDialogGetResult(OrbisImeDialogResult* result) { + result->endstatus = OrbisImeDialogEndStatus::ORBIS_IME_DIALOG_END_STATUS_OK; LOG_ERROR(Lib_ImeDialog, "(STUBBED) called"); return ORBIS_OK; } int PS4_SYSV_ABI sceImeDialogGetStatus() { - LOG_ERROR(Lib_ImeDialog, "(STUBBED) called"); - return ORBIS_OK; + if (g_ime_dlg_status == OrbisImeDialogStatus::ORBIS_IME_DIALOG_STATUS_RUNNING) { + return OrbisImeDialogStatus::ORBIS_IME_DIALOG_STATUS_FINISHED; + } + + return g_ime_dlg_status; } -int PS4_SYSV_ABI sceImeDialogInit(const OrbisImeDialogParam* param, - const OrbisImeParamExtended* extended) { +int PS4_SYSV_ABI sceImeDialogInit(OrbisImeDialogParam* param, OrbisImeParamExtended* extended) { LOG_ERROR(Lib_ImeDialog, "(STUBBED) called"); + const std::wstring_view text = L"shadPS4"; + param->maxTextLength = text.size(); + std::memcpy(param->inputTextBuffer, text.data(), text.size() * sizeof(wchar_t)); + g_ime_dlg_status = OrbisImeDialogStatus::ORBIS_IME_DIALOG_STATUS_RUNNING; return ORBIS_OK; } @@ -82,6 +91,7 @@ int PS4_SYSV_ABI sceImeDialogSetPanelPosition() { int PS4_SYSV_ABI sceImeDialogTerm() { LOG_ERROR(Lib_ImeDialog, "(STUBBED) called"); + g_ime_dlg_status = OrbisImeDialogStatus::ORBIS_IME_DIALOG_STATUS_NONE; return ORBIS_OK; } diff --git a/src/core/libraries/dialogs/ime_dialog.h b/src/core/libraries/dialogs/ime_dialog.h index 08c980a4..ffe42b31 100644 --- a/src/core/libraries/dialogs/ime_dialog.h +++ b/src/core/libraries/dialogs/ime_dialog.h @@ -174,8 +174,7 @@ 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 sceImeDialogInit(OrbisImeDialogParam* param, OrbisImeParamExtended* extended); int PS4_SYSV_ABI sceImeDialogInitInternal(); int PS4_SYSV_ABI sceImeDialogInitInternal2(); int PS4_SYSV_ABI sceImeDialogInitInternal3();