From de113a4a0521bbb8f560065454e67ebee9c32969 Mon Sep 17 00:00:00 2001 From: Ben Vanik Date: Sun, 5 Jan 2014 16:22:49 -0800 Subject: [PATCH] Adding thread stack padding. --- src/xenia/cpu/xenon_thread_state.cc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/xenia/cpu/xenon_thread_state.cc b/src/xenia/cpu/xenon_thread_state.cc index 4653296e1..c4dd94069 100644 --- a/src/xenia/cpu/xenon_thread_state.cc +++ b/src/xenia/cpu/xenon_thread_state.cc @@ -45,6 +45,10 @@ XenonThreadState::XenonThreadState( context_->r[1] = stack_address_ + stack_size; context_->r[13] = thread_state_address_; + // Pad out stack a bit, as some games seem to overwrite the caller by about + // 16 to 32b. + context_->r[1] -= 64; + raw_context_ = context_; alloy::tracing::WriteEvent(EventType::ThreadInit({