Skip to content

VERY experimental Nintendo Switch 2 emulator

C++

Thread: Fixed bug with ResetThread where cpu_registers[15] was being incorrectly set

bunneib774b8b04e50
diff --git a/src/core/hle/kernel/thread.cpp b/src/core/hle/kernel/thread.cpp
index 180c149280..6196c352c1 100644
--- a/src/core/hle/kernel/thread.cpp
+++ b/src/core/hle/kernel/thread.cpp
@@ -114,7 +114,7 @@ void ResetThread(Thread* t, u32 arg, s32 lowest_priority) {
memset(&t->context, 0, sizeof(ThreadContext));
t->context.cpu_registers[0] = arg;
- t->context.pc = t->context.cpu_registers[15] = t->entry_point;
+ t->context.pc = t->context.reg_15 = t->entry_point;
t->context.sp = t->stack_top;
t->context.cpsr = 0x1F; // Usermode