diff --git a/src/citron/util/title_ids.h b/src/citron/util/title_ids.h index 7f1c26754..049fc3081 100644 --- a/src/citron/util/title_ids.h +++ b/src/citron/util/title_ids.h @@ -14,7 +14,9 @@ private: public: static constexpr u64 FinalFantasyTactics = 0x010038B015560000ULL; - static constexpr u64 LittleNightmares3 = 0x010066101A55A800ULL || 0x010066101A55A000ULL; + // Base title ID for Little Nightmares 3 (covers both 0x010066101A55A800 and 0x010066101A55A000) + // The base title ID is obtained by masking with 0xFFFFFFFFFFFFE000 + static constexpr u64 LittleNightmares3Base = 0x010066101A55A000ULL; }; } // namespace UICommon diff --git a/src/core/hle/kernel/physical_core.cpp b/src/core/hle/kernel/physical_core.cpp index 69db3790d..31cd74c5f 100644 --- a/src/core/hle/kernel/physical_core.cpp +++ b/src/core/hle/kernel/physical_core.cpp @@ -6,6 +6,7 @@ #include "citron/util/title_ids.h" #include "core/core.h" #include "core/debugger/debugger.h" +#include "core/file_sys/common_funcs.h" #include "core/hle/kernel/k_process.h" #include "core/hle/kernel/k_thread.h" #include "core/hle/kernel/kernel.h" @@ -136,7 +137,9 @@ void PhysicalCore::RunThread(Kernel::KThread* thread) { // Detect null pointer execution loop (PC in very low memory addresses) // Only apply this recovery fix for Little Nightmares 3 to avoid issues with other games - if (current_pc < 0x1000 && program_id == UICommon::TitleID::LittleNightmares3) { + // Check if the base title ID matches Little Nightmares 3 (covers both base and update variants) + if (current_pc < 0x1000 && + FileSys::GetBaseTitleID(program_id) == UICommon::TitleID::LittleNightmares3Base) { LOG_WARNING(Core_ARM, "Null pointer execution detected at PC={:016X}", current_pc); LOG_WARNING(Core_ARM, "Attempting to recover by returning from invalid function call");