diff --git a/externals/fmt b/externals/fmt index bc8d32e9..c9851835 160000 --- a/externals/fmt +++ b/externals/fmt @@ -1 +1 @@ -Subproject commit bc8d32e9643d2be5fc070abf2a50bc021544545d +Subproject commit c98518351efd5a46f5d448e947e0b7242d197d07 diff --git a/externals/glslang b/externals/glslang index 52f68dc6..7c4d91e7 160000 --- a/externals/glslang +++ b/externals/glslang @@ -1 +1 @@ -Subproject commit 52f68dc6b2a9d017b43161f31f13a6f44636ee7c +Subproject commit 7c4d91e7819a1d27213aa3499953d54ae1a00e8f diff --git a/externals/magic_enum b/externals/magic_enum index 664ee62c..dae6bbf1 160000 --- a/externals/magic_enum +++ b/externals/magic_enum @@ -1 +1 @@ -Subproject commit 664ee62c12570948b0e025d15b42d641fba8d54a +Subproject commit dae6bbf16c363e9ead4e628a47fdb02956a634f3 diff --git a/externals/sdl3 b/externals/sdl3 index f9a06c20..4cc3410d 160000 --- a/externals/sdl3 +++ b/externals/sdl3 @@ -1 +1 @@ -Subproject commit f9a06c20ed85fb1d6754fc2280d6183382217910 +Subproject commit 4cc3410dce50cefce98d3cf3cf1bc8eca83b862a diff --git a/externals/toml11 b/externals/toml11 index b389bbc4..fcb1d3d7 160000 --- a/externals/toml11 +++ b/externals/toml11 @@ -1 +1 @@ -Subproject commit b389bbc4ebf90fa2fe7651de3046fb19f661ba3c +Subproject commit fcb1d3d7e5885edfadbbe9572991dc4b3248af58 diff --git a/externals/vulkan-headers b/externals/vulkan-headers index b379292b..595c8d47 160000 --- a/externals/vulkan-headers +++ b/externals/vulkan-headers @@ -1 +1 @@ -Subproject commit b379292b2ab6df5771ba9870d53cf8b2c9295daf +Subproject commit 595c8d4794410a4e64b98dc58d27c0310d7ea2fd diff --git a/externals/xxhash b/externals/xxhash index a57f6cce..ee65ff98 160000 --- a/externals/xxhash +++ b/externals/xxhash @@ -1 +1 @@ -Subproject commit a57f6cce2698049863af8c25787084ae0489d849 +Subproject commit ee65ff988bab34a184c700e2fbe1e1c5bc27485d diff --git a/src/common/config.cpp b/src/common/config.cpp index 7e677f84..f676ab94 100644 --- a/src/common/config.cpp +++ b/src/common/config.cpp @@ -43,6 +43,8 @@ u32 m_window_size_H = 720; std::vector m_pkg_viewer; std::vector m_elf_viewer; std::vector m_recent_files; +// Settings +u32 m_language = 1; // english bool isLleLibc() { return isLibc; @@ -207,6 +209,9 @@ std::vector getRecentFiles() { return m_recent_files; } +u32 GetLanguage() { + return m_language; +} void load(const std::filesystem::path& path) { // If the configuration file does not exist, create it and return std::error_code error; @@ -223,90 +228,82 @@ void load(const std::filesystem::path& path) { fmt::print("Got exception trying to load config file. Exception: {}\n", ex.what()); return; } - if (data.contains("General")) { - auto generalResult = toml::expect(data.at("General")); - if (generalResult.is_ok()) { - auto general = generalResult.unwrap(); + const toml::value& general = data.at("General"); - isNeo = toml::find_or(general, "isPS4Pro", false); - isFullscreen = toml::find_or(general, "Fullscreen", false); - logFilter = toml::find_or(general, "logFilter", ""); - logType = toml::find_or(general, "logType", "sync"); - isShowSplash = toml::find_or(general, "showSplash", true); - } + isNeo = toml::find_or(general, "isPS4Pro", false); + isFullscreen = toml::find_or(general, "Fullscreen", false); + logFilter = toml::find_or(general, "logFilter", ""); + logType = toml::find_or(general, "logType", "sync"); + isShowSplash = toml::find_or(general, "showSplash", true); } + if (data.contains("GPU")) { - auto gpuResult = toml::expect(data.at("GPU")); - if (gpuResult.is_ok()) { - auto gpu = gpuResult.unwrap(); + const toml::value& gpu = data.at("GPU"); - screenWidth = toml::find_or(gpu, "screenWidth", screenWidth); - screenHeight = toml::find_or(gpu, "screenHeight", screenHeight); - isNullGpu = toml::find_or(gpu, "nullGpu", false); - shouldDumpShaders = toml::find_or(gpu, "dumpShaders", false); - shouldDumpPM4 = toml::find_or(gpu, "dumpPM4", false); - vblankDivider = toml::find_or(gpu, "vblankDivider", 1); - } + screenWidth = toml::find_or(gpu, "screenWidth", screenWidth); + screenHeight = toml::find_or(gpu, "screenHeight", screenHeight); + isNullGpu = toml::find_or(gpu, "nullGpu", false); + shouldDumpShaders = toml::find_or(gpu, "dumpShaders", false); + shouldDumpPM4 = toml::find_or(gpu, "dumpPM4", false); + vblankDivider = toml::find_or(gpu, "vblankDivider", 1); } + if (data.contains("Vulkan")) { - const auto vkResult = toml::expect(data.at("Vulkan")); - if (vkResult.is_ok()) { - auto vk = vkResult.unwrap(); + const toml::value& vk = data.at("Vulkan"); - gpuId = toml::find_or(vk, "gpuId", 0); - vkValidation = toml::find_or(vk, "validation", true); - vkValidationSync = toml::find_or(vk, "validation_sync", true); - rdocEnable = toml::find_or(vk, "rdocEnable", false); - } + gpuId = toml::find_or(vk, "gpuId", -1); + vkValidation = toml::find_or(vk, "validation", false); + vkValidationSync = toml::find_or(vk, "validation_sync", false); + rdocEnable = toml::find_or(vk, "rdocEnable", false); } + if (data.contains("Debug")) { - auto debugResult = toml::expect(data.at("Debug")); - if (debugResult.is_ok()) { - auto debug = debugResult.unwrap(); + const toml::value& debug = data.at("Debug"); - isDebugDump = toml::find_or(debug, "DebugDump", false); - } + isDebugDump = toml::find_or(debug, "DebugDump", false); } + if (data.contains("LLE")) { - auto lleResult = toml::expect(data.at("LLE")); - if (lleResult.is_ok()) { - auto lle = lleResult.unwrap(); + const toml::value& lle = data.at("LLE"); - isLibc = toml::find_or(lle, "libc", true); - } + isLibc = toml::find_or(lle, "libc", true); } - if (data.contains("GUI")) { - auto guiResult = toml::expect(data.at("GUI")); - if (guiResult.is_ok()) { - auto gui = guiResult.unwrap(); - 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); - m_slider_pos_grid = toml::find_or(gui, "sliderPosGrid", 0); - mw_themes = toml::find_or(gui, "theme", 0); - m_window_size_W = toml::find_or(gui, "mw_width", 0); - m_window_size_H = toml::find_or(gui, "mw_height", 0); - settings_install_dir = toml::find_or(gui, "installDir", ""); - main_window_geometry_x = toml::find_or(gui, "geometry_x", 0); - main_window_geometry_y = toml::find_or(gui, "geometry_y", 0); - main_window_geometry_w = toml::find_or(gui, "geometry_w", 0); - main_window_geometry_h = toml::find_or(gui, "geometry_h", 0); - m_pkg_viewer = toml::find_or>(gui, "pkgDirs", {}); - m_elf_viewer = toml::find_or>(gui, "elfDirs", {}); - m_recent_files = toml::find_or>(gui, "recentFiles", {}); - m_table_mode = toml::find_or(gui, "gameTableMode", 0); - } + if (data.contains("GUI")) { + const toml::value& gui = data.at("GUI"); + + 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); + m_slider_pos_grid = toml::find_or(gui, "sliderPosGrid", 0); + mw_themes = toml::find_or(gui, "theme", 0); + m_window_size_W = toml::find_or(gui, "mw_width", 0); + m_window_size_H = toml::find_or(gui, "mw_height", 0); + settings_install_dir = toml::find_or(gui, "installDir", ""); + main_window_geometry_x = toml::find_or(gui, "geometry_x", 0); + main_window_geometry_y = toml::find_or(gui, "geometry_y", 0); + main_window_geometry_w = toml::find_or(gui, "geometry_w", 0); + main_window_geometry_h = toml::find_or(gui, "geometry_h", 0); + m_pkg_viewer = toml::find_or>(gui, "pkgDirs", {}); + m_elf_viewer = toml::find_or>(gui, "elfDirs", {}); + m_recent_files = toml::find_or>(gui, "recentFiles", {}); + m_table_mode = toml::find_or(gui, "gameTableMode", 0); + } + + if (data.contains("Settings")) { + const toml::value& settings = data.at("Settings"); + + m_language = toml::find_or(settings, "consoleLanguage", 1); } } void save(const std::filesystem::path& path) { - toml::basic_value data; + toml::value data; std::error_code error; if (std::filesystem::exists(path, error)) { try { - data = toml::parse(path); + data = toml::parse(path); } catch (const std::exception& ex) { fmt::print("Exception trying to parse config file. Exception: {}\n", ex.what()); return; @@ -353,6 +350,8 @@ void save(const std::filesystem::path& path) { data["GUI"]["elfDirs"] = m_elf_viewer; data["GUI"]["recentFiles"] = m_recent_files; + data["Settings"]["consoleLanguage"] = m_language; + std::ofstream file(path, std::ios::out); file << data; file.close(); diff --git a/src/common/config.h b/src/common/config.h index 637ac746..53c88ec9 100644 --- a/src/common/config.h +++ b/src/common/config.h @@ -64,4 +64,7 @@ std::vector getPkgViewer(); std::vector getElfViewer(); std::vector getRecentFiles(); +// settings +u32 GetLanguage(); + }; // namespace Config diff --git a/src/core/libraries/kernel/thread_management.cpp b/src/core/libraries/kernel/thread_management.cpp index 6be90cce..85e2d0e6 100644 --- a/src/core/libraries/kernel/thread_management.cpp +++ b/src/core/libraries/kernel/thread_management.cpp @@ -1519,6 +1519,8 @@ void pthreadSymbolsRegister(Core::Loader::SymbolsResolver* sym) { LIB_FUNCTION("1tKyG7RlMJo", "libkernel", 1, "libkernel", 1, 1, scePthreadGetprio); LIB_FUNCTION("W0Hpm2X0uPE", "libkernel", 1, "libkernel", 1, 1, scePthreadSetprio); LIB_FUNCTION("GBUY7ywdULE", "libkernel", 1, "libkernel", 1, 1, scePthreadRename); + LIB_FUNCTION("F+yfmduIBB8", "libkernel", 1, "libkernel", 1, 1, scePthreadAttrSetstackaddr); + LIB_FUNCTION("El+cQ20DynU", "libkernel", 1, "libkernel", 1, 1, scePthreadAttrSetguardsize); LIB_FUNCTION("aI+OeCz8xrQ", "libkernel", 1, "libkernel", 1, 1, scePthreadSelf); LIB_FUNCTION("EotR8a3ASf4", "libkernel", 1, "libkernel", 1, 1, posix_pthread_self); diff --git a/src/core/libraries/pad/pad.cpp b/src/core/libraries/pad/pad.cpp index 064c71b8..d3993550 100644 --- a/src/core/libraries/pad/pad.cpp +++ b/src/core/libraries/pad/pad.cpp @@ -2,6 +2,7 @@ // SPDX-License-Identifier: GPL-2.0-or-later // Generated By moduleGenerator +#include #include #include "common/logging/log.h" #include "core/libraries/error_codes.h" @@ -85,7 +86,18 @@ int PS4_SYSV_ABI scePadGetCapability() { int PS4_SYSV_ABI scePadGetControllerInformation(s32 handle, OrbisPadControllerInformation* pInfo) { LOG_INFO(Lib_Pad, "called handle = {}", handle); - std::memset(pInfo, 0, sizeof(OrbisPadControllerInformation)); + if (handle < 0) { + pInfo->touchPadInfo.pixelDensity = 1; + pInfo->touchPadInfo.resolution.x = 1920; + pInfo->touchPadInfo.resolution.y = 950; + pInfo->stickInfo.deadZoneLeft = 2; + pInfo->stickInfo.deadZoneRight = 2; + pInfo->connectionType = ORBIS_PAD_PORT_TYPE_STANDARD; + pInfo->connectedCount = 1; + pInfo->connected = false; + pInfo->deviceClass = ORBIS_PAD_DEVICE_CLASS_STANDARD; + return SCE_OK; + } pInfo->touchPadInfo.pixelDensity = 1; pInfo->touchPadInfo.resolution.x = 1920; pInfo->touchPadInfo.resolution.y = 950; @@ -239,7 +251,6 @@ int PS4_SYSV_ABI scePadOutputReport() { } int PS4_SYSV_ABI scePadRead(s32 handle, OrbisPadData* pData, s32 num) { - std::memset(pData, 0, sizeof(OrbisPadData)); int connected_count = 0; bool connected = false; Input::State states[64]; @@ -306,11 +317,9 @@ int PS4_SYSV_ABI scePadReadHistory() { int PS4_SYSV_ABI scePadReadState(s32 handle, OrbisPadData* pData) { auto* controller = Common::Singleton::Instance(); - int connectedCount = 0; bool isConnected = false; Input::State state; - std::memset(pData, 0, sizeof(OrbisPadData)); controller->ReadState(&state, &isConnected, &connectedCount); pData->buttons = state.buttonsState; pData->leftStick.x = state.axes[static_cast(Input::Axis::LeftX)]; @@ -322,7 +331,7 @@ int PS4_SYSV_ABI scePadReadState(s32 handle, OrbisPadData* pData) { pData->orientation.x = 0; pData->orientation.y = 0; pData->orientation.z = 0; - pData->orientation.w = 0; + pData->orientation.w = 1; pData->acceleration.x = 0.0f; pData->acceleration.y = 0.0f; pData->acceleration.z = 0.0f; diff --git a/src/core/libraries/playgo/playgo.cpp b/src/core/libraries/playgo/playgo.cpp index a3af8b4c..af98253f 100644 --- a/src/core/libraries/playgo/playgo.cpp +++ b/src/core/libraries/playgo/playgo.cpp @@ -58,6 +58,7 @@ s32 PS4_SYSV_ABI scePlayGoGetLocus(OrbisPlayGoHandle handle, const OrbisPlayGoCh if (chunkIds[i] <= playgo->GetPlaygoHeader().mchunk_count) { outLoci[i] = OrbisPlayGoLocusValue::ORBIS_PLAYGO_LOCUS_LOCAL_FAST; } else { + outLoci[i] = ORBIS_PLAYGO_LOCUS_NOT_DOWNLOADED; return ORBIS_PLAYGO_ERROR_BAD_CHUNK_ID; } } @@ -70,12 +71,13 @@ s32 PS4_SYSV_ABI scePlayGoGetProgress(OrbisPlayGoHandle handle, const OrbisPlayG handle, *chunkIds, numberOfEntries); outProgress->progressSize = 0x10000; // todo? outProgress->totalSize = 0x10000; - return 0; + return ORBIS_OK; } s32 PS4_SYSV_ABI scePlayGoGetToDoList(OrbisPlayGoHandle handle, OrbisPlayGoToDo* outTodoList, u32 numberOfEntries, u32* outEntries) { - LOG_ERROR(Lib_PlayGo, "(STUBBED)called"); + LOG_ERROR(Lib_PlayGo, "(STUBBED)called handle = {} numberOfEntries = {}", handle, + numberOfEntries); if (handle != 1) return ORBIS_PLAYGO_ERROR_BAD_HANDLE; if (outTodoList == nullptr) diff --git a/src/core/libraries/system/systemservice.cpp b/src/core/libraries/system/systemservice.cpp index b704ccd9..d99ec7c7 100644 --- a/src/core/libraries/system/systemservice.cpp +++ b/src/core/libraries/system/systemservice.cpp @@ -1898,7 +1898,7 @@ s32 PS4_SYSV_ABI sceSystemServiceParamGetInt(int param_id, int* value) { } switch (param_id) { case ORBIS_SYSTEM_SERVICE_PARAM_ID_LANG: - *value = ORBIS_SYSTEM_PARAM_LANG_ENGLISH_US; + *value = Config::GetLanguage(); break; case ORBIS_SYSTEM_SERVICE_PARAM_ID_DATE_FORMAT: *value = ORBIS_SYSTEM_PARAM_DATE_FORMAT_DDMMYYYY; diff --git a/src/emulator.cpp b/src/emulator.cpp index a34ee359..034b8706 100644 --- a/src/emulator.cpp +++ b/src/emulator.cpp @@ -128,6 +128,7 @@ void Emulator::Run(const std::filesystem::path& file) { std::filesystem::create_directory(mount_temp_dir); } mnt->Mount(mount_temp_dir, "/temp0"); // called in app_content ==> stat/mkdir + mnt->Mount(mount_temp_dir, "/temp"); const auto& mount_download_dir = Common::FS::GetUserPath(Common::FS::PathType::DownloadDir) / id; @@ -182,7 +183,7 @@ void Emulator::Run(const std::filesystem::path& file) { } void Emulator::LoadSystemModules(const std::filesystem::path& file) { - constexpr std::array ModulesToLoad{ + constexpr std::array ModulesToLoad{ {{"libSceNgs2.sprx", nullptr}, {"libSceFiber.sprx", nullptr}, {"libSceUlt.sprx", nullptr}, @@ -191,8 +192,7 @@ void Emulator::LoadSystemModules(const std::filesystem::path& file) { {"libSceLibcInternal.sprx", &Libraries::LibcInternal::RegisterlibSceLibcInternal}, {"libSceDiscMap.sprx", &Libraries::DiscMap::RegisterlibSceDiscMap}, {"libSceRtc.sprx", &Libraries::Rtc::RegisterlibSceRtc}, - {"libSceJpegEnc.sprx", nullptr}, - {"libSceJson2.sprx", nullptr}}, + {"libSceJpegEnc.sprx", nullptr}}, }; std::vector found_modules; diff --git a/src/sdl_window.cpp b/src/sdl_window.cpp index 0d25cd3f..5e1a4c95 100644 --- a/src/sdl_window.cpp +++ b/src/sdl_window.cpp @@ -45,21 +45,21 @@ WindowSDL::WindowSDL(s32 width_, s32 height_, Input::GameController* controller_ #if defined(SDL_PLATFORM_WIN32) window_info.type = WindowSystemType::Windows; - window_info.render_surface = - SDL_GetProperty(SDL_GetWindowProperties(window), SDL_PROP_WINDOW_WIN32_HWND_POINTER, NULL); + window_info.render_surface = SDL_GetPointerProperty(SDL_GetWindowProperties(window), + SDL_PROP_WINDOW_WIN32_HWND_POINTER, NULL); #elif defined(SDL_PLATFORM_LINUX) if (SDL_strcmp(SDL_GetCurrentVideoDriver(), "x11") == 0) { window_info.type = WindowSystemType::X11; - window_info.display_connection = SDL_GetProperty(SDL_GetWindowProperties(window), - SDL_PROP_WINDOW_X11_DISPLAY_POINTER, NULL); + window_info.display_connection = SDL_GetPointerProperty( + SDL_GetWindowProperties(window), SDL_PROP_WINDOW_X11_DISPLAY_POINTER, NULL); window_info.render_surface = (void*)SDL_GetNumberProperty( SDL_GetWindowProperties(window), SDL_PROP_WINDOW_X11_WINDOW_NUMBER, 0); } else if (SDL_strcmp(SDL_GetCurrentVideoDriver(), "wayland") == 0) { window_info.type = WindowSystemType::Wayland; - window_info.display_connection = SDL_GetProperty( + window_info.display_connection = SDL_GetPointerProperty( SDL_GetWindowProperties(window), SDL_PROP_WINDOW_WAYLAND_DISPLAY_POINTER, NULL); - window_info.render_surface = SDL_GetProperty(SDL_GetWindowProperties(window), - SDL_PROP_WINDOW_WAYLAND_SURFACE_POINTER, NULL); + window_info.render_surface = SDL_GetPointerProperty( + SDL_GetWindowProperties(window), SDL_PROP_WINDOW_WAYLAND_SURFACE_POINTER, NULL); } #elif defined(SDL_PLATFORM_MACOS) window_info.type = WindowSystemType::Metal;