From 85f4c38b4e44b90ed6737d196e1ecb76bc0883cc Mon Sep 17 00:00:00 2001 From: Megamouse Date: Wed, 31 Jan 2024 00:40:06 +0100 Subject: [PATCH] Update submodules - Updates SDL to 2.30.0 - Updates curl to 8.6.0 - Updates libusb to 1.0.27 - Updates zlib to 1.3.1 - Updates FAudio to 24.02 --- 3rdparty/FAudio | 2 +- 3rdparty/curl/curl | 2 +- 3rdparty/libsdl-org/SDL | 2 +- 3rdparty/libsdl-org/SDL.vcxproj | 22 +++++++- 3rdparty/libsdl-org/SDL.vcxproj.filters | 22 +++++++- 3rdparty/libusb/libusb | 2 +- 3rdparty/zlib/zlib | 2 +- rpcs3/Emu/Cell/lv2/sys_usbd.cpp | 72 +++++++++++++++---------- 8 files changed, 90 insertions(+), 36 deletions(-) diff --git a/3rdparty/FAudio b/3rdparty/FAudio index b2bf5b385b..38e9da7264 160000 --- a/3rdparty/FAudio +++ b/3rdparty/FAudio @@ -1 +1 @@ -Subproject commit b2bf5b385bb0719f6afc12fd3636be14280f4fbb +Subproject commit 38e9da7264641c9cc69a80d09082f166d9b8eaf9 diff --git a/3rdparty/curl/curl b/3rdparty/curl/curl index 7161cb17c0..5ce164e0e9 160000 --- a/3rdparty/curl/curl +++ b/3rdparty/curl/curl @@ -1 +1 @@ -Subproject commit 7161cb17c01dcff1dc5bf89a18437d9d729f1ecd +Subproject commit 5ce164e0e9290c96eb7d502173426c0a135ec008 diff --git a/3rdparty/libsdl-org/SDL b/3rdparty/libsdl-org/SDL index 15ead9a40d..859844eae3 160000 --- a/3rdparty/libsdl-org/SDL +++ b/3rdparty/libsdl-org/SDL @@ -1 +1 @@ -Subproject commit 15ead9a40d09a1eb9972215cceac2bf29c9b77f6 +Subproject commit 859844eae358447be8d66e6da59b6fb3df0ed778 diff --git a/3rdparty/libsdl-org/SDL.vcxproj b/3rdparty/libsdl-org/SDL.vcxproj index 8e0c367326..687761ae93 100644 --- a/3rdparty/libsdl-org/SDL.vcxproj +++ b/3rdparty/libsdl-org/SDL.vcxproj @@ -11,6 +11,12 @@ + + + + + + @@ -133,7 +139,9 @@ + + @@ -188,6 +196,13 @@ + + + + + + + @@ -238,7 +253,13 @@ + + + + + + @@ -418,7 +439,6 @@ - {8DC244EE-A0BD-4038-BAF7-CFAFA5EB2BAA} diff --git a/3rdparty/libsdl-org/SDL.vcxproj.filters b/3rdparty/libsdl-org/SDL.vcxproj.filters index e9d2239b00..e7f2fa2dcb 100644 --- a/3rdparty/libsdl-org/SDL.vcxproj.filters +++ b/3rdparty/libsdl-org/SDL.vcxproj.filters @@ -178,10 +178,15 @@ - + + + + + + @@ -409,5 +414,20 @@ + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/3rdparty/libusb/libusb b/3rdparty/libusb/libusb index 4239bc3a50..d52e355daa 160000 --- a/3rdparty/libusb/libusb +++ b/3rdparty/libusb/libusb @@ -1 +1 @@ -Subproject commit 4239bc3a50014b8e6a5a2a59df1fff3b7469543b +Subproject commit d52e355daa09f17ce64819122cb067b8a2ee0d4b diff --git a/3rdparty/zlib/zlib b/3rdparty/zlib/zlib index 09155eaa2f..51b7f2abda 160000 --- a/3rdparty/zlib/zlib +++ b/3rdparty/zlib/zlib @@ -1 +1 @@ -Subproject commit 09155eaa2f9270dc4ed1fa13e2b4b2613e6e4851 +Subproject commit 51b7f2abdade71cd9bb0e7a373ef2610ec6f9daf diff --git a/rpcs3/Emu/Cell/lv2/sys_usbd.cpp b/rpcs3/Emu/Cell/lv2/sys_usbd.cpp index 04e5f4fb80..ce33ac77da 100644 --- a/rpcs3/Emu/Cell/lv2/sys_usbd.cpp +++ b/rpcs3/Emu/Cell/lv2/sys_usbd.cpp @@ -158,43 +158,57 @@ void LIBUSB_CALL callback_transfer(struct libusb_transfer* transfer) usbh.transfer_complete(transfer); } +static void LIBUSB_CALL log_cb(libusb_context *ctx, enum libusb_log_level level, const char *str) +{ + if (!str) + return; + + const std::string msg = fmt::trim(str, " \t\n"); + + switch (level) + { + case LIBUSB_LOG_LEVEL_ERROR: + sys_usbd.error("libusb log: %s", msg); + break; + case LIBUSB_LOG_LEVEL_WARNING: + sys_usbd.warning("libusb log: %s", msg); + break; + case LIBUSB_LOG_LEVEL_INFO: + sys_usbd.notice("libusb log: %s", msg); + break; + case LIBUSB_LOG_LEVEL_DEBUG: + sys_usbd.trace("libusb log: %s", msg); + break; + default: + break; + } +} + usb_handler_thread::usb_handler_thread() { +#if LIBUSB_API_VERSION >= 0x0100010A + libusb_init_option log_lv_opt{}; + log_lv_opt.option = LIBUSB_OPTION_LOG_LEVEL; + log_lv_opt.value.ival = LIBUSB_LOG_LEVEL_WARNING;// You can also set the LIBUSB_DEBUG env variable instead + + libusb_init_option log_cb_opt{}; + log_cb_opt.option = LIBUSB_OPTION_LOG_CB; + log_cb_opt.value.log_cbval = &log_cb; + + std::vector options = { + std::move(log_lv_opt), + std::move(log_cb_opt) + }; + + if (int res = libusb_init_context(&ctx, options.data(), static_cast(options.size())); res < 0) +#else if (int res = libusb_init(&ctx); res < 0) +#endif { sys_usbd.error("Failed to initialize sys_usbd: %s", libusb_error_name(res)); return; } -#if LIBUSB_API_VERSION >= 0x01000107 - // Set LIBUSB_DEBUG env variable to receive log messages - libusb_set_log_cb(ctx, [](libusb_context* /* ctx */, libusb_log_level level, const char* str) - { - if (!str) - return; - - const std::string msg = fmt::trim(str, " \t\n"); - - switch (level) - { - case LIBUSB_LOG_LEVEL_ERROR: - sys_usbd.error("libusb log: %s", msg); - break; - case LIBUSB_LOG_LEVEL_WARNING: - sys_usbd.warning("libusb log: %s", msg); - break; - case LIBUSB_LOG_LEVEL_INFO: - sys_usbd.notice("libusb log: %s", msg); - break; - case LIBUSB_LOG_LEVEL_DEBUG: - sys_usbd.trace("libusb log: %s", msg); - break; - default: - break; - } - }, LIBUSB_LOG_CB_CONTEXT); -#endif - for (u32 index = 0; index < MAX_SYS_USBD_TRANSFERS; index++) { transfers[index].transfer = libusb_alloc_transfer(8);