core/memory: Migrate over Write{8, 16, 32, 64, Block} to the Memory class

The Write functions are used slightly less than the Read functions,
which make these a bit nicer to move over.

The only adjustments we really need to make here are to Dynarmic's
exclusive monitor instance. We need to keep a reference to the currently
active memory instance to perform exclusive read/write operations.
This commit is contained in:
Lioncash 2019-11-26 17:39:57 -05:00
parent b05bfc6036
commit e4c381b885
14 changed files with 298 additions and 153 deletions

View file

@ -34,16 +34,16 @@ u64 MemoryReadWidth(Memory::Memory& memory, u32 width, VAddr addr) {
void MemoryWriteWidth(Memory::Memory& memory, u32 width, VAddr addr, u64 value) {
switch (width) {
case 1:
Memory::Write8(addr, static_cast<u8>(value));
memory.Write8(addr, static_cast<u8>(value));
break;
case 2:
Memory::Write16(addr, static_cast<u16>(value));
memory.Write16(addr, static_cast<u16>(value));
break;
case 4:
Memory::Write32(addr, static_cast<u32>(value));
memory.Write32(addr, static_cast<u32>(value));
break;
case 8:
Memory::Write64(addr, value);
memory.Write64(addr, value);
break;
default:
UNREACHABLE();