Merge branch 'master' into sve_xar_rotates

This commit is contained in:
Elad 2026-06-24 08:27:36 +03:00 committed by GitHub
commit 1b7cbc8bfc
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
318 changed files with 2722 additions and 1542 deletions

View File

@ -13,31 +13,18 @@ export HOMEBREW_NO_AUTO_UPDATE=1
export HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK=1
export HOMEBREW_NO_ENV_HINTS=1
export HOMEBREW_NO_INSTALL_CLEANUP=1
brew update
brew install -f --overwrite --quiet ccache "llvm@$LLVM_COMPILER_VER"
brew link -f --overwrite --quiet "llvm@$LLVM_COMPILER_VER"
if [ "$AARCH64" -eq 1 ]; then
brew install -f --overwrite --quiet googletest opencv@4 sdl3 vulkan-headers vulkan-loader molten-vk
brew unlink --quiet ffmpeg fmt qtbase qtsvg qtdeclarative protobuf || true
else
arch -x86_64 /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
arch -x86_64 /usr/local/bin/brew install -f --overwrite --quiet python@3.14 opencv@4 "llvm@$LLVM_COMPILER_VER" sdl3 vulkan-headers vulkan-loader molten-vk
arch -x86_64 /usr/local/bin/brew unlink --quiet ffmpeg qtbase qtsvg qtdeclarative protobuf || true
fi
brew install -f --overwrite --quiet googletest opencv@4 sdl3 vulkan-headers vulkan-loader molten-vk
brew unlink --quiet ffmpeg fmt qtbase qtsvg qtdeclarative protobuf || true
export CXX=clang++
export CC=clang
export BREW_PATH;
if [ "$AARCH64" -eq 1 ]; then
BREW_PATH="$(brew --prefix)"
export BREW_BIN="/opt/homebrew/bin"
export BREW_SBIN="/opt/homebrew/sbin"
else
BREW_PATH="$("/usr/local/bin/brew" --prefix)"
export BREW_BIN="/usr/local/bin"
export BREW_SBIN="/usr/local/sbin"
fi
BREW_PATH="$(brew --prefix)"
export BREW_BIN="$BREW_PATH/bin"
export BREW_SBIN="$BREW_PATH/sbin"
export WORKDIR;
WORKDIR="$(pwd)"
@ -68,7 +55,7 @@ ditto "/tmp/Qt/$QT_VER" "qt-downloader/$QT_VER"
export Qt6_DIR="$WORKDIR/qt-downloader/$QT_VER/clang_64/lib/cmake/Qt$QT_VER_MAIN"
export SDL3_DIR="$BREW_PATH/opt/sdl3/lib/cmake/SDL3"
export PATH="/opt/homebrew/opt/llvm@$LLVM_COMPILER_VER/bin:$PATH"
export PATH="$BREW_PATH/opt/llvm@$LLVM_COMPILER_VER/bin:$PATH"
export LDFLAGS="-L$BREW_PATH/opt/llvm@$LLVM_COMPILER_VER/lib/c++ -L$BREW_PATH/opt/llvm@$LLVM_COMPILER_VER/lib/unwind -lunwind"
export VULKAN_SDK
@ -82,12 +69,13 @@ LLVM_DIR="$BREW_PATH/opt/llvm@$LLVM_COMPILER_VER"
git submodule -q update --init --depth=1 --jobs=8 $(awk '/path/ && !/llvm/ && !/opencv/ && !/SDL/ && !/feralinteractive/ { print $3 }' .gitmodules)
mkdir build && cd build || exit 1
# The below should be uncommented once bugs with Qt 6 QListWidgets when using the OS 26 visual style are resolved.
# sudo xcode-select -switch /Applications/Xcode_26.3.app/Contents/Developer
if [ "$AARCH64" -eq 1 ]; then
cmake .. \
-DBUILD_RPCS3_TESTS="${RUN_UNIT_TESTS}" \
-DRUN_RPCS3_TESTS="${RUN_UNIT_TESTS}" \
-DCMAKE_OSX_DEPLOYMENT_TARGET=14.4 \
-DCMAKE_OSX_DEPLOYMENT_TARGET=15.0 \
-DCMAKE_OSX_SYSROOT="$(xcrun --sdk macosx --show-sdk-path)" \
-DMACOSX_BUNDLE_SHORT_VERSION_STRING="${COMM_TAG}" \
-DMACOSX_BUNDLE_BUNDLE_VERSION="${COMM_COUNT}" \
@ -102,31 +90,8 @@ cmake .. \
-DUSE_SYSTEM_SDL=ON \
-DUSE_SYSTEM_OPENCV=ON \
-G Ninja
else
cmake .. \
-DBUILD_RPCS3_TESTS=OFF \
-DRUN_RPCS3_TESTS=OFF \
-DCMAKE_OSX_ARCHITECTURES=x86_64 \
-DCMAKE_SYSTEM_PROCESSOR=x86_64 \
-DCMAKE_TOOLCHAIN_FILE=buildfiles/cmake/TCDarwinX86_64.cmake \
-DCMAKE_OSX_DEPLOYMENT_TARGET=14.4 \
-DCMAKE_OSX_SYSROOT="$(xcrun --sdk macosx --show-sdk-path)" \
-DMACOSX_BUNDLE_SHORT_VERSION_STRING="${COMM_TAG}" \
-DMACOSX_BUNDLE_BUNDLE_VERSION="${COMM_COUNT}"\
-DSTATIC_LINK_LLVM=ON \
-DUSE_SDL=ON \
-DUSE_DISCORD_RPC=ON \
-DUSE_AUDIOUNIT=ON \
-DUSE_SYSTEM_FFMPEG=OFF \
-DUSE_NATIVE_INSTRUCTIONS=OFF \
-DUSE_PRECOMPILED_HEADERS=OFF \
-DUSE_SYSTEM_MVK=ON \
-DUSE_SYSTEM_SDL=ON \
-DUSE_SYSTEM_OPENCV=ON \
-G Ninja
fi
ninja; build_status=$?;
ninja -j4; build_status=$?;
cd ..

View File

@ -7,7 +7,6 @@ cd bin
git clone --revision=a075e5e417f87675ea3137b7365f3e5a99608d72 https://github.com/KhronosGroup/MoltenVK.git
cd MoltenVK
./fetchDependencies --macos
sudo xcode-select -switch /Applications/Xcode_16.2.app/Contents/Developer
make macos MVK_USE_METAL_PRIVATE_API=1
cd ../
@ -84,7 +83,7 @@ echo "[InternetShortcut]" > Quickstart.url
echo "URL=https://rpcs3.net/quickstart" >> Quickstart.url
echo "IconIndex=0" >> Quickstart.url
if [ "$AARCH64" -eq 1 ]; then
if [ "$(arch)" = "arm64" ]; then
ARCHIVE_FILEPATH="$BUILD_ARTIFACTSTAGINGDIRECTORY/rpcs3-v${LVER}_macos_aarch64.7z"
else
ARCHIVE_FILEPATH="$BUILD_ARTIFACTSTAGINGDIRECTORY/rpcs3-v${LVER}_macos.7z"

View File

@ -123,15 +123,15 @@ jobs:
matrix:
include:
- name: Intel
AARCH64: 0
runs-on: macos-15-intel
UPLOAD_COMMIT_HASH: 51ae32f468089a8169aaf1567de355ff4a3e0842
UPLOAD_REPO_FULL_NAME: rpcs3/rpcs3-binaries-mac
- name: Apple Silicon
AARCH64: 1
runs-on: macos-15
UPLOAD_COMMIT_HASH: 8e21bdbc40711a3fccd18fbf17b742348b0f4281
UPLOAD_REPO_FULL_NAME: rpcs3/rpcs3-binaries-mac-arm64
name: RPCS3 Mac ${{ matrix.name }}
runs-on: macos-14
runs-on: ${{ matrix.runs-on }}
env:
CCACHE_DIR: /tmp/ccache_dir
QT_VER: '6.11.1'
@ -140,8 +140,7 @@ jobs:
RELEASE_MESSAGE: ../GitHubReleaseMessage.txt
UPLOAD_COMMIT_HASH: ${{ matrix.UPLOAD_COMMIT_HASH }}
UPLOAD_REPO_FULL_NAME: ${{ matrix.UPLOAD_REPO_FULL_NAME }}
AARCH64: ${{ matrix.AARCH64 }}
RUN_UNIT_TESTS: github.event_name == 'pull_request' && 'ON' || 'OFF'
RUN_UNIT_TESTS: ${{ matrix.name == 'Apple Silicon' && (github.event_name == 'pull_request' && 'ON') || 'OFF' }}
steps:
- name: Checkout repository
uses: actions/checkout@main

2
3rdparty/ffmpeg vendored

@ -1 +1 @@
Subproject commit 42300548cb6363b4496e7f0041a461daafd52dfe
Subproject commit 649d9d9353184a17ae78d9df4a6fbbe7456f0428

View File

@ -164,14 +164,17 @@ namespace pine
return IPCBuffer{ 5, MakeFailIPC(ret_buffer) };
};
const auto write_string = [&](const std::string& str)
const auto write_string = [&](std::string_view str)
{
if (!SafetyChecks(buf_cnt, 0, ret_cnt, str.size() + 1 + sizeof(u32), buf_size))
return false;
ToArray(ret_buffer, ::narrow<u32>(str.size() + 1), ret_cnt);
ret_cnt += sizeof(u32);
memcpy(&ret_buffer[ret_cnt], str.data(), str.size());
ret_cnt += str.size();
if (str.size())
{
std::memcpy(&ret_buffer[ret_cnt], str.data(), str.size());
ret_cnt += str.size();
}
ret_buffer[ret_cnt++] = '\0';
return true;
};
@ -512,7 +515,7 @@ namespace pine
*/
static inline bool SafetyChecks(usz command_len, usz command_size, usz reply_len, usz reply_size = 0, usz buf_size = MAX_IPC_SIZE - 1)
{
bool res = ((command_len + command_size) > buf_size ||
const bool res = ((command_len + command_size) > buf_size ||
(reply_len + reply_size) >= MAX_IPC_RETURN_SIZE);
if (res) [[unlikely]]
return false;
@ -524,8 +527,8 @@ namespace pine
pine_server() noexcept
{
#ifdef _WIN32
WSADATA wsa;
struct sockaddr_in server;
WSADATA wsa {};
struct sockaddr_in server {};
m_sock = INVALID_SOCKET;
m_msgsock = INVALID_SOCKET;
@ -579,7 +582,7 @@ namespace pine
fmt::append(m_socket_name, ".%d", slot);
}
struct sockaddr_un server;
struct sockaddr_un server {};
m_sock = socket(AF_UNIX, SOCK_STREAM, 0);
if (m_sock < 0)

2
3rdparty/pugixml vendored

@ -1 +1 @@
Subproject commit ee86beb30e4973f5feffe3ce63bfa4fbadf72f38
Subproject commit c8033ce9d039e7f9d134877c363397b3cfe20816

View File

@ -757,7 +757,7 @@ void cfg::log_entry::from_default()
std::pair<u16, u16> cfg::device_info::get_usb_ids() const
{
auto string_to_hex = [](const std::string& str) -> u16
auto string_to_hex = [](std::string_view str) -> u16
{
u16 value = 0x0000;
if (!str.empty() && std::from_chars(str.data(), str.data() + str.size(), value, 16).ec != std::errc{})

View File

@ -525,7 +525,7 @@ class jit_compiler final
atomic_t<usz> m_disk_space = umax;
public:
jit_compiler(const std::unordered_map<std::string, u64>& _link, const std::string& _cpu, u32 flags = 0, std::function<u64(const std::string&)> symbols_cement = {}) noexcept;
jit_compiler(const std::unordered_map<std::string, u64>& _link, std::string_view _cpu, u32 flags = 0, std::function<u64(const std::string&)> symbols_cement = {}) noexcept;
jit_compiler& operator=(thread_state) noexcept;
~jit_compiler() noexcept;
@ -571,7 +571,7 @@ public:
u64 get(const std::string& name);
// Get CPU info
static std::string cpu(const std::string& _cpu);
static std::string cpu(std::string_view _cpu);
// Get system triple (PPU)
static std::string triple1();

View File

@ -551,9 +551,9 @@ public:
}
};
std::string jit_compiler::cpu(const std::string& _cpu)
std::string jit_compiler::cpu(std::string_view _cpu)
{
std::string m_cpu = _cpu;
std::string m_cpu = std::string(_cpu);
if (m_cpu.empty())
{
@ -681,7 +681,7 @@ bool jit_compiler::add_sub_disk_space(ssz space)
}).second;
}
jit_compiler::jit_compiler(const std::unordered_map<std::string, u64>& _link, const std::string& _cpu, u32 flags, std::function<u64(const std::string&)> symbols_cement) noexcept
jit_compiler::jit_compiler(const std::unordered_map<std::string, u64>& _link, std::string_view _cpu, u32 flags, std::function<u64(const std::string&)> symbols_cement) noexcept
: m_context(new llvm::LLVMContext)
, m_cpu(cpu(_cpu))
{

View File

@ -921,6 +921,13 @@ std::string_view fmt::trim_front_sv(std::string_view source, std::string_view va
void fmt::trim_back(std::string& source, std::string_view values)
{
const usz index = source.find_last_not_of(values);
if (index == source.npos)
{
source.clear();
return;
}
source.resize(index + 1);
}

View File

@ -29,7 +29,7 @@ void fmt_class_string<cheat_type>::format(std::string& out, u64 arg)
bool cheat_info::from_str(std::string_view cheat_line)
{
const auto cheat_vec = fmt::split(cheat_line, {"@@@"}, false);
auto cheat_vec = fmt::split(cheat_line, {"@@@"}, false);
s64 val64 = 0;
if (cheat_vec.size() != 5 || !try_to_int64(&val64, cheat_vec[2], 0, cheat_type_max - 1))
@ -38,11 +38,11 @@ bool cheat_info::from_str(std::string_view cheat_line)
return false;
}
game = cheat_vec[0];
description = cheat_vec[1];
game = std::move(cheat_vec[0]);
description = std::move(cheat_vec[1]);
type = cheat_type{::narrow<u8>(val64)};
offset = std::stoul(cheat_vec[3]);
red_script = cheat_vec[4];
red_script = std::move(cheat_vec[4]);
return true;
}

View File

@ -119,18 +119,18 @@ namespace utils
if (sym->NameLen)
{
const auto function_name = wstr_to_utf8(sym->Name, static_cast<int>(sym->NameLen));
std::string function_name = wstr_to_utf8(sym->Name, static_cast<int>(sym->NameLen));
// Attempt to get file and line information if available
DWORD unused2;
if (SymGetLineFromAddrW64(hProcess, reinterpret_cast<DWORD64>(pointer), &unused2, &line_info))
{
const auto full_path = fmt::format("%s:%u %s", wstr_to_utf8(line_info.FileName, -1), line_info.LineNumber, function_name);
result.push_back(full_path);
std::string full_path = fmt::format("%s:%u %s", wstr_to_utf8(line_info.FileName, -1), line_info.LineNumber, function_name);
result.push_back(std::move(full_path));
}
else
{
result.push_back(function_name);
result.push_back(std::move(function_name));
}
}
else

View File

@ -14,7 +14,7 @@ namespace utils
// Printing utilities
template <typename T>
concept Logger = requires (T& t, const std::string& msg)
concept Logger = requires (T& t, std::string_view msg)
{
{ t.print(msg) };
};
@ -28,7 +28,7 @@ namespace utils
: log(chan)
{}
void print(const std::string& s)
void print(std::string_view s)
{
log.error("%s", s);
}

View File

@ -33,7 +33,7 @@ public:
std::lock_guard lock(mutex);
if (std::shared_ptr<void> new_val = std::invoke(func); new_val)
{
storage.push_back(new_val);
storage.push_back(std::move(new_val));
}
delete_unused();
}

View File

@ -24,29 +24,27 @@ namespace utils
return (m_hi << 24) | (m_mid << 16) | (m_lo << 8) | ((uint(m_type) & 0xf) << 4) | (m_type_index & 0xf);
}
std::string version::to_string() const
std::string version::to_string(bool simple) const
{
std::string version = std::to_string(hi()) + "." + std::to_string(mid());
std::string version = fmt::format("%d.%d", hi(), mid());
if (lo())
{
version += '.';
version += std::to_string(lo());
fmt::append(version, ".%d", lo());
}
if (type() != version_type::release)
if (!simple && type() != version_type::release)
{
if (!postfix().empty())
{
version += "-" + postfix();
fmt::append(version, "-%s", postfix());
}
version += ' ';
version += utils::to_string(type());
fmt::append(version, " %s", utils::to_string(type()));
if (type_index() > 1)
{
version += " " + std::to_string(type_index());
fmt::append(version, " %d", type_index());
}
}

View File

@ -23,10 +23,10 @@ namespace utils
uint m_lo;
version_type m_type = version_type::release;
uint m_type_index = 1;
const char* m_postfix;
std::string_view m_postfix;
public:
constexpr version(uint hi, uint mid, uint lo, version_type type, uint type_index, const char* postfix)
constexpr version(uint hi, uint mid, uint lo, version_type type, uint type_index, std::string_view postfix)
: m_hi(hi)
, m_mid(mid)
, m_lo(lo)
@ -56,7 +56,7 @@ namespace utils
return m_type;
}
std::string postfix() const
std::string_view postfix() const
{
return m_postfix;
}
@ -67,7 +67,7 @@ namespace utils
}
uint to_hex() const;
std::string to_string() const;
std::string to_string(bool simple = false) const;
};
// Generic version comparison (e.g. 0.0.5 vs 1.3)

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.3 KiB

After

Width:  |  Height:  |  Size: 999 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.2 KiB

After

Width:  |  Height:  |  Size: 484 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.0 KiB

After

Width:  |  Height:  |  Size: 504 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.2 KiB

After

Width:  |  Height:  |  Size: 503 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.7 KiB

After

Width:  |  Height:  |  Size: 399 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.3 KiB

After

Width:  |  Height:  |  Size: 477 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.9 KiB

After

Width:  |  Height:  |  Size: 380 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.8 KiB

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.2 KiB

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.6 KiB

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.5 KiB

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.2 KiB

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.5 KiB

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.4 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.5 KiB

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.6 KiB

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.6 KiB

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.6 KiB

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 42 KiB

After

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 43 KiB

After

Width:  |  Height:  |  Size: 31 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.9 KiB

After

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.4 KiB

After

Width:  |  Height:  |  Size: 4.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.1 KiB

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.9 KiB

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.3 KiB

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.5 KiB

After

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.9 KiB

After

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.6 KiB

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.6 KiB

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.6 KiB

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.0 KiB

After

Width:  |  Height:  |  Size: 4.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.0 KiB

After

Width:  |  Height:  |  Size: 5.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.5 KiB

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.9 KiB

After

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.8 KiB

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.0 KiB

After

Width:  |  Height:  |  Size: 5.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.9 KiB

After

Width:  |  Height:  |  Size: 4.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.2 KiB

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 618 B

After

Width:  |  Height:  |  Size: 402 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 497 B

After

Width:  |  Height:  |  Size: 299 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 360 B

After

Width:  |  Height:  |  Size: 237 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 561 B

After

Width:  |  Height:  |  Size: 334 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 472 B

After

Width:  |  Height:  |  Size: 290 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 473 B

After

Width:  |  Height:  |  Size: 345 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 489 B

After

Width:  |  Height:  |  Size: 337 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 384 B

After

Width:  |  Height:  |  Size: 253 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 721 B

After

Width:  |  Height:  |  Size: 435 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 509 B

After

Width:  |  Height:  |  Size: 270 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 702 B

After

Width:  |  Height:  |  Size: 497 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 672 B

After

Width:  |  Height:  |  Size: 446 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 447 B

After

Width:  |  Height:  |  Size: 276 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 587 B

After

Width:  |  Height:  |  Size: 365 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 332 B

After

Width:  |  Height:  |  Size: 228 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 668 B

After

Width:  |  Height:  |  Size: 423 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 659 B

After

Width:  |  Height:  |  Size: 440 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 354 B

After

Width:  |  Height:  |  Size: 201 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.8 KiB

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 358 KiB

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 20 KiB

After

Width:  |  Height:  |  Size: 6.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.1 KiB

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 26 KiB

After

Width:  |  Height:  |  Size: 7.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.8 KiB

After

Width:  |  Height:  |  Size: 873 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 34 KiB

After

Width:  |  Height:  |  Size: 4.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.3 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.5 KiB

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.7 KiB

After

Width:  |  Height:  |  Size: 1.7 KiB

View File

@ -117,6 +117,13 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "rpcs3_test", "rpcs3\tests\r
{70CD65B0-91D6-4FAE-9A7B-4AF55D0D1B12} = {70CD65B0-91D6-4FAE-9A7B-4AF55D0D1B12}
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "pugixml", "pugixml", "{F520F4A6-27D1-4DD2-9BB2-E0625826D0A3}"
ProjectSection(SolutionItems) = preProject
3rdparty\pugixml\src\pugiconfig.hpp = 3rdparty\pugixml\src\pugiconfig.hpp
3rdparty\pugixml\src\pugixml.cpp = 3rdparty\pugixml\src\pugixml.cpp
3rdparty\pugixml\src\pugixml.hpp = 3rdparty\pugixml\src\pugixml.hpp
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|x64 = Debug|x64
@ -274,6 +281,7 @@ Global
{8846A9AA-5539-4C91-8301-F54260E1A07A} = {6C3B64A0-8F8A-4DC4-8C0B-D71EBEED7FA8}
{3C67A2FF-4710-402A-BE3E-31B0CB0576DF} = {6C3B64A0-8F8A-4DC4-8C0B-D71EBEED7FA8}
{D1CBF84E-07F8-4ACB-9CD2-BD205FDEEE1E} = {02EA681E-C7D8-13C7-8484-4AC65E1B71E8}
{F520F4A6-27D1-4DD2-9BB2-E0625826D0A3} = {6C3B64A0-8F8A-4DC4-8C0B-D71EBEED7FA8}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {06CC7920-E085-4B81-9582-8DE8AAD42510}

View File

@ -192,6 +192,7 @@ if(BUILD_RPCS3_TESTS)
tests/test_rsx_cfg.cpp
tests/test_rsx_fp_asm.cpp
tests/test_dmux_pamf.cpp
tests/test_spu_analyser.cpp
)
target_link_libraries(rpcs3_test

View File

@ -5,7 +5,7 @@
LOG_CHANNEL(key_vault_log, "KEY_VAULT");
SELF_KEY::SELF_KEY(u64 ver_start, u64 ver_end, u16 rev, u32 type, const std::string& e, const std::string& r, const std::string& pb, const std::string& pr, u32 ct)
SELF_KEY::SELF_KEY(u64 ver_start, u64 ver_end, u16 rev, u32 type, std::string_view e, std::string_view r, std::string_view pb, std::string_view pr, u32 ct)
{
version_start = ver_start;
version_end = ver_end;

View File

@ -30,7 +30,7 @@ struct SELF_KEY
u8 priv[0x15]{};
u32 curve_type{};
SELF_KEY(u64 ver_start, u64 ver_end, u16 rev, u32 type, const std::string& e, const std::string& r, const std::string& pb, const std::string& pr, u32 ct);
SELF_KEY(u64 ver_start, u64 ver_end, u16 rev, u32 type, std::string_view e, std::string_view r, std::string_view pb, std::string_view pr, u32 ct);
};
constexpr u32 PASSPHRASE_KEY_LEN = 16;

View File

@ -679,7 +679,7 @@ u128 GetEdatRifKeyFromRapFile(const fs::file& rap_file)
return rifkey;
}
bool VerifyEDATHeaderWithKLicense(const fs::file& input, const std::string& input_file_name, const u8* custom_klic, NPD_HEADER* npd_out)
bool VerifyEDATHeaderWithKLicense(const fs::file& input, std::string_view input_file_name, const u8* custom_klic, NPD_HEADER* npd_out)
{
// Setup NPD and EDAT/SDAT structs.
NPD_HEADER NPD;
@ -702,7 +702,7 @@ bool VerifyEDATHeaderWithKLicense(const fs::file& input, const std::string& inpu
// Perform header validation (EDAT only).
char real_file_name[CRYPTO_MAX_PATH]{};
extract_file_name(input_file_name.c_str(), real_file_name);
extract_file_name(input_file_name, real_file_name);
if (!validate_npd_hashes(real_file_name, custom_klic, &NPD, &EDAT, false))
{
edat_log.error("NPD hash validation failed!");
@ -810,7 +810,7 @@ bool EDATADecrypter::ReadHeader()
{
// extract key from RIF
char real_file_name[CRYPTO_MAX_PATH]{};
extract_file_name(m_file_name.c_str(), real_file_name);
extract_file_name(m_file_name, real_file_name);
if (!validate_npd_hashes(real_file_name, reinterpret_cast<const u8*>(&dec_key), &npdHeader, &edatHeader, false))
{

View File

@ -62,7 +62,7 @@ struct EDAT_HEADER
extern fs::file DecryptEDAT(const fs::file& input, const std::string& input_file_name, int mode, u8 *custom_klic);
extern void read_npd_edat_header(const fs::file* input, NPD_HEADER& NPD, EDAT_HEADER& EDAT);
extern bool VerifyEDATHeaderWithKLicense(const fs::file& input, const std::string& input_file_name, const u8* custom_klic, NPD_HEADER *npd_out = nullptr);
extern bool VerifyEDATHeaderWithKLicense(const fs::file& input, std::string_view input_file_name, const u8* custom_klic, NPD_HEADER *npd_out = nullptr);
u128 GetEdatRifKeyFromRapFile(const fs::file& rap_file);

View File

@ -24,13 +24,13 @@
// Auxiliary functions (endian swap, xor).
// Bytes conversion auxiliary function.
void bytes_to_hex(std::string& hex_str, const unsigned char* data, unsigned int data_length)
void bytes_to_hex(std::string& hex_str, const unsigned char* data, usz data_length)
{
size_t str_length = data_length * 2;
const usz str_length = data_length * 2;
hex_str.resize(str_length);
for (size_t i = 0; i < str_length; i += 2)
for (usz i = 0; i < str_length; i += 2)
{
const auto [ptr, err] = std::to_chars(hex_str.data() + i, hex_str.data() + i + 2, *data++, 16);
if (err != std::errc())
@ -49,19 +49,28 @@ void bytes_to_hex(std::string& hex_str, const unsigned char* data, unsigned int
}
// Hex string conversion auxiliary function.
void hex_to_bytes(unsigned char* data, std::string_view hex_str, unsigned int str_length)
void hex_to_bytes(unsigned char* data, std::string_view hex_str, usz str_length, std::string* error)
{
const auto strn_length = (str_length > 0) ? str_length : hex_str.size();
const usz strn_length = (str_length > 0) ? str_length : hex_str.size();
// Don't convert if the string length is odd.
if ((strn_length % 2) == 0)
{
for (size_t i = 0; i < strn_length; i += 2)
for (usz i = 0; i < strn_length; i += 2)
{
const auto [ptr, err] = std::from_chars(hex_str.data() + i, hex_str.data() + i + 2, *data++, 16);
if (err != std::errc())
{
fmt::throw_exception("Failed to read hex string: %s", std::make_error_code(err).message());
std::string msg = fmt::format("Failed to read hex string: %s (hex='%s')", std::make_error_code(err).message(), hex_str);
if (error)
{
*error = std::move(msg);
}
else
{
fmt::throw_exception("%s", msg);
}
}
}
}
@ -127,17 +136,15 @@ void cmac_hash_forge(unsigned char *key, int /*key_len*/, unsigned char *in, usz
aes_cmac(&ctx, in_len, in, hash);
}
char* extract_file_name(const char* file_path, char real_file_name[CRYPTO_MAX_PATH])
char* extract_file_name(std::string_view file_path, char real_file_name[CRYPTO_MAX_PATH])
{
std::string_view v(file_path);
if (const auto pos = v.find_last_of(fs::delim); pos != umax)
if (const auto pos = file_path.find_last_of(fs::delim); pos != umax)
{
v.remove_prefix(pos + 1);
file_path.remove_prefix(pos + 1);
}
std::span r(real_file_name, CRYPTO_MAX_PATH);
strcpy_trunc(r, v);
strcpy_trunc(r, file_path);
return real_file_name;
}

View File

@ -11,15 +11,15 @@
enum { CRYPTO_MAX_PATH = 4096 };
char* extract_file_name(const char* file_path, char real_file_name[CRYPTO_MAX_PATH]);
char* extract_file_name(std::string_view file_path, char real_file_name[CRYPTO_MAX_PATH]);
std::string sha256_get_hash(const char* data, usz size, bool lower_case);
// Bytes conversion auxiliary function.
void bytes_to_hex(std::string& hex_str, const unsigned char* data, unsigned int data_length);
void bytes_to_hex(std::string& hex_str, const unsigned char* data, usz data_length);
// Hex string conversion auxiliary function.
void hex_to_bytes(unsigned char* data, std::string_view hex_str, unsigned int str_length);
void hex_to_bytes(unsigned char* data, std::string_view hex_str, usz str_length, std::string* error = nullptr);
// Crypto functions (AES128-CBC, AES128-ECB, SHA1-HMAC and AES-CMAC).
void aescbc128_decrypt(unsigned char *key, unsigned char *iv, unsigned char *in, unsigned char *out, usz len);

View File

@ -128,7 +128,7 @@ target_sources(rpcs3_emu PRIVATE
../Loader/TAR.cpp
../Loader/ISO.cpp
../Loader/iso_cache.cpp
../Loader/iso_validation.cpp
../Loader/content_validation.cpp
../Loader/TROPUSR.cpp
../Loader/TRP.cpp
)
@ -588,6 +588,7 @@ if(NOT ANDROID AND NOT APPLE)
RSX/GL/glutils/buffer_object.cpp
RSX/GL/glutils/capabilities.cpp
RSX/GL/glutils/common.cpp
RSX/GL/glutils/ex.cpp
RSX/GL/glutils/fbo.cpp
RSX/GL/glutils/image.cpp
RSX/GL/glutils/program.cpp

View File

@ -46,26 +46,26 @@ namespace aarch64
{
compiled_instruction_t i{};
i.asm_ = inst;
m_instructions.push_back(i);
m_instructions.push_back(std::move(i));
}
void UASM::emit1(const char* inst, const Arg& arg0, const std::vector<gpr>& clobbered)
{
int arg_id = 0;
fmt_replacement_list_t repl = {
const fmt_replacement_list_t repl = {
{ "{0}", arg0.to_string(&arg_id) }
};
compiled_instruction_t i{};
i.asm_ = fmt::replace_all(inst, repl);
embed_args(i, { arg0 }, clobbered);
m_instructions.push_back(i);
m_instructions.push_back(std::move(i));
}
void UASM::emit2(const char* inst, const Arg& arg0, const Arg& arg1, const std::vector<gpr>& clobbered)
{
int arg_id = 0;
fmt_replacement_list_t repl = {
const fmt_replacement_list_t repl = {
{ "{0}", arg0.to_string(&arg_id) },
{ "{1}", arg1.to_string(&arg_id) },
};
@ -73,13 +73,13 @@ namespace aarch64
compiled_instruction_t i{};
i.asm_ = fmt::replace_all(inst, repl);
embed_args(i, { arg0, arg1 }, clobbered);
m_instructions.push_back(i);
m_instructions.push_back(std::move(i));
}
void UASM::emit3(const char* inst, const Arg& arg0, const Arg& arg1, const Arg& arg2, const std::vector<gpr>& clobbered)
{
int arg_id = 0;
fmt_replacement_list_t repl = {
const fmt_replacement_list_t repl = {
{ "{0}", arg0.to_string(&arg_id) },
{ "{1}", arg1.to_string(&arg_id) },
{ "{2}", arg2.to_string(&arg_id) },
@ -88,13 +88,13 @@ namespace aarch64
compiled_instruction_t i{};
i.asm_ = fmt::replace_all(inst, repl);
embed_args(i, { arg0, arg1, arg2 }, clobbered);
m_instructions.push_back(i);
m_instructions.push_back(std::move(i));
}
void UASM::emit4(const char* inst, const Arg& arg0, const Arg& arg1, const Arg& arg2, const Arg& arg3, const std::vector<gpr>& clobbered)
{
int arg_id = 0;
fmt_replacement_list_t repl = {
const fmt_replacement_list_t repl = {
{ "{0}", arg0.to_string(&arg_id) },
{ "{1}", arg1.to_string(&arg_id) },
{ "{2}", arg2.to_string(&arg_id) },
@ -104,14 +104,14 @@ namespace aarch64
compiled_instruction_t i{};
i.asm_ = fmt::replace_all(inst, repl);
embed_args(i, { arg0, arg1, arg2, arg3 }, clobbered);
m_instructions.push_back(i);
m_instructions.push_back(std::move(i));
}
void UASM::insert(llvm::IRBuilder<>* irb, llvm::LLVMContext& ctx) const
{
for (const auto& inst : m_instructions)
{
auto constraints = fmt::merge(inst.constraints, ",");
const auto constraints = fmt::merge(inst.constraints, ",");
llvm_asm(irb, inst.asm_, inst.args, constraints, ctx);
}
}

View File

@ -219,7 +219,7 @@ namespace aarch64
return result;
}
gpr GHC_frame_preservation_pass::get_base_register_for_call(const std::string& callee_name, gpr default_reg)
gpr GHC_frame_preservation_pass::get_base_register_for_call(std::string_view callee_name, gpr default_reg)
{
// We go over the base_register_lookup table and find the first matching pattern
for (const auto& pattern : m_config.base_register_lookup)

View File

@ -45,7 +45,7 @@ namespace aarch64
bool use_stack_frames = true; // Allocate a stack frame for each function. The gateway can alternatively manage a global stack to use as scratch.
bool optimize = true; // Optimize instructions when possible. Set to false when debugging.
u32 hypervisor_context_offset = 0; // Offset within the "thread" object where we can find the hypervisor context (registers configured at gateway).
std::function<bool(const std::string&)> exclusion_callback; // [Optional] Callback run on each function before transform. Return "true" to exclude from frame processing.
std::function<bool(std::string_view)> exclusion_callback; // [Optional] Callback run on each function before transform. Return "true" to exclude from frame processing.
std::vector<std::pair<std::string, gpr>> base_register_lookup; // [Optional] Function lookup table to determine the location of the "thread" context.
std::vector<std::string> faux_function_list; // [Optional] List of faux block names to treat as untrusted - typically fake functions representing codecaves.
};
@ -67,7 +67,7 @@ namespace aarch64
bool is_faux_function(const std::string& function_name);
gpr get_base_register_for_call(const std::string& callee_name, gpr default_reg = gpr::x19);
gpr get_base_register_for_call(std::string_view callee_name, gpr default_reg = gpr::x19);
void process_leaf_function(llvm::IRBuilder<>* irb, llvm::Function& f);

View File

@ -3781,6 +3781,23 @@ public:
#endif
}
template <typename T1, typename T2, typename T3>
value_t<u32[4]> vperm2d128From512(T1 a, T2 b, T3 c)
{
value_t<u32[4]> result;
value_t<u32[16]> perm512;
const auto data0 = a.eval(m_ir);
const auto index128 = b.eval(m_ir);
const auto data1 = c.eval(m_ir);
const auto index512 = m_ir->CreateInsertVector(get_type<u32[16]>(), llvm::UndefValue::get(get_type<u32[16]>()), index128, m_ir->getInt64(0));
perm512.value = m_ir->CreateCall(get_intrinsic(llvm::Intrinsic::x86_avx512_vpermi2var_d_512), {data0, index512, data1});
result.value = m_ir->CreateExtractVector(get_type<u32[4]>(), perm512.value, m_ir->getInt64(0));
return result;
}
template <typename T1, typename T2>
value_t<u8[16]> gf2p8affineqb(T1 a, T2 b, u8 c)
{

View File

@ -1019,6 +1019,13 @@ void cell_audio_thread::operator()()
// Destroy ringbuffer
ringbuffer.reset();
// Destroy the audio backend on this thread (the one that created it in cfg.reset()).
// The backend's ctor calls CoInitializeEx here on Windows; releasing it on a different
// thread (g_fxo->clear() runs on the GUI thread during Kill()) would land the matching
// CoUninitialize on the GUI thread, draining its OLE reference and silently breaking the
// main window's file drag&drop. Keep COM init/teardown balanced on this thread.
cfg.backend.reset();
}
audio_port* cell_audio_thread::open_port()
@ -1662,36 +1669,35 @@ error_code AudioSetNotifyEventQueue(ppu_thread& ppu, u64 key, u32 iFlags)
lv2_sleep(20, &ppu);
// Dirty hack for sound: confirm the creation of _mxr000 event queue by _cellsurMixerMain thread
constexpr u64 c_mxr000 = 0x8000cafe0246030;
constexpr u64 c_mxr000 = 0x8000cafe02460300;
if (key == c_mxr000 || key == 0)
{
bool has_sur_mixer_thread = false;
for (usz count = 0; !lv2_event_queue::find(c_mxr000) && count < 100; count++)
const bool has_sur_mixer_thread = idm::select<named_thread<ppu_thread>>([&](u32 id, named_thread<ppu_thread>& test_ppu)
{
if (has_sur_mixer_thread || idm::select<named_thread<ppu_thread>>([&](u32 id, named_thread<ppu_thread>& test_ppu)
// Confirm thread existence
if (id == ppu.id)
{
// Confirm thread existence
if (id == ppu.id)
{
return false;
}
const auto ptr = test_ppu.ppu_tname.load();
if (!ptr)
{
return false;
}
return *ptr == "_cellsurMixerMain"sv;
}).ret)
{
has_sur_mixer_thread = true;
return false;
}
else
const auto ptr = test_ppu.ppu_tname.load();
if (!ptr)
{
return false;
}
return *ptr == "_cellsurMixerMain"sv;
}).ret;
bool was_mxr000_queue_found = false;
for (usz count = 0; has_sur_mixer_thread && count < 100; count++)
{
if (lv2_event_queue::find(c_mxr000))
{
was_mxr000_queue_found = true;
break;
}
@ -1701,13 +1707,14 @@ error_code AudioSetNotifyEventQueue(ppu_thread& ppu, u64 key, u32 iFlags)
return {};
}
cellAudio.error("AudioSetNotifyEventQueue(): Waiting for _mxr000. x%d", count);
(count < 3 ? cellAudio.warning : cellAudio.error)("AudioSetNotifyEventQueue(): Waiting for _mxr000. x%d", count);
lv2_sleep(50'000, &ppu);
}
if (has_sur_mixer_thread && lv2_event_queue::find(c_mxr000))
if (key == 0 && was_mxr000_queue_found)
{
// Correct key value argument
key = c_mxr000;
}
}

View File

@ -72,7 +72,7 @@ struct music_export
};
bool check_music_path(const std::string& file_path)
bool check_music_path(std::string_view file_path)
{
if (file_path.size() >= CELL_MUSIC_EXPORT_UTIL_HDD_PATH_MAX)
{

View File

@ -74,7 +74,7 @@ struct photo_export
};
bool check_photo_path(const std::string& file_path)
bool check_photo_path(std::string_view file_path)
{
if (file_path.size() >= CELL_PHOTO_EXPORT_UTIL_HDD_PATH_MAX)
{

View File

@ -1155,15 +1155,16 @@ static NEVER_INLINE error_code savedata_op(ppu_thread& ppu, u32 operation, u32 v
}
}
auto delete_save = [&]()
const auto delete_save = [&]()
{
strcpy_trunc(doneGet->dirName, save_entries[selected].dirName);
const SaveDataEntry& entry = ::at32(save_entries, selected);
strcpy_trunc(doneGet->dirName, entry.dirName);
doneGet->hddFreeSizeKB = 40 * 1024 * 1024 - 256; // Read explanation in cellHddGameCheck
doneGet->excResult = CELL_OK;
std::memset(doneGet->reserved, 0, sizeof(doneGet->reserved));
const std::string old_path = base_dir + ".backup_" + save_entries[selected].escaped + "/";
const std::string del_path = base_dir + save_entries[selected].escaped + "/";
const std::string old_path = base_dir + ".backup_" + entry.escaped + "/";
const std::string del_path = base_dir + entry.escaped + "/";
const fs::dir _dir(del_path);
u64 size_bytes = 0;
@ -1456,7 +1457,7 @@ static NEVER_INLINE error_code savedata_op(ppu_thread& ppu, u32 operation, u32 v
}
else
{
fmt::throw_exception("Invalid savedata selected");
fmt::throw_exception("Invalid savedata selected (selected=%d)", selected);
}
}
}

View File

@ -75,7 +75,7 @@ error_code cellSslGetMemoryInfo()
return CELL_OK;
}
std::string getCert(const std::string& certPath, const int certID, const bool isNormalCert)
std::string getCert(std::string_view certPath, const int certID, const bool isNormalCert)
{
int newID = certID;

Some files were not shown because too many files have changed in this diff Show More