Skip to content

Commit

Permalink
Core: Remove MemoryWatcher
Browse files Browse the repository at this point in the history
MemoryWatcher only works on Linux and affects emulation determinism due
to scheduling additional events, which causes NetPlay to desync.
Considering that this interface is a rather specialized use case, the
communication with it is kinda crappy *and* it's affecting emulation, I
think it's best to just axe it and come up with a better implementation
of the functionality.
  • Loading branch information
Techjar committed Apr 28, 2019
1 parent 664cfb2 commit 0c02e77
Show file tree
Hide file tree
Showing 8 changed files with 3 additions and 211 deletions.
2 changes: 0 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -481,8 +481,6 @@ endif()
if(UNIX)
message(STATUS "Using named pipes as controller inputs")
add_definitions(-DUSE_PIPES=1)
message(STATUS "Watching game memory for changes")
add_definitions(-DUSE_MEMORYWATCHER=1)
endif()

if(ENABLE_ANALYTICS)
Expand Down
5 changes: 0 additions & 5 deletions Source/Core/Common/CommonPaths.h
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@
#define STYLES_DIR "Styles"
#define ANAGLYPH_DIR "Anaglyph"
#define PIPES_DIR "Pipes"
#define MEMORYWATCHER_DIR "MemoryWatcher"
#define WFSROOT_DIR "WFS"
#define BACKUP_DIR "Backup"
#define RESOURCEPACK_DIR "ResourcePacks"
Expand Down Expand Up @@ -95,10 +94,6 @@
#define ARAM_DUMP "aram.raw"
#define FAKEVMEM_DUMP "fakevmem.raw"

// Files in the directory returned by GetUserPath(D_MEMORYWATCHER_IDX)
#define MEMORYWATCHER_LOCATIONS "Locations.txt"
#define MEMORYWATCHER_SOCKET "MemoryWatcher"

// Sys files
#define TOTALDB "totaldb.dsy"

Expand Down
6 changes: 0 additions & 6 deletions Source/Core/Common/FileUtil.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -800,12 +800,6 @@ static void RebuildUserDirectories(unsigned int dir_index)
s_user_paths[F_GCSRAM_IDX] = s_user_paths[D_GCUSER_IDX] + GC_SRAM;
s_user_paths[F_WIISDCARD_IDX] = s_user_paths[D_WIIROOT_IDX] + DIR_SEP WII_SDCARD;

s_user_paths[D_MEMORYWATCHER_IDX] = s_user_paths[D_USER_IDX] + MEMORYWATCHER_DIR DIR_SEP;
s_user_paths[F_MEMORYWATCHERLOCATIONS_IDX] =
s_user_paths[D_MEMORYWATCHER_IDX] + MEMORYWATCHER_LOCATIONS;
s_user_paths[F_MEMORYWATCHERSOCKET_IDX] =
s_user_paths[D_MEMORYWATCHER_IDX] + MEMORYWATCHER_SOCKET;

// The shader cache has moved to the cache directory, so remove the old one.
// TODO: remove that someday.
File::DeleteDirRecursively(s_user_paths[D_USER_IDX] + SHADERCACHE_LEGACY_DIR DIR_SEP);
Expand Down
3 changes: 0 additions & 3 deletions Source/Core/Common/FileUtil.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ enum
D_THEMES_IDX,
D_STYLES_IDX,
D_PIPES_IDX,
D_MEMORYWATCHER_IDX,
D_WFSROOT_IDX,
D_BACKUP_IDX,
D_RESOURCEPACK_IDX,
Expand All @@ -64,8 +63,6 @@ enum
F_ARAMDUMP_IDX,
F_FAKEVMEMDUMP_IDX,
F_GCSRAM_IDX,
F_MEMORYWATCHERLOCATIONS_IDX,
F_MEMORYWATCHERSOCKET_IDX,
F_WIISDCARD_IDX,
NUM_PATH_INDICES
};
Expand Down
4 changes: 0 additions & 4 deletions Source/Core/Core/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -379,7 +379,3 @@ endif()
if(GDBSTUB)
target_sources(core PRIVATE PowerPC/GDBStub.cpp)
endif()

if(UNIX)
target_sources(core PRIVATE MemoryWatcher.cpp)
endif()
17 changes: 3 additions & 14 deletions Source/Core/Core/Core.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,16 +32,11 @@
#include "Common/Timer.h"

#include "Core/Analytics.h"
#include "Core/Boot/Boot.h"
#include "Core/BootManager.h"
#include "Core/ConfigManager.h"
#include "Core/CoreTiming.h"
#include "Core/DSPEmulator.h"
#include "Core/Host.h"
#include "Core/MemTools.h"
#ifdef USE_MEMORYWATCHER
#include "Core/MemoryWatcher.h"
#endif
#include "Core/Boot/Boot.h"
#include "Core/FifoPlayer/FifoPlayer.h"
#include "Core/HLE/HLE.h"
#include "Core/HW/CPU.h"
Expand All @@ -53,7 +48,9 @@
#include "Core/HW/SystemTimers.h"
#include "Core/HW/VideoInterface.h"
#include "Core/HW/Wiimote.h"
#include "Core/Host.h"
#include "Core/IOS/IOS.h"
#include "Core/MemTools.h"
#include "Core/Movie.h"
#include "Core/NetPlayClient.h"
#include "Core/NetPlayProto.h"
Expand Down Expand Up @@ -269,10 +266,6 @@ void Stop() // - Hammertime!
}

ResetRumble();

#ifdef USE_MEMORYWATCHER
MemoryWatcher::Shutdown();
#endif
}

void DeclareAsCPUThread()
Expand Down Expand Up @@ -315,10 +308,6 @@ static void CpuThread(const std::optional<std::string>& savestate_path, bool del
if (_CoreParameter.bFastmem)
EMM::InstallExceptionHandler(); // Let's run under memory watch

#ifdef USE_MEMORYWATCHER
MemoryWatcher::Init();
#endif

if (savestate_path)
{
::State::LoadAs(*savestate_path);
Expand Down
130 changes: 0 additions & 130 deletions Source/Core/Core/MemoryWatcher.cpp

This file was deleted.

47 changes: 0 additions & 47 deletions Source/Core/Core/MemoryWatcher.h

This file was deleted.

0 comments on commit 0c02e77

Please sign in to comment.