From c536053dec93d1ac503cd491be700326740265c2 Mon Sep 17 00:00:00 2001 From: "Dr. Chat" Date: Fri, 24 Jul 2015 23:08:55 -0500 Subject: [PATCH] Fix improper getting arguments from stack Also fix PrimitivePointerParam conversion error --- src/xenia/kernel/util/shim_utils.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/xenia/kernel/util/shim_utils.h b/src/xenia/kernel/util/shim_utils.h index 60189b913..2a1411bf1 100644 --- a/src/xenia/kernel/util/shim_utils.h +++ b/src/xenia/kernel/util/shim_utils.h @@ -113,7 +113,7 @@ class Param { *out_value = V(init.ppc_context->r[3 + ordinal_]); } else { uint32_t stack_ptr = - uint32_t(init.ppc_context->r[1]) + 0x54 + (ordinal_ - 7) * 8; + uint32_t(init.ppc_context->r[1]) + 0x54 + (ordinal_ - 8) * 8; *out_value = xe::load_and_swap(init.ppc_context->virtual_membase + stack_ptr); } @@ -190,7 +190,9 @@ class PrimitivePointerParam : public ParamBase { init.ppc_context->virtual_membase + value_) : nullptr; } - PrimitivePointerParam(T* host_ptr) : ParamBase(), host_ptr_(host_ptr) {} + PrimitivePointerParam(T* host_ptr) : ParamBase() { + host_ptr_ = reinterpret_cast*>(host_ptr); + } PrimitivePointerParam& operator=(const T*& other) { host_ptr_ = other; return *this;