mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2025-07-26 20:15:03 +00:00
sceErrorDialog implemenation (no ui)
This commit is contained in:
parent
c28f3b4f9d
commit
13b9469af4
@ -192,6 +192,7 @@ 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
|
||||
|
12
src/core/libraries/dialogs/error_codes.h
Normal file
12
src/core/libraries/dialogs/error_codes.h
Normal 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
|
@ -5,27 +5,36 @@
|
||||
#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() {
|
||||
LOG_ERROR(Lib_ErrorDialog, "(STUBBED) called");
|
||||
g_error_dlg_status = OrbisErrorDialogStatus::ORBIS_ERROR_DIALOG_STATUS_FINISHED;
|
||||
return ORBIS_OK;
|
||||
}
|
||||
|
||||
int PS4_SYSV_ABI sceErrorDialogGetStatus() {
|
||||
LOG_ERROR(Lib_ErrorDialog, "(STUBBED) called");
|
||||
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 sceErrorDialogInitialize() {
|
||||
LOG_ERROR(Lib_ErrorDialog, "(STUBBED) called");
|
||||
return ORBIS_OK;
|
||||
}
|
||||
|
||||
int PS4_SYSV_ABI sceErrorDialogOpen() {
|
||||
LOG_ERROR(Lib_ErrorDialog, "(STUBBED) called");
|
||||
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;
|
||||
}
|
||||
|
||||
@ -40,13 +49,19 @@ int PS4_SYSV_ABI sceErrorDialogOpenWithReport() {
|
||||
}
|
||||
|
||||
int PS4_SYSV_ABI sceErrorDialogTerminate() {
|
||||
LOG_ERROR(Lib_ErrorDialog, "(STUBBED) called");
|
||||
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;
|
||||
}
|
||||
|
||||
int PS4_SYSV_ABI sceErrorDialogUpdateStatus() {
|
||||
LOG_ERROR(Lib_ErrorDialog, "(STUBBED) called");
|
||||
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) {
|
||||
|
@ -10,14 +10,28 @@ 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();
|
||||
int PS4_SYSV_ABI sceErrorDialogGetStatus();
|
||||
int PS4_SYSV_ABI sceErrorDialogInitialize();
|
||||
int PS4_SYSV_ABI sceErrorDialogOpen();
|
||||
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();
|
||||
int PS4_SYSV_ABI sceErrorDialogUpdateStatus();
|
||||
OrbisErrorDialogStatus PS4_SYSV_ABI sceErrorDialogUpdateStatus();
|
||||
|
||||
void RegisterlibSceErrorDialog(Core::Loader::SymbolsResolver* sym);
|
||||
} // namespace Libraries::ErrorDialog
|
Loading…
Reference in New Issue
Block a user