diff --git a/Source/Core/Core/HW/MMIO.h b/Source/Core/Core/HW/MMIO.h index 41353b7858..35f83d8b99 100644 --- a/Source/Core/Core/HW/MMIO.h +++ b/Source/Core/Core/HW/MMIO.h @@ -92,10 +92,10 @@ public: // Note that for reads we cannot simply return the read value because C++ // allows overloading only with parameter types, not return types. #define READ_FUNC(Size) \ - void Read(u32 addr, u##Size& val) const \ + void Read(u32 addr, u##Size* val) const \ { \ u32 id = UniqueID(addr) / sizeof (u##Size); \ - val = m_Read##Size##Handlers[id].Read(addr); \ + *val = m_Read##Size##Handlers[id].Read(addr); \ } READ_FUNC(8) READ_FUNC(16) READ_FUNC(32) #undef READ_FUNC @@ -134,7 +134,7 @@ public: // Dummy 64 bits variants of these functions. While 64 bits MMIO access is // not supported, we need these in order to make the code compile. - void Read(u32 addr, u64& val) const { _dbg_assert_(MEMMAP, 0); } + void Read(u32 addr, u64* val) const { _dbg_assert_(MEMMAP, 0); } void Write(u32 addr, u64 val) const { _dbg_assert_(MEMMAP, 0); } private: diff --git a/Source/Core/Core/HW/MemmapFunctions.cpp b/Source/Core/Core/HW/MemmapFunctions.cpp index 404df6aeee..895d861f05 100644 --- a/Source/Core/Core/HW/MemmapFunctions.cpp +++ b/Source/Core/Core/HW/MemmapFunctions.cpp @@ -98,7 +98,7 @@ inline void ReadFromHardware(T &_var, const u32 em_address, const u32 effective_ if (em_address < 0xcc000000) _var = EFB_Read(em_address); else - mmio_mapping->Read(em_address, _var); + mmio_mapping->Read(em_address, &_var); } else if (((em_address & 0xF0000000) == 0x80000000) || ((em_address & 0xF0000000) == 0xC0000000) ||