From eb5d7e0f31443b95e9848fed069386373780a7d6 Mon Sep 17 00:00:00 2001 From: Ben Vanik Date: Sun, 12 Jan 2014 14:43:59 -0800 Subject: [PATCH] Comments. --- src/alloy/backend/ivm/ivm_intcode.cc | 2 ++ src/xenia/cpu/xex_module.cc | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/alloy/backend/ivm/ivm_intcode.cc b/src/alloy/backend/ivm/ivm_intcode.cc index cc88228a2..5a5c98a5e 100644 --- a/src/alloy/backend/ivm/ivm_intcode.cc +++ b/src/alloy/backend/ivm/ivm_intcode.cc @@ -491,6 +491,8 @@ int Translate_DEBUG_BREAK_TRUE(TranslationContext& ctx, Instr* i) { } uint32_t IntCode_TRAP(IntCodeState& ics, const IntCode* i) { + // 0x0FE00014 is a 'debug print' where r3 = buffer r4 = length + // TODO(benvanik): post software interrupt to debugger. __debugbreak(); return IA_NEXT; } diff --git a/src/xenia/cpu/xex_module.cc b/src/xenia/cpu/xex_module.cc index fd6f74c2f..9291724d2 100644 --- a/src/xenia/cpu/xex_module.cc +++ b/src/xenia/cpu/xex_module.cc @@ -147,10 +147,10 @@ int XexModule::SetupLibraryImports(const xe_xex2_import_library_t* library) { } else { if (kernel_export->is_implemented) { // Implemented - replace with pointer. - *slot = XESWAP32BE(kernel_export->variable_ptr); + XESETUINT32BE(slot, kernel_export->variable_ptr); } else { // Not implemented - write with a dummy value. - *slot = XESWAP32BE(0xD000BEEF | (kernel_export->ordinal & 0xFFF) << 16); + XESETUINT32BE(slot, 0xD000BEEF | (kernel_export->ordinal & 0xFFF) << 16); XELOGCPU("WARNING: imported a variable with no value: %s", kernel_export->name); }