mirror of
https://git.citron-emu.org/citron/emulator
synced 2025-12-19 10:43:33 +00:00
fix: correct Little Nightmares 3 TitleID check for PC to LR recovery
The TitleID check was broken due to using || operator which evaluated to 1 instead of a title ID value, preventing the recovery mechanism from working. - Fix title_ids.h: Replace incorrect || expression with proper LittleNightmares3Base constant (0x010066101A55A000) - Update physical_core.cpp: Use GetBaseTitleID() to match both base and update title ID variants This now correctly identifies Little Nightmares 3 and enables the recovery mechanism that sets PC to LR when detecting null pointer execution loops. Signed-off-by: Zephyron <zephyron@citron-emu.org>
This commit is contained in:
@@ -14,7 +14,9 @@ private:
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
static constexpr u64 FinalFantasyTactics = 0x010038B015560000ULL;
|
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
|
} // namespace UICommon
|
||||||
|
|||||||
@@ -6,6 +6,7 @@
|
|||||||
#include "citron/util/title_ids.h"
|
#include "citron/util/title_ids.h"
|
||||||
#include "core/core.h"
|
#include "core/core.h"
|
||||||
#include "core/debugger/debugger.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_process.h"
|
||||||
#include "core/hle/kernel/k_thread.h"
|
#include "core/hle/kernel/k_thread.h"
|
||||||
#include "core/hle/kernel/kernel.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)
|
// 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
|
// 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, "Null pointer execution detected at PC={:016X}", current_pc);
|
||||||
LOG_WARNING(Core_ARM, "Attempting to recover by returning from invalid function call");
|
LOG_WARNING(Core_ARM, "Attempting to recover by returning from invalid function call");
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user