diff --git a/.ci/build-mac-arm64.sh b/.ci/build-mac-arm64.sh index 3049ed1c04..7249d0ef61 100644 --- a/.ci/build-mac-arm64.sh +++ b/.ci/build-mac-arm64.sh @@ -71,6 +71,9 @@ if [ ! -d "/tmp/Qt/$QT_VER" ]; then git clone https://github.com/engnr/qt-downloader.git cd qt-downloader git checkout f52efee0f18668c6d6de2dec0234b8c4bc54c597 + # nested Qt 6.8.0 URL workaround + sed -i '' "s/'qt{0}_{0}{1}{2}'.format(major, minor, patch)]))/'qt{0}_{0}{1}{2}'.format(major, minor, patch), 'qt{0}_{0}{1}{2}'.format(major, minor, patch)]))/g" qt-downloader + sed -i '' "s/'{}\/{}\/qt{}_{}\/'/'{0}\/{1}\/qt{2}_{3}\/qt{2}_{3}\/'/g" qt-downloader cd "/tmp/Qt" "$BREW_X64_PATH/bin/pipenv" run pip3 install py7zr requests semantic_version lxml mkdir -p "$QT_VER/macos" ; ln -s "macos" "$QT_VER/clang_64" diff --git a/.ci/build-mac.sh b/.ci/build-mac.sh index dbbb8f8876..2b69d63154 100644 --- a/.ci/build-mac.sh +++ b/.ci/build-mac.sh @@ -39,6 +39,9 @@ if [ ! -d "/tmp/Qt/$QT_VER" ]; then git clone https://github.com/engnr/qt-downloader.git cd qt-downloader git checkout f52efee0f18668c6d6de2dec0234b8c4bc54c597 + # nested Qt 6.8.0 URL workaround + sed -i '' "s/'qt{0}_{0}{1}{2}'.format(major, minor, patch)]))/'qt{0}_{0}{1}{2}'.format(major, minor, patch), 'qt{0}_{0}{1}{2}'.format(major, minor, patch)]))/g" qt-downloader + sed -i '' "s/'{}\/{}\/qt{}_{}\/'/'{0}\/{1}\/qt{2}_{3}\/qt{2}_{3}\/'/g" qt-downloader cd "/tmp/Qt" "$BREW_X64_PATH/bin/pipenv" run pip3 install py7zr requests semantic_version lxml mkdir -p "$QT_VER/macos" ; ln -s "macos" "$QT_VER/clang_64" diff --git a/.ci/setup-windows.sh b/.ci/setup-windows.sh index d20d816998..c09b394f39 100755 --- a/.ci/setup-windows.sh +++ b/.ci/setup-windows.sh @@ -11,9 +11,9 @@ PR_NUMBER="$SYSTEM_PULLREQUEST_PULLREQUESTID" QT_HOST="http://qt.mirror.constant.com/" QT_URL_VER=$(echo "$QT_VER" | sed "s/\.//g") QT_VER_MSVC_UP=$(echo "${QT_VER_MSVC}" | tr '[:lower:]' '[:upper:]') -QT_PREFIX="online/qtsdkrepository/windows_x86/desktop/qt${QT_VER_MAIN}_${QT_URL_VER}/qt.qt${QT_VER_MAIN}.${QT_URL_VER}." +QT_PREFIX="online/qtsdkrepository/windows_x86/desktop/qt${QT_VER_MAIN}_${QT_URL_VER}/qt${QT_VER_MAIN}_${QT_URL_VER}/qt.qt${QT_VER_MAIN}.${QT_URL_VER}." QT_PREFIX_2="win64_${QT_VER_MSVC}_64/${QT_VER}-0-${QT_DATE}" -QT_SUFFIX="-Windows-Windows_10_22H2-${QT_VER_MSVC_UP}-Windows-Windows_10_22H2-X86_64.7z" +QT_SUFFIX="-Windows-Windows_11_23H2-${QT_VER_MSVC_UP}-Windows-Windows_11_23H2-X86_64.7z" QT_BASE_URL="${QT_HOST}${QT_PREFIX}${QT_PREFIX_2}qtbase${QT_SUFFIX}" QT_DECL_URL="${QT_HOST}${QT_PREFIX}${QT_PREFIX_2}qtdeclarative${QT_SUFFIX}" QT_TOOL_URL="${QT_HOST}${QT_PREFIX}${QT_PREFIX_2}qttools${QT_SUFFIX}" diff --git a/.cirrus.yml b/.cirrus.yml index 4dce31a4e9..c9e17f24f6 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -7,7 +7,7 @@ env: BUILD_SOURCEBRANCHNAME: $CIRRUS_BRANCH RPCS3_TOKEN: ENCRYPTED[100ebb8e3552bf2021d0ef55dccda3e58d27be5b6cab0b0b92843ef490195d3c4edaefa087e4a3b425caa6392300b9b1] QT_VER_MAIN: '6' - QT_VER: '6.7.3' + QT_VER: '6.8.0' # windows_task: # matrix: @@ -20,8 +20,8 @@ env: # CIRRUS_SHELL: "bash" # COMPILER: msvc # BUILD_ARTIFACTSTAGINGDIRECTORY: ${CIRRUS_WORKING_DIR}\artifacts\ -# QT_VER_MSVC: 'msvc2019' -# QT_DATE: '202409200836' +# QT_VER_MSVC: 'msvc2022' +# QT_DATE: '202410030750' # QTDIR: C:\Qt\${QT_VER}\${QT_VER_MSVC}_64 # VULKAN_VER: '1.3.268.0' # VULKAN_SDK_SHA: '8459ef49bd06b697115ddd3d97c9aec729e849cd775f5be70897718a9b3b9db5' @@ -56,7 +56,7 @@ env: # linux_task: # container: -# image: rpcs3/rpcs3-ci-focal:1.7 +# image: rpcs3/rpcs3-ci-focal:1.9 # cpu: 4 # memory: 16G # env: diff --git a/BUILDING.md b/BUILDING.md index 4d0758005c..2b1c416f26 100644 --- a/BUILDING.md +++ b/BUILDING.md @@ -19,26 +19,26 @@ The following tools are required to build RPCS3 on Windows 10 or later: with standalone **CMake** tool. - [Python 3.6+](https://www.python.org/downloads/) (add to PATH) -- [Qt 6.7.3](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) +- [Qt 6.8.0](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) - [Vulkan SDK 1.3.268.0](https://vulkan.lunarg.com/sdk/home) (see "Install the SDK" [here](https://vulkan.lunarg.com/doc/sdk/latest/windows/getting_started.html)) for now future SDKs don't work. You need precisely 1.3.268.0. 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. In order to build **RPCS3** with the `sln` solution (with **Visual Studio**), **Qt** libs need to be detected. To detect the libs: -- add and set the `QTDIR` environment variable, e.g. `\6.7.3\msvc2019_64\` +- add and set the `QTDIR` environment variable, e.g. `\6.8.0\msvc2019_64\` - or use the [Visual Studio Qt Plugin](https://marketplace.visualstudio.com/items?itemName=TheQtCompany.QtVisualStudioTools2019) **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.LEGACYQtVisualStudioTools2019) instead. In order to build **RPCS3** with the `CMake` solution (with both **Visual Studio** and standalone **CMake** tool): -- add and set the `CMAKE_PREFIX_PATH` environment variable to the **Qt** libs path, e.g. `\6.7.3\msvc2019_64\` +- add and set the `CMAKE_PREFIX_PATH` environment variable to the **Qt** libs path, e.g. `\6.8.0\msvc2019_64\` ### Linux These are the essentials tools to build RPCS3 on Linux. Some of them can be installed through your favorite package manager: - Clang 17+ or GCC 13+ - [CMake 3.28.0+](https://www.cmake.org/download/) -- [Qt 6.7.3](https://www.qt.io/download-qt-installer) +- [Qt 6.8.0](https://www.qt.io/download-qt-installer) - [Vulkan SDK 1.3.268.0](https://vulkan.lunarg.com/sdk/home) (See "Install the SDK" [here](https://vulkan.lunarg.com/doc/sdk/latest/linux/getting_started.html)) for now future SDKs don't work. You need precisely 1.3.268.0. - [SDL2](https://github.com/libsdl-org/SDL/releases) (for the FAudio backend) @@ -119,7 +119,7 @@ Start **Visual Studio**, click on `Open a project or solution` and select the `r ##### Configuring the Qt Plugin (if used) 1) go to `Extensions->Qt VS Tools->Qt Versions` -2) add the path to your Qt installation with compiler e.g. `\6.7.3\msvc2019_64`, version will fill in automatically +2) add the path to your Qt installation with compiler e.g. `\6.8.0\msvc2019_64`, version will fill in automatically 3) go to `Extensions->Qt VS Tools->Options->Legacy Project Format`. (Only available in the **Legacy Qt Plugin**) 4) set `Build: Run pre-build setup` to `true`. (Only available in the **Legacy Qt Plugin**) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 8c6c8f36b5..4c7055a676 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -69,9 +69,9 @@ jobs: variables: COMPILER: msvc QT_VER_MAIN: '6' - QT_VER: '6.7.3' - QT_VER_MSVC: 'msvc2019' - QT_DATE: '202409200836' + QT_VER: '6.8.0' + QT_VER_MSVC: 'msvc2022' + QT_DATE: '202410030750' QTDIR: C:\Qt\$(QT_VER)\$(QT_VER_MSVC)_64 VULKAN_VER: '1.3.268.0' VULKAN_SDK_SHA: '8459ef49bd06b697115ddd3d97c9aec729e849cd775f5be70897718a9b3b9db5' @@ -132,7 +132,7 @@ jobs: UPLOAD_REPO_FULL_NAME: "RPCS3/rpcs3-binaries-mac" RELEASE_MESSAGE: "../GitHubReleaseMessage.txt" ARTDIR: $(Build.ArtifactStagingDirectory) - QT_VER: '6.7.3' + QT_VER: '6.8.0' QT_VER_MAIN: '6' LLVM_COMPILER_VER: '16' @@ -193,7 +193,7 @@ jobs: UPLOAD_REPO_FULL_NAME: "RPCS3/rpcs3-binaries-mac-arm64" RELEASE_MESSAGE: "../GitHubReleaseMessage.txt" ARTDIR: $(Build.ArtifactStagingDirectory) - QT_VER: '6.7.3' + QT_VER: '6.8.0' QT_VER_MAIN: '6' LLVM_COMPILER_VER: '16' diff --git a/rpcs3/Emu/Cell/lv2/sys_net.cpp b/rpcs3/Emu/Cell/lv2/sys_net.cpp index 9b4428686a..efac7556d1 100644 --- a/rpcs3/Emu/Cell/lv2/sys_net.cpp +++ b/rpcs3/Emu/Cell/lv2/sys_net.cpp @@ -54,7 +54,7 @@ void fmt_class_string::format(std::string& out, u64 arg) { format_enum(out, arg, [](auto error) { - switch (s32 _error = error) + switch (static_cast(error)) { #define SYS_NET_ERROR_CASE(x) \ case -x: return "-" #x; \ @@ -1413,6 +1413,7 @@ error_code sys_net_bnet_poll(ppu_thread& ppu, vm::ptr fds, s32 n } has_timedout = network_clear_queue(ppu); + clear_ppu_to_awake(ppu); ppu.state -= cpu_flag::signal; break; } @@ -1646,6 +1647,7 @@ error_code sys_net_bnet_select(ppu_thread& ppu, s32 nfds, vm::ptrget_name(), ppu->current_function, ppu->gpr[3], ppu->gpr[4], ppu->gpr[5], ppu->gpr[6]); ppu->gpr[3] = static_cast(-SYS_NET_EINTR); lv2_obj::append(ppu.get()); diff --git a/rpcs3/Emu/Cell/lv2/sys_net/lv2_socket.cpp b/rpcs3/Emu/Cell/lv2/sys_net/lv2_socket.cpp index d5d53b6c70..02f5b2c697 100644 --- a/rpcs3/Emu/Cell/lv2/sys_net/lv2_socket.cpp +++ b/rpcs3/Emu/Cell/lv2/sys_net/lv2_socket.cpp @@ -165,11 +165,11 @@ void lv2_socket::queue_wake(ppu_thread* ppu) { case SYS_NET_SOCK_STREAM: case SYS_NET_SOCK_DGRAM: - g_fxo->get().ppu_to_awake.emplace_back(ppu); + g_fxo->get().add_ppu_to_awake(ppu); break; case SYS_NET_SOCK_DGRAM_P2P: case SYS_NET_SOCK_STREAM_P2P: - g_fxo->get().ppu_to_awake.emplace_back(ppu); + g_fxo->get().add_ppu_to_awake(ppu); break; default: break; diff --git a/rpcs3/Emu/Cell/lv2/sys_net/network_context.cpp b/rpcs3/Emu/Cell/lv2/sys_net/network_context.cpp index 72356c54e1..aaf79d4f41 100644 --- a/rpcs3/Emu/Cell/lv2/sys_net/network_context.cpp +++ b/rpcs3/Emu/Cell/lv2/sys_net/network_context.cpp @@ -85,8 +85,32 @@ namespace np void init_np_handler_dependencies(); } +void base_network_thread::add_ppu_to_awake(ppu_thread* ppu) +{ + std::lock_guard lock(mutex_ppu_to_awake); + ppu_to_awake.emplace_back(ppu); +} + +void base_network_thread::del_ppu_to_awake(ppu_thread* ppu) +{ + std::lock_guard lock(mutex_ppu_to_awake); + + for (auto it = ppu_to_awake.begin(); it != ppu_to_awake.end();) + { + if (*it == ppu) + { + it = ppu_to_awake.erase(it); + continue; + } + + it++; + } +} + void base_network_thread::wake_threads() { + std::lock_guard lock(mutex_ppu_to_awake); + ppu_to_awake.erase(std::unique(ppu_to_awake.begin(), ppu_to_awake.end()), ppu_to_awake.end()); for (ppu_thread* ppu : ppu_to_awake) { @@ -117,7 +141,10 @@ void network_thread::operator()() std::vector> socklist; socklist.reserve(lv2_socket::id_count); - ppu_to_awake.clear(); + { + std::lock_guard lock(mutex_ppu_to_awake); + ppu_to_awake.clear(); + } std::vector<::pollfd> fds(lv2_socket::id_count); #ifdef _WIN32 diff --git a/rpcs3/Emu/Cell/lv2/sys_net/network_context.h b/rpcs3/Emu/Cell/lv2/sys_net/network_context.h index 5cb846bd88..658196c4b4 100644 --- a/rpcs3/Emu/Cell/lv2/sys_net/network_context.h +++ b/rpcs3/Emu/Cell/lv2/sys_net/network_context.h @@ -9,6 +9,10 @@ struct base_network_thread { + void add_ppu_to_awake(ppu_thread* ppu); + void del_ppu_to_awake(ppu_thread* ppu); + + shared_mutex mutex_ppu_to_awake; std::vector ppu_to_awake; void wake_threads(); diff --git a/rpcs3/Emu/Cell/lv2/sys_net/sys_net_helpers.cpp b/rpcs3/Emu/Cell/lv2/sys_net/sys_net_helpers.cpp index 8eb13bc168..0fabc61cae 100644 --- a/rpcs3/Emu/Cell/lv2/sys_net/sys_net_helpers.cpp +++ b/rpcs3/Emu/Cell/lv2/sys_net/sys_net_helpers.cpp @@ -6,6 +6,8 @@ #include "lv2_socket.h" #include "sys_net_helpers.h" +#include "network_context.h" + LOG_CHANNEL(sys_net); int get_native_error() @@ -194,6 +196,12 @@ u32 network_clear_queue(ppu_thread& ppu) return cleared; } +void clear_ppu_to_awake(ppu_thread& ppu) +{ + g_fxo->get().del_ppu_to_awake(&ppu); + g_fxo->get().del_ppu_to_awake(&ppu); +} + #ifdef _WIN32 // Workaround function for WSAPoll not reporting failed connections void windows_poll(std::vector& fds, unsigned long nfds, int timeout, std::vector& connecting) diff --git a/rpcs3/Emu/Cell/lv2/sys_net/sys_net_helpers.h b/rpcs3/Emu/Cell/lv2/sys_net/sys_net_helpers.h index 1243ec1933..1cd9e136ca 100644 --- a/rpcs3/Emu/Cell/lv2/sys_net/sys_net_helpers.h +++ b/rpcs3/Emu/Cell/lv2/sys_net/sys_net_helpers.h @@ -24,6 +24,7 @@ sys_net_sockaddr native_addr_to_sys_net_addr(const ::sockaddr_storage& native_ad ::sockaddr_in sys_net_addr_to_native_addr(const sys_net_sockaddr& sn_addr); bool is_ip_public_address(const ::sockaddr_in& addr); u32 network_clear_queue(ppu_thread& ppu); +void clear_ppu_to_awake(ppu_thread& ppu); #ifdef _WIN32 void windows_poll(std::vector& fds, unsigned long nfds, int timeout, std::vector& connecting); diff --git a/rpcs3/Emu/scoped_progress_dialog.cpp b/rpcs3/Emu/scoped_progress_dialog.cpp index b7a016fc20..35606b4600 100644 --- a/rpcs3/Emu/scoped_progress_dialog.cpp +++ b/rpcs3/Emu/scoped_progress_dialog.cpp @@ -76,7 +76,7 @@ scoped_progress_dialog::scoped_progress_dialog(std::string text) noexcept if (!info && info.compare_and_swap_test(c_null_ptr, installed_ptr)) { - m_text_index = new_text_index; + m_text_index = ::narrow(new_text_index); break; } } @@ -105,7 +105,7 @@ scoped_progress_dialog::~scoped_progress_dialog() noexcept while (true) { - u32 restored_text_index = umax; + u64 restored_text_index = umax; if (progr.text_index == m_text_index && !g_progr_text_queue[m_text_index]) { @@ -148,7 +148,7 @@ scoped_progress_dialog::~scoped_progress_dialog() noexcept return true; } - progr0.text_index = restored_text_index; + progr0.text_index = ::narrow(restored_text_index); progr0.update_id++; } diff --git a/rpcs3/main.cpp b/rpcs3/main.cpp index 1c2e73ecf9..d6770127b2 100644 --- a/rpcs3/main.cpp +++ b/rpcs3/main.cpp @@ -1099,10 +1099,10 @@ int main(int argc, char** argv) { if (Emu.IsPathInsideDir(emu_dir, path.toStdString())) { - report_fatal_error(fmt::format( + report_fatal_error(QObject::tr( "RPCS3 should never be run from a temporary location!\n" "Please install RPCS3 in a persistent location.\n" - "Current location:\n%s", emu_dir)); + "Current location:\n%0").arg(QString::fromStdString(emu_dir)).toStdString()); return 1; } } @@ -1112,10 +1112,10 @@ int main(int argc, char** argv) { if (emu_dir.find(expr) != umax) { - report_fatal_error(fmt::format( + report_fatal_error(QObject::tr( "RPCS3 should never be run from an archive!\n" "Please install RPCS3 in a persistent location.\n" - "Current location:\n%s", emu_dir)); + "Current location:\n%0").arg(QString::fromStdString(emu_dir)).toStdString()); return 1; } } diff --git a/rpcs3/rpcs3qt/qt_camera_video_sink.cpp b/rpcs3/rpcs3qt/qt_camera_video_sink.cpp index 7d83583a62..bcfd573afe 100644 --- a/rpcs3/rpcs3qt/qt_camera_video_sink.cpp +++ b/rpcs3/rpcs3qt/qt_camera_video_sink.cpp @@ -71,7 +71,7 @@ bool qt_camera_video_sink::present(const QVideoFrame& frame) // Flip image if necessary if (flip_horizontally || flip_vertically) { - image = image.mirrored(flip_horizontally, flip_vertically); + image.mirror(flip_horizontally, flip_vertically); } if (image.format() != QImage::Format_RGBA8888)