diff --git a/CMakeLists.txt b/CMakeLists.txt index 84eaefbbb..30e6c58c0 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/externals/sdl3 b/externals/sdl3 index 3a1d76d29..22422f774 160000 --- a/externals/sdl3 +++ b/externals/sdl3 @@ -1 +1 @@ -Subproject commit 3a1d76d298db023f6cf37fb08ee766f20a4e12ab +Subproject commit 22422f7748d5128135995ed34c8f8012861c7332 diff --git a/src/common/config.cpp b/src/common/config.cpp index b46ab8d6e..158bfeddf 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 6e6a5d960..c86e35ebc 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/common/logging/filter.cpp b/src/common/logging/filter.cpp index 6fe2ec4e4..376c55ba7 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 c42cf5665..535a88a6d 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 b651bab44..7427640b6 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 000000000..52f73edc6 --- /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 000000000..aa1d0c5b4 --- /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 diff --git a/src/imgui/renderer/imgui_impl_sdl3.cpp b/src/imgui/renderer/imgui_impl_sdl3.cpp index 60b440c24..e67bdc775 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/qt_gui/game_list_frame.cpp b/src/qt_gui/game_list_frame.cpp index b1cd07216..9753f511b 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 ab9233886..581a8a55f 100644 --- a/src/qt_gui/game_list_utils.h +++ b/src/qt_gui/game_list_utils.h @@ -62,11 +62,46 @@ public: 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 3f4970dad..a4b584294 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 089158fd3..8d68d1c90 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 4fc9c2de1..a4dadcb1a 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 ef1ae27a3..70b7d3ecc 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 2fc6a29fe..7f1de3afd 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 8d3885808..84165536e 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 0262ee149..fad185d41 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 a25ff639e..a97d3d3c8 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 52aa4b17c..697e615fb 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 97fee5dfa..51e85dfbb 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 d25ad30f4..35f3eb55f 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 6ecc3fc90..a2bd9c1da 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 fc5ad4a99..b97914ca2 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 f7ba3661b..d4ea1c7e6 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 21c8145ed..359955765 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 fea8d55bc..9cca0b656 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 eaf51a975..0594bcbd2 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 83dbf7dd8..8ca8246ba 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 3142a17e5..12d644458 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 378673a30..782db12e2 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 5d9c84769..94bbf028a 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 71354fb06..3bd8e38b5 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 0e803ea42..a38e2fd98 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 7354b4bd9..a83dc9829 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 3a6f060cb..9a244a9df 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 4596000f2..be50f935a 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 5b260050e..ff4e48e80 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 7fcac6d7e..e546d955c 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 bb4476b9e..ece5f9490 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 49d419d8b..11642d52b 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 diff --git a/src/sdl_window.cpp b/src/sdl_window.cpp index 318b3349b..b0126def2 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); } } diff --git a/src/video_core/amdgpu/resource.h b/src/video_core/amdgpu/resource.h index 744aacdc5..75b8b2acf 100644 --- a/src/video_core/amdgpu/resource.h +++ b/src/video_core/amdgpu/resource.h @@ -119,6 +119,7 @@ constexpr std::string_view NameOf(ImageType type) { enum class TilingMode : u32 { Depth_MacroTiled = 0u, Display_Linear = 0x8u, + Display_MicroTiled = 0x9u, Display_MacroTiled = 0xAu, Texture_MicroTiled = 0xDu, Texture_MacroTiled = 0xEu, @@ -131,6 +132,8 @@ constexpr std::string_view NameOf(TilingMode type) { return "Depth_MacroTiled"; case TilingMode::Display_Linear: return "Display_Linear"; + case TilingMode::Display_MicroTiled: + return "Display_MicroTiled"; case TilingMode::Display_MacroTiled: return "Display_MacroTiled"; case TilingMode::Texture_MicroTiled: diff --git a/src/video_core/host_shaders/CMakeLists.txt b/src/video_core/host_shaders/CMakeLists.txt index a9c2964ad..e60cca122 100644 --- a/src/video_core/host_shaders/CMakeLists.txt +++ b/src/video_core/host_shaders/CMakeLists.txt @@ -2,6 +2,7 @@ # SPDX-License-Identifier: GPL-2.0-or-later set(SHADER_FILES + detilers/display_micro_64bpp.comp detilers/macro_32bpp.comp detilers/macro_64bpp.comp detilers/macro_8bpp.comp diff --git a/src/video_core/host_shaders/detilers/display_micro_64bpp.comp b/src/video_core/host_shaders/detilers/display_micro_64bpp.comp new file mode 100644 index 000000000..3e0485682 --- /dev/null +++ b/src/video_core/host_shaders/detilers/display_micro_64bpp.comp @@ -0,0 +1,60 @@ +// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-License-Identifier: GPL-2.0-or-later + +#version 450 + +layout (local_size_x = 64, local_size_y = 1, local_size_z = 1) in; + +layout(std430, binding = 0) buffer input_buf { + uint in_data[]; +}; +layout(std430, binding = 1) buffer output_buf { + uint out_data[]; +}; + +layout(push_constant) uniform image_info { + uint num_levels; + uint pitch; + uint height; + uint c0; + uint c1; +} info; + +const uint lut_64bpp[16] = { + 0x05040100, 0x0d0c0908, + 0x07060302, 0x0f0e0b0a, + 0x15141110, 0x1d1c1918, + 0x17161312, 0x1f1e1b1a, + 0x25242120, 0x2d2c2928, + 0x27262322, 0x2f2e2b2a, + 0x35343130, 0x3d3c3938, + 0x37363332, 0x3f3e3b3a, +}; + +#define MICRO_TILE_DIM (8) +#define MICRO_TILE_SZ (512) +#define TEXELS_PER_ELEMENT (1) +#define BPP (64) + +void main() { + uint x = gl_GlobalInvocationID.x % info.pitch; + uint y = (gl_GlobalInvocationID.x / info.pitch) % info.height; + uint z = gl_GlobalInvocationID.x / (info.pitch * info.height); + + uint col = bitfieldExtract(x, 0, 3); + uint row = bitfieldExtract(y, 0, 3); + uint idx_dw = lut_64bpp[(col + row * MICRO_TILE_DIM) >> 2u]; + uint byte_ofs = gl_LocalInvocationID.x & 3u; + uint idx = bitfieldExtract(idx_dw >> (8 * byte_ofs), 0, 8); + + uint slice_offs = z * info.c1 * MICRO_TILE_SZ; + uint tile_row = y / MICRO_TILE_DIM; + uint tile_column = x / MICRO_TILE_DIM; + uint tile_offs = ((tile_row * info.c0) + tile_column) * MICRO_TILE_SZ; + uint offs = slice_offs + tile_offs + ((idx * BPP) / 8u); + + uint p0 = in_data[(offs >> 2) + 0]; + uint p1 = in_data[(offs >> 2) + 1]; + out_data[2 * gl_GlobalInvocationID.x + 0] = p0; + out_data[2 * gl_GlobalInvocationID.x + 1] = p1; +} diff --git a/src/video_core/texture_cache/image_info.cpp b/src/video_core/texture_cache/image_info.cpp index 58c2a8e23..1992f1fb7 100644 --- a/src/video_core/texture_cache/image_info.cpp +++ b/src/video_core/texture_cache/image_info.cpp @@ -182,6 +182,7 @@ void ImageInfo::UpdateSize() { case AmdGpu::TilingMode::Texture_Volume: mip_d += (-mip_d) & 3u; [[fallthrough]]; + case AmdGpu::TilingMode::Display_MicroTiled: case AmdGpu::TilingMode::Texture_MicroTiled: { std::tie(mip_info.pitch, mip_info.size) = ImageSizeMicroTiled(mip_w, mip_h, bpp, num_samples); diff --git a/src/video_core/texture_cache/texture_cache.cpp b/src/video_core/texture_cache/texture_cache.cpp index bef083d1a..a281b89c9 100644 --- a/src/video_core/texture_cache/texture_cache.cpp +++ b/src/video_core/texture_cache/texture_cache.cpp @@ -469,9 +469,6 @@ ImageView& TextureCache::FindDepthTarget(BaseDesc& desc) { } void TextureCache::RefreshImage(Image& image, Vulkan::Scheduler* custom_scheduler /*= nullptr*/) { - RENDERER_TRACE; - TRACE_HINT(fmt::format("{:x}:{:x}", image.info.guest_address, image.info.guest_size)); - if (False(image.flags & ImageFlagBits::Dirty)) { return; } @@ -480,6 +477,9 @@ void TextureCache::RefreshImage(Image& image, Vulkan::Scheduler* custom_schedule return; } + RENDERER_TRACE; + TRACE_HINT(fmt::format("{:x}:{:x}", image.info.guest_address, image.info.guest_size)); + if (True(image.flags & ImageFlagBits::MaybeCpuDirty) && False(image.flags & ImageFlagBits::CpuDirty)) { // The image size should be less than page size to be considered MaybeCpuDirty diff --git a/src/video_core/texture_cache/tile_manager.cpp b/src/video_core/texture_cache/tile_manager.cpp index aba255ce5..ede91d128 100644 --- a/src/video_core/texture_cache/tile_manager.cpp +++ b/src/video_core/texture_cache/tile_manager.cpp @@ -8,6 +8,7 @@ #include "video_core/texture_cache/image_view.h" #include "video_core/texture_cache/tile_manager.h" +#include "video_core/host_shaders/detilers/display_micro_64bpp_comp.h" #include "video_core/host_shaders/detilers/macro_32bpp_comp.h" #include "video_core/host_shaders/detilers/macro_64bpp_comp.h" #include "video_core/host_shaders/detilers/macro_8bpp_comp.h" @@ -53,6 +54,14 @@ const DetilerContext* TileManager::GetDetiler(const ImageInfo& info) const { return nullptr; } break; + case AmdGpu::TilingMode::Display_MicroTiled: + switch (bpp) { + case 64: + return &detilers[DetilerType::Display_Micro64]; + default: + return nullptr; + } + break; default: return nullptr; } @@ -68,10 +77,11 @@ struct DetilerParams { TileManager::TileManager(const Vulkan::Instance& instance, Vulkan::Scheduler& scheduler) : instance{instance}, scheduler{scheduler} { static const std::array detiler_shaders{ - HostShaders::MICRO_8BPP_COMP, HostShaders::MICRO_16BPP_COMP, - HostShaders::MICRO_32BPP_COMP, HostShaders::MICRO_64BPP_COMP, - HostShaders::MICRO_128BPP_COMP, HostShaders::MACRO_8BPP_COMP, - HostShaders::MACRO_32BPP_COMP, HostShaders::MACRO_64BPP_COMP, + HostShaders::MICRO_8BPP_COMP, HostShaders::MICRO_16BPP_COMP, + HostShaders::MICRO_32BPP_COMP, HostShaders::MICRO_64BPP_COMP, + HostShaders::MICRO_128BPP_COMP, HostShaders::MACRO_8BPP_COMP, + HostShaders::MACRO_32BPP_COMP, HostShaders::MACRO_64BPP_COMP, + HostShaders::DISPLAY_MICRO_64BPP_COMP, }; boost::container::static_vector bindings{ @@ -258,7 +268,8 @@ std::pair TileManager::TryDetile(vk::Buffer in_buffer, u32 in_o params.num_levels = info.resources.levels; params.pitch0 = info.pitch >> (info.props.is_block ? 2u : 0u); params.height = info.size.height; - if (info.tiling_mode == AmdGpu::TilingMode::Texture_Volume) { + if (info.tiling_mode == AmdGpu::TilingMode::Texture_Volume || + info.tiling_mode == AmdGpu::TilingMode::Display_MicroTiled) { ASSERT(info.resources.levels == 1); const auto tiles_per_row = info.pitch / 8u; const auto tiles_per_slice = tiles_per_row * ((info.size.height + 7u) / 8u); diff --git a/src/video_core/texture_cache/tile_manager.h b/src/video_core/texture_cache/tile_manager.h index 4eae7be9e..adda16b3d 100644 --- a/src/video_core/texture_cache/tile_manager.h +++ b/src/video_core/texture_cache/tile_manager.h @@ -22,6 +22,8 @@ enum DetilerType : u32 { Macro32, Macro64, + Display_Micro64, + Max };