Skip to content

Commit 0b299b6

Browse files
authored
Merge branch 'master' into fix/g27-steering-disconnect
2 parents f9c9ca7 + c6e9672 commit 0b299b6

149 files changed

Lines changed: 5738 additions & 1866 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/rpcs3.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ jobs:
134134
runs-on: ${{ matrix.runs-on }}
135135
env:
136136
CCACHE_DIR: /tmp/ccache_dir
137-
QT_VER: '6.11.1'
137+
QT_VER: '6.11.2'
138138
QT_VER_MAIN: '6'
139139
LLVM_COMPILER_VER: '22'
140140
RELEASE_MESSAGE: ../GitHubReleaseMessage.txt
@@ -212,9 +212,9 @@ jobs:
212212
env:
213213
COMPILER: msvc
214214
QT_VER_MAIN: '6'
215-
QT_VER: '6.11.1'
215+
QT_VER: '6.11.2'
216216
QT_VER_MSVC: 'msvc2022'
217-
QT_DATE: '202605090529'
217+
QT_DATE: '202608131017'
218218
LLVM_VER: '22.1.8'
219219
VULKAN_VER: '1.4.341.1'
220220
VULKAN_SDK_SHA: 'bcf2d75aa9556889ab974858666e20b3655b6055a0db704ccb47279ff33b5bfe'

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,3 +126,6 @@ CMakeUserPresets.json
126126

127127
.cache/
128128
.lldbinit
129+
130+
# claude
131+
CLAUDE.md

3rdparty/opencv/opencv

Submodule opencv updated 158 files

BUILDING.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,26 +20,26 @@ The following tools are required to build RPCS3 on Windows 10 or later:
2020
with standalone **CMake** tool.
2121

2222
- [Python 3.6+](https://www.python.org/downloads/) (add to PATH)
23-
- [Qt 6.11.1](https://www.qt.io/download-qt-installer) In case you can't download from the official installer, you can use [Another Qt installer](https://github.com/miurahr/aqtinstall) (In that case you will need to manually add the "qtmultimedia" module when installing Qt)
23+
- [Qt 6.11.2](https://www.qt.io/download-qt-installer) In case you can't download from the official installer, you can use [Another Qt installer](https://github.com/miurahr/aqtinstall) (In that case you will need to manually add the "qtmultimedia" module when installing Qt)
2424
- [Vulkan SDK 1.4.341.1](https://vulkan.lunarg.com/sdk/home) (see "Install the SDK" [here](https://vulkan.lunarg.com/doc/sdk/latest/windows/getting_started.html)). Note that future SDKs may not work.
2525

2626
The `sln` solution available only on **Visual Studio** is the preferred building solution. It easily allows to build the **RPCS3** application in `Release` and `Debug` mode.
2727

2828
In order to build **RPCS3** with the `sln` solution (with **Visual Studio**), **Qt** libs need to be detected. To detect the libs:
29-
- add and set the `QTDIR` environment variable, e.g. `<QtInstallFolder>\6.11.1\msvc2022_64\`
29+
- add and set the `QTDIR` environment variable, e.g. `<QtInstallFolder>\6.11.2\msvc2022_64\`
3030
- or use the [Visual Studio Qt Plugin](https://marketplace.visualstudio.com/items?itemName=TheQtCompany.QtVisualStudioTools2022)
3131

3232
**NOTE:** If you have issues with the **Visual Studio Qt Plugin**, you may want to uninstall it and install the [Legacy Qt Plugin](https://marketplace.visualstudio.com/items?itemName=TheQtCompany.LEGACYQtVisualStudioTools2022) instead.
3333

3434
In order to build **RPCS3** with the `CMake` solution (with both **Visual Studio** and standalone **CMake** tool):
35-
- add and set the `Qt6_ROOT` environment variable to the **Qt** libs path, e.g. `<QtInstallFolder>\6.11.1\msvc2022_64\`
35+
- add and set the `Qt6_ROOT` environment variable to the **Qt** libs path, e.g. `<QtInstallFolder>\6.11.2\msvc2022_64\`
3636

3737
### Linux
3838

3939
These are the essentials tools to build RPCS3 on Linux. Some of them can be installed through your favorite package manager:
4040
- Clang 17+ or GCC 13+
4141
- [CMake 3.28.0+](https://www.cmake.org/download/)
42-
- [Qt 6.11.1](https://www.qt.io/download-qt-installer)
42+
- [Qt 6.11.2](https://www.qt.io/download-qt-installer)
4343
- [Vulkan SDK 1.4.341.1](https://vulkan.lunarg.com/sdk/home) (See "Install the SDK" [here](https://vulkan.lunarg.com/doc/sdk/latest/linux/getting_started.html)). Note that future SDKs may not work.
4444
- [SDL3](https://github.com/libsdl-org/SDL/releases) (for the FAudio backend)
4545

@@ -123,7 +123,7 @@ Start **Visual Studio**, click on `Open a project or solution` and select the `r
123123
##### Configuring the Qt Plugin (if used)
124124

125125
1) go to `Extensions->Qt VS Tools->Qt Versions`
126-
2) add the path to your Qt installation with compiler e.g. `<QtInstallFolder>\6.11.1\msvc2022_64`, version will fill in automatically
126+
2) add the path to your Qt installation with compiler e.g. `<QtInstallFolder>\6.11.2\msvc2022_64`, version will fill in automatically
127127
3) go to `Extensions->Qt VS Tools->Options->Legacy Project Format`. (Only available in the **Legacy Qt Plugin**)
128128
4) set `Build: Run pre-build setup` to `true`. (Only available in the **Legacy Qt Plugin**)
129129

buildfiles/msvc/rpcs3_default.props

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
<IntDir>$(SolutionDir)build\tmp\$(ProjectName)-$(Configuration)-$(Platform)\</IntDir>
1010
<GTestPath>$(SolutionDir)packages\Microsoft.googletest.v140.windesktop.msvcstl.static.rt-static.1.8.1.8\build\native\Microsoft.googletest.v140.windesktop.msvcstl.static.rt-static.targets</GTestPath>
1111
<GTestInstalled Condition="Exists('$(GTestPath)')">true</GTestInstalled>
12-
<OpenCvBuildDir>$(SolutionDir)3rdparty\opencv\opencv\opencv413\build</OpenCvBuildDir>
13-
<OpenCvWorld>opencv_world4130</OpenCvWorld>
12+
<OpenCvBuildDir>$(SolutionDir)3rdparty\opencv\opencv\opencv414\build</OpenCvBuildDir>
13+
<OpenCvWorld>opencv_world4140</OpenCvWorld>
1414
</PropertyGroup>
1515
<ItemDefinitionGroup>
1616
<Lib>

rpcs3/Crypto/unedat.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -839,7 +839,7 @@ bool EDATADecrypter::ReadHeader()
839839
// Type 2: Use key from RAP file (RIF key). (also used for type 1 at the moment)
840840
else
841841
{
842-
const std::string rap_path = rpcs3::utils::get_rap_file_path(npdHeader.content_id);
842+
const std::string rap_path = rpcs3::utils::get_rap_file_path(npdHeader.get_content_id());
843843

844844
if (fs::file rap{rap_path}; rap && rap.size() >= sizeof(dec_key))
845845
{

rpcs3/Crypto/unedat.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,12 @@ struct NPD_HEADER
4949
u8 dev_hash[0x10];
5050
s64 activate_time;
5151
s64 expire_time;
52+
53+
std::string get_content_id() const
54+
{
55+
const std::string_view id{content_id, sizeof(content_id)};
56+
return std::string{id.substr(0, id.find_first_of('\0'))};
57+
}
5258
};
5359

5460
struct EDAT_HEADER

rpcs3/Crypto/unpkg.cpp

Lines changed: 31 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -952,11 +952,11 @@ bool package_reader::fill_data(std::map<std::string, install_entry*>& all_instal
952952
default:
953953
{
954954
// TODO: check for valid utf8 characters
955-
const std::string true_path = std::filesystem::weakly_canonical(path).string();
955+
const std::string true_path = std::filesystem::path(path).lexically_normal().string();
956956
if (true_path.empty())
957957
{
958958
num_failures++;
959-
pkg_log.error("Failed to get weakly_canonical path for '%s'", path);
959+
pkg_log.error("Failed to normalize package path for '%s'", path);
960960
break;
961961
}
962962

@@ -1216,10 +1216,14 @@ void package_reader::extract_worker()
12161216
while (read_size < size)
12171217
{
12181218
const u64 block_size = std::min<u64>(BUF_SIZE, size - read_size);
1219-
const u64 available_buffer_size = buffer.size() - read_size;
1219+
u64 available_buffer_size = original_size - read_size;
1220+
1221+
if (buffer.data() == ptr)
1222+
{
1223+
available_buffer_size = buffer.size() - read_size;
1224+
ensure(buffer.size() == original_size + BUF_PADDING);
1225+
}
12201226

1221-
ensure(buffer.data() == ptr);
1222-
ensure(buffer.size() == original_size + BUF_PADDING);
12231227
ensure(available_buffer_size >= block_size);
12241228

12251229
const usz advance_size = decrypt(entry.file_offset + pos, block_size, is_psp ? PKG_AES_KEY2 : m_dec_key.data(), std::span<u8>{static_cast<u8*>(ptr) + read_size, available_buffer_size});
@@ -1359,14 +1363,32 @@ package_install_result package_reader::extract_data(std::deque<package_reader>&
13591363
if (reader.m_num_failures == 0)
13601364
{
13611365
const usz thread_count = std::min<usz>(utils::get_thread_count(), reader.m_install_entries.size());
1366+
atomic_t<u32> num_threads_succeeded {0}; // Check if any thread didn't finish. For example when hitting an exception.
13621367

1363-
named_thread_group workers("PKG Installer "sv, std::max<u32>(::narrow<u32>(thread_count), 1) - 1, [&]()
1368+
if (thread_count > 1)
13641369
{
1370+
named_thread_group workers("PKG Installer "sv, ::narrow<u32>(thread_count) - 1, [&]()
1371+
{
1372+
reader.extract_worker();
1373+
num_threads_succeeded++;
1374+
});
1375+
13651376
reader.extract_worker();
1366-
});
1377+
num_threads_succeeded++;
1378+
1379+
workers.join();
1380+
}
1381+
else
1382+
{
1383+
reader.extract_worker();
1384+
num_threads_succeeded++;
1385+
}
13671386

1368-
reader.extract_worker();
1369-
workers.join();
1387+
if (thread_count != num_threads_succeeded)
1388+
{
1389+
pkg_log.error("%d thread(s) failed with an exception!", thread_count - num_threads_succeeded);
1390+
reader.m_num_failures++;
1391+
}
13701392
}
13711393

13721394
num_failures += reader.m_num_failures;

rpcs3/Crypto/unself.cpp

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -323,7 +323,7 @@ void supplemental_header::Show() const
323323
self_log.notice("Version: 0x%08x", PS3_npdrm_header.npd.version);
324324
self_log.notice("License: 0x%08x", PS3_npdrm_header.npd.license);
325325
self_log.notice("Type: 0x%08x", PS3_npdrm_header.npd.type);
326-
self_log.notice("ContentID: %s", PS3_npdrm_header.npd.content_id);
326+
self_log.notice("ContentID: %s", PS3_npdrm_header.npd.get_content_id());
327327
self_log.notice("Digest: %s", PS3_npdrm_header.npd.digest);
328328
self_log.notice("Inverse digest: %s", PS3_npdrm_header.npd.title_hash);
329329
self_log.notice("XOR digest: %s", PS3_npdrm_header.npd.dev_hash);
@@ -1065,7 +1065,7 @@ bool SELFDecrypter::DecryptNPDRM(u8 *metadata, u32 metadata_size)
10651065
if (npd->license == 1) // Network license.
10661066
{
10671067
// Try to find a RAP file to get the key.
1068-
if (!GetKeyFromRap(npd->content_id, npdrm_key))
1068+
if (!GetKeyFromRap(npd->get_content_id(), npdrm_key))
10691069
{
10701070
self_log.error("Can't decrypt network NPDRM!");
10711071
return false;
@@ -1074,7 +1074,7 @@ bool SELFDecrypter::DecryptNPDRM(u8 *metadata, u32 metadata_size)
10741074
else if (npd->license == 2) // Local license.
10751075
{
10761076
// Try to find a RAP file to get the key.
1077-
if (!GetKeyFromRap(npd->content_id, npdrm_key))
1077+
if (!GetKeyFromRap(npd->get_content_id(), npdrm_key))
10781078
{
10791079
self_log.error("Can't find RAP file for NPDRM decryption!");
10801080
return false;
@@ -1283,14 +1283,13 @@ fs::file SELFDecrypter::MakeElf(bool isElf32)
12831283
return e;
12841284
}
12851285

1286-
bool SELFDecrypter::GetKeyFromRap(const char* content_id, u8* npdrm_key)
1286+
bool SELFDecrypter::GetKeyFromRap(std::string_view content_id, u8* npdrm_key)
12871287
{
12881288
// Set empty RAP key.
12891289
std::array<u8, 0x10> rap_key {};
12901290

12911291
// Try to find a matching RAP file under exdata folder.
1292-
const std::string ci_str = content_id;
1293-
const std::string rap_path = rpcs3::utils::get_rap_file_path(ci_str);
1292+
const std::string rap_path = rpcs3::utils::get_rap_file_path(content_id);
12941293

12951294
// Open the RAP file and read the key.
12961295
const fs::file rap_file(rap_path);
@@ -1303,7 +1302,7 @@ bool SELFDecrypter::GetKeyFromRap(const char* content_id, u8* npdrm_key)
13031302
return false;
13041303
}
13051304

1306-
self_log.notice("Loading RAP file %s.rap", ci_str);
1305+
self_log.notice("Loading RAP file %s.rap", content_id);
13071306

13081307
if (rap_file.read(rap_key.data(), rap_key.size()) != rap_key.size())
13091308
{

rpcs3/Crypto/unself.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -478,7 +478,7 @@ class SELFDecrypter
478478
bool DecryptData();
479479
bool DecryptNPDRM(u8 *metadata, u32 metadata_size);
480480
const NPD_HEADER* GetNPDHeader() const;
481-
static bool GetKeyFromRap(const char *content_id, u8 *npdrm_key);
481+
static bool GetKeyFromRap(std::string_view content_id, u8 *npdrm_key);
482482

483483
private:
484484
template<typename EHdr, typename SHdr, typename PHdr>

0 commit comments

Comments
 (0)