System: Move old SysThread junk to gui

This commit is contained in:
Connor McLaughlin 2022-05-05 23:01:09 +10:00 committed by refractionpcsx2
parent 64534542a9
commit 756cd1ee47
27 changed files with 34 additions and 62 deletions

View File

@ -41,7 +41,7 @@
#endif #endif
#ifndef PCSX2_CORE #ifndef PCSX2_CORE
#include "System/SysThreads.h" #include "gui/SysThreads.h"
#else #else
#include "VMManager.h" #include "VMManager.h"
#endif #endif
@ -373,8 +373,6 @@ s32 cdvdWriteConfig(const u8* config)
return 0; return 0;
} }
static Threading::MutexRecursive Mutex_NewDiskCB;
// Sets ElfCRC to the CRC of the game bound to the CDVD source. // Sets ElfCRC to the CRC of the game bound to the CDVD source.
static __fi ElfObject* loadElf(std::string filename, bool isPSXElf) static __fi ElfObject* loadElf(std::string filename, bool isPSXElf)
{ {
@ -415,8 +413,6 @@ static __fi ElfObject* loadElf(std::string filename, bool isPSXElf)
static __fi void _reloadElfInfo(std::string elfpath) static __fi void _reloadElfInfo(std::string elfpath)
{ {
// Now's a good time to reload the ELF info... // Now's a good time to reload the ELF info...
Threading::ScopedLock locker(Mutex_NewDiskCB);
if (elfpath == LastELF) if (elfpath == LastELF)
return; return;
@ -912,13 +908,6 @@ void SaveStateBase::cdvdFreeze()
void cdvdNewDiskCB() void cdvdNewDiskCB()
{ {
Threading::ScopedTryLock lock(Mutex_NewDiskCB);
if (lock.Failed())
{
DevCon.WriteLn(Color_Red, L"NewDiskCB Lock Failed");
return;
}
DoCDVDresetDiskTypeCache(); DoCDVDresetDiskTypeCache();
cdvdDetectDisk(); cdvdDetectDisk();

View File

@ -1139,7 +1139,9 @@ set(pcsx2GuiSources
gui/pxWindowTextWriter.cpp gui/pxWindowTextWriter.cpp
gui/RecentIsoList.cpp gui/RecentIsoList.cpp
gui/Saveslots.cpp gui/Saveslots.cpp
gui/SysCoreThread.cpp
gui/SysState.cpp gui/SysState.cpp
gui/SysThreadBase.cpp
gui/ThreadingDialogs.cpp gui/ThreadingDialogs.cpp
gui/UpdateUI.cpp gui/UpdateUI.cpp
gui/wxAppWithHelpers.cpp gui/wxAppWithHelpers.cpp
@ -1191,6 +1193,7 @@ set(pcsx2GuiHeaders
gui/pxStaticText.h gui/pxStaticText.h
gui/RecentIsoList.h gui/RecentIsoList.h
gui/Saveslots.h gui/Saveslots.h
gui/SysThreads.h
gui/ThreadingDialogs.h gui/ThreadingDialogs.h
gui/ThreadingDialogs.cpp gui/ThreadingDialogs.cpp
gui/wxGuiTools.h gui/wxGuiTools.h
@ -1368,19 +1371,9 @@ set(pcsx2RecordingVirtualPadResources
${res_rec_vp_src}/upPressed.h ${res_rec_vp_src}/upPressed.h
) )
# System sources
set(pcsx2SystemSources
System/SysThreadBase.cpp)
if(NOT PCSX2_CORE)
list(APPEND pcsx2SystemSources
System/SysCoreThread.cpp
)
endif()
# System headers # System headers
set(pcsx2SystemHeaders set(pcsx2SystemHeaders
System/RecTypes.h System/RecTypes.h)
System/SysThreads.h)
# Utilities sources # Utilities sources
set(pcsx2UtilitiesSources set(pcsx2UtilitiesSources
@ -1517,7 +1510,6 @@ target_sources(PCSX2 PRIVATE
${pcsx2FrontendHeaders} ${pcsx2FrontendHeaders}
${pcsx2ps2Sources} ${pcsx2ps2Sources}
${pcsx2ps2Headers} ${pcsx2ps2Headers}
${pcsx2SystemSources}
${pcsx2SystemHeaders} ${pcsx2SystemHeaders}
${pcsx2UtilitiesSources} ${pcsx2UtilitiesSources}
${pcsx2UtilitiesHeaders}) ${pcsx2UtilitiesHeaders})

View File

@ -28,7 +28,7 @@
#include "SymbolMap.h" #include "SymbolMap.h"
#ifndef PCSX2_CORE #ifndef PCSX2_CORE
#include "System/SysThreads.h" #include "gui/SysThreads.h"
#endif #endif
R5900DebugInterface r5900Debug; R5900DebugInterface r5900Debug;

View File

@ -15,7 +15,6 @@
#pragma once #pragma once
#include <deque> #include <deque>
#include "System/SysThreads.h"
#include "Gif.h" #include "Gif.h"
#include "Vif.h" #include "Vif.h"
#include "GS.h" #include "GS.h"

View File

@ -20,7 +20,7 @@
#include "R5900OpcodeTables.h" #include "R5900OpcodeTables.h"
#include "R5900Exceptions.h" #include "R5900Exceptions.h"
#ifndef PCSX2_CORE #ifndef PCSX2_CORE
#include "System/SysThreads.h" #include "gui/SysThreads.h"
#else #else
#include "VMManager.h" #include "VMManager.h"
#endif #endif

View File

@ -18,6 +18,7 @@
#include "MTVU.h" #include "MTVU.h"
#include "newVif.h" #include "newVif.h"
#include "Gif_Unit.h" #include "Gif_Unit.h"
#include "common/Threading.h"
#include <thread> #include <thread>
VU_Thread vu1Thread; VU_Thread vu1Thread;

View File

@ -40,7 +40,7 @@
#include "Memory.h" #include "Memory.h"
#include "gui/AppSaveStates.h" #include "gui/AppSaveStates.h"
#include "gui/AppCoreThread.h" #include "gui/AppCoreThread.h"
#include "System/SysThreads.h" #include "gui/SysThreads.h"
#include "svnrev.h" #include "svnrev.h"
#include "PINE.h" #include "PINE.h"

View File

@ -28,7 +28,7 @@
#define PINE_EMULATOR_NAME "pcsx2" #define PINE_EMULATOR_NAME "pcsx2"
#include "common/PersistentThread.h" #include "common/PersistentThread.h"
#include "System/SysThreads.h" #include "gui/SysThreads.h"
#include <string> #include <string>
#ifdef _WIN32 #ifdef _WIN32
#include <WinSock2.h> #include <WinSock2.h>

View File

@ -23,7 +23,6 @@
#include "PerformanceMetrics.h" #include "PerformanceMetrics.h"
#include "System.h" #include "System.h"
#include "System/SysThreads.h"
#include "GS.h" #include "GS.h"
#include "MTVU.h" #include "MTVU.h"
@ -177,9 +176,9 @@ void PerformanceMetrics::Update(bool gs_register_write, bool fb_blit)
s_last_ticks = ticks; s_last_ticks = ticks;
const double pct_divider = const double pct_divider =
100.0 * (1.0 / ((static_cast<double>(ticks_delta) * static_cast<double>(GetThreadTicksPerSecond())) / 100.0 * (1.0 / ((static_cast<double>(ticks_delta) * static_cast<double>(Threading::GetThreadTicksPerSecond())) /
static_cast<double>(GetTickFrequency()))); static_cast<double>(GetTickFrequency())));
const double time_divider = 1000.0 * (1.0 / static_cast<double>(GetThreadTicksPerSecond())) * const double time_divider = 1000.0 * (1.0 / static_cast<double>(Threading::GetThreadTicksPerSecond())) *
(1.0 / static_cast<double>(s_frames_since_last_update)); (1.0 / static_cast<double>(s_frames_since_last_update));
const u64 cpu_time = s_cpu_thread_handle.GetCPUTime(); const u64 cpu_time = s_cpu_thread_handle.GetCPUTime();

View File

@ -18,13 +18,16 @@
#include "R3000A.h" #include "R3000A.h"
#include "Common.h" #include "Common.h"
#include "Config.h" #include "Config.h"
#include "System/SysThreads.h"
#include "R5900OpcodeTables.h" #include "R5900OpcodeTables.h"
#include "DebugTools/Breakpoints.h" #include "DebugTools/Breakpoints.h"
#include "IopBios.h" #include "IopBios.h"
#include "IopHw.h" #include "IopHw.h"
#ifndef PCSX2_CORE
#include "gui/SysThreads.h"
#endif
using namespace R3000A; using namespace R3000A;
// Used to flag delay slot instructions when throwig exceptions. // Used to flag delay slot instructions when throwig exceptions.

View File

@ -27,7 +27,7 @@
#include "MTVU.h" #include "MTVU.h"
#ifndef PCSX2_CORE #ifndef PCSX2_CORE
#include "System/SysThreads.h" #include "gui/SysThreads.h"
#else #else
#include "VMManager.h" #include "VMManager.h"
#endif #endif

View File

@ -34,7 +34,6 @@
#include "Elfheader.h" #include "Elfheader.h"
#include "Counters.h" #include "Counters.h"
#include "Patch.h" #include "Patch.h"
#include "System/SysThreads.h"
#include "DebugTools/Breakpoints.h" #include "DebugTools/Breakpoints.h"
#include "Host.h" #include "Host.h"
#include "GS.h" #include "GS.h"
@ -46,6 +45,7 @@
#ifndef PCSX2_CORE #ifndef PCSX2_CORE
#include "gui/App.h" #include "gui/App.h"
#include "gui/ConsoleLogger.h" #include "gui/ConsoleLogger.h"
#include "gui/SysThreads.h"
#else #else
#include "VMManager.h" #include "VMManager.h"
#endif #endif

View File

@ -46,7 +46,6 @@
#include "R5900.h" #include "R5900.h"
#include "SPU2/spu2.h" #include "SPU2/spu2.h"
#include "DEV9/DEV9.h" #include "DEV9/DEV9.h"
#include "System/SysThreads.h"
#include "USB/USB.h" #include "USB/USB.h"
#include "PAD/Host/PAD.h" #include "PAD/Host/PAD.h"
#include "Sio.h" #include "Sio.h"

View File

@ -22,6 +22,7 @@
#include <wx/apptrait.h> #include <wx/apptrait.h>
#include <memory> #include <memory>
#include "SysThreads.h"
#include "pxEventThread.h" #include "pxEventThread.h"
#include "AppCommon.h" #include "AppCommon.h"
@ -38,7 +39,6 @@ struct HostKeyEvent;
#include "GS.h" #include "GS.h"
#include "System.h" #include "System.h"
#include "System/SysThreads.h"
// TODO: Not the best location for this, but it needs to be accessed by MTGS etc. // TODO: Not the best location for this, but it needs to be accessed by MTGS etc.
extern WindowInfo g_gs_window_info; extern WindowInfo g_gs_window_info;

View File

@ -15,7 +15,7 @@
#pragma once #pragma once
#include "System/SysThreads.h" #include "SysThreads.h"
#include "pxEventThread.h" #include "pxEventThread.h"
#include "AppCommon.h" #include "AppCommon.h"

View File

@ -20,7 +20,7 @@
#include "gui/Dialogs/ModalPopups.h" #include "gui/Dialogs/ModalPopups.h"
#include "System/SysThreads.h" #include "gui/SysThreads.h"
#include "PathDefs.h" #include "PathDefs.h"
#include "gui/AppConfig.h" #include "gui/AppConfig.h"

View File

@ -21,7 +21,7 @@
#include "GSFrame.h" #include "GSFrame.h"
#include "IniInterface.h" #include "IniInterface.h"
#include "SPU2/spu2.h" #include "SPU2/spu2.h"
#include "System/SysThreads.h" #include "SysThreads.h"
#include "DEV9/DEV9.h" #include "DEV9/DEV9.h"
#include "USB/USB.h" #include "USB/USB.h"
#include "PAD/Gamepad.h" #include "PAD/Gamepad.h"

View File

@ -17,7 +17,7 @@
#include "MemoryTypes.h" #include "MemoryTypes.h"
#include "App.h" #include "App.h"
#include "System/SysThreads.h" #include "SysThreads.h"
#include "SaveState.h" #include "SaveState.h"
#include "VUmicro.h" #include "VUmicro.h"

View File

@ -332,13 +332,9 @@ bool SysThreadBase::StateCheckInThread()
m_RunningLock.Acquire(); m_RunningLock.Acquire();
if (m_ExecMode != ExecMode_Closing) if (m_ExecMode != ExecMode_Closing)
{ {
#ifndef PCSX2_CORE
// AppCoreThread deals with Reseting CDVD // AppCoreThread deals with Reseting CDVD
OnResumeInThread(g_CDVDReset ? static_cast<SystemsMask>(systemsToTearDown & ~(System_CDVD)) : systemsToTearDown); OnResumeInThread(g_CDVDReset ? static_cast<SystemsMask>(systemsToTearDown & ~(System_CDVD)) : systemsToTearDown);
g_CDVDReset = false; g_CDVDReset = false;
#else
OnResumeInThread(systemsToTearDown);
#endif
break; break;
} }
m_sem_ChangingExecMode.Post(); m_sem_ChangingExecMode.Post();
@ -361,9 +357,7 @@ bool SysThreadBase::StateCheckInThread()
m_RunningLock.Acquire(); m_RunningLock.Acquire();
OnResumeInThread(static_cast<SystemsMask>(-1)); // All systems OnResumeInThread(static_cast<SystemsMask>(-1)); // All systems
#ifndef PCSX2_CORE
g_CDVDReset = false; g_CDVDReset = false;
#endif
break; break;
jNO_DEFAULT; jNO_DEFAULT;

View File

@ -171,7 +171,6 @@ protected:
virtual void OnResumeInThread(SystemsMask systemsToReinstate) = 0; virtual void OnResumeInThread(SystemsMask systemsToReinstate) = 0;
}; };
#ifndef PCSX2_CORE
// -------------------------------------------------------------------------------------- // --------------------------------------------------------------------------------------
// SysCoreThread class // SysCoreThread class
// -------------------------------------------------------------------------------------- // --------------------------------------------------------------------------------------
@ -289,5 +288,3 @@ namespace PINESettings
{ {
extern unsigned int slot; extern unsigned int slot;
}; };
#endif

View File

@ -549,9 +549,9 @@
</ClCompile> </ClCompile>
<ClCompile Include="SaveState.cpp" /> <ClCompile Include="SaveState.cpp" />
<ClCompile Include="SourceLog.cpp" /> <ClCompile Include="SourceLog.cpp" />
<ClCompile Include="System\SysCoreThread.cpp" /> <ClCompile Include="gui\SysCoreThread.cpp" />
<ClCompile Include="System.cpp" /> <ClCompile Include="System.cpp" />
<ClCompile Include="System\SysThreadBase.cpp" /> <ClCompile Include="gui\SysThreadBase.cpp" />
<ClCompile Include="Elfheader.cpp" /> <ClCompile Include="Elfheader.cpp" />
<ClCompile Include="CDVD\InputIsoFile.cpp" /> <ClCompile Include="CDVD\InputIsoFile.cpp" />
<ClCompile Include="x86\BaseblockEx.cpp" /> <ClCompile Include="x86\BaseblockEx.cpp" />
@ -1009,7 +1009,7 @@
<ClInclude Include="SaveState.h" /> <ClInclude Include="SaveState.h" />
<ClInclude Include="SingleRegisterTypes.h" /> <ClInclude Include="SingleRegisterTypes.h" />
<ClInclude Include="System.h" /> <ClInclude Include="System.h" />
<ClInclude Include="System\SysThreads.h" /> <ClInclude Include="gui\SysThreads.h" />
<ClInclude Include="System\RecTypes.h" /> <ClInclude Include="System\RecTypes.h" />
<ClInclude Include="Counters.h" /> <ClInclude Include="Counters.h" />
<ClInclude Include="Dmac.h" /> <ClInclude Include="Dmac.h" />

View File

@ -452,13 +452,13 @@
<ClCompile Include="SourceLog.cpp"> <ClCompile Include="SourceLog.cpp">
<Filter>System</Filter> <Filter>System</Filter>
</ClCompile> </ClCompile>
<ClCompile Include="System\SysCoreThread.cpp"> <ClCompile Include="gui\SysCoreThread.cpp">
<Filter>System</Filter> <Filter>System</Filter>
</ClCompile> </ClCompile>
<ClCompile Include="System.cpp"> <ClCompile Include="System.cpp">
<Filter>System</Filter> <Filter>System</Filter>
</ClCompile> </ClCompile>
<ClCompile Include="System\SysThreadBase.cpp"> <ClCompile Include="gui\SysThreadBase.cpp">
<Filter>System</Filter> <Filter>System</Filter>
</ClCompile> </ClCompile>
<ClCompile Include="Elfheader.cpp"> <ClCompile Include="Elfheader.cpp">
@ -1807,7 +1807,7 @@
<ClInclude Include="System.h"> <ClInclude Include="System.h">
<Filter>System\Include</Filter> <Filter>System\Include</Filter>
</ClInclude> </ClInclude>
<ClInclude Include="System\SysThreads.h"> <ClInclude Include="gui\SysThreads.h">
<Filter>System\Include</Filter> <Filter>System\Include</Filter>
</ClInclude> </ClInclude>
<ClInclude Include="System\RecTypes.h"> <ClInclude Include="System\RecTypes.h">

View File

@ -322,7 +322,6 @@
<ClCompile Include="SaveState.cpp" /> <ClCompile Include="SaveState.cpp" />
<ClCompile Include="SourceLog.cpp" /> <ClCompile Include="SourceLog.cpp" />
<ClCompile Include="System.cpp" /> <ClCompile Include="System.cpp" />
<ClCompile Include="System\SysThreadBase.cpp" />
<ClCompile Include="Elfheader.cpp" /> <ClCompile Include="Elfheader.cpp" />
<ClCompile Include="CDVD\InputIsoFile.cpp" /> <ClCompile Include="CDVD\InputIsoFile.cpp" />
<ClCompile Include="x86\BaseblockEx.cpp" /> <ClCompile Include="x86\BaseblockEx.cpp" />

View File

@ -365,9 +365,6 @@
<ClCompile Include="System.cpp"> <ClCompile Include="System.cpp">
<Filter>System</Filter> <Filter>System</Filter>
</ClCompile> </ClCompile>
<ClCompile Include="System\SysThreadBase.cpp">
<Filter>System</Filter>
</ClCompile>
<ClCompile Include="Elfheader.cpp"> <ClCompile Include="Elfheader.cpp">
<Filter>System\ISO</Filter> <Filter>System\ISO</Filter>
</ClCompile> </ClCompile>

View File

@ -24,7 +24,6 @@
#include "R3000A.h" #include "R3000A.h"
#include "BaseblockEx.h" #include "BaseblockEx.h"
#include "System/RecTypes.h" #include "System/RecTypes.h"
#include "System/SysThreads.h"
#include "R5900OpcodeTables.h" #include "R5900OpcodeTables.h"
#include "IopBios.h" #include "IopBios.h"
#include "IopHw.h" #include "IopHw.h"
@ -43,6 +42,10 @@
#include "common/Perf.h" #include "common/Perf.h"
#include "DebugTools/Breakpoints.h" #include "DebugTools/Breakpoints.h"
#ifndef PCSX2_CORE
#include "gui/SysThreads.h"
#endif
using namespace x86Emitter; using namespace x86Emitter;
extern u32 g_iopNextEventCycle; extern u32 g_iopNextEventCycle;

View File

@ -30,7 +30,7 @@
#include "Dump.h" #include "Dump.h"
#ifndef PCSX2_CORE #ifndef PCSX2_CORE
#include "System/SysThreads.h" #include "gui/SysThreads.h"
#else #else
#include "VMManager.h" #include "VMManager.h"
#endif #endif