Skip to content

Commit 9772901

Browse files
committed
Merge branch 'master' into windows-clang
2 parents 1148253 + f61aaf8 commit 9772901

35 files changed

+271
-143
lines changed

.github/workflows/rpcs3.yml

Lines changed: 20 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ env:
2424
jobs:
2525
Linux_Build:
2626
# Only run push event on master branch of main repo, but run all PRs
27-
#if: github.event_name != 'push' || (github.repository == 'RPCS3/rpcs3' && github.ref_name == 'master')
27+
if: github.event_name != 'push' || (github.repository == 'RPCS3/rpcs3' && github.ref_name == 'master')
2828
strategy:
2929
fail-fast: false
3030
matrix:
@@ -117,7 +117,7 @@ jobs:
117117

118118
Mac_Build:
119119
# Only run push event on master branch of main repo, but run all PRs
120-
#if: github.event_name != 'push' || (github.repository == 'RPCS3/rpcs3' && github.ref_name == 'master')
120+
if: github.event_name != 'push' || (github.repository == 'RPCS3/rpcs3' && github.ref_name == 'master')
121121
strategy:
122122
fail-fast: false
123123
matrix:
@@ -191,22 +191,22 @@ jobs:
191191
run: .ci/github-upload.sh
192192

193193
- name: Save Build Ccache
194-
#if: github.ref == 'refs/heads/master'
194+
if: github.ref == 'refs/heads/master'
195195
uses: actions/cache/save@main
196196
with:
197197
path: ${{ env.CCACHE_DIR }}
198198
key: ${{ steps.restore-build-ccache.outputs.cache-primary-key }}
199199

200200
- name: Save Qt Cache
201-
#if: github.ref == 'refs/heads/master'
201+
if: github.ref == 'refs/heads/master'
202202
uses: actions/cache/save@main
203203
with:
204204
path: /tmp/Qt
205205
key: ${{ steps.restore-qt-cache.outputs.cache-primary-key }}
206206

207207
Windows_Build:
208208
# Only run push event on master branch of main repo, but run all PRs
209-
#if: github.event_name != 'push' || (github.repository == 'RPCS3/rpcs3' && github.ref_name == 'master')
209+
if: github.event_name != 'push' || (github.repository == 'RPCS3/rpcs3' && github.ref_name == 'master')
210210
name: RPCS3 Windows
211211
runs-on: windows-2025
212212
env:
@@ -312,22 +312,22 @@ jobs:
312312
run: .ci/github-upload.sh
313313

314314
- name: Save Build Ccache
315-
#if: github.ref == 'refs/heads/master'
315+
if: github.ref == 'refs/heads/master'
316316
uses: actions/cache/save@main
317317
with:
318318
path: ${{ env.CCACHE_DIR }}
319319
key: ${{ steps.restore-build-ccache.outputs.cache-primary-key }}
320320

321321
- name: Save Dependencies Cache
322-
#if: github.ref == 'refs/heads/master'
322+
if: github.ref == 'refs/heads/master'
323323
uses: actions/cache/save@main
324324
with:
325325
path: ${{ env.DEPS_CACHE_DIR }}
326326
key: ${{ steps.restore-dependencies-cache.outputs.cache-primary-key }}
327327

328328
Windows_Build_Clang:
329329
# Only run push event on master branch of main repo, but run all PRs
330-
#if: github.event_name != 'push' || (github.repository == 'RPCS3/rpcs3' && github.ref_name == 'master')
330+
if: github.event_name != 'push' || (github.repository == 'RPCS3/rpcs3' && github.ref_name == 'master')
331331
runs-on: windows-2025
332332
strategy:
333333
fail-fast: false
@@ -415,9 +415,7 @@ jobs:
415415
--clean-after-build
416416
417417
- name: Save vcpkg cache
418-
if: ${{ matrix.compiler == 'clang-cl' }}
419-
#if: ${{ !steps.restore-vcpkg-cache.outputs.cache-hit && matrix.compiler == 'clang-cl' }}
420-
#if: github.ref == 'refs/heads/master'
418+
if: ${{ github.ref == 'refs/heads/master' && matrix.compiler == 'clang-cl' }}
421419
uses: actions/cache/save@main
422420
with:
423421
path: |
@@ -452,7 +450,7 @@ jobs:
452450
C:\PROGRA~1\LLVM\bin\clang-cl.exe --version
453451
- name: Save LLVM Cache
454452
if: ${{ matrix.compiler == 'clang-cl' && steps.llvm-cache.outputs.cache-hit != 'true' }}
455-
#if: github.ref == 'refs/heads/master'
453+
if: github.ref == 'refs/heads/master'
456454
uses: actions/cache/save@main
457455
with:
458456
path: ./llvm-${{ matrix.llvmver }}
@@ -473,6 +471,8 @@ jobs:
473471
export CCACHE_DIR=$(cygpath -u "$CCACHE_DIR")
474472
echo "CCACHE_DIR=$CCACHE_DIR"
475473
.ci/build-windows-clang.sh
474+
.ci/setup-windows-ci-vars.sh ${{ matrix.arch }} ${{ matrix.compiler }}
475+
.ci/deploy-windows-${{ matrix.compiler }}.sh
476476
477477
- name: install DIA SDK
478478
if: ${{ matrix.compiler == 'clang-cl' }}
@@ -484,21 +484,18 @@ jobs:
484484
- name: Build RPCS3
485485
if: ${{ matrix.compiler == 'clang-cl' }}
486486
shell: bash
487-
run: .ci/build-windows-clang-cl.sh
487+
run: |
488+
.ci/build-windows-clang-cl.sh
489+
.ci/setup-windows-ci-vars.sh ${{ matrix.arch }} ${{ matrix.compiler }}
490+
.ci/deploy-windows-${{ matrix.compiler }}.sh
488491
489492
- name: Save build Ccache
490-
#if: github.ref == 'refs/heads/master'
493+
if: github.ref == 'refs/heads/master'
491494
uses: actions/cache/save@main
492495
with:
493496
path: ${{ env.CCACHE_DIR }}
494497
key: ${{ steps.restore-build-ccache.outputs.cache-primary-key }}
495498

496-
- name: Prepare Artifacts
497-
shell: bash
498-
run: |
499-
.ci/setup-windows-ci-vars.sh ${{ matrix.arch }} ${{ matrix.compiler }}
500-
.ci/deploy-windows-${{ matrix.compiler }}.sh
501-
502499
- name: Upload artifacts
503500
uses: actions/upload-artifact@main
504501
with:
@@ -508,8 +505,8 @@ jobs:
508505
if-no-files-found: error
509506

510507
FreeBSD_Build:
511-
# Only run push event on master branch of main repo, but run all PRs
512-
#if: github.event_name != 'push' || (github.repository == 'RPCS3/rpcs3' && github.ref_name == 'master')
508+
# Only run push event on master branch of main repo, but run all PRs
509+
if: github.event_name != 'push' || (github.repository == 'RPCS3/rpcs3' && github.ref_name == 'master')
513510
name: RPCS3 FreeBSD
514511
runs-on: ubuntu-latest
515512
timeout-minutes: 60
@@ -540,7 +537,7 @@ jobs:
540537
run: .ci/install-freebsd.sh && .ci/build-freebsd.sh
541538

542539
- name: Save Build Ccache
543-
#if: github.ref == 'refs/heads/master'
540+
if: github.ref == 'refs/heads/master'
544541
uses: actions/cache/save@main
545542
with:
546543
path: ${{ env.CCACHE_DIR }}

3rdparty/qt6.cmake

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,15 @@ find_package(Qt6 ${QT_MIN_VER} CONFIG COMPONENTS Widgets Concurrent Multimedia M
66
if(WIN32)
77
target_link_libraries(3rdparty_qt6 INTERFACE Qt6::Widgets Qt6::Concurrent Qt6::Multimedia Qt6::MultimediaWidgets Qt6::Svg Qt6::SvgWidgets)
88
else()
9-
find_package(Qt6 ${QT_MIN_VER} COMPONENTS DBus Gui)
9+
set(QT_NO_PRIVATE_MODULE_WARNING ON)
10+
find_package(Qt6 ${QT_MIN_VER} COMPONENTS DBus Gui GuiPrivate)
1011
if(Qt6DBus_FOUND)
1112
target_link_libraries(3rdparty_qt6 INTERFACE Qt6::Widgets Qt6::DBus Qt6::Concurrent Qt6::Multimedia Qt6::MultimediaWidgets Qt6::Svg Qt6::SvgWidgets)
1213
target_compile_definitions(3rdparty_qt6 INTERFACE -DHAVE_QTDBUS)
1314
else()
1415
target_link_libraries(3rdparty_qt6 INTERFACE Qt6::Widgets Qt6::Concurrent Qt6::Multimedia Qt6::MultimediaWidgets Qt6::Svg Qt6::SvgWidgets)
1516
endif()
16-
target_include_directories(3rdparty_qt6 INTERFACE ${Qt6Gui_PRIVATE_INCLUDE_DIRS})
17+
target_link_libraries(3rdparty_qt6 INTERFACE Qt6::GuiPrivate)
1718
endif()
1819

1920
if(Qt6Widgets_FOUND)

rpcs3/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ if (NOT ANDROID)
162162
add_custom_command(TARGET rpcs3 POST_BUILD
163163
COMMAND ${WINDEPLOYQT_EXECUTABLE} --no-compiler-runtime --no-opengl-sw --no-patchqt
164164
--no-translations --no-system-d3d-compiler --no-system-dxc-compiler --no-quick-import
165-
--plugindir $<TARGET_FILE_DIR:rpcs3>/qt6/plugins
165+
--plugindir "$<IF:$<CXX_COMPILER_FRONTEND_VARIANT:MSVC>,$<TARGET_FILE_DIR:rpcs3>/qt6/plugins,$<TARGET_FILE_DIR:rpcs3>/share/qt6/plugins>"
166166
--verbose 0
167167
$<TARGET_FILE:rpcs3>
168168
)

rpcs3/Emu/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -591,6 +591,7 @@ if(TARGET 3rdparty_vulkan)
591591
RSX/VK/vkutils/device.cpp
592592
RSX/VK/vkutils/sampler.cpp
593593
RSX/VK/vkutils/shared.cpp
594+
RSX/VK/vkutils/unique_resource.cpp
594595
RSX/VK/VKAsyncScheduler.cpp
595596
RSX/VK/VKCommandStream.cpp
596597
RSX/VK/VKCommonDecompiler.cpp

rpcs3/Emu/Cell/Modules/sceNp.cpp

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3198,7 +3198,7 @@ error_code sceNpLookupTerm()
31983198

31993199
error_code sceNpLookupCreateTitleCtx(vm::cptr<SceNpCommunicationId> communicationId, vm::cptr<SceNpId> selfNpId)
32003200
{
3201-
sceNp.warning("sceNpLookupCreateTitleCtx(communicationId=*0x%x(%s), selfNpId=0x%x)", communicationId, communicationId ? communicationId->data : "", selfNpId);
3201+
sceNp.warning("sceNpLookupCreateTitleCtx(communicationId=*0x%x(%s), selfNpId=0x%x)", communicationId, communicationId ? std::string_view(communicationId->data, 9) : "", selfNpId);
32023202

32033203
auto& nph = g_fxo->get<named_thread<np::np_handler>>();
32043204

@@ -6962,7 +6962,7 @@ error_code sceNpSignalingGetConnectionFromPeerAddress(u32 ctx_id, np_in_addr_t p
69626962
return CELL_OK;
69636963
}
69646964

6965-
error_code sceNpSignalingGetLocalNetInfo(u32 ctx_id, vm::ptr<SceNpSignalingNetInfo> info)
6965+
error_code sceNpSignalingGetLocalNetInfo(u32 ctx_id, vm::ptr<SceNpSignalingNetInfoDeprecated> info)
69666966
{
69676967
sceNp.warning("sceNpSignalingGetLocalNetInfo(ctx_id=%d, info=*0x%x)", ctx_id, info);
69686968

@@ -6973,7 +6973,8 @@ error_code sceNpSignalingGetLocalNetInfo(u32 ctx_id, vm::ptr<SceNpSignalingNetIn
69736973
return SCE_NP_SIGNALING_ERROR_NOT_INITIALIZED;
69746974
}
69756975

6976-
if (!info || info->size != sizeof(SceNpSignalingNetInfo))
6976+
// Library has backward support for a version of SceNpSignalingNetInfo without npport
6977+
if (!info || (info->size != sizeof(SceNpSignalingNetInfo) && info->size != sizeof(SceNpSignalingNetInfoDeprecated)))
69776978
{
69786979
return SCE_NP_SIGNALING_ERROR_INVALID_ARGUMENT;
69796980
}
@@ -6985,7 +6986,12 @@ error_code sceNpSignalingGetLocalNetInfo(u32 ctx_id, vm::ptr<SceNpSignalingNetIn
69856986
info->nat_status = SCE_NP_SIGNALING_NETINFO_NAT_STATUS_TYPE2;
69866987
info->upnp_status = nph.get_upnp_status();
69876988
info->npport_status = SCE_NP_SIGNALING_NETINFO_NPPORT_STATUS_OPEN;
6988-
info->npport = SCE_NP_PORT;
6989+
6990+
if (info->size == sizeof(SceNpSignalingNetInfo))
6991+
{
6992+
auto new_info = vm::unsafe_ptr_cast<SceNpSignalingNetInfo>(info);
6993+
new_info->npport = SCE_NP_PORT;
6994+
}
69896995

69906996
return CELL_OK;
69916997
}

rpcs3/Emu/Cell/Modules/sceNp.h

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1584,6 +1584,16 @@ struct SceNpSignalingNetInfo
15841584
be_t<u16> npport;
15851585
};
15861586

1587+
struct SceNpSignalingNetInfoDeprecated
1588+
{
1589+
be_t<u32> size;
1590+
be_t<u32> local_addr; // in_addr
1591+
be_t<u32> mapped_addr; // in_addr
1592+
be_t<s32> nat_status;
1593+
be_t<s32> upnp_status;
1594+
be_t<s32> npport_status;
1595+
};
1596+
15871597
struct SceNpCustomMenuAction
15881598
{
15891599
be_t<u32> options;

rpcs3/Emu/Cell/Modules/sceNp2.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1300,7 +1300,7 @@ error_code sceNpMatching2GrantRoomOwner(
13001300
error_code sceNpMatching2CreateContext(
13011301
vm::cptr<SceNpId> npId, vm::cptr<SceNpCommunicationId> commId, vm::cptr<SceNpCommunicationPassphrase> passPhrase, vm::ptr<SceNpMatching2ContextId> ctxId, s32 option)
13021302
{
1303-
sceNp2.warning("sceNpMatching2CreateContext(npId=*0x%x, commId=*0x%x(%s), passPhrase=*0x%x, ctxId=*0x%x, option=%d)", npId, commId, commId ? commId->data : "", passPhrase, ctxId, option);
1303+
sceNp2.warning("sceNpMatching2CreateContext(npId=*0x%x, commId=*0x%x(%s), passPhrase=*0x%x, ctxId=*0x%x, option=%d)", npId, commId, commId ? std::string_view(commId->data, 9) : "", passPhrase, ctxId, option);
13041304

13051305
auto& nph = g_fxo->get<named_thread<np::np_handler>>();
13061306

rpcs3/Emu/NP/np_contexts.cpp

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
#include "Emu/Cell/PPUCallback.h"
55
#include "Emu/IdManager.h"
66
#include "Emu/Cell/Modules/cellSysutil.h"
7+
#include "np_helpers.h"
78

89
LOG_CHANNEL(sceNp2);
910

@@ -53,7 +54,7 @@ void generic_async_transaction_context::set_result_and_wake(error_code err)
5354

5455
tus_ctx::tus_ctx(vm::cptr<SceNpCommunicationId> communicationId, vm::cptr<SceNpCommunicationPassphrase> passphrase)
5556
{
56-
ensure(!communicationId->data[9] && strlen(communicationId->data) == 9);
57+
ensure(communicationId && np::validate_communication_id(*communicationId), "tus_ctx::tus_ctx: Invalid SceNpCommunicationId");
5758
memcpy(&this->communicationId, communicationId.get_ptr(), sizeof(SceNpCommunicationId));
5859
memcpy(&this->passphrase, passphrase.get_ptr(), sizeof(SceNpCommunicationPassphrase));
5960
}
@@ -96,7 +97,7 @@ bool destroy_tus_transaction_context(s32 ctx_id)
9697

9798
score_ctx::score_ctx(vm::cptr<SceNpCommunicationId> communicationId, vm::cptr<SceNpCommunicationPassphrase> passphrase)
9899
{
99-
ensure(!communicationId->data[9] && strlen(communicationId->data) == 9);
100+
ensure(communicationId && np::validate_communication_id(*communicationId), "score_ctx::score_ctx: Invalid SceNpCommunicationId");
100101
memcpy(&this->communicationId, communicationId.get_ptr(), sizeof(SceNpCommunicationId));
101102
memcpy(&this->passphrase, passphrase.get_ptr(), sizeof(SceNpCommunicationPassphrase));
102103
}
@@ -140,7 +141,7 @@ bool destroy_score_transaction_context(s32 ctx_id)
140141

141142
match2_ctx::match2_ctx(vm::cptr<SceNpCommunicationId> communicationId, vm::cptr<SceNpCommunicationPassphrase> passphrase, s32 option)
142143
{
143-
ensure(!communicationId->data[9] && strlen(communicationId->data) == 9);
144+
ensure(communicationId && np::validate_communication_id(*communicationId), "match2_ctx::match2_ctx: Invalid SceNpCommunicationId");
144145
memcpy(&this->communicationId, communicationId.get_ptr(), sizeof(SceNpCommunicationId));
145146
memcpy(&this->passphrase, passphrase.get_ptr(), sizeof(SceNpCommunicationPassphrase));
146147

@@ -149,7 +150,7 @@ match2_ctx::match2_ctx(vm::cptr<SceNpCommunicationId> communicationId, vm::cptr<
149150
}
150151
u16 create_match2_context(vm::cptr<SceNpCommunicationId> communicationId, vm::cptr<SceNpCommunicationPassphrase> passphrase, s32 option)
151152
{
152-
sceNp2.notice("Creating match2 context with communicationId: <%s>", static_cast<const char*>(communicationId->data));
153+
sceNp2.notice("Creating match2 context with communicationId: <%s>", std::string_view(communicationId->data, 9));
153154
return static_cast<u16>(idm::make<match2_ctx>(communicationId, passphrase, option));
154155
}
155156
bool destroy_match2_context(u16 ctx_id)
@@ -167,7 +168,7 @@ shared_ptr<match2_ctx> get_match2_context(u16 ctx_id)
167168

168169
lookup_title_ctx::lookup_title_ctx(vm::cptr<SceNpCommunicationId> communicationId)
169170
{
170-
ensure(!communicationId->data[9] && strlen(communicationId->data) == 9);
171+
ensure(communicationId && np::validate_communication_id(*communicationId), "lookup_title_ctx::lookup_title_ctx: Invalid SceNpCommunicationId");
171172
memcpy(&this->communicationId, communicationId.get_ptr(), sizeof(SceNpCommunicationId));
172173
}
173174
s32 create_lookup_title_context(vm::cptr<SceNpCommunicationId> communicationId)

rpcs3/Emu/NP/np_helpers.cpp

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#include "Emu/Cell/Modules/sceNp.h"
12
#include "stdafx.h"
23
#include "util/types.hpp"
34
#include "Utilities/StrUtil.h"
@@ -22,9 +23,15 @@ namespace np
2223
return fmt::format("%02X:%02X:%02X:%02X:%02X:%02X", ether[0], ether[1], ether[2], ether[3], ether[4], ether[5]);
2324
}
2425

26+
bool validate_communication_id(const SceNpCommunicationId& com_id)
27+
{
28+
return std::all_of(com_id.data, com_id.data + 9, [](char c) { return (c >= '0' && c <= '9') || (c >= 'A' && c <= 'Z'); }) && com_id.num <= 99;
29+
}
30+
2531
std::string communication_id_to_string(const SceNpCommunicationId& communicationId)
2632
{
27-
return fmt::format("%s_%02d", communicationId.data, communicationId.num);
33+
std::string_view com_id_data(communicationId.data, 9);
34+
return fmt::format("%s_%02d", com_id_data, communicationId.num);
2835
}
2936

3037
void strings_to_userinfo(std::string_view npid, std::string_view online_name, std::string_view avatar_url, SceNpUserInfo& user_info)

rpcs3/Emu/NP/np_helpers.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ namespace np
88
{
99
std::string ip_to_string(u32 addr);
1010
std::string ether_to_string(std::array<u8, 6>& ether);
11+
bool validate_communication_id(const SceNpCommunicationId& com_id);
1112
std::string communication_id_to_string(const SceNpCommunicationId& communicationId);
1213

1314
void string_to_npid(std::string_view str, SceNpId& npid);

0 commit comments

Comments
 (0)