core: Prepare various classes for memory read/write migration

Amends a few interfaces to be able to handle the migration over to the
new Memory class by passing the class by reference as a function
parameter where necessary.

Notably, within the filesystem services, this eliminates two ReadBlock()
calls by using the helper functions of HLERequestContext to do that for
us.
This commit is contained in:
Lioncash 2019-11-26 14:10:49 -05:00
parent fc7d0a17b6
commit 536fc7f0ea
24 changed files with 108 additions and 61 deletions

View file

@ -28,6 +28,7 @@ public:
explicit ARM_Dynarmic_Callbacks(ARM_Dynarmic& parent) : parent(parent) {}
u8 MemoryRead8(u64 vaddr) override {
auto& s = parent.system;
return Memory::Read8(vaddr);
}
u16 MemoryRead16(u64 vaddr) override {
@ -171,9 +172,10 @@ void ARM_Dynarmic::Step() {
ARM_Dynarmic::ARM_Dynarmic(System& system, ExclusiveMonitor& exclusive_monitor,
std::size_t core_index)
: cb(std::make_unique<ARM_Dynarmic_Callbacks>(*this)), inner_unicorn{system},
core_index{core_index}, system{system},
exclusive_monitor{dynamic_cast<DynarmicExclusiveMonitor&>(exclusive_monitor)} {}
: ARM_Interface{system},
cb(std::make_unique<ARM_Dynarmic_Callbacks>(*this)), inner_unicorn{system},
core_index{core_index}, exclusive_monitor{
dynamic_cast<DynarmicExclusiveMonitor&>(exclusive_monitor)} {}
ARM_Dynarmic::~ARM_Dynarmic() = default;

View file

@ -58,7 +58,6 @@ private:
ARM_Unicorn inner_unicorn;
std::size_t core_index;
System& system;
DynarmicExclusiveMonitor& exclusive_monitor;
};