diff --git a/src/core/emulator_settings.cpp b/src/core/emulator_settings.cpp index c1c0342ea..8f26485e6 100644 --- a/src/core/emulator_settings.cpp +++ b/src/core/emulator_settings.cpp @@ -93,7 +93,8 @@ void EmulatorSettingsImpl::PrintChangedSummary(const std::vector& c EmulatorSettingsImpl::EmulatorSettingsImpl() = default; EmulatorSettingsImpl::~EmulatorSettingsImpl() { - Save(); + if (m_loaded) + Save(); } std::shared_ptr EmulatorSettingsImpl::GetInstance() { @@ -380,6 +381,7 @@ bool EmulatorSettingsImpl::Load(const std::string& serial) { SDL_ShowMessageBox(&msg_box, &result); if (result == 1) { if (TransferSettings()) { + m_loaded = true; Save(); return true; } else { @@ -397,6 +399,7 @@ bool EmulatorSettingsImpl::Load(const std::string& serial) { if (GetConfigVersion() != Common::g_scm_rev) { Save(); } + m_loaded = true; return true; } else { // ── Per-game override file ───────────────────────────────── diff --git a/src/core/emulator_settings.h b/src/core/emulator_settings.h index 0490aba77..fab94c6ff 100644 --- a/src/core/emulator_settings.h +++ b/src/core/emulator_settings.h @@ -465,6 +465,8 @@ private: VulkanSettings m_vulkan{}; ConfigMode m_configMode{ConfigMode::Default}; + bool m_loaded{false}; + static std::shared_ptr s_instance; static std::mutex s_mutex; diff --git a/src/core/libraries/kernel/memory.cpp b/src/core/libraries/kernel/memory.cpp index 5d94735ae..378064e44 100644 --- a/src/core/libraries/kernel/memory.cpp +++ b/src/core/libraries/kernel/memory.cpp @@ -318,38 +318,6 @@ s32 PS4_SYSV_ABI sceKernelMapFlexibleMemory(void** addr_in_out, u64 len, s32 pro return sceKernelMapNamedFlexibleMemory(addr_in_out, len, prot, flags, "anon"); } -s32 PS4_SYSV_ABI sceKernelMapNamedSystemFlexibleMemory(void** addr_in_out, u64 len, s32 prot, - s32 flags, const char* name) { - LOG_INFO(Kernel_Vmm, "in_addr = {}, len = {:#x}, prot = {:#x}, flags = {:#x}, name = '{}'", - fmt::ptr(*addr_in_out), len, prot, flags, name); - if (len == 0 || !Common::Is16KBAligned(len)) { - LOG_ERROR(Kernel_Vmm, "len is 0 or not 16kb multiple"); - return ORBIS_KERNEL_ERROR_EINVAL; - } - - if (name == nullptr) { - LOG_ERROR(Kernel_Vmm, "name is invalid!"); - return ORBIS_KERNEL_ERROR_EFAULT; - } - - if (std::strlen(name) >= ORBIS_KERNEL_MAXIMUM_NAME_LENGTH) { - LOG_ERROR(Kernel_Vmm, "name exceeds 32 bytes!"); - return ORBIS_KERNEL_ERROR_ENAMETOOLONG; - } - - VAddr in_addr = reinterpret_cast(*addr_in_out); - if (in_addr == 0) { - in_addr = 0x880000000; - } - const auto mem_prot = static_cast(prot); - const auto map_flags = static_cast(flags); - auto* memory = Core::Memory::Instance(); - const auto ret = memory->MapMemory(addr_in_out, in_addr, len, mem_prot, map_flags, - Core::VMAType::Stack, name); - LOG_INFO(Kernel_Vmm, "out_addr = {}", fmt::ptr(*addr_in_out)); - return ret; -} - s32 PS4_SYSV_ABI sceKernelQueryMemoryProtection(void* addr, void** start, void** end, u32* prot) { auto* memory = Core::Memory::Instance(); return memory->QueryProtection(std::bit_cast(addr), start, end, prot); @@ -865,7 +833,6 @@ void RegisterMemory(Core::Loader::SymbolsResolver* sym) { LIB_FUNCTION("PGhQHd-dzv8", "libkernel", 1, "libkernel", sceKernelMmap); LIB_FUNCTION("cQke9UuBQOk", "libkernel", 1, "libkernel", sceKernelMunmap); LIB_FUNCTION("mL8NDH86iQI", "libkernel", 1, "libkernel", sceKernelMapNamedFlexibleMemory); - LIB_FUNCTION("kc+LEEIYakc", "libkernel", 1, "libkernel", sceKernelMapNamedSystemFlexibleMemory); LIB_FUNCTION("aNz11fnnzi4", "libkernel", 1, "libkernel", sceKernelAvailableFlexibleMemorySize); LIB_FUNCTION("aNz11fnnzi4", "libkernel_avlfmem", 1, "libkernel", sceKernelAvailableFlexibleMemorySize); diff --git a/src/core/libraries/sysmodule/sysmodule_internal.cpp b/src/core/libraries/sysmodule/sysmodule_internal.cpp index b2853e2fa..56e130289 100644 --- a/src/core/libraries/sysmodule/sysmodule_internal.cpp +++ b/src/core/libraries/sysmodule/sysmodule_internal.cpp @@ -223,8 +223,7 @@ s32 loadModuleInternal(s32 index, s32 argc, const void* argv, s32* res_out) { {"libSceAudiodec.sprx", nullptr}, {"libSceFont.sprx", &Libraries::Font::RegisterlibSceFont}, {"libSceFontFt.sprx", &Libraries::FontFt::RegisterlibSceFontFt}, - {"libSceFreeTypeOt.sprx", nullptr}, - {"libScePadTracker.sprx", nullptr}}); + {"libSceFreeTypeOt.sprx", nullptr}}); // Iterate through the allowed array const auto it = std::ranges::find_if( diff --git a/src/sdl_window.cpp b/src/sdl_window.cpp index a798b1e18..e27e8db88 100644 --- a/src/sdl_window.cpp +++ b/src/sdl_window.cpp @@ -26,6 +26,7 @@ #ifdef __APPLE__ #include "SDL3/SDL_metal.h" #endif +#include namespace Frontend {