From bbff23a8bb052b3dc7ca34aad7c44c11d750996a Mon Sep 17 00:00:00 2001 From: Ben Vanik Date: Tue, 29 Dec 2015 12:45:27 -0800 Subject: [PATCH] REBASE: Fixing Memory::Reset(). --- src/xenia/memory.cc | 14 +++++--------- src/xenia/memory.h | 2 -- 2 files changed, 5 insertions(+), 11 deletions(-) diff --git a/src/xenia/memory.cc b/src/xenia/memory.cc index d01f8fb46..d9e7840f8 100644 --- a/src/xenia/memory.cc +++ b/src/xenia/memory.cc @@ -272,7 +272,11 @@ void Memory::UnmapViews() { } void Memory::Reset() { - // TODO(benvanik): zero memory, free all heap page tables, etc. + heaps_.v00000000.Reset(); + heaps_.v40000000.Reset(); + heaps_.v80000000.Reset(); + heaps_.v90000000.Reset(); + heaps_.physical.Reset(); } BaseHeap* Memory::LookupHeap(uint32_t address) { @@ -458,14 +462,6 @@ bool Memory::Restore(ByteStream* stream) { return true; } -void Memory::Reset() { - heaps_.v00000000.Reset(); - heaps_.v40000000.Reset(); - heaps_.v80000000.Reset(); - heaps_.v90000000.Reset(); - heaps_.physical.Reset(); -} - xe::memory::PageAccess ToPageAccess(uint32_t protect) { if ((protect & kMemoryProtectRead) && !(protect & kMemoryProtectWrite)) { return xe::memory::PageAccess::kReadOnly; diff --git a/src/xenia/memory.h b/src/xenia/memory.h index f65edb85c..6a0fc9c5d 100644 --- a/src/xenia/memory.h +++ b/src/xenia/memory.h @@ -332,8 +332,6 @@ class Memory { bool Save(ByteStream* stream); bool Restore(ByteStream* stream); - void Reset(); - private: int MapViews(uint8_t* mapping_base); void UnmapViews();