From 3b2035a054fda7229eade49921817ddbcf35f9c2 Mon Sep 17 00:00:00 2001 From: Ben Vanik Date: Wed, 13 May 2015 00:37:35 -0700 Subject: [PATCH] Adding case for ObReferenceObjectByHandle, but impl still todo. --- src/xenia/kernel/xboxkrnl_ob.cc | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/src/xenia/kernel/xboxkrnl_ob.cc b/src/xenia/kernel/xboxkrnl_ob.cc index 9aaaf1e09..2c22d1a93 100644 --- a/src/xenia/kernel/xboxkrnl_ob.cc +++ b/src/xenia/kernel/xboxkrnl_ob.cc @@ -66,8 +66,24 @@ SHIM_CALL ObReferenceObjectByHandle_shim(PPCContext* ppc_state, // TODO(benvanik): get native value, if supported. uint32_t native_ptr; switch (object_type_ptr) { - case 0xD01BBEEF: // ExThreadObjectType - { + case 0x00000000: { // whatever? + switch (object->type()) { + // TODO(benvanik): need to track native_ptr in XObject, allocate as + // needed? + /*case XObject::kTypeEvent: + XEvent* ev = (XEvent*)object; + break;*/ + case XObject::kTypeThread: + XThread* thread = (XThread*)object; + native_ptr = thread->thread_state_ptr(); + break; + default: + assert_unhandled_case(object->type()); + native_ptr = 0xDEADF00D; + break; + } + } break; + case 0xD01BBEEF: { // ExThreadObjectType XThread* thread = (XThread*)object; native_ptr = thread->thread_state_ptr(); } break;