Merge branch 'main' into http-part2

This commit is contained in:
georgemoralis 2025-04-08 16:45:03 +03:00 committed by GitHub
commit a4ff2ac8b7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
18 changed files with 99 additions and 93 deletions

View file

@ -54,8 +54,9 @@ else()
endif()
if (ARCHITECTURE STREQUAL "x86_64")
# Target the same x86_64 feature set as the PS4 CPU to match requirements.
add_compile_options(-march=btver2 -mno-sse4a)
# Target Sandy Bridge as a reasonable subset of instructions supported by PS4 and host CPUs.
# Note that the native PS4 architecture 'btver2' has been attempted but causes issues with M1 CPUs.
add_compile_options(-march=sandybridge -mtune=generic)
endif()
if (APPLE AND ARCHITECTURE STREQUAL "x86_64" AND CMAKE_HOST_SYSTEM_PROCESSOR STREQUAL "arm64")
@ -202,6 +203,8 @@ execute_process(
OUTPUT_STRIP_TRAILING_WHITESPACE
)
set(APP_VERSION "0.7.1 WIP")
set(APP_IS_RELEASE false)
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/src/common/scm_rev.cpp.in" "${CMAKE_CURRENT_BINARY_DIR}/src/common/scm_rev.cpp" @ONLY)
message("end git things, remote: ${GIT_REMOTE_NAME}, branch: ${GIT_BRANCH}")
@ -218,7 +221,7 @@ find_package(SDL3 3.1.2 CONFIG)
find_package(stb MODULE)
find_package(toml11 4.2.0 CONFIG)
find_package(tsl-robin-map 1.3.0 CONFIG)
find_package(VulkanHeaders 1.4.305 CONFIG)
find_package(VulkanHeaders 1.4.309 CONFIG)
find_package(VulkanMemoryAllocator 3.1.0 CONFIG)
find_package(xbyak 7.07 CONFIG)
find_package(xxHash 0.8.2 MODULE)
@ -671,7 +674,6 @@ set(COMMON src/common/logging/backend.cpp
src/common/uint128.h
src/common/unique_function.h
src/common/va_ctx.h
src/common/version.h
src/common/ntapi.h
src/common/ntapi.cpp
src/common/number_utils.h
@ -1193,8 +1195,8 @@ if (ENABLE_QT_GUI)
MACOSX_BUNDLE ON
MACOSX_BUNDLE_INFO_PLIST "${CMAKE_CURRENT_SOURCE_DIR}/dist/MacOSBundleInfo.plist.in"
MACOSX_BUNDLE_ICON_FILE "shadPS4.icns"
MACOSX_BUNDLE_SHORT_VERSION_STRING "0.4.1"
)
MACOSX_BUNDLE_SHORT_VERSION_STRING "${APP_VERSION}"
)
set_source_files_properties(src/images/shadPS4.icns PROPERTIES
MACOSX_PACKAGE_LOCATION Resources)

View file

@ -122,6 +122,27 @@ R3 | M |
Keyboard and mouse inputs can be customized in the settings menu by clicking the Controller button, and further details and help on controls are also found there. Custom bindings are saved per-game. Inputs support up to three keys per binding, mouse buttons, mouse movement mapped to joystick input, and more.
# Firmware files
shadPS4 can load some PlayStation 4 firmware files, these must be dumped from your legally owned PlayStation 4 console.\
The following firmware modules are supported and must be placed in shadPS4's `user/sys_modules` folder.
<div align="center">
| Modules | Modules | Modules | Modules |
|-------------------------|-------------------------|-------------------------|-------------------------|
| libSceCesCs.sprx | libSceFont.sprx | libSceFontFt.sprx | libSceFreeTypeOt.sprx |
| libSceJson.sprx | libSceJson2.sprx | libSceLibcInternal.sprx | libSceNgs2.sprx |
| libSceRtc.sprx | libSceUlt.sprx | | |
</div>
> [!Caution]
> The above modules are required to run the games properly and must be extracted from your PlayStation 4.\
> **We do not provide any information or support on how to do this**.
# Main team
- [**georgemoralis**](https://github.com/georgemoralis)

@ -1 +1 @@
Subproject commit 2048427e50f9eb20f2b8f98d316ecaee398c9b91
Subproject commit 83510e0f3835c3c43651dda087305abc42572e17

@ -1 +1 @@
Subproject commit 2c32b6bf86f3c4a5539aa1f0bacbd59fe61759cf
Subproject commit cb71abe3063094bf383379b15473d39cb1144120

@ -1 +1 @@
Subproject commit a03d2f6d5753b365d704d58161825890baad0755
Subproject commit 952f776f6573aafbb62ea717d871cd1d6816c387

View file

@ -7,10 +7,10 @@
#include <fmt/xchar.h> // for wstring support
#include <toml.hpp>
#include "common/config.h"
#include "common/logging/formatter.h"
#include "common/path_util.h"
#include "config.h"
#include "logging/formatter.h"
#include "version.h"
#include "common/scm_rev.h"
namespace toml {
template <typename TC, typename K>
@ -763,7 +763,7 @@ void load(const std::filesystem::path& path) {
logFilter = toml::find_or<std::string>(general, "logFilter", "");
logType = toml::find_or<std::string>(general, "logType", "sync");
userName = toml::find_or<std::string>(general, "userName", "shadPS4");
if (Common::isRelease) {
if (Common::g_is_release) {
updateChannel = toml::find_or<std::string>(general, "updateChannel", "Release");
} else {
updateChannel = toml::find_or<std::string>(general, "updateChannel", "Nightly");
@ -1108,7 +1108,7 @@ void setDefaultValues() {
logFilter = "";
logType = "sync";
userName = "shadPS4";
if (Common::isRelease) {
if (Common::g_is_release) {
updateChannel = "Release";
} else {
updateChannel = "Nightly";

View file

@ -3,21 +3,17 @@
#include "common/scm_rev.h"
#define GIT_REV "@GIT_REV@"
#define GIT_BRANCH "@GIT_BRANCH@"
#define GIT_DESC "@GIT_DESC@"
#define GIT_REMOTE_NAME "@GIT_REMOTE_NAME@"
#define GIT_REMOTE_URL "@GIT_REMOTE_URL@"
#define BUILD_DATE "@BUILD_DATE@"
namespace Common {
const char g_scm_rev[] = GIT_REV;
const char g_scm_branch[] = GIT_BRANCH;
const char g_scm_desc[] = GIT_DESC;
const char g_scm_remote_name[] = GIT_REMOTE_NAME;
const char g_scm_remote_url[] = GIT_REMOTE_URL;
const char g_scm_date[] = BUILD_DATE;
constexpr char g_version[] = "@APP_VERSION@";
constexpr bool g_is_release = @APP_IS_RELEASE@;
constexpr char g_scm_rev[] = "@GIT_REV@";
constexpr char g_scm_branch[] = "@GIT_BRANCH@";
constexpr char g_scm_desc[] = "@GIT_DESC@";
constexpr char g_scm_remote_name[] = "@GIT_REMOTE_NAME@";
constexpr char g_scm_remote_url[] = "@GIT_REMOTE_URL@";
constexpr char g_scm_date[] = "@BUILD_DATE@";
} // namespace

View file

@ -5,6 +5,9 @@
namespace Common {
extern const char g_version[];
extern const bool g_is_release;
extern const char g_scm_rev[];
extern const char g_scm_branch[];
extern const char g_scm_desc[];

View file

@ -1,14 +0,0 @@
// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later
#pragma once
#include <string>
#include <string_view>
namespace Common {
constexpr char VERSION[] = "0.7.1 WIP";
constexpr bool isRelease = false;
} // namespace Common

View file

@ -22,7 +22,6 @@
#include "common/polyfill_thread.h"
#include "common/scm_rev.h"
#include "common/singleton.h"
#include "common/version.h"
#include "core/file_format/psf.h"
#include "core/file_format/trp.h"
#include "core/file_sys/fs.h"
@ -123,7 +122,7 @@ void Emulator::Run(const std::filesystem::path& file, const std::vector<std::str
Common::Log::Initialize(id + ".log");
Common::Log::Start();
}
LOG_INFO(Loader, "Starting shadps4 emulator v{} ", Common::VERSION);
LOG_INFO(Loader, "Starting shadps4 emulator v{} ", Common::g_version);
LOG_INFO(Loader, "Revision {}", Common::g_scm_rev);
LOG_INFO(Loader, "Branch {}", Common::g_scm_branch);
LOG_INFO(Loader, "Description {}", Common::g_scm_desc);
@ -197,8 +196,8 @@ void Emulator::Run(const std::filesystem::path& file, const std::vector<std::str
std::string game_title = fmt::format("{} - {} <{}>", id, title, app_version);
std::string window_title = "";
if (Common::isRelease) {
window_title = fmt::format("shadPS4 v{} | {}", Common::VERSION, game_title);
if (Common::g_is_release) {
window_title = fmt::format("shadPS4 v{} | {}", Common::g_version, game_title);
} else {
std::string remote_url(Common::g_scm_remote_url);
std::string remote_host;
@ -208,10 +207,10 @@ void Emulator::Run(const std::filesystem::path& file, const std::vector<std::str
remote_host = "unknown";
}
if (remote_host == "shadps4-emu" || remote_url.length() == 0) {
window_title = fmt::format("shadPS4 v{} {} {} | {}", Common::VERSION,
window_title = fmt::format("shadPS4 v{} {} {} | {}", Common::g_version,
Common::g_scm_branch, Common::g_scm_desc, game_title);
} else {
window_title = fmt::format("shadPS4 v{} {}/{} {} | {}", Common::VERSION, remote_host,
window_title = fmt::format("shadPS4 v{} {}/{} {} | {}", Common::g_version, remote_host,
Common::g_scm_branch, Common::g_scm_desc, game_title);
}
}

View file

@ -22,7 +22,6 @@
#include "common/elf_info.h"
#include "common/io_file.h"
#include "common/path_util.h"
#include "common/version.h"
#include "input/controller.h"
#include "input/input_mouse.h"
@ -551,18 +550,18 @@ void ControllerOutput::FinalizeUpdate() {
break;
case Axis::TriggerLeft:
ApplyDeadzone(new_param, lefttrigger_deadzone);
controller->Axis(0, c_axis, GetAxis(0x0, 0x80, *new_param));
controller->Axis(0, c_axis, GetAxis(0x0, 0x7f, *new_param));
controller->CheckButton(0, OrbisPadButtonDataOffset::L2, *new_param > 0x20);
return;
case Axis::TriggerRight:
ApplyDeadzone(new_param, righttrigger_deadzone);
controller->Axis(0, c_axis, GetAxis(0x0, 0x80, *new_param));
controller->Axis(0, c_axis, GetAxis(0x0, 0x7f, *new_param));
controller->CheckButton(0, OrbisPadButtonDataOffset::R2, *new_param > 0x20);
return;
default:
break;
}
controller->Axis(0, c_axis, GetAxis(-0x80, 0x80, *new_param * multiplier));
controller->Axis(0, c_axis, GetAxis(-0x80, 0x7f, *new_param * multiplier));
}
}

View file

@ -61,11 +61,11 @@ Uint32 MousePolling(void* param, Uint32 id, Uint32 interval) {
float a_x = cos(angle) * output_speed, a_y = sin(angle) * output_speed;
if (d_x != 0 && d_y != 0) {
controller->Axis(0, axis_x, GetAxis(-0x80, 0x80, a_x));
controller->Axis(0, axis_y, GetAxis(-0x80, 0x80, a_y));
controller->Axis(0, axis_x, GetAxis(-0x80, 0x7f, a_x));
controller->Axis(0, axis_y, GetAxis(-0x80, 0x7f, a_y));
} else {
controller->Axis(0, axis_x, GetAxis(-0x80, 0x80, 0));
controller->Axis(0, axis_y, GetAxis(-0x80, 0x80, 0));
controller->Axis(0, axis_x, GetAxis(-0x80, 0x7f, 0));
controller->Axis(0, axis_y, GetAxis(-0x80, 0x7f, 0));
}
return interval;

View file

@ -24,7 +24,6 @@
#include <common/config.h>
#include <common/path_util.h>
#include <common/scm_rev.h>
#include <common/version.h>
#include "check_update.h"
using namespace Common::FS;
@ -52,7 +51,7 @@ void CheckUpdate::CheckForUpdates(const bool showMessage) {
url = QUrl("https://api.github.com/repos/shadps4-emu/shadPS4/releases/latest");
checkName = false;
} else {
if (Common::isRelease) {
if (Common::g_is_release) {
Config::setUpdateChannel("Release");
} else {
Config::setUpdateChannel("Nightly");
@ -162,7 +161,7 @@ tr("The Auto Updater allows up to 60 update checks per hour.\\nYou have reached
QString currentRev = (updateChannel == "Nightly")
? QString::fromStdString(Common::g_scm_rev)
: "v." + QString::fromStdString(Common::VERSION);
: "v." + QString::fromStdString(Common::g_version);
QString currentDate = Common::g_scm_date;
QDateTime dateTime = QDateTime::fromString(latestDate, Qt::ISODate);

View file

@ -13,7 +13,7 @@
#include "cheats_patches.h"
#include "common/config.h"
#include "common/path_util.h"
#include "common/version.h"
#include "common/scm_rev.h"
#include "compatibility_info.h"
#include "game_info.h"
#include "trophy_viewer.h"
@ -115,14 +115,15 @@ public:
compatibilityMenu->addAction(updateCompatibility);
compatibilityMenu->addAction(viewCompatibilityReport);
if (Common::isRelease) {
if (Common::g_is_release) {
compatibilityMenu->addAction(submitCompatibilityReport);
}
menu.addMenu(compatibilityMenu);
compatibilityMenu->setEnabled(Config::getCompatibilityEnabled());
viewCompatibilityReport->setEnabled(!m_games[itemID].compatibility.url.isEmpty());
viewCompatibilityReport->setEnabled(m_games[itemID].compatibility.status !=
CompatibilityStatus::Unknown);
// Show menu.
auto selected = menu.exec(global_pos);
@ -557,24 +558,36 @@ public:
}
if (selected == viewCompatibilityReport) {
if (!m_games[itemID].compatibility.url.isEmpty())
QDesktopServices::openUrl(QUrl(m_games[itemID].compatibility.url));
if (m_games[itemID].compatibility.issue_number != "") {
auto url_issues =
"https://github.com/shadps4-emu/shadps4-game-compatibility/issues/";
QDesktopServices::openUrl(
QUrl(url_issues + m_games[itemID].compatibility.issue_number));
}
}
if (selected == submitCompatibilityReport) {
QUrl url = QUrl("https://github.com/shadps4-emu/shadps4-game-compatibility/issues/new");
QUrlQuery query;
query.addQueryItem("template", QString("game_compatibility.yml"));
query.addQueryItem(
"title", QString("%1 - %2").arg(QString::fromStdString(m_games[itemID].serial),
QString::fromStdString(m_games[itemID].name)));
query.addQueryItem("game-name", QString::fromStdString(m_games[itemID].name));
query.addQueryItem("game-serial", QString::fromStdString(m_games[itemID].serial));
query.addQueryItem("game-version", QString::fromStdString(m_games[itemID].version));
query.addQueryItem("emulator-version", QString(Common::VERSION));
url.setQuery(query);
if (m_games[itemID].compatibility.issue_number == "") {
QUrl url =
QUrl("https://github.com/shadps4-emu/shadps4-game-compatibility/issues/new");
QUrlQuery query;
query.addQueryItem("template", QString("game_compatibility.yml"));
query.addQueryItem(
"title", QString("%1 - %2").arg(QString::fromStdString(m_games[itemID].serial),
QString::fromStdString(m_games[itemID].name)));
query.addQueryItem("game-name", QString::fromStdString(m_games[itemID].name));
query.addQueryItem("game-serial", QString::fromStdString(m_games[itemID].serial));
query.addQueryItem("game-version", QString::fromStdString(m_games[itemID].version));
query.addQueryItem("emulator-version", QString(Common::g_version));
url.setQuery(query);
QDesktopServices::openUrl(url);
QDesktopServices::openUrl(url);
} else {
auto url_issues =
"https://github.com/shadps4-emu/shadps4-game-compatibility/issues/";
QDesktopServices::openUrl(
QUrl(url_issues + m_games[itemID].compatibility.issue_number));
}
}
}

View file

@ -18,7 +18,6 @@
#include "common/path_util.h"
#include "common/scm_rev.h"
#include "common/string_util.h"
#include "common/version.h"
#include "control_settings.h"
#include "game_install_dialog.h"
#include "kbm_gui.h"
@ -58,8 +57,8 @@ bool MainWindow::Init() {
// show ui
setMinimumSize(720, 405);
std::string window_title = "";
if (Common::isRelease) {
window_title = fmt::format("shadPS4 v{}", Common::VERSION);
if (Common::g_is_release) {
window_title = fmt::format("shadPS4 v{}", Common::g_version);
} else {
std::string remote_url(Common::g_scm_remote_url);
std::string remote_host;
@ -69,10 +68,10 @@ bool MainWindow::Init() {
remote_host = "unknown";
}
if (remote_host == "shadps4-emu" || remote_url.length() == 0) {
window_title = fmt::format("shadPS4 v{} {} {}", Common::VERSION, Common::g_scm_branch,
window_title = fmt::format("shadPS4 v{} {} {}", Common::g_version, Common::g_scm_branch,
Common::g_scm_desc);
} else {
window_title = fmt::format("shadPS4 v{} {}/{} {}", Common::VERSION, remote_host,
window_title = fmt::format("shadPS4 v{} {}/{} {}", Common::g_version, remote_host,
Common::g_scm_branch, Common::g_scm_desc);
}
}

View file

@ -9,7 +9,7 @@
#include <fmt/format.h>
#include "common/config.h"
#include "common/version.h"
#include "common/scm_rev.h"
#include "qt_gui/compatibility_info.h"
#ifdef ENABLE_DISCORD_RPC
#include "common/discord_rpc_handler.h"
@ -491,7 +491,7 @@ void SettingsDialog::LoadValuesFromConfig() {
QString updateChannel = QString::fromStdString(Config::getUpdateChannel());
ui->updateComboBox->setCurrentText(
channelMap.key(updateChannel != "Release" && updateChannel != "Nightly"
? (Common::isRelease ? "Release" : "Nightly")
? (Common::g_is_release ? "Release" : "Nightly")
: updateChannel));
#endif

View file

@ -10,7 +10,6 @@
#include "common/assert.h"
#include "common/config.h"
#include "common/elf_info.h"
#include "common/version.h"
#include "core/debug_state.h"
#include "core/libraries/kernel/time.h"
#include "core/libraries/pad/pad.h"

View file

@ -278,7 +278,6 @@ vk::UniqueInstance CreateInstance(Frontend::WindowSystemType window_type, bool e
vk::Bool32 enable_force_barriers = vk::True;
#ifdef __APPLE__
const vk::Bool32 mvk_debug_mode = enable_crash_diagnostic ? vk::True : vk::False;
constexpr vk::Bool32 mvk_use_mtlheap = vk::True;
#endif
const std::array layer_setings = {
@ -355,15 +354,6 @@ vk::UniqueInstance CreateInstance(Frontend::WindowSystemType window_type, bool e
.valueCount = 1,
.pValues = &mvk_debug_mode,
},
// Use MTLHeap to back device memory, which among other things allows us to
// use VK_IMAGE_CREATE_2D_ARRAY_COMPATIBLE_BIT via memory aliasing.
vk::LayerSettingEXT{
.pLayerName = "MoltenVK",
.pSettingName = "MVK_CONFIG_USE_MTLHEAP",
.type = vk::LayerSettingTypeEXT::eBool32,
.valueCount = 1,
.pValues = &mvk_use_mtlheap,
},
#endif
};