core: Move Freezer class to tools namespace

This commit is contained in:
Zach Hilman 2019-06-07 11:11:11 -04:00
parent c9983ad9a7
commit ed82fa3a91
4 changed files with 17 additions and 17 deletions

View file

@ -454,8 +454,6 @@ add_library(core STATIC
loader/nsp.h loader/nsp.h
loader/xci.cpp loader/xci.cpp
loader/xci.h loader/xci.h
memory/freezer.cpp
memory/freezer.h
memory.cpp memory.cpp
memory.h memory.h
memory_setup.h memory_setup.h
@ -465,6 +463,8 @@ add_library(core STATIC
settings.h settings.h
telemetry_session.cpp telemetry_session.cpp
telemetry_session.h telemetry_session.h
tools/freezer.cpp
tools/freezer.h
) )
create_target_directory_groups(core) create_target_directory_groups(core)

View file

@ -28,10 +28,10 @@
#include "core/hle/service/service.h" #include "core/hle/service/service.h"
#include "core/hle/service/sm/sm.h" #include "core/hle/service/sm/sm.h"
#include "core/loader/loader.h" #include "core/loader/loader.h"
#include "core/memory/freezer.h"
#include "core/perf_stats.h" #include "core/perf_stats.h"
#include "core/settings.h" #include "core/settings.h"
#include "core/telemetry_session.h" #include "core/telemetry_session.h"
#include "core/tools/freezer.h"
#include "file_sys/cheat_engine.h" #include "file_sys/cheat_engine.h"
#include "video_core/debug_utils/debug_utils.h" #include "video_core/debug_utils/debug_utils.h"
#include "video_core/renderer_base.h" #include "video_core/renderer_base.h"
@ -244,7 +244,7 @@ struct System::Impl {
bool is_powered_on = false; bool is_powered_on = false;
std::unique_ptr<FileSys::CheatEngine> cheat_engine; std::unique_ptr<FileSys::CheatEngine> cheat_engine;
std::unique_ptr<Memory::Freezer> memory_freezer; std::unique_ptr<Tools::Freezer> memory_freezer;
/// Frontend applets /// Frontend applets
Service::AM::Applets::AppletManager applet_manager; Service::AM::Applets::AppletManager applet_manager;

View file

@ -8,9 +8,9 @@
#include "core/core_timing.h" #include "core/core_timing.h"
#include "core/core_timing_util.h" #include "core/core_timing_util.h"
#include "core/memory.h" #include "core/memory.h"
#include "core/memory/freezer.h" #include "core/tools/freezer.h"
namespace Memory { namespace Tools {
namespace { namespace {
@ -19,13 +19,13 @@ constexpr s64 MEMORY_FREEZER_TICKS = static_cast<s64>(Core::Timing::BASE_CLOCK_R
u64 MemoryReadWidth(u32 width, VAddr addr) { u64 MemoryReadWidth(u32 width, VAddr addr) {
switch (width) { switch (width) {
case 1: case 1:
return Read8(addr); return Memory::Read8(addr);
case 2: case 2:
return Read16(addr); return Memory::Read16(addr);
case 4: case 4:
return Read32(addr); return Memory::Read32(addr);
case 8: case 8:
return Read64(addr); return Memory::Read64(addr);
default: default:
UNREACHABLE(); UNREACHABLE();
return 0; return 0;
@ -35,16 +35,16 @@ u64 MemoryReadWidth(u32 width, VAddr addr) {
void MemoryWriteWidth(u32 width, VAddr addr, u64 value) { void MemoryWriteWidth(u32 width, VAddr addr, u64 value) {
switch (width) { switch (width) {
case 1: case 1:
Write8(addr, static_cast<u8>(value)); Memory::Write8(addr, static_cast<u8>(value));
break; break;
case 2: case 2:
Write16(addr, static_cast<u16>(value)); Memory::Write16(addr, static_cast<u16>(value));
break; break;
case 4: case 4:
Write32(addr, static_cast<u32>(value)); Memory::Write32(addr, static_cast<u32>(value));
break; break;
case 8: case 8:
Write64(addr, value); Memory::Write64(addr, value);
break; break;
default: default:
UNREACHABLE(); UNREACHABLE();
@ -185,4 +185,4 @@ void Freezer::FillEntryReads() {
} }
} }
} // namespace Memory } // namespace Tools

View file

@ -15,7 +15,7 @@ class CoreTiming;
struct EventType; struct EventType;
} // namespace Core::Timing } // namespace Core::Timing
namespace Memory { namespace Tools {
// A class that will effectively freeze memory values. // A class that will effectively freeze memory values.
class Freezer { class Freezer {
@ -72,4 +72,4 @@ private:
Core::Timing::CoreTiming& core_timing; Core::Timing::CoreTiming& core_timing;
}; };
} // namespace Memory } // namespace Tools