diff --git a/src/citron/util/title_ids.h b/src/citron/util/title_ids.h index b6671a7d0..ddbe4756c 100644 --- a/src/citron/util/title_ids.h +++ b/src/citron/util/title_ids.h @@ -14,6 +14,7 @@ private: public: static constexpr u64 FinalFantasyTactics = 0x010038B015560000ULL; + static constexpr u64 LittleNightmares3 = 0x010066101A55A800ULL; }; } // namespace UICommon diff --git a/src/core/hle/kernel/physical_core.cpp b/src/core/hle/kernel/physical_core.cpp index 9d826e243..69db3790d 100644 --- a/src/core/hle/kernel/physical_core.cpp +++ b/src/core/hle/kernel/physical_core.cpp @@ -3,6 +3,7 @@ #include "common/scope_exit.h" #include "common/settings.h" +#include "citron/util/title_ids.h" #include "core/core.h" #include "core/debugger/debugger.h" #include "core/hle/kernel/k_process.h" @@ -130,8 +131,12 @@ void PhysicalCore::RunThread(Kernel::KThread* thread) { interface->GetContext(ctx); u64 current_pc = ctx.pc; + // Get the program ID (title ID) to check if this fix should apply + u64 program_id = process->GetProgramId(); + // Detect null pointer execution loop (PC in very low memory addresses) - if (current_pc < 0x1000) { + // Only apply this recovery fix for Little Nightmares 3 to avoid issues with other games + if (current_pc < 0x1000 && program_id == UICommon::TitleID::LittleNightmares3) { 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");