Skip to content
Permalink
Browse files

Core: Remove MemoryWatcher

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 0c02e77eee0a12b178b11676ca548aeb1cbb7116
@@ -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)
@@ -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"
@@ -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"

@@ -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);
@@ -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,
@@ -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
};
@@ -379,7 +379,3 @@ endif()
if(GDBSTUB)
target_sources(core PRIVATE PowerPC/GDBStub.cpp)
endif()

if(UNIX)
target_sources(core PRIVATE MemoryWatcher.cpp)
endif()
@@ -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"
@@ -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"
@@ -269,10 +266,6 @@ void Stop() // - Hammertime!
}

ResetRumble();

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

void DeclareAsCPUThread()
@@ -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);

This file was deleted.

This file was deleted.

0 comments on commit 0c02e77

Please sign in to comment.
You can’t perform that action at this time.