From 6f1e488b37facdf0c78c638b10b338206faff879 Mon Sep 17 00:00:00 2001 From: georgemoralis Date: Thu, 2 May 2024 10:57:24 +0300 Subject: [PATCH 1/3] fixed stack allocation issue --- CMakeLists.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 670190cc..5ded8ed3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -394,6 +394,8 @@ if (WIN32) endif() # Target Windows 10 RS5 add_definitions(-DNTDDI_VERSION=0x0A000006 -D_WIN32_WINNT=0x0A00 -DWINVER=0x0A00) + # Increase stack,commit + set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /STACK:0x200000,0x200000") endif() if (WIN32) From b0b73f12839e243281c1479cb968d4e60c5f80a8 Mon Sep 17 00:00:00 2001 From: georgemoralis Date: Thu, 2 May 2024 10:57:45 +0300 Subject: [PATCH 2/3] print param.sfo info at startup --- src/main.cpp | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/main.cpp b/src/main.cpp index 967bd227..b37702b2 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -6,6 +6,7 @@ #include #include +#include #include "common/config.h" #include "common/discord.h" #include "common/logging/backend.h" @@ -48,6 +49,23 @@ int main(int argc, char* argv[]) { std::filesystem::path p = std::string(path); mnt->Mount(p.parent_path(), "/app0"); + // Loading param.sfo file if exists + std::filesystem::path sce_sys_folder = p.parent_path() / "sce_sys"; + if (std::filesystem::is_directory(sce_sys_folder)) { + for (const auto& entry : std::filesystem::directory_iterator(sce_sys_folder)) { + if (entry.path().filename() == "param.sfo") { + auto* param_sfo = Common::Singleton::Instance(); + param_sfo->open(sce_sys_folder.string() + "/param.sfo"); + std::string id(param_sfo->GetString("CONTENT_ID"), 7, 9); + std::string title(param_sfo->GetString("TITLE")); + LOG_INFO(Loader, "Game id: {} Title: {}", id, title); + u32 fw_version = param_sfo->GetInteger("SYSTEM_VER"); + std::string app_version = param_sfo->GetString("APP_VER"); + LOG_INFO(Loader, "Fw: {:#x} App Version: {}", fw_version, app_version); + } + } + } + auto linker = Common::Singleton::Instance(); Libraries::InitHLELibs(&linker->getHLESymbols()); linker->LoadModule(path); From 2308d7f1d6319ee685c7f89b6e2d2036b24093cf Mon Sep 17 00:00:00 2001 From: georgemoralis Date: Thu, 2 May 2024 15:48:48 +0300 Subject: [PATCH 3/3] better way for compiler option --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 5ded8ed3..498051ad 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -395,7 +395,7 @@ if (WIN32) # Target Windows 10 RS5 add_definitions(-DNTDDI_VERSION=0x0A000006 -D_WIN32_WINNT=0x0A00 -DWINVER=0x0A00) # Increase stack,commit - set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /STACK:0x200000,0x200000") + target_link_options(shadps4 PRIVATE /STACK:0x200000,0x200000) endif() if (WIN32)