Remove references to global CoreThread (use accessor)

This commit is contained in:
Connor McLaughlin 2021-08-19 17:59:02 +10:00 committed by Kojin
parent 324a3d09e6
commit 6b2a865e57
4 changed files with 15 additions and 19 deletions

View File

@ -18,7 +18,6 @@
#include "DebugInterface.h"
#include "Memory.h"
#include "R5900.h"
#include "gui/AppCoreThread.h"
#include "Debug.h"
#include "VU.h"
#include "GS.h" // Required for gsNonMirroredRead()
@ -28,8 +27,6 @@
#include "IopMem.h"
#include "SymbolMap.h"
extern AppCoreThread CoreThread;
R5900DebugInterface r5900Debug;
R3000DebugInterface r3000Debug;

View File

@ -469,7 +469,7 @@ SocketIPC::IPCBuffer SocketIPC::ParseCommand(char* buf, char* ret_buffer, u32 bu
switch (m_vm->HasActiveMachine())
{
case true:
if (CoreThread.IsClosing())
if (GetCoreThread().IsClosing())
status = Paused;
else
status = Running;

View File

@ -374,7 +374,7 @@ bool InputRecording::Play(wxWindow* parent, wxString filename)
// Either load the savestate, or restart the game
if (inputRecordingData.FromSaveState())
{
if (!CoreThread.IsOpen())
if (!GetCoreThread().IsOpen())
{
inputRec::consoleLog("Game is not open, aborting playing input recording which starts on a save-state.");
inputRecordingData.Close();

View File

@ -20,7 +20,6 @@
#include "Counters.h"
#include "DebugTools/Debug.h"
#include "MemoryTypes.h"
#include "gui/App.h"
#include "gui/MainFrame.h"
#include "InputRecording.h"
@ -68,24 +67,24 @@ void InputRecordingControls::HandlePausingAndLocking()
frameLock = false;
Resume();
}
else if (!emulationCurrentlyPaused && CoreThread.IsOpen() && CoreThread.IsRunning())
else if (!emulationCurrentlyPaused && GetCoreThread().IsOpen() && GetCoreThread().IsRunning())
{
emulationCurrentlyPaused = true;
CoreThread.PauseSelf();
GetCoreThread().PauseSelf();
}
}
else if (pauseEmulation && CoreThread.IsOpen() && CoreThread.IsRunning())
else if (pauseEmulation && GetCoreThread().IsOpen() && GetCoreThread().IsRunning())
{
emulationCurrentlyPaused = true;
CoreThread.PauseSelf();
GetCoreThread().PauseSelf();
}
}
void InputRecordingControls::ResumeCoreThreadIfStarted()
{
if (resumeEmulation && CoreThread.IsOpen())
if (resumeEmulation && GetCoreThread().IsOpen())
{
CoreThread.Resume();
GetCoreThread().Resume();
resumeEmulation = false;
emulationCurrentlyPaused = false;
}
@ -115,7 +114,7 @@ bool InputRecordingControls::IsFrameAdvancing()
bool InputRecordingControls::IsPaused()
{
return emulationCurrentlyPaused && CoreThread.IsOpen() && CoreThread.IsPaused();
return emulationCurrentlyPaused && GetCoreThread().IsOpen() && GetCoreThread().IsPaused();
}
void InputRecordingControls::Pause()
@ -126,13 +125,13 @@ void InputRecordingControls::Pause()
void InputRecordingControls::PauseImmediately()
{
if (!CoreThread.IsPaused())
if (!GetCoreThread().IsPaused())
{
Pause();
if (CoreThread.IsOpen() && CoreThread.IsRunning())
if (GetCoreThread().IsOpen() && GetCoreThread().IsRunning())
{
emulationCurrentlyPaused = true;
CoreThread.PauseSelf();
GetCoreThread().PauseSelf();
}
}
}
@ -150,13 +149,13 @@ void InputRecordingControls::Resume()
void InputRecordingControls::ResumeImmediately()
{
if (CoreThread.IsPaused())
if (GetCoreThread().IsPaused())
{
Resume();
if (CoreThread.IsRunning())
if (GetCoreThread().IsRunning())
{
emulationCurrentlyPaused = false;
CoreThread.Resume();
GetCoreThread().Resume();
}
}
}