From 7e5cc6162cfa5ff951bee48d440d0834fa8a7461 Mon Sep 17 00:00:00 2001 From: SamuelFontes Date: Thu, 8 Aug 2024 15:57:43 -0300 Subject: [PATCH 1/5] qt_gui: Refreshing game list after install directory change The game list wasn't being refreshed automaticly after a manual directory change on the QT GUI, now the RefreshGameTable will be called after the GameInstallDialog is executed. --- src/qt_gui/main_window.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/qt_gui/main_window.cpp b/src/qt_gui/main_window.cpp index 29d7c15fe..646433ee7 100644 --- a/src/qt_gui/main_window.cpp +++ b/src/qt_gui/main_window.cpp @@ -583,6 +583,7 @@ void MainWindow::InstallDragDropPkg(std::filesystem::path file, int pkgNum, int void MainWindow::InstallDirectory() { GameInstallDialog dlg; dlg.exec(); + RefreshGameTable(); } void MainWindow::SetLastUsedTheme() { From 564b2f63105ecb4cc1ead7a218084c1ee19ff07d Mon Sep 17 00:00:00 2001 From: SamuelFontes Date: Thu, 8 Aug 2024 16:14:35 -0300 Subject: [PATCH 2/5] 361: Game directory window appears every time qt_gui: When a command line argument is passed to the GUI version, it will always prompt to change the game directory. This happens because the "user" folder is created on the elf or eboot.bin location. This change will ignore the game install directory configuration at startup when an command line argument is passed. Since if a game was passed, it should start automatically as this is the expected behaviour. --- src/qt_gui/main.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/qt_gui/main.cpp b/src/qt_gui/main.cpp index 15a06c867..cff01cc2b 100644 --- a/src/qt_gui/main.cpp +++ b/src/qt_gui/main.cpp @@ -21,8 +21,11 @@ int main(int argc, char* argv[]) { Config::load(user_dir / "config.toml"); std::filesystem::create_directory(user_dir / "game_data"); + // Check if elf or eboot.bin path was passed as a command line argument + bool has_command_line_argument = argc > 1; + // Check if the game install directory is set - if (Config::getGameInstallDir() == "") { + if (Config::getGameInstallDir() == "" && !has_command_line_argument) { GameInstallDialog dlg; dlg.exec(); } @@ -35,7 +38,7 @@ int main(int argc, char* argv[]) { m_main_window->Init(); // Check for command line arguments - if (argc > 1) { + if (has_command_line_argument) { Core::Emulator emulator; emulator.Run(argv[1]); } From e5087877ae527fedc939791289fe843a57e69ee0 Mon Sep 17 00:00:00 2001 From: georgemoralis Date: Thu, 8 Aug 2024 22:31:14 +0300 Subject: [PATCH 3/5] revert some sdl switches --- externals/CMakeLists.txt | 7 ------- 1 file changed, 7 deletions(-) diff --git a/externals/CMakeLists.txt b/externals/CMakeLists.txt index 6426ef16d..9ebdd8783 100644 --- a/externals/CMakeLists.txt +++ b/externals/CMakeLists.txt @@ -59,14 +59,7 @@ endif() # SDL3 if (NOT TARGET SDL3::SDL3) - set(SDL_DIRECTX OFF) - set(SDL_MMX OFF) - set(SDL_OPENGL OFF) - set(SDL_OPENGLES OFF) set(SDL_PIPEWIRE OFF) - set(SDL_RENDER_D3D OFF) - set(SDL_WASAPI OFF) - set(SDL_XINPUT OFF) add_subdirectory(sdl3) endif() From 48c58d5ce0ca430518a5c2fc237d66783a83dc3c Mon Sep 17 00:00:00 2001 From: Stephen Miller <56742918+StevenMiller123@users.noreply.github.com> Date: Thu, 8 Aug 2024 15:42:51 -0500 Subject: [PATCH 4/5] Kernel-Related Fixes (#386) * Fix OrbisKernelBatchMapEntry struct UE4 games and GTA V cause the BatchMap offset to overflow on Windows. Changing the type fixes this, and doesn't seem to cause any regressions on Windows or Linux. * Implement posix_sem_trywait Grand Theft Auto V needs this. * Add missing scePthreadAttrGetdetachstate NID Noticed this missing NID while testing games. --- src/core/libraries/kernel/memory_management.h | 2 +- src/core/libraries/kernel/thread_management.cpp | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/core/libraries/kernel/memory_management.h b/src/core/libraries/kernel/memory_management.h index 25a4a9f09..6735ead71 100644 --- a/src/core/libraries/kernel/memory_management.h +++ b/src/core/libraries/kernel/memory_management.h @@ -63,7 +63,7 @@ struct OrbisVirtualQueryInfo { struct OrbisKernelBatchMapEntry { void* start; - off_t offset; + size_t offset; size_t length; char protection; char type; diff --git a/src/core/libraries/kernel/thread_management.cpp b/src/core/libraries/kernel/thread_management.cpp index 48347ea53..6be90cce3 100644 --- a/src/core/libraries/kernel/thread_management.cpp +++ b/src/core/libraries/kernel/thread_management.cpp @@ -1360,6 +1360,10 @@ int PS4_SYSV_ABI posix_sem_wait(sem_t* sem) { return sem_wait(sem); } +int PS4_SYSV_ABI posix_sem_trywait(sem_t* sem) { + return sem_trywait(sem); +} + #ifndef HAVE_SEM_TIMEDWAIT int sem_timedwait(sem_t* sem, const struct timespec* abstime) { int rc; @@ -1499,6 +1503,7 @@ void pthreadSymbolsRegister(Core::Loader::SymbolsResolver* sym) { LIB_FUNCTION("WrOLvHU0yQM", "libScePosix", 1, "libkernel", 1, 1, posix_pthread_setspecific); LIB_FUNCTION("4+h9EzwKF4I", "libkernel", 1, "libkernel", 1, 1, scePthreadAttrSetschedpolicy); LIB_FUNCTION("-Wreprtu0Qs", "libkernel", 1, "libkernel", 1, 1, scePthreadAttrSetdetachstate); + LIB_FUNCTION("JaRMy+QcpeU", "libkernel", 1, "libkernel", 1, 1, scePthreadAttrGetdetachstate); LIB_FUNCTION("eXbUSpEaTsA", "libkernel", 1, "libkernel", 1, 1, scePthreadAttrSetinheritsched); LIB_FUNCTION("DzES9hQF4f4", "libkernel", 1, "libkernel", 1, 1, scePthreadAttrSetschedparam); LIB_FUNCTION("nsYoNRywwNg", "libkernel", 1, "libkernel", 1, 1, scePthreadAttrInit); @@ -1611,6 +1616,7 @@ void pthreadSymbolsRegister(Core::Loader::SymbolsResolver* sym) { LIB_FUNCTION("Xs9hdiD7sAA", "libScePosix", 1, "libkernel", 1, 1, posix_pthread_setschedparam); LIB_FUNCTION("pDuPEf3m4fI", "libScePosix", 1, "libkernel", 1, 1, posix_sem_init); LIB_FUNCTION("YCV5dGGBcCo", "libScePosix", 1, "libkernel", 1, 1, posix_sem_wait); + LIB_FUNCTION("WBWzsRifCEA", "libScePosix", 1, "libkernel", 1, 1, posix_sem_trywait); LIB_FUNCTION("w5IHyvahg-o", "libScePosix", 1, "libkernel", 1, 1, posix_sem_timedwait); LIB_FUNCTION("IKP8typ0QUk", "libScePosix", 1, "libkernel", 1, 1, posix_sem_post); LIB_FUNCTION("cDW233RAwWo", "libScePosix", 1, "libkernel", 1, 1, posix_sem_destroy); From ab56665d4b75e13e99e824dc531b8642d0377632 Mon Sep 17 00:00:00 2001 From: SleepingSnakezzz <71992016+SleepingSnakezzz@users.noreply.github.com> Date: Thu, 8 Aug 2024 22:43:21 +0200 Subject: [PATCH 5/5] Update latest build instructions.md (#385) Expands on the existing instructions for more clarity. --- documents/Quickstart/Quickstart.md | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/documents/Quickstart/Quickstart.md b/documents/Quickstart/Quickstart.md index 29c7ba499..4c51b288a 100644 --- a/documents/Quickstart/Quickstart.md +++ b/documents/Quickstart/Quickstart.md @@ -37,13 +37,18 @@ SPDX-License-Identifier: GPL-2.0-or-later - Windows 10 or Ubuntu 22.04 -## Have the latest WIP version +## How to run the latest Work-in-Progress builds of ShadPS4 -When you go to Github Release, you have the latest major versions (e.g. v0.0.3), but if you want to have the latest Work-In-Progress version, you can go to Actions on Github to download it (Please note a Github account is required to be able to download). +1. Go to and make sure you are logged into your GitHub account (important!) +2. On the left side of the page, select your operating system of choice (the "**qt**" versions have a user interface, which is probably the one you want. The others are SDL versions, which can only be run via command line). ![image](https://github.com/user-attachments/assets/43f01bbf-236c-4d6d-98ac-f5a5badd4ce8) - +3. In the workflow list, select the latest entry with a green :white_check_mark: icon in front of it. (or the latest entry for whatever pull request you wish to test). ![image](https://github.com/user-attachments/assets/6365f407-867c-44ae-bf00-944f8d84a349) -After downloading the version suitable for you (Windows or Linux), you must unzip the file and then you can run it. Please note, there are two versions for each platform, a Qt version with user interface and one without (SDL Builds). +4. On the bottom of this page, select the name of the file, and it should start downloading. (If there is no file here, double check that you are indeed logged into a GitHub account, and that there is a green :white_check_mark: icon. ![image](https://github.com/user-attachments/assets/97924500-3911-4f90-ab63-ffae7e52700b) + +5. Once downloaded, extract to its own folder, and run ShadPS4's executable from the extracted folder. + +6. Upon first launch, ShadPS4 will prompt you to select a folder to store your installed games in. Select "Browse" and then select a folder that ShadPS4 can use to install your PKG files to. ## Install PKG files