From 43a3b4f3c05917756f75c95b90c2dd9f4f9cfd3d Mon Sep 17 00:00:00 2001 From: Ben Vanik Date: Sun, 8 Jun 2014 22:21:23 -0700 Subject: [PATCH] Support constant value movs to mmio memory. --- src/xenia/cpu/xenon_memory.cc | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/src/xenia/cpu/xenon_memory.cc b/src/xenia/cpu/xenon_memory.cc index 22f928022..10dcf5f47 100644 --- a/src/xenia/cpu/xenon_memory.cc +++ b/src/xenia/cpu/xenon_memory.cc @@ -193,11 +193,16 @@ LONG CALLBACK CheckMMIOHandler(PEXCEPTION_POINTERS ex_info) { ex_info->ContextRecord->Rip += len; return EXCEPTION_CONTINUE_EXECUTION; } else if (action == 1) { - XEASSERT((disasm.Argument2.ArgType & BE::REGISTER_TYPE) == - BE::REGISTER_TYPE); - uint64_t* reg_ptr = GetContextRegPtr(disasm.Argument2.ArgType, - ex_info->ContextRecord); - uint64_t value = *reg_ptr; + uint64_t value; + if ((disasm.Argument2.ArgType & BE::REGISTER_TYPE) == BE::REGISTER_TYPE) { + uint64_t* reg_ptr = GetContextRegPtr(disasm.Argument2.ArgType, + ex_info->ContextRecord); + value = *reg_ptr; + } else if ((disasm.Argument2.ArgType & BE::CONSTANT_TYPE) == BE::CONSTANT_TYPE) { + value = disasm.Instruction.Immediat; + } else { + XEASSERTALWAYS(); + } switch (disasm.Argument2.ArgSize) { case 8: value = static_cast(value);