diff --git a/src/xenia/cpu/ppc/testing/ppc_testing_main.cc b/src/xenia/cpu/ppc/testing/ppc_testing_main.cc index 7a05ec5eb..b5e9c700e 100644 --- a/src/xenia/cpu/ppc/testing/ppc_testing_main.cc +++ b/src/xenia/cpu/ppc/testing/ppc_testing_main.cc @@ -189,7 +189,7 @@ class TestRunner { memory->Reset(); // Setup a fresh processor. - processor.reset(new Processor(memory.get(), nullptr, nullptr)); + processor.reset(new Processor(nullptr, memory.get(), nullptr, nullptr)); processor->Setup(); processor->set_debug_info_flags(DebugInfoFlags::kDebugInfoAll); diff --git a/src/xenia/cpu/processor.cc b/src/xenia/cpu/processor.cc index 830b8c1e3..bd85cfba9 100644 --- a/src/xenia/cpu/processor.cc +++ b/src/xenia/cpu/processor.cc @@ -55,9 +55,12 @@ class BuiltinModule : public Module { std::string name_; }; -Processor::Processor(xe::Memory* memory, ExportResolver* export_resolver, - debug::Debugger* debugger) - : memory_(memory), debugger_(debugger), export_resolver_(export_resolver) {} +Processor::Processor(xe::Emulator* emulator, xe::Memory* memory, + ExportResolver* export_resolver, debug::Debugger* debugger) + : emulator_(emulator), + memory_(memory), + debugger_(debugger), + export_resolver_(export_resolver) {} Processor::~Processor() { { diff --git a/src/xenia/cpu/processor.h b/src/xenia/cpu/processor.h index 1963f7447..ef5790dc4 100644 --- a/src/xenia/cpu/processor.h +++ b/src/xenia/cpu/processor.h @@ -49,10 +49,11 @@ enum class Irql : uint32_t { class Processor { public: - Processor(Memory* memory, ExportResolver* export_resolver, + Processor(Emulator* emulator, Memory* memory, ExportResolver* export_resolver, debug::Debugger* debugger); ~Processor(); + Emulator* emulator() const { return emulator_; } Memory* memory() const { return memory_; } debug::Debugger* debugger() const { return debugger_; } StackWalker* stack_walker() const { return stack_walker_.get(); } @@ -105,6 +106,7 @@ class Processor { bool DemandFunction(Function* function); + Emulator* emulator_ = nullptr; Memory* memory_ = nullptr; debug::Debugger* debugger_ = nullptr; std::unique_ptr stack_walker_; diff --git a/src/xenia/cpu/testing/util.h b/src/xenia/cpu/testing/util.h index 561c33010..a9b908921 100644 --- a/src/xenia/cpu/testing/util.h +++ b/src/xenia/cpu/testing/util.h @@ -40,7 +40,7 @@ class TestFunction { #if XENIA_TEST_X64 { auto processor = - std::make_unique(memory.get(), nullptr, nullptr); + std::make_unique(nullptr, memory.get(), nullptr, nullptr); processor->Setup(); processors.emplace_back(std::move(processor)); } diff --git a/src/xenia/emulator.cc b/src/xenia/emulator.cc index d6bdd393d..f39c840d4 100644 --- a/src/xenia/emulator.cc +++ b/src/xenia/emulator.cc @@ -116,7 +116,7 @@ X_STATUS Emulator::Setup( // Initialize the CPU. processor_ = std::make_unique( - memory_.get(), export_resolver_.get(), debugger_.get()); + this, memory_.get(), export_resolver_.get(), debugger_.get()); if (!processor_->Setup()) { return X_STATUS_UNSUCCESSFUL; }