From c6ab149c56f9a528da945d49302b67a50340cb79 Mon Sep 17 00:00:00 2001 From: Stephen Miller <56742918+StevenMiller123@users.noreply.github.com> Date: Sun, 12 Jan 2025 14:27:54 -0600 Subject: [PATCH 1/3] libSceHttp2 Stubs (#2139) * Auto-generate libSceHttp2 * Improved stub for sceHttp2Init Needed for updated versions of Cyberpunk 2077. Parameters are based on fpPS4, while the stub itself is based on similar stubs in our other networking libraries. * Clang I guess the line length calculations in the moduleGenerator are still not perfect? --- CMakeLists.txt | 2 + src/common/logging/filter.cpp | 1 + src/common/logging/types.h | 1 + src/core/libraries/libs.cpp | 2 + src/core/libraries/network/http2.cpp | 360 +++++++++++++++++++++++++++ src/core/libraries/network/http2.h | 72 ++++++ 6 files changed, 438 insertions(+) create mode 100644 src/core/libraries/network/http2.cpp create mode 100644 src/core/libraries/network/http2.h diff --git a/CMakeLists.txt b/CMakeLists.txt index 84eaefbbbc7..30e6c58c037 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -254,6 +254,8 @@ set(KERNEL_LIB src/core/libraries/kernel/sync/mutex.cpp set(NETWORK_LIBS src/core/libraries/network/http.cpp src/core/libraries/network/http.h + src/core/libraries/network/http2.cpp + src/core/libraries/network/http2.h src/core/libraries/network/net.cpp src/core/libraries/network/netctl.cpp src/core/libraries/network/netctl.h diff --git a/src/common/logging/filter.cpp b/src/common/logging/filter.cpp index 6fe2ec4e40e..376c55ba7df 100644 --- a/src/common/logging/filter.cpp +++ b/src/common/logging/filter.cpp @@ -95,6 +95,7 @@ bool ParseFilterRule(Filter& instance, Iterator begin, Iterator end) { SUB(Lib, SaveData) \ SUB(Lib, SaveDataDialog) \ SUB(Lib, Http) \ + SUB(Lib, Http2) \ SUB(Lib, Ssl) \ SUB(Lib, Ssl2) \ SUB(Lib, SysModule) \ diff --git a/src/common/logging/types.h b/src/common/logging/types.h index c42cf5665fa..535a88a6d6b 100644 --- a/src/common/logging/types.h +++ b/src/common/logging/types.h @@ -65,6 +65,7 @@ enum class Class : u8 { Lib_Ssl, ///< The LibSceSsl implementation. Lib_Ssl2, ///< The LibSceSsl2 implementation. Lib_Http, ///< The LibSceHttp implementation. + Lib_Http2, ///< The LibSceHttp2 implementation. Lib_SysModule, ///< The LibSceSysModule implementation Lib_NpCommon, ///< The LibSceNpCommon implementation Lib_NpManager, ///< The LibSceNpManager implementation diff --git a/src/core/libraries/libs.cpp b/src/core/libraries/libs.cpp index b651bab44b2..7427640b6af 100644 --- a/src/core/libraries/libs.cpp +++ b/src/core/libraries/libs.cpp @@ -21,6 +21,7 @@ #include "core/libraries/mouse/mouse.h" #include "core/libraries/move/move.h" #include "core/libraries/network/http.h" +#include "core/libraries/network/http2.h" #include "core/libraries/network/net.h" #include "core/libraries/network/netctl.h" #include "core/libraries/network/ssl.h" @@ -66,6 +67,7 @@ void InitHLELibs(Core::Loader::SymbolsResolver* sym) { Libraries::MsgDialog::RegisterlibSceMsgDialog(sym); Libraries::AudioOut::RegisterlibSceAudioOut(sym); Libraries::Http::RegisterlibSceHttp(sym); + Libraries::Http2::RegisterlibSceHttp2(sym); Libraries::Net::RegisterlibSceNet(sym); Libraries::NetCtl::RegisterlibSceNetCtl(sym); Libraries::SaveData::RegisterlibSceSaveData(sym); diff --git a/src/core/libraries/network/http2.cpp b/src/core/libraries/network/http2.cpp new file mode 100644 index 00000000000..52f73edc6c7 --- /dev/null +++ b/src/core/libraries/network/http2.cpp @@ -0,0 +1,360 @@ +// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-License-Identifier: GPL-2.0-or-later + +#include "common/logging/log.h" +#include "core/libraries/error_codes.h" +#include "core/libraries/libs.h" +#include "core/libraries/network/http2.h" + +namespace Libraries::Http2 { + +int PS4_SYSV_ABI _Z5dummyv() { + LOG_ERROR(Lib_Http2, "(STUBBED) called"); + return ORBIS_OK; +} + +int PS4_SYSV_ABI sceHttp2AbortRequest() { + LOG_ERROR(Lib_Http2, "(STUBBED) called"); + return ORBIS_OK; +} + +int PS4_SYSV_ABI sceHttp2AddCookie() { + LOG_ERROR(Lib_Http2, "(STUBBED) called"); + return ORBIS_OK; +} + +int PS4_SYSV_ABI sceHttp2AddRequestHeader() { + LOG_ERROR(Lib_Http2, "(STUBBED) called"); + return ORBIS_OK; +} + +int PS4_SYSV_ABI sceHttp2AuthCacheFlush() { + LOG_ERROR(Lib_Http2, "(STUBBED) called"); + return ORBIS_OK; +} + +int PS4_SYSV_ABI sceHttp2CookieExport() { + LOG_ERROR(Lib_Http2, "(STUBBED) called"); + return ORBIS_OK; +} + +int PS4_SYSV_ABI sceHttp2CookieFlush() { + LOG_ERROR(Lib_Http2, "(STUBBED) called"); + return ORBIS_OK; +} + +int PS4_SYSV_ABI sceHttp2CookieImport() { + LOG_ERROR(Lib_Http2, "(STUBBED) called"); + return ORBIS_OK; +} + +int PS4_SYSV_ABI sceHttp2CreateCookieBox() { + LOG_ERROR(Lib_Http2, "(STUBBED) called"); + return ORBIS_OK; +} + +int PS4_SYSV_ABI sceHttp2CreateRequestWithURL() { + LOG_ERROR(Lib_Http2, "(STUBBED) called"); + return ORBIS_OK; +} + +int PS4_SYSV_ABI sceHttp2CreateTemplate() { + LOG_ERROR(Lib_Http2, "(STUBBED) called"); + return ORBIS_OK; +} + +int PS4_SYSV_ABI sceHttp2DeleteCookieBox() { + LOG_ERROR(Lib_Http2, "(STUBBED) called"); + return ORBIS_OK; +} + +int PS4_SYSV_ABI sceHttp2DeleteRequest() { + LOG_ERROR(Lib_Http2, "(STUBBED) called"); + return ORBIS_OK; +} + +int PS4_SYSV_ABI sceHttp2DeleteTemplate() { + LOG_ERROR(Lib_Http2, "(STUBBED) called"); + return ORBIS_OK; +} + +int PS4_SYSV_ABI sceHttp2GetAllResponseHeaders() { + LOG_ERROR(Lib_Http2, "(STUBBED) called"); + return ORBIS_OK; +} + +int PS4_SYSV_ABI sceHttp2GetAuthEnabled() { + LOG_ERROR(Lib_Http2, "(STUBBED) called"); + return ORBIS_OK; +} + +int PS4_SYSV_ABI sceHttp2GetAutoRedirect() { + LOG_ERROR(Lib_Http2, "(STUBBED) called"); + return ORBIS_OK; +} + +int PS4_SYSV_ABI sceHttp2GetCookie() { + LOG_ERROR(Lib_Http2, "(STUBBED) called"); + return ORBIS_OK; +} + +int PS4_SYSV_ABI sceHttp2GetCookieBox() { + LOG_ERROR(Lib_Http2, "(STUBBED) called"); + return ORBIS_OK; +} + +int PS4_SYSV_ABI sceHttp2GetCookieStats() { + LOG_ERROR(Lib_Http2, "(STUBBED) called"); + return ORBIS_OK; +} + +int PS4_SYSV_ABI sceHttp2GetMemoryPoolStats() { + LOG_ERROR(Lib_Http2, "(STUBBED) called"); + return ORBIS_OK; +} + +int PS4_SYSV_ABI sceHttp2GetResponseContentLength() { + LOG_ERROR(Lib_Http2, "(STUBBED) called"); + return ORBIS_OK; +} + +int PS4_SYSV_ABI sceHttp2GetStatusCode() { + LOG_ERROR(Lib_Http2, "(STUBBED) called"); + return ORBIS_OK; +} + +int PS4_SYSV_ABI sceHttp2Init(int net_id, int ssl_id, size_t pool_size, int max_requests) { + LOG_ERROR(Lib_Http2, "(DUMMY) called"); + static int id = 0; + return ++id; +} + +int PS4_SYSV_ABI sceHttp2ReadData() { + LOG_ERROR(Lib_Http2, "(STUBBED) called"); + return ORBIS_OK; +} + +int PS4_SYSV_ABI sceHttp2ReadDataAsync() { + LOG_ERROR(Lib_Http2, "(STUBBED) called"); + return ORBIS_OK; +} + +int PS4_SYSV_ABI sceHttp2RedirectCacheFlush() { + LOG_ERROR(Lib_Http2, "(STUBBED) called"); + return ORBIS_OK; +} + +int PS4_SYSV_ABI sceHttp2RemoveRequestHeader() { + LOG_ERROR(Lib_Http2, "(STUBBED) called"); + return ORBIS_OK; +} + +int PS4_SYSV_ABI sceHttp2SendRequest() { + LOG_ERROR(Lib_Http2, "(STUBBED) called"); + return ORBIS_OK; +} + +int PS4_SYSV_ABI sceHttp2SendRequestAsync() { + LOG_ERROR(Lib_Http2, "(STUBBED) called"); + return ORBIS_OK; +} + +int PS4_SYSV_ABI sceHttp2SetAuthEnabled() { + LOG_ERROR(Lib_Http2, "(STUBBED) called"); + return ORBIS_OK; +} + +int PS4_SYSV_ABI sceHttp2SetAuthInfoCallback() { + LOG_ERROR(Lib_Http2, "(STUBBED) called"); + return ORBIS_OK; +} + +int PS4_SYSV_ABI sceHttp2SetAutoRedirect() { + LOG_ERROR(Lib_Http2, "(STUBBED) called"); + return ORBIS_OK; +} + +int PS4_SYSV_ABI sceHttp2SetConnectionWaitTimeOut() { + LOG_ERROR(Lib_Http2, "(STUBBED) called"); + return ORBIS_OK; +} + +int PS4_SYSV_ABI sceHttp2SetConnectTimeOut() { + LOG_ERROR(Lib_Http2, "(STUBBED) called"); + return ORBIS_OK; +} + +int PS4_SYSV_ABI sceHttp2SetCookieBox() { + LOG_ERROR(Lib_Http2, "(STUBBED) called"); + return ORBIS_OK; +} + +int PS4_SYSV_ABI sceHttp2SetCookieMaxNum() { + LOG_ERROR(Lib_Http2, "(STUBBED) called"); + return ORBIS_OK; +} + +int PS4_SYSV_ABI sceHttp2SetCookieMaxNumPerDomain() { + LOG_ERROR(Lib_Http2, "(STUBBED) called"); + return ORBIS_OK; +} + +int PS4_SYSV_ABI sceHttp2SetCookieMaxSize() { + LOG_ERROR(Lib_Http2, "(STUBBED) called"); + return ORBIS_OK; +} + +int PS4_SYSV_ABI sceHttp2SetCookieRecvCallback() { + LOG_ERROR(Lib_Http2, "(STUBBED) called"); + return ORBIS_OK; +} + +int PS4_SYSV_ABI sceHttp2SetCookieSendCallback() { + LOG_ERROR(Lib_Http2, "(STUBBED) called"); + return ORBIS_OK; +} + +int PS4_SYSV_ABI sceHttp2SetInflateGZIPEnabled() { + LOG_ERROR(Lib_Http2, "(STUBBED) called"); + return ORBIS_OK; +} + +int PS4_SYSV_ABI sceHttp2SetMinSslVersion() { + LOG_ERROR(Lib_Http2, "(STUBBED) called"); + return ORBIS_OK; +} + +int PS4_SYSV_ABI sceHttp2SetPreSendCallback() { + LOG_ERROR(Lib_Http2, "(STUBBED) called"); + return ORBIS_OK; +} + +int PS4_SYSV_ABI sceHttp2SetRecvTimeOut() { + LOG_ERROR(Lib_Http2, "(STUBBED) called"); + return ORBIS_OK; +} + +int PS4_SYSV_ABI sceHttp2SetRedirectCallback() { + LOG_ERROR(Lib_Http2, "(STUBBED) called"); + return ORBIS_OK; +} + +int PS4_SYSV_ABI sceHttp2SetRequestContentLength() { + LOG_ERROR(Lib_Http2, "(STUBBED) called"); + return ORBIS_OK; +} + +int PS4_SYSV_ABI sceHttp2SetResolveRetry() { + LOG_ERROR(Lib_Http2, "(STUBBED) called"); + return ORBIS_OK; +} + +int PS4_SYSV_ABI sceHttp2SetResolveTimeOut() { + LOG_ERROR(Lib_Http2, "(STUBBED) called"); + return ORBIS_OK; +} + +int PS4_SYSV_ABI sceHttp2SetSendTimeOut() { + LOG_ERROR(Lib_Http2, "(STUBBED) called"); + return ORBIS_OK; +} + +int PS4_SYSV_ABI sceHttp2SetSslCallback() { + LOG_ERROR(Lib_Http2, "(STUBBED) called"); + return ORBIS_OK; +} + +int PS4_SYSV_ABI sceHttp2SetTimeOut() { + LOG_ERROR(Lib_Http2, "(STUBBED) called"); + return ORBIS_OK; +} + +int PS4_SYSV_ABI sceHttp2SslDisableOption() { + LOG_ERROR(Lib_Http2, "(STUBBED) called"); + return ORBIS_OK; +} + +int PS4_SYSV_ABI sceHttp2SslEnableOption() { + LOG_ERROR(Lib_Http2, "(STUBBED) called"); + return ORBIS_OK; +} + +int PS4_SYSV_ABI sceHttp2Term() { + LOG_ERROR(Lib_Http2, "(STUBBED) called"); + return ORBIS_OK; +} + +int PS4_SYSV_ABI sceHttp2WaitAsync() { + LOG_ERROR(Lib_Http2, "(STUBBED) called"); + return ORBIS_OK; +} + +void RegisterlibSceHttp2(Core::Loader::SymbolsResolver* sym) { + LIB_FUNCTION("AS45QoYHjc4", "libSceHttp2", 1, "libSceHttp2", 1, 1, _Z5dummyv); + LIB_FUNCTION("IZ-qjhRqvjk", "libSceHttp2", 1, "libSceHttp2", 1, 1, sceHttp2AbortRequest); + LIB_FUNCTION("flPxnowtvWY", "libSceHttp2", 1, "libSceHttp2", 1, 1, sceHttp2AddCookie); + LIB_FUNCTION("nrPfOE8TQu0", "libSceHttp2", 1, "libSceHttp2", 1, 1, sceHttp2AddRequestHeader); + LIB_FUNCTION("WeuDjj5m4YU", "libSceHttp2", 1, "libSceHttp2", 1, 1, sceHttp2AuthCacheFlush); + LIB_FUNCTION("JlFGR4v50Kw", "libSceHttp2", 1, "libSceHttp2", 1, 1, sceHttp2CookieExport); + LIB_FUNCTION("5VlQSzXW-SQ", "libSceHttp2", 1, "libSceHttp2", 1, 1, sceHttp2CookieFlush); + LIB_FUNCTION("B5ibZI5UlzU", "libSceHttp2", 1, "libSceHttp2", 1, 1, sceHttp2CookieImport); + LIB_FUNCTION("N4UfjvWJsMw", "libSceHttp2", 1, "libSceHttp2", 1, 1, sceHttp2CreateCookieBox); + LIB_FUNCTION("mmyOCxQMVYQ", "libSceHttp2", 1, "libSceHttp2", 1, 1, + sceHttp2CreateRequestWithURL); + LIB_FUNCTION("+wCt7fCijgk", "libSceHttp2", 1, "libSceHttp2", 1, 1, sceHttp2CreateTemplate); + LIB_FUNCTION("O9ync3F-JVI", "libSceHttp2", 1, "libSceHttp2", 1, 1, sceHttp2DeleteCookieBox); + LIB_FUNCTION("c8D9qIjo8EY", "libSceHttp2", 1, "libSceHttp2", 1, 1, sceHttp2DeleteRequest); + LIB_FUNCTION("pDom5-078DA", "libSceHttp2", 1, "libSceHttp2", 1, 1, sceHttp2DeleteTemplate); + LIB_FUNCTION("-rdXUi2XW90", "libSceHttp2", 1, "libSceHttp2", 1, 1, + sceHttp2GetAllResponseHeaders); + LIB_FUNCTION("m-OL13q8AI8", "libSceHttp2", 1, "libSceHttp2", 1, 1, sceHttp2GetAuthEnabled); + LIB_FUNCTION("od5QCZhZSfw", "libSceHttp2", 1, "libSceHttp2", 1, 1, sceHttp2GetAutoRedirect); + LIB_FUNCTION("GQFGj0rYX+A", "libSceHttp2", 1, "libSceHttp2", 1, 1, sceHttp2GetCookie); + LIB_FUNCTION("IX23slKvtQI", "libSceHttp2", 1, "libSceHttp2", 1, 1, sceHttp2GetCookieBox); + LIB_FUNCTION("eij7UzkUqK8", "libSceHttp2", 1, "libSceHttp2", 1, 1, sceHttp2GetCookieStats); + LIB_FUNCTION("otUQuZa-mv0", "libSceHttp2", 1, "libSceHttp2", 1, 1, sceHttp2GetMemoryPoolStats); + LIB_FUNCTION("o0DBQpFE13o", "libSceHttp2", 1, "libSceHttp2", 1, 1, + sceHttp2GetResponseContentLength); + LIB_FUNCTION("9XYJwCf3lEA", "libSceHttp2", 1, "libSceHttp2", 1, 1, sceHttp2GetStatusCode); + LIB_FUNCTION("3JCe3lCbQ8A", "libSceHttp2", 1, "libSceHttp2", 1, 1, sceHttp2Init); + LIB_FUNCTION("QygCNNmbGss", "libSceHttp2", 1, "libSceHttp2", 1, 1, sceHttp2ReadData); + LIB_FUNCTION("bGN-6zbo7ms", "libSceHttp2", 1, "libSceHttp2", 1, 1, sceHttp2ReadDataAsync); + LIB_FUNCTION("klwUy2Wg+q8", "libSceHttp2", 1, "libSceHttp2", 1, 1, sceHttp2RedirectCacheFlush); + LIB_FUNCTION("jHdP0CS4ZlA", "libSceHttp2", 1, "libSceHttp2", 1, 1, sceHttp2RemoveRequestHeader); + LIB_FUNCTION("rbqZig38AT8", "libSceHttp2", 1, "libSceHttp2", 1, 1, sceHttp2SendRequest); + LIB_FUNCTION("A+NVAFu4eCg", "libSceHttp2", 1, "libSceHttp2", 1, 1, sceHttp2SendRequestAsync); + LIB_FUNCTION("jjFahkBPCYs", "libSceHttp2", 1, "libSceHttp2", 1, 1, sceHttp2SetAuthEnabled); + LIB_FUNCTION("Wwj6HbB2mOo", "libSceHttp2", 1, "libSceHttp2", 1, 1, sceHttp2SetAuthInfoCallback); + LIB_FUNCTION("b9AvoIaOuHI", "libSceHttp2", 1, "libSceHttp2", 1, 1, sceHttp2SetAutoRedirect); + LIB_FUNCTION("n8hMLe31OPA", "libSceHttp2", 1, "libSceHttp2", 1, 1, + sceHttp2SetConnectionWaitTimeOut); + LIB_FUNCTION("-HIO4VT87v8", "libSceHttp2", 1, "libSceHttp2", 1, 1, sceHttp2SetConnectTimeOut); + LIB_FUNCTION("jrVHsKCXA0g", "libSceHttp2", 1, "libSceHttp2", 1, 1, sceHttp2SetCookieBox); + LIB_FUNCTION("mPKVhQqh2Es", "libSceHttp2", 1, "libSceHttp2", 1, 1, sceHttp2SetCookieMaxNum); + LIB_FUNCTION("o7+WXe4WadE", "libSceHttp2", 1, "libSceHttp2", 1, 1, + sceHttp2SetCookieMaxNumPerDomain); + LIB_FUNCTION("6a0N6GPD7RM", "libSceHttp2", 1, "libSceHttp2", 1, 1, sceHttp2SetCookieMaxSize); + LIB_FUNCTION("zdtXKn9X7no", "libSceHttp2", 1, "libSceHttp2", 1, 1, + sceHttp2SetCookieRecvCallback); + LIB_FUNCTION("McYmUpQ3-DY", "libSceHttp2", 1, "libSceHttp2", 1, 1, + sceHttp2SetCookieSendCallback); + LIB_FUNCTION("uRosf8GQbHQ", "libSceHttp2", 1, "libSceHttp2", 1, 1, + sceHttp2SetInflateGZIPEnabled); + LIB_FUNCTION("09tk+kIA1Ns", "libSceHttp2", 1, "libSceHttp2", 1, 1, sceHttp2SetMinSslVersion); + LIB_FUNCTION("UL4Fviw+IAM", "libSceHttp2", 1, "libSceHttp2", 1, 1, sceHttp2SetPreSendCallback); + LIB_FUNCTION("izvHhqgDt44", "libSceHttp2", 1, "libSceHttp2", 1, 1, sceHttp2SetRecvTimeOut); + LIB_FUNCTION("BJgi0CH7al4", "libSceHttp2", 1, "libSceHttp2", 1, 1, sceHttp2SetRedirectCallback); + LIB_FUNCTION("FSAFOzi0FpM", "libSceHttp2", 1, "libSceHttp2", 1, 1, + sceHttp2SetRequestContentLength); + LIB_FUNCTION("Gcjh+CisAZM", "libSceHttp2", 1, "libSceHttp2", 1, 1, sceHttp2SetResolveRetry); + LIB_FUNCTION("ACjtE27aErY", "libSceHttp2", 1, "libSceHttp2", 1, 1, sceHttp2SetResolveTimeOut); + LIB_FUNCTION("XPtW45xiLHk", "libSceHttp2", 1, "libSceHttp2", 1, 1, sceHttp2SetSendTimeOut); + LIB_FUNCTION("YrWX+DhPHQY", "libSceHttp2", 1, "libSceHttp2", 1, 1, sceHttp2SetSslCallback); + LIB_FUNCTION("VYMxTcBqSE0", "libSceHttp2", 1, "libSceHttp2", 1, 1, sceHttp2SetTimeOut); + LIB_FUNCTION("B37SruheQ5Y", "libSceHttp2", 1, "libSceHttp2", 1, 1, sceHttp2SslDisableOption); + LIB_FUNCTION("EWcwMpbr5F8", "libSceHttp2", 1, "libSceHttp2", 1, 1, sceHttp2SslEnableOption); + LIB_FUNCTION("YiBUtz-pGkc", "libSceHttp2", 1, "libSceHttp2", 1, 1, sceHttp2Term); + LIB_FUNCTION("MOp-AUhdfi8", "libSceHttp2", 1, "libSceHttp2", 1, 1, sceHttp2WaitAsync); +}; + +} // namespace Libraries::Http2 \ No newline at end of file diff --git a/src/core/libraries/network/http2.h b/src/core/libraries/network/http2.h new file mode 100644 index 00000000000..aa1d0c5b4ef --- /dev/null +++ b/src/core/libraries/network/http2.h @@ -0,0 +1,72 @@ +// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-License-Identifier: GPL-2.0-or-later + +#pragma once + +#include "common/types.h" + +namespace Core::Loader { +class SymbolsResolver; +} + +namespace Libraries::Http2 { + +int PS4_SYSV_ABI _Z5dummyv(); +int PS4_SYSV_ABI sceHttp2AbortRequest(); +int PS4_SYSV_ABI sceHttp2AddCookie(); +int PS4_SYSV_ABI sceHttp2AddRequestHeader(); +int PS4_SYSV_ABI sceHttp2AuthCacheFlush(); +int PS4_SYSV_ABI sceHttp2CookieExport(); +int PS4_SYSV_ABI sceHttp2CookieFlush(); +int PS4_SYSV_ABI sceHttp2CookieImport(); +int PS4_SYSV_ABI sceHttp2CreateCookieBox(); +int PS4_SYSV_ABI sceHttp2CreateRequestWithURL(); +int PS4_SYSV_ABI sceHttp2CreateTemplate(); +int PS4_SYSV_ABI sceHttp2DeleteCookieBox(); +int PS4_SYSV_ABI sceHttp2DeleteRequest(); +int PS4_SYSV_ABI sceHttp2DeleteTemplate(); +int PS4_SYSV_ABI sceHttp2GetAllResponseHeaders(); +int PS4_SYSV_ABI sceHttp2GetAuthEnabled(); +int PS4_SYSV_ABI sceHttp2GetAutoRedirect(); +int PS4_SYSV_ABI sceHttp2GetCookie(); +int PS4_SYSV_ABI sceHttp2GetCookieBox(); +int PS4_SYSV_ABI sceHttp2GetCookieStats(); +int PS4_SYSV_ABI sceHttp2GetMemoryPoolStats(); +int PS4_SYSV_ABI sceHttp2GetResponseContentLength(); +int PS4_SYSV_ABI sceHttp2GetStatusCode(); +int PS4_SYSV_ABI sceHttp2Init(int net_id, int ssl_id, size_t pool_size, int max_requests); +int PS4_SYSV_ABI sceHttp2ReadData(); +int PS4_SYSV_ABI sceHttp2ReadDataAsync(); +int PS4_SYSV_ABI sceHttp2RedirectCacheFlush(); +int PS4_SYSV_ABI sceHttp2RemoveRequestHeader(); +int PS4_SYSV_ABI sceHttp2SendRequest(); +int PS4_SYSV_ABI sceHttp2SendRequestAsync(); +int PS4_SYSV_ABI sceHttp2SetAuthEnabled(); +int PS4_SYSV_ABI sceHttp2SetAuthInfoCallback(); +int PS4_SYSV_ABI sceHttp2SetAutoRedirect(); +int PS4_SYSV_ABI sceHttp2SetConnectionWaitTimeOut(); +int PS4_SYSV_ABI sceHttp2SetConnectTimeOut(); +int PS4_SYSV_ABI sceHttp2SetCookieBox(); +int PS4_SYSV_ABI sceHttp2SetCookieMaxNum(); +int PS4_SYSV_ABI sceHttp2SetCookieMaxNumPerDomain(); +int PS4_SYSV_ABI sceHttp2SetCookieMaxSize(); +int PS4_SYSV_ABI sceHttp2SetCookieRecvCallback(); +int PS4_SYSV_ABI sceHttp2SetCookieSendCallback(); +int PS4_SYSV_ABI sceHttp2SetInflateGZIPEnabled(); +int PS4_SYSV_ABI sceHttp2SetMinSslVersion(); +int PS4_SYSV_ABI sceHttp2SetPreSendCallback(); +int PS4_SYSV_ABI sceHttp2SetRecvTimeOut(); +int PS4_SYSV_ABI sceHttp2SetRedirectCallback(); +int PS4_SYSV_ABI sceHttp2SetRequestContentLength(); +int PS4_SYSV_ABI sceHttp2SetResolveRetry(); +int PS4_SYSV_ABI sceHttp2SetResolveTimeOut(); +int PS4_SYSV_ABI sceHttp2SetSendTimeOut(); +int PS4_SYSV_ABI sceHttp2SetSslCallback(); +int PS4_SYSV_ABI sceHttp2SetTimeOut(); +int PS4_SYSV_ABI sceHttp2SslDisableOption(); +int PS4_SYSV_ABI sceHttp2SslEnableOption(); +int PS4_SYSV_ABI sceHttp2Term(); +int PS4_SYSV_ABI sceHttp2WaitAsync(); + +void RegisterlibSceHttp2(Core::Loader::SymbolsResolver* sym); +} // namespace Libraries::Http2 \ No newline at end of file From 4f2f9494b02305a1b5d39e94eda63933972e15d9 Mon Sep 17 00:00:00 2001 From: kalaposfos13 <153381648+kalaposfos13@users.noreply.github.com> Date: Sun, 12 Jan 2025 21:31:05 +0100 Subject: [PATCH 2/3] GUI: Speed up GUI loading by caching game sizes (#2130) * Add show game size toggle * Fix (#7) * Fix I removed the gameSizeCheckBox from the 'Emulator' group and put it in 'GUI settings' hLayoutTrophy which contains the Trophy information was inside the GUIMusicLayout, so I fixed that too. * TR * Use cached sizes if the feature is enabled --------- Co-authored-by: DanielSvoboda --- src/common/config.cpp | 11 +++ src/common/config.h | 2 + src/qt_gui/game_list_frame.cpp | 2 + src/qt_gui/game_list_utils.h | 35 ++++++++ src/qt_gui/settings_dialog.cpp | 2 + src/qt_gui/settings_dialog.ui | 143 ++++++++++++++++--------------- src/qt_gui/translations/ar.ts | 4 + src/qt_gui/translations/da_DK.ts | 4 + src/qt_gui/translations/de.ts | 4 + src/qt_gui/translations/el.ts | 4 + src/qt_gui/translations/en.ts | 4 + src/qt_gui/translations/es_ES.ts | 4 + src/qt_gui/translations/fa_IR.ts | 4 + src/qt_gui/translations/fi.ts | 4 + src/qt_gui/translations/fr.ts | 4 + src/qt_gui/translations/hu_HU.ts | 4 + src/qt_gui/translations/id.ts | 4 + src/qt_gui/translations/it.ts | 4 + src/qt_gui/translations/ja_JP.ts | 4 + src/qt_gui/translations/ko_KR.ts | 4 + src/qt_gui/translations/lt_LT.ts | 4 + src/qt_gui/translations/nb.ts | 4 + src/qt_gui/translations/nl.ts | 4 + src/qt_gui/translations/pl_PL.ts | 4 + src/qt_gui/translations/pt_BR.ts | 4 + src/qt_gui/translations/ro_RO.ts | 4 + src/qt_gui/translations/ru_RU.ts | 4 + src/qt_gui/translations/sq.ts | 4 + src/qt_gui/translations/sv.ts | 4 + src/qt_gui/translations/tr_TR.ts | 4 + src/qt_gui/translations/uk_UA.ts | 4 + src/qt_gui/translations/vi_VN.ts | 4 + src/qt_gui/translations/zh_CN.ts | 4 + src/qt_gui/translations/zh_TW.ts | 4 + 34 files changed, 239 insertions(+), 68 deletions(-) diff --git a/src/common/config.cpp b/src/common/config.cpp index b46ab8d6ebc..158bfeddf47 100644 --- a/src/common/config.cpp +++ b/src/common/config.cpp @@ -72,6 +72,7 @@ static bool checkCompatibilityOnStartup = false; static std::string trophyKey; // Gui +static bool load_game_size = true; std::vector settings_install_dirs = {}; std::filesystem::path settings_addon_install_dir = {}; u32 main_window_geometry_x = 400; @@ -102,6 +103,14 @@ void setTrophyKey(std::string key) { trophyKey = key; } +bool GetLoadGameSizeEnabled() { + return load_game_size; +} + +void setLoadGameSizeEnabled(bool enable) { + load_game_size = enable; +} + bool isNeoModeConsole() { return isNeo; } @@ -650,6 +659,7 @@ void load(const std::filesystem::path& path) { if (data.contains("GUI")) { const toml::value& gui = data.at("GUI"); + load_game_size = toml::find_or(gui, "loadGameSizeEnabled", true); m_icon_size = toml::find_or(gui, "iconSize", 0); m_icon_size_grid = toml::find_or(gui, "iconSizeGrid", 0); m_slider_pos = toml::find_or(gui, "sliderPos", 0); @@ -755,6 +765,7 @@ void save(const std::filesystem::path& path) { install_dirs.emplace_back(std::string{fmt::UTF(dirString.u8string()).data}); } data["GUI"]["installDirs"] = install_dirs; + data["GUI"]["loadGameSizeEnabled"] = load_game_size; data["GUI"]["addonInstallDir"] = std::string{fmt::UTF(settings_addon_install_dir.u8string()).data}; diff --git a/src/common/config.h b/src/common/config.h index 6e6a5d9609b..c86e35ebce7 100644 --- a/src/common/config.h +++ b/src/common/config.h @@ -17,6 +17,8 @@ void saveMainWindow(const std::filesystem::path& path); std::string getTrophyKey(); void setTrophyKey(std::string key); +bool GetLoadGameSizeEnabled(); +void setLoadGameSizeEnabled(bool enable); bool getIsFullscreen(); std::string getFullscreenMode(); bool isNeoModeConsole(); diff --git a/src/qt_gui/game_list_frame.cpp b/src/qt_gui/game_list_frame.cpp index b1cd0721617..9753f511be9 100644 --- a/src/qt_gui/game_list_frame.cpp +++ b/src/qt_gui/game_list_frame.cpp @@ -106,6 +106,8 @@ void GameListFrame::PlayBackgroundMusic(QTableWidgetItem* item) { void GameListFrame::PopulateGameList() { // Do not show status column if it is not enabled this->setColumnHidden(2, !Config::getCompatibilityEnabled()); + this->setColumnHidden(6, !Config::GetLoadGameSizeEnabled()); + this->setRowCount(m_game_info->m_games.size()); ResizeIcons(icon_size); diff --git a/src/qt_gui/game_list_utils.h b/src/qt_gui/game_list_utils.h index ab923388653..581a8a55fe9 100644 --- a/src/qt_gui/game_list_utils.h +++ b/src/qt_gui/game_list_utils.h @@ -62,11 +62,46 @@ class GameListUtils : public QObject { QDir dir(dirPath); QDirIterator it(dir.absolutePath(), QDirIterator::Subdirectories); qint64 total = 0; + + if (!Config::GetLoadGameSizeEnabled()) { + game.size = FormatSize(0).toStdString(); + return; + } + + // Cache path + QFile size_cache_file(Common::FS::GetUserPath(Common::FS::PathType::MetaDataDir) / + game.serial / "size_cache.txt"); + QFileInfo cacheInfo(size_cache_file); + QFileInfo dirInfo(dirPath); + + // Check if cache file exists and is valid + if (size_cache_file.exists() && cacheInfo.lastModified() >= dirInfo.lastModified()) { + if (size_cache_file.open(QIODevice::ReadOnly | QIODevice::Text)) { + QTextStream in(&size_cache_file); + QString cachedSize = in.readLine(); + size_cache_file.close(); + + if (!cachedSize.isEmpty()) { + game.size = cachedSize.toStdString(); + return; + } + } + } + + // Cache is invalid or does not exist; calculate size while (it.hasNext()) { it.next(); total += it.fileInfo().size(); } + game.size = FormatSize(total).toStdString(); + + // Save new cache + if (size_cache_file.open(QIODevice::WriteOnly | QIODevice::Text)) { + QTextStream out(&size_cache_file); + out << QString::fromStdString(game.size) << "\n"; + size_cache_file.close(); + } } static QString GetRegion(char region) { diff --git a/src/qt_gui/settings_dialog.cpp b/src/qt_gui/settings_dialog.cpp index 3f4970dad7b..a4b584294be 100644 --- a/src/qt_gui/settings_dialog.cpp +++ b/src/qt_gui/settings_dialog.cpp @@ -315,6 +315,7 @@ void SettingsDialog::LoadValuesFromConfig() { toml::find_or(data, "General", "FullscreenMode", "Borderless"))); ui->separateUpdatesCheckBox->setChecked( toml::find_or(data, "General", "separateUpdateEnabled", false)); + ui->gameSizeCheckBox->setChecked(toml::find_or(data, "GUI", "loadGameSizeEnabled", true)); ui->showSplashCheckBox->setChecked(toml::find_or(data, "General", "showSplash", false)); ui->logTypeComboBox->setCurrentText( QString::fromStdString(toml::find_or(data, "General", "logType", "async"))); @@ -568,6 +569,7 @@ void SettingsDialog::UpdateSettings() { Config::setDumpShaders(ui->dumpShadersCheckBox->isChecked()); Config::setNullGpu(ui->nullGpuCheckBox->isChecked()); Config::setSeparateUpdateEnabled(ui->separateUpdatesCheckBox->isChecked()); + Config::setLoadGameSizeEnabled(ui->gameSizeCheckBox->isChecked()); Config::setShowSplash(ui->showSplashCheckBox->isChecked()); Config::setDebugDump(ui->debugDump->isChecked()); Config::setVkValidation(ui->vkValidationCheckBox->isChecked()); diff --git a/src/qt_gui/settings_dialog.ui b/src/qt_gui/settings_dialog.ui index 089158fd328..8d68d1c9028 100644 --- a/src/qt_gui/settings_dialog.ui +++ b/src/qt_gui/settings_dialog.ui @@ -68,7 +68,7 @@ 0 0 946 - 536 + 586 @@ -134,7 +134,7 @@ - + Fullscreen Mode @@ -483,6 +483,13 @@ 11 + + + + Show Game Size In List + + + @@ -557,59 +564,59 @@ + + + + + + 6 + + + 0 + + + 50 + - - - 6 - - - 0 - - - 80 - + - - - - - Trophy - - - - - - Disable Trophy Pop-ups - - - - - - - Trophy Key - - - - - - - - 0 - 0 - - - - - 10 - false - - - - - - - - + + + Trophy + + + + + + Disable Trophy Pop-ups + + + + + + + Trophy Key + + + + + + + + 0 + 0 + + + + + 10 + false + + + + + + @@ -637,8 +644,8 @@ 0 0 - 926 - 536 + 946 + 586 @@ -853,13 +860,13 @@ - - - - Enable Motion Controls - - - + + + + Enable Motion Controls + + + @@ -935,8 +942,8 @@ 0 0 - 926 - 536 + 946 + 586 @@ -1186,8 +1193,8 @@ 0 0 - 926 - 536 + 946 + 586 @@ -1259,8 +1266,8 @@ 0 0 - 926 - 536 + 946 + 586 diff --git a/src/qt_gui/translations/ar.ts b/src/qt_gui/translations/ar.ts index 4fc9c2de15c..a4dadcb1ade 100644 --- a/src/qt_gui/translations/ar.ts +++ b/src/qt_gui/translations/ar.ts @@ -540,6 +540,10 @@ Enable Separate Update Folder Enable Separate Update Folder + + Show Game Size In List + عرض حجم اللعبة في القائمة + Show Splash إظهار شاشة البداية diff --git a/src/qt_gui/translations/da_DK.ts b/src/qt_gui/translations/da_DK.ts index ef1ae27a3cb..70b7d3eccbd 100644 --- a/src/qt_gui/translations/da_DK.ts +++ b/src/qt_gui/translations/da_DK.ts @@ -540,6 +540,10 @@ Enable Separate Update Folder Enable Separate Update Folder + + Show Game Size In List + Vis vis spilstørrelse i listen + Show Splash Show Splash diff --git a/src/qt_gui/translations/de.ts b/src/qt_gui/translations/de.ts index 2fc6a29feb7..7f1de3afdcb 100644 --- a/src/qt_gui/translations/de.ts +++ b/src/qt_gui/translations/de.ts @@ -540,6 +540,10 @@ Enable Separate Update Folder Enable Separate Update Folder + + Show Game Size In List + Zeigen Sie die Spielgröße in der Liste + Show Splash Startbildschirm anzeigen diff --git a/src/qt_gui/translations/el.ts b/src/qt_gui/translations/el.ts index 8d388580828..84165536e06 100644 --- a/src/qt_gui/translations/el.ts +++ b/src/qt_gui/translations/el.ts @@ -540,6 +540,10 @@ Enable Separate Update Folder Enable Separate Update Folder + + Show Game Size In List + Εμφάνιση Μεγέθους Παιχνιδιού στη Λίστα + Show Splash Show Splash diff --git a/src/qt_gui/translations/en.ts b/src/qt_gui/translations/en.ts index 0262ee149e3..fad185d4176 100644 --- a/src/qt_gui/translations/en.ts +++ b/src/qt_gui/translations/en.ts @@ -540,6 +540,10 @@ Enable Separate Update Folder Enable Separate Update Folder + + Show Game Size In List + Show Game Size In List + Show Splash Show Splash diff --git a/src/qt_gui/translations/es_ES.ts b/src/qt_gui/translations/es_ES.ts index a25ff639e5e..a97d3d3c86b 100644 --- a/src/qt_gui/translations/es_ES.ts +++ b/src/qt_gui/translations/es_ES.ts @@ -540,6 +540,10 @@ Enable Separate Update Folder Enable Separate Update Folder + + Show Game Size In List + Mostrar Tamaño del Juego en la Lista + Show Splash Mostrar splash diff --git a/src/qt_gui/translations/fa_IR.ts b/src/qt_gui/translations/fa_IR.ts index 52aa4b17cee..697e615fb4f 100644 --- a/src/qt_gui/translations/fa_IR.ts +++ b/src/qt_gui/translations/fa_IR.ts @@ -540,6 +540,10 @@ Enable Separate Update Folder فعال‌سازی پوشه جداگانه برای به‌روزرسانی + + Show Game Size In List + نمایش اندازه بازی در لیست + Show Splash Splash نمایش diff --git a/src/qt_gui/translations/fi.ts b/src/qt_gui/translations/fi.ts index 97fee5dfa28..51e85dfbb68 100644 --- a/src/qt_gui/translations/fi.ts +++ b/src/qt_gui/translations/fi.ts @@ -540,6 +540,10 @@ Enable Separate Update Folder Ota Käyttöön Erillinen Päivityshakemisto + + Show Game Size In List + Näytä pelin koko luettelossa + Show Splash Näytä Aloitusnäyttö diff --git a/src/qt_gui/translations/fr.ts b/src/qt_gui/translations/fr.ts index d25ad30f4c6..35f3eb55f42 100644 --- a/src/qt_gui/translations/fr.ts +++ b/src/qt_gui/translations/fr.ts @@ -540,6 +540,10 @@ Enable Separate Update Folder Dossier séparé pour les mises à jours + + Show Game Size In List + Afficher la taille du jeu dans la liste + Show Splash Afficher l'image du jeu diff --git a/src/qt_gui/translations/hu_HU.ts b/src/qt_gui/translations/hu_HU.ts index 6ecc3fc90a9..a2bd9c1dadb 100644 --- a/src/qt_gui/translations/hu_HU.ts +++ b/src/qt_gui/translations/hu_HU.ts @@ -540,6 +540,10 @@ Enable Separate Update Folder Külön Frissítési Mappa Engedélyezése + + Show Game Size In List + Játékméret megjelenítése a listában + Show Splash Indítóképernyő Mutatása diff --git a/src/qt_gui/translations/id.ts b/src/qt_gui/translations/id.ts index fc5ad4a99f6..b97914ca2d7 100644 --- a/src/qt_gui/translations/id.ts +++ b/src/qt_gui/translations/id.ts @@ -540,6 +540,10 @@ Enable Separate Update Folder Enable Separate Update Folder + + Show Game Size In List + Tampilkan Ukuran Game di Daftar + Show Splash Show Splash diff --git a/src/qt_gui/translations/it.ts b/src/qt_gui/translations/it.ts index f7ba3661bdd..d4ea1c7e650 100644 --- a/src/qt_gui/translations/it.ts +++ b/src/qt_gui/translations/it.ts @@ -540,6 +540,10 @@ Enable Separate Update Folder Abilita Cartella Aggiornamenti Separata + + Show Game Size In List + Mostra la dimensione del gioco nell'elenco + Show Splash Mostra Schermata Iniziale diff --git a/src/qt_gui/translations/ja_JP.ts b/src/qt_gui/translations/ja_JP.ts index 21c8145edc4..359955765d2 100644 --- a/src/qt_gui/translations/ja_JP.ts +++ b/src/qt_gui/translations/ja_JP.ts @@ -540,6 +540,10 @@ Enable Separate Update Folder Enable Separate Update Folder + + Show Game Size In List + ゲームサイズをリストに表示 + Show Splash スプラッシュを表示する diff --git a/src/qt_gui/translations/ko_KR.ts b/src/qt_gui/translations/ko_KR.ts index fea8d55bcb4..9cca0b656a2 100644 --- a/src/qt_gui/translations/ko_KR.ts +++ b/src/qt_gui/translations/ko_KR.ts @@ -540,6 +540,10 @@ Enable Separate Update Folder Enable Separate Update Folder + + Show Game Size In List + 게임 크기를 목록에 표시 + Show Splash Show Splash diff --git a/src/qt_gui/translations/lt_LT.ts b/src/qt_gui/translations/lt_LT.ts index eaf51a975ce..0594bcbd238 100644 --- a/src/qt_gui/translations/lt_LT.ts +++ b/src/qt_gui/translations/lt_LT.ts @@ -540,6 +540,10 @@ Enable Separate Update Folder Enable Separate Update Folder + + Show Game Size In List + Rodyti žaidimo dydį sąraše + Show Splash Show Splash diff --git a/src/qt_gui/translations/nb.ts b/src/qt_gui/translations/nb.ts index 83dbf7dd815..8ca8246ba95 100644 --- a/src/qt_gui/translations/nb.ts +++ b/src/qt_gui/translations/nb.ts @@ -540,6 +540,10 @@ Enable Separate Update Folder Aktiver seperat oppdateringsmappe + + Show Game Size In List + Vis spillstørrelse i listen + Show Splash Vis velkomstbilde diff --git a/src/qt_gui/translations/nl.ts b/src/qt_gui/translations/nl.ts index 3142a17e5c0..12d6444580d 100644 --- a/src/qt_gui/translations/nl.ts +++ b/src/qt_gui/translations/nl.ts @@ -540,6 +540,10 @@ Enable Separate Update Folder Enable Separate Update Folder + + Show Game Size In List + Toon grootte van het spel in de lijst + Show Splash Show Splash diff --git a/src/qt_gui/translations/pl_PL.ts b/src/qt_gui/translations/pl_PL.ts index 378673a306f..782db12e2f4 100644 --- a/src/qt_gui/translations/pl_PL.ts +++ b/src/qt_gui/translations/pl_PL.ts @@ -540,6 +540,10 @@ Enable Separate Update Folder Enable Separate Update Folder + + Show Game Size In List + Pokaż rozmiar gry na liście + Show Splash Pokaż ekran powitania diff --git a/src/qt_gui/translations/pt_BR.ts b/src/qt_gui/translations/pt_BR.ts index 5d9c84769d2..94bbf028a49 100644 --- a/src/qt_gui/translations/pt_BR.ts +++ b/src/qt_gui/translations/pt_BR.ts @@ -540,6 +540,10 @@ Enable Separate Update Folder Habilitar pasta de atualização separada + + Show Game Size In List + Mostrar Tamanho do Jogo na Lista + Show Splash Mostrar Splash Inicial diff --git a/src/qt_gui/translations/ro_RO.ts b/src/qt_gui/translations/ro_RO.ts index 71354fb06d7..3bd8e38b5c3 100644 --- a/src/qt_gui/translations/ro_RO.ts +++ b/src/qt_gui/translations/ro_RO.ts @@ -540,6 +540,10 @@ Enable Separate Update Folder Enable Separate Update Folder + + Show Game Size In List + Afișează dimensiunea jocului în listă + Show Splash Show Splash diff --git a/src/qt_gui/translations/ru_RU.ts b/src/qt_gui/translations/ru_RU.ts index 0e803ea42af..a38e2fd9849 100644 --- a/src/qt_gui/translations/ru_RU.ts +++ b/src/qt_gui/translations/ru_RU.ts @@ -540,6 +540,10 @@ Enable Separate Update Folder Отдельная папка обновлений + + Show Game Size In List + Показать размер игры в списке + Show Splash Показывать заставку diff --git a/src/qt_gui/translations/sq.ts b/src/qt_gui/translations/sq.ts index 7354b4bd962..a83dc982966 100644 --- a/src/qt_gui/translations/sq.ts +++ b/src/qt_gui/translations/sq.ts @@ -540,6 +540,10 @@ Enable Separate Update Folder Aktivizo dosjen e ndarë të përditësimit + + Show Game Size In List + Shfaq madhësinë e lojës në listë + Show Splash Shfaq Pamjen e nisjes diff --git a/src/qt_gui/translations/sv.ts b/src/qt_gui/translations/sv.ts index 3a6f060cbd3..9a244a9df6a 100644 --- a/src/qt_gui/translations/sv.ts +++ b/src/qt_gui/translations/sv.ts @@ -1032,6 +1032,10 @@ Enable Separate Update Folder Aktivera separat uppdateringsmapp + + Show Game Size In List + Visa spelstorlek i listan + Show Splash Visa startskärm diff --git a/src/qt_gui/translations/tr_TR.ts b/src/qt_gui/translations/tr_TR.ts index 4596000f24b..be50f935a71 100644 --- a/src/qt_gui/translations/tr_TR.ts +++ b/src/qt_gui/translations/tr_TR.ts @@ -540,6 +540,10 @@ Enable Separate Update Folder Enable Separate Update Folder + + Show Game Size In List + Göster oyun boyutunu listede + Show Splash Başlangıç Ekranını Göster diff --git a/src/qt_gui/translations/uk_UA.ts b/src/qt_gui/translations/uk_UA.ts index 5b260050e2a..ff4e48e8037 100644 --- a/src/qt_gui/translations/uk_UA.ts +++ b/src/qt_gui/translations/uk_UA.ts @@ -540,6 +540,10 @@ Enable Separate Update Folder Увімкнути окрему папку оновлень + + Show Game Size In List + Показати розмір гри в списку + Show Splash Показувати заставку diff --git a/src/qt_gui/translations/vi_VN.ts b/src/qt_gui/translations/vi_VN.ts index 7fcac6d7eb8..e546d955c2c 100644 --- a/src/qt_gui/translations/vi_VN.ts +++ b/src/qt_gui/translations/vi_VN.ts @@ -540,6 +540,10 @@ Enable Separate Update Folder Enable Separate Update Folder + + Show Game Size In List + Hiển thị Kích thước Game trong Danh sách + Show Splash Show Splash diff --git a/src/qt_gui/translations/zh_CN.ts b/src/qt_gui/translations/zh_CN.ts index bb4476b9ee9..ece5f94902d 100644 --- a/src/qt_gui/translations/zh_CN.ts +++ b/src/qt_gui/translations/zh_CN.ts @@ -540,6 +540,10 @@ Enable Separate Update Folder 启用单独的更新目录 + + Show Game Size In List + 显示游戏大小在列表中 + Show Splash 显示启动画面 diff --git a/src/qt_gui/translations/zh_TW.ts b/src/qt_gui/translations/zh_TW.ts index 49d419d8b9a..11642d52b0c 100644 --- a/src/qt_gui/translations/zh_TW.ts +++ b/src/qt_gui/translations/zh_TW.ts @@ -540,6 +540,10 @@ Enable Separate Update Folder Enable Separate Update Folder + + Show Game Size In List + 顯示遊戲大小在列表中 + Show Splash Show Splash From 4719d32295095e6a084045629f6456c2a1f8b635 Mon Sep 17 00:00:00 2001 From: squidbus <175574877+squidbus@users.noreply.github.com> Date: Sun, 12 Jan 2025 12:44:42 -0800 Subject: [PATCH 3/3] sdl: Respect text input main thread requirements. (#2138) --- externals/sdl3 | 2 +- src/imgui/renderer/imgui_impl_sdl3.cpp | 41 ++++++++++---------------- src/sdl_window.cpp | 8 +++-- 3 files changed, 23 insertions(+), 28 deletions(-) diff --git a/externals/sdl3 b/externals/sdl3 index 3a1d76d298d..22422f7748d 160000 --- a/externals/sdl3 +++ b/externals/sdl3 @@ -1 +1 @@ -Subproject commit 3a1d76d298db023f6cf37fb08ee766f20a4e12ab +Subproject commit 22422f7748d5128135995ed34c8f8012861c7332 diff --git a/src/imgui/renderer/imgui_impl_sdl3.cpp b/src/imgui/renderer/imgui_impl_sdl3.cpp index 60b440c245d..e67bdc77592 100644 --- a/src/imgui/renderer/imgui_impl_sdl3.cpp +++ b/src/imgui/renderer/imgui_impl_sdl3.cpp @@ -11,7 +11,6 @@ #include #if defined(__APPLE__) #include -#include #endif #ifdef _WIN32 #ifndef WIN32_LEAN_AND_MEAN @@ -72,33 +71,25 @@ static void PlatformSetImeData(ImGuiContext*, ImGuiViewport* viewport, ImGuiPlat auto window_id = (SDL_WindowID)(intptr_t)viewport->PlatformHandle; SDL_Window* window = SDL_GetWindowFromID(window_id); if ((!data->WantVisible || bd->ime_window != window) && bd->ime_window != nullptr) { - auto stop_input = [&bd] { SDL_StopTextInput(bd->ime_window); }; -#ifdef __APPLE__ - dispatch_sync(dispatch_get_main_queue(), ^{ - stop_input(); - }); -#else - stop_input(); -#endif + SDL_RunOnMainThread( + [](void* userdata) { SDL_StopTextInput(static_cast(userdata)); }, + bd->ime_window, true); bd->ime_window = nullptr; } if (data->WantVisible) { - SDL_Rect r; - r.x = (int)data->InputPos.x; - r.y = (int)data->InputPos.y; - r.w = 1; - r.h = (int)data->InputLineHeight; - const auto start_input = [&window, &r] { - SDL_SetTextInputArea(window, &r, 0); - SDL_StartTextInput(window); - }; -#ifdef __APPLE__ - dispatch_sync(dispatch_get_main_queue(), ^{ - start_input(); - }); -#else - start_input(); -#endif + std::pair usr_data; + usr_data.first = window; + usr_data.second.x = (int)data->InputPos.x; + usr_data.second.y = (int)data->InputPos.y; + usr_data.second.w = 1; + usr_data.second.h = (int)data->InputLineHeight; + SDL_RunOnMainThread( + [](void* userdata) { + auto* params = static_cast*>(userdata); + SDL_SetTextInputArea(params->first, ¶ms->second, 0); + SDL_StartTextInput(params->first); + }, + &usr_data, true); bd->ime_window = window; } } diff --git a/src/sdl_window.cpp b/src/sdl_window.cpp index 318b3349bf7..b0126def20b 100644 --- a/src/sdl_window.cpp +++ b/src/sdl_window.cpp @@ -205,7 +205,9 @@ void WindowSDL::InitTimers() { void WindowSDL::RequestKeyboard() { if (keyboard_grab == 0) { - SDL_StartTextInput(window); + SDL_RunOnMainThread( + [](void* userdata) { SDL_StartTextInput(static_cast(userdata)); }, window, + true); } keyboard_grab++; } @@ -214,7 +216,9 @@ void WindowSDL::ReleaseKeyboard() { ASSERT(keyboard_grab > 0); keyboard_grab--; if (keyboard_grab == 0) { - SDL_StopTextInput(window); + SDL_RunOnMainThread( + [](void* userdata) { SDL_StopTextInput(static_cast(userdata)); }, window, + true); } }