From bb8a400b7becbb41a621cb29d1a817d80d5bd981 Mon Sep 17 00:00:00 2001
From: georgemoralis <giorgosmrls@gmail.com>
Date: Mon, 8 Apr 2024 19:03:51 +0300
Subject: [PATCH] dummy libscesavedatadialog

---
 CMakeLists.txt                              |  2 +
 src/common/logging/filter.cpp               |  1 +
 src/common/logging/types.h                  | 81 ++++++++++----------
 src/core/hle/libraries/libs.cpp             |  2 +
 src/core/libraries/libscesavedatadialog.cpp | 84 +++++++++++++++++++++
 src/core/libraries/libscesavedatadialog.h   | 22 ++++++
 6 files changed, 152 insertions(+), 40 deletions(-)
 create mode 100644 src/core/libraries/libscesavedatadialog.cpp
 create mode 100644 src/core/libraries/libscesavedatadialog.h

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 00ec2d40..12ebc4f8 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -120,6 +120,8 @@ set(LIBRARIES src/core/libraries/library_common.h
               src/core/libraries/libsceposix.h
               src/core/libraries/libscesavedata.cpp
               src/core/libraries/libscesavedata.h
+              src/core/libraries/libscesavedatadialog.cpp
+              src/core/libraries/libscesavedatadialog.h
               src/core/libraries/libscessl.cpp
               src/core/libraries/libscessl.h
               src/core/libraries/libscesysmodule.cpp
diff --git a/src/common/logging/filter.cpp b/src/common/logging/filter.cpp
index 32ffd245..042d0f9c 100644
--- a/src/common/logging/filter.cpp
+++ b/src/common/logging/filter.cpp
@@ -92,6 +92,7 @@ bool ParseFilterRule(Filter& instance, Iterator begin, Iterator end) {
     SUB(Lib, Net)                                                                                  \
     SUB(Lib, NetCtl)                                                                               \
     SUB(Lib, SaveData)                                                                             \
+    SUB(Lib, SaveDataDialog)                                                                       \
     SUB(Lib, Http)                                                                                 \
     SUB(Lib, Ssl)                                                                                  \
     SUB(Lib, SysModule)                                                                            \
diff --git a/src/common/logging/types.h b/src/common/logging/types.h
index 0287a198..840d3d04 100644
--- a/src/common/logging/types.h
+++ b/src/common/logging/types.h
@@ -29,46 +29,47 @@ enum class Level : u8 {
  * filter.cpp.
  */
 enum class Class : u8 {
-    Log,               ///< Messages about the log system itself
-    Common,            ///< Library routines
-    Common_Filesystem, ///< Filesystem interface library
-    Common_Memory,     ///< Memory mapping and management functions
-    Core,              ///< LLE emulation core
-    Core_Linker,       ///< The module linker
-    Config,            ///< Emulator configuration (including commandline)
-    Debug,             ///< Debugging tools
-    Kernel,            ///< The HLE implementation of the PS4 kernel.
-    Kernel_Pthread,    ///< The pthread implementation of the kernel.
-    Kernel_Fs,         ///< The filesystem implementation of the kernel.
-    Kernel_Vmm,        ///< The virtual memory implementation of the kernel.
-    Kernel_Event,      ///< The event management implementation of the kernel.
-    Kernel_Sce,        ///< The sony specific interfaces provided by the kernel.
-    Lib,               ///< HLE implementation of system library. Each major library
-                       ///< should have its own subclass.
-    Lib_LibC,          ///< The LibC implementation.
-    Lib_Kernel,        ///< The LibKernel implementation.
-    Lib_Pad,           ///< The LibScePad implementation.
-    Lib_GnmDriver,     ///< The LibSceGnmDriver implementation.
-    Lib_SystemService, ///< The LibSceSystemService implementation.
-    Lib_UserService,   ///< The LibSceUserService implementation.
-    Lib_VideoOut,      ///< The LibSceVideoOut implementation.
-    Lib_CommonDlg,     ///< The LibSceCommonDialog implementation.
-    Lib_MsgDlg,        ///< The LibSceMsgDialog implementation.
-    Lib_AudioOut,      ///< The LibSceAudioOut implementation.
-    Lib_AudioIn,       ///< The LibSceAudioIn implementation.
-    Lib_Net,           ///< The LibSceNet implementation.
-    Lib_NetCtl,        ///< The LibSecNetCtl implementation.
-    Lib_SaveData,      ///< The LibSceSaveData implementation.
-    Lib_Ssl,           ///< The LibSceSsl implementation.
-    Lib_Http,          ///< The LibSceHttp implementation.
-    Lib_SysModule,     ///< The LibSceSysModule implementation
-    Frontend,          ///< Emulator UI
-    Render,            ///< Video Core
-    Render_Vulkan,     ///< Vulkan backend
-    Loader,            ///< ROM loader
-    Input,             ///< Input emulation
-    Tty,               ///< Debug output from emu
-    Count              ///< Total number of logging classes
+    Log,                ///< Messages about the log system itself
+    Common,             ///< Library routines
+    Common_Filesystem,  ///< Filesystem interface library
+    Common_Memory,      ///< Memory mapping and management functions
+    Core,               ///< LLE emulation core
+    Core_Linker,        ///< The module linker
+    Config,             ///< Emulator configuration (including commandline)
+    Debug,              ///< Debugging tools
+    Kernel,             ///< The HLE implementation of the PS4 kernel.
+    Kernel_Pthread,     ///< The pthread implementation of the kernel.
+    Kernel_Fs,          ///< The filesystem implementation of the kernel.
+    Kernel_Vmm,         ///< The virtual memory implementation of the kernel.
+    Kernel_Event,       ///< The event management implementation of the kernel.
+    Kernel_Sce,         ///< The sony specific interfaces provided by the kernel.
+    Lib,                ///< HLE implementation of system library. Each major library
+                        ///< should have its own subclass.
+    Lib_LibC,           ///< The LibC implementation.
+    Lib_Kernel,         ///< The LibKernel implementation.
+    Lib_Pad,            ///< The LibScePad implementation.
+    Lib_GnmDriver,      ///< The LibSceGnmDriver implementation.
+    Lib_SystemService,  ///< The LibSceSystemService implementation.
+    Lib_UserService,    ///< The LibSceUserService implementation.
+    Lib_VideoOut,       ///< The LibSceVideoOut implementation.
+    Lib_CommonDlg,      ///< The LibSceCommonDialog implementation.
+    Lib_MsgDlg,         ///< The LibSceMsgDialog implementation.
+    Lib_AudioOut,       ///< The LibSceAudioOut implementation.
+    Lib_AudioIn,        ///< The LibSceAudioIn implementation.
+    Lib_Net,            ///< The LibSceNet implementation.
+    Lib_NetCtl,         ///< The LibSecNetCtl implementation.
+    Lib_SaveData,       ///< The LibSceSaveData implementation.
+    Lib_SaveDataDialog, ///< The LibSceSaveDataDialog implementation.
+    Lib_Ssl,            ///< The LibSceSsl implementation.
+    Lib_Http,           ///< The LibSceHttp implementation.
+    Lib_SysModule,      ///< The LibSceSysModule implementation
+    Frontend,           ///< Emulator UI
+    Render,             ///< Video Core
+    Render_Vulkan,      ///< Vulkan backend
+    Loader,             ///< ROM loader
+    Input,              ///< Input emulation
+    Tty,                ///< Debug output from emu
+    Count               ///< Total number of logging classes
 };
 
 } // namespace Common::Log
diff --git a/src/core/hle/libraries/libs.cpp b/src/core/hle/libraries/libs.cpp
index 1e28e100..c06d634e 100644
--- a/src/core/hle/libraries/libs.cpp
+++ b/src/core/hle/libraries/libs.cpp
@@ -18,6 +18,7 @@
 #include "src/core/libraries/libscenetctl.h"
 #include "src/core/libraries/libsceposix.h"
 #include "src/core/libraries/libscesavedata.h"
+#include "src/core/libraries/libscesavedatadialog.h"
 #include "src/core/libraries/libscessl.h"
 #include "src/core/libraries/libscesysmodule.h"
 #include "src/core/libraries/libscesystemservice.h"
@@ -49,6 +50,7 @@ void InitHLELibs(Core::Loader::SymbolsResolver* sym) {
     Libraries::Kernel::Registerlibkernel(sym);
     Libraries::Posix::Registerlibsceposix(sym);
     Libraries::AudioIn::RegisterlibSceAudioIn(sym);
+    Libraries::SaveDataDialog::RegisterlibSceSaveDataDialog(sym);
 }
 
 } // namespace OldLibraries
diff --git a/src/core/libraries/libscesavedatadialog.cpp b/src/core/libraries/libscesavedatadialog.cpp
new file mode 100644
index 00000000..8d53e73e
--- /dev/null
+++ b/src/core/libraries/libscesavedatadialog.cpp
@@ -0,0 +1,84 @@
+// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project
+// SPDX-License-Identifier: GPL-2.0-or-later
+
+// Generated By moduleGenerator
+#include "common/logging/log.h"
+#include "error_codes.h"
+#include "libscesavedatadialog.h"
+
+namespace Libraries::SaveDataDialog {
+
+int PS4_SYSV_ABI sceSaveDataDialogClose() {
+    LOG_ERROR(Lib_SaveDataDialog, "(STUBBED) called");
+    return ORBIS_OK;
+}
+
+int PS4_SYSV_ABI sceSaveDataDialogGetResult() {
+    LOG_ERROR(Lib_SaveDataDialog, "(STUBBED) called");
+    return ORBIS_OK;
+}
+
+int PS4_SYSV_ABI sceSaveDataDialogGetStatus() {
+    LOG_ERROR(Lib_SaveDataDialog, "(STUBBED) called");
+    return ORBIS_OK;
+}
+
+int PS4_SYSV_ABI sceSaveDataDialogInitialize() {
+    LOG_ERROR(Lib_SaveDataDialog, "(STUBBED) called");
+    return ORBIS_OK;
+}
+
+int PS4_SYSV_ABI sceSaveDataDialogIsReadyToDisplay() {
+    LOG_ERROR(Lib_SaveDataDialog, "(STUBBED) called");
+    return ORBIS_OK;
+}
+
+int PS4_SYSV_ABI sceSaveDataDialogOpen() {
+    LOG_ERROR(Lib_SaveDataDialog, "(STUBBED) called");
+    return ORBIS_OK;
+}
+
+int PS4_SYSV_ABI sceSaveDataDialogProgressBarInc() {
+    LOG_ERROR(Lib_SaveDataDialog, "(STUBBED) called");
+    return ORBIS_OK;
+}
+
+int PS4_SYSV_ABI sceSaveDataDialogProgressBarSetValue() {
+    LOG_ERROR(Lib_SaveDataDialog, "(STUBBED) called");
+    return ORBIS_OK;
+}
+
+int PS4_SYSV_ABI sceSaveDataDialogTerminate() {
+    LOG_ERROR(Lib_SaveDataDialog, "(STUBBED) called");
+    return ORBIS_OK;
+}
+
+int PS4_SYSV_ABI sceSaveDataDialogUpdateStatus() {
+    LOG_ERROR(Lib_SaveDataDialog, "(STUBBED) called");
+    return ORBIS_OK;
+}
+
+void RegisterlibSceSaveDataDialog(Core::Loader::SymbolsResolver* sym) {
+    LIB_FUNCTION("fH46Lag88XY", "libSceSaveDataDialog", 1, "libSceSaveDataDialog", 1, 1,
+                 sceSaveDataDialogClose);
+    LIB_FUNCTION("yEiJ-qqr6Cg", "libSceSaveDataDialog", 1, "libSceSaveDataDialog", 1, 1,
+                 sceSaveDataDialogGetResult);
+    LIB_FUNCTION("ERKzksauAJA", "libSceSaveDataDialog", 1, "libSceSaveDataDialog", 1, 1,
+                 sceSaveDataDialogGetStatus);
+    LIB_FUNCTION("s9e3+YpRnzw", "libSceSaveDataDialog", 1, "libSceSaveDataDialog", 1, 1,
+                 sceSaveDataDialogInitialize);
+    LIB_FUNCTION("en7gNVnh878", "libSceSaveDataDialog", 1, "libSceSaveDataDialog", 1, 1,
+                 sceSaveDataDialogIsReadyToDisplay);
+    LIB_FUNCTION("4tPhsP6FpDI", "libSceSaveDataDialog", 1, "libSceSaveDataDialog", 1, 1,
+                 sceSaveDataDialogOpen);
+    LIB_FUNCTION("V-uEeFKARJU", "libSceSaveDataDialog", 1, "libSceSaveDataDialog", 1, 1,
+                 sceSaveDataDialogProgressBarInc);
+    LIB_FUNCTION("hay1CfTmLyA", "libSceSaveDataDialog", 1, "libSceSaveDataDialog", 1, 1,
+                 sceSaveDataDialogProgressBarSetValue);
+    LIB_FUNCTION("YuH2FA7azqQ", "libSceSaveDataDialog", 1, "libSceSaveDataDialog", 1, 1,
+                 sceSaveDataDialogTerminate);
+    LIB_FUNCTION("KK3Bdg1RWK0", "libSceSaveDataDialog", 1, "libSceSaveDataDialog", 1, 1,
+                 sceSaveDataDialogUpdateStatus);
+};
+
+} // namespace Libraries::SaveDataDialog
\ No newline at end of file
diff --git a/src/core/libraries/libscesavedatadialog.h b/src/core/libraries/libscesavedatadialog.h
new file mode 100644
index 00000000..f13978b8
--- /dev/null
+++ b/src/core/libraries/libscesavedatadialog.h
@@ -0,0 +1,22 @@
+// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project
+// SPDX-License-Identifier: GPL-2.0-or-later
+
+#pragma once
+
+#include "library_common.h"
+
+namespace Libraries::SaveDataDialog {
+
+int PS4_SYSV_ABI sceSaveDataDialogClose();
+int PS4_SYSV_ABI sceSaveDataDialogGetResult();
+int PS4_SYSV_ABI sceSaveDataDialogGetStatus();
+int PS4_SYSV_ABI sceSaveDataDialogInitialize();
+int PS4_SYSV_ABI sceSaveDataDialogIsReadyToDisplay();
+int PS4_SYSV_ABI sceSaveDataDialogOpen();
+int PS4_SYSV_ABI sceSaveDataDialogProgressBarInc();
+int PS4_SYSV_ABI sceSaveDataDialogProgressBarSetValue();
+int PS4_SYSV_ABI sceSaveDataDialogTerminate();
+int PS4_SYSV_ABI sceSaveDataDialogUpdateStatus();
+
+void RegisterlibSceSaveDataDialog(Core::Loader::SymbolsResolver* sym);
+} // namespace Libraries::SaveDataDialog
\ No newline at end of file