From 2a45e5f7929fe2a1fad9aec178b6a9c64870275b Mon Sep 17 00:00:00 2001 From: unknown Date: Sat, 18 Jul 2015 12:45:55 -0400 Subject: [PATCH] Declare a couple constants to help clean the code rewrites. --- Source/Project64/N64 System/Mips/Memory Virtual Mem.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Source/Project64/N64 System/Mips/Memory Virtual Mem.cpp b/Source/Project64/N64 System/Mips/Memory Virtual Mem.cpp index b5feb9b2f..f7cacbbfc 100644 --- a/Source/Project64/N64 System/Mips/Memory Virtual Mem.cpp +++ b/Source/Project64/N64 System/Mips/Memory Virtual Mem.cpp @@ -5372,11 +5372,14 @@ void CMipsMemoryVM::TLB_Unmaped( DWORD Vaddr, DWORD Len ) void CMipsMemoryVM::RdramChanged ( CMipsMemoryVM * _this ) { - if (_this->m_AllocatedRdramSize == g_Settings->LoadDword(Game_RDRamSize)) + const size_t new_size = g_Settings -> LoadDword(Game_RDRamSize); + const size_t old_size = _this -> m_AllocatedRdramSize; + + if (old_size == new_size) { return; } - if (_this->m_AllocatedRdramSize == 0x400000) + if (old_size == 0x400000) { if (VirtualAlloc(_this->m_RDRAM + 0x400000, 0x400000, MEM_COMMIT, PAGE_READWRITE)==NULL) {