Misc: #ifdef out last bits of wx-dependent code

This commit is contained in:
Connor McLaughlin 2021-12-19 01:11:52 +10:00 committed by refractionpcsx2
parent a898682f3e
commit 252562db90
18 changed files with 115 additions and 5 deletions

View File

@ -35,6 +35,12 @@
#include "Recording/InputRecording.h" #include "Recording/InputRecording.h"
#endif #endif
#ifndef PCSX2_CORE
#include "System/SysThreads.h"
#else
#include "VMManager.h"
#endif
// This typically reflects the Sony-assigned serial code for the Disc, if one exists. // This typically reflects the Sony-assigned serial code for the Disc, if one exists.
// (examples: SLUS-2113, etc). // (examples: SLUS-2113, etc).
// If the disc is homebrew then it probably won't have a valid serial; in which case // If the disc is homebrew then it probably won't have a valid serial; in which case
@ -492,8 +498,18 @@ void cdvdReloadElfInfo(wxString elfoverride)
} }
catch (Exception::FileNotFound& e) catch (Exception::FileNotFound& e)
{ {
#ifdef PCSX2_CORE
Console.Error("Failed to load ELF info");
LastELF.clear();
DiscSerial.clear();
ElfCRC = 0;
ElfEntry = 0;
ElfTextRange = {};
return;
#else
pxFail("Not in my back yard!"); pxFail("Not in my back yard!");
Cpu->ThrowException(e); Cpu->ThrowException(e);
#endif
} }
} }
@ -2146,7 +2162,11 @@ static void cdvdWrite16(u8 rt) // SCOMMAND
case 0x0F: // sceCdPowerOff (0:1)- Call74 from Xcdvdman case 0x0F: // sceCdPowerOff (0:1)- Call74 from Xcdvdman
Console.WriteLn(Color_StrongBlack, "sceCdPowerOff called. Resetting VM."); Console.WriteLn(Color_StrongBlack, "sceCdPowerOff called. Resetting VM.");
#ifndef PCSX2_CORE
GetCoreThread().Reset(); GetCoreThread().Reset();
#else
VMManager::Reset();
#endif
break; break;
case 0x12: // sceCdReadILinkId (0:9) case 0x12: // sceCdReadILinkId (0:9)

View File

@ -173,9 +173,13 @@ static void TestTemplate(const wxDirName &base, const wxString &fname, bool canE
static std::string iso2indexname(const std::string& isoname) static std::string iso2indexname(const std::string& isoname)
{ {
#ifndef PCSX2_CORE
//testTemplate(isoname); //testTemplate(isoname);
wxDirName appRoot = // TODO: have only one of this in PCSX2. Right now have few... wxDirName appRoot = // TODO: have only one of this in PCSX2. Right now have few...
(wxDirName)(wxFileName(wxStandardPaths::Get().GetExecutablePath()).GetPath()); (wxDirName)(wxFileName(wxStandardPaths::Get().GetExecutablePath()).GetPath());
#else
const wxDirName& appRoot = EmuFolders::DataRoot;
#endif
//TestTemplate(appRoot, isoname, false); //TestTemplate(appRoot, isoname, false);
return StringUtil::wxStringToUTF8String(ApplyTemplate(L"gzip index", appRoot, EmuConfig.GzipIsoIndexTemplate, isoname, false)); return StringUtil::wxStringToUTF8String(ApplyTemplate(L"gzip index", appRoot, EmuConfig.GzipIsoIndexTemplate, isoname, false));
} }

View File

@ -408,8 +408,10 @@ const std::vector<BreakPoint> CBreakPoints::GetBreakpoints()
} }
// including them earlier causes some ambiguities // including them earlier causes some ambiguities
#ifndef PCSX2_CORE
#include "gui/App.h" #include "gui/App.h"
#include "gui/Debugger/DisassemblyDialog.h" #include "gui/Debugger/DisassemblyDialog.h"
#endif
void CBreakPoints::Update(BreakPointCpu cpu, u32 addr) void CBreakPoints::Update(BreakPointCpu cpu, u32 addr)
{ {
@ -427,7 +429,10 @@ void CBreakPoints::Update(BreakPointCpu cpu, u32 addr)
if (resume) if (resume)
r5900Debug.resumeCpu(); r5900Debug.resumeCpu();
#ifndef PCSX2_CORE
auto disassembly_window = wxGetApp().GetDisassemblyPtr(); auto disassembly_window = wxGetApp().GetDisassemblyPtr();
if (disassembly_window) // make sure that valid pointer is recieved to prevent potential NULL dereference. if (disassembly_window) // make sure that valid pointer is recieved to prevent potential NULL dereference.
disassembly_window->update(); disassembly_window->update();
#endif
} }

View File

@ -167,26 +167,38 @@ private:
bool DebugInterface::isAlive() bool DebugInterface::isAlive()
{ {
#ifndef PCSX2_CORE
return GetCoreThread().IsOpen() && g_FrameCount > 0; return GetCoreThread().IsOpen() && g_FrameCount > 0;
#else
return false;
#endif
} }
bool DebugInterface::isCpuPaused() bool DebugInterface::isCpuPaused()
{ {
#ifndef PCSX2_CORE
return GetCoreThread().IsPaused(); return GetCoreThread().IsPaused();
#else
return false;
#endif
} }
void DebugInterface::pauseCpu() void DebugInterface::pauseCpu()
{ {
#ifndef PCSX2_CORE
SysCoreThread& core = GetCoreThread(); SysCoreThread& core = GetCoreThread();
if (!core.IsPaused()) if (!core.IsPaused())
core.Pause({}, true); core.Pause({}, true);
#endif
} }
void DebugInterface::resumeCpu() void DebugInterface::resumeCpu()
{ {
#ifndef PCSX2_CORE
SysCoreThread& core = GetCoreThread(); SysCoreThread& core = GetCoreThread();
if (core.IsPaused()) if (core.IsPaused())
core.Resume(); core.Resume();
#endif
} }

View File

@ -20,7 +20,10 @@
#include "GS.h" // for sending game crc to mtgs #include "GS.h" // for sending game crc to mtgs
#include "Elfheader.h" #include "Elfheader.h"
#include "DebugTools/SymbolMap.h" #include "DebugTools/SymbolMap.h"
#ifndef PCSX2_CORE
#include "gui/AppCoreThread.h" #include "gui/AppCoreThread.h"
#endif
u32 ElfCRC; u32 ElfCRC;
u32 ElfEntry; u32 ElfEntry;
@ -353,7 +356,9 @@ int GetPS2ElfName( wxString& name )
else if( parts.lvalue == L"VER" ) else if( parts.lvalue == L"VER" )
{ {
Console.WriteLn( Color_Blue, L"(SYSTEM.CNF) Software version = " + parts.rvalue ); Console.WriteLn( Color_Blue, L"(SYSTEM.CNF) Software version = " + parts.rvalue );
#ifndef PCSX2_CORE
GameInfo::gameVersion = parts.rvalue; GameInfo::gameVersion = parts.rvalue;
#endif
} }
} }

View File

@ -19,7 +19,11 @@
#include "R5900OpcodeTables.h" #include "R5900OpcodeTables.h"
#include "R5900Exceptions.h" #include "R5900Exceptions.h"
#ifndef PCSX2_CORE
#include "System/SysThreads.h" #include "System/SysThreads.h"
#else
#include "VMManager.h"
#endif
#include "Elfheader.h" #include "Elfheader.h"
@ -60,7 +64,9 @@ void intBreakpoint(bool memcheck)
} }
CBreakPoints::SetBreakpointTriggered(true); CBreakPoints::SetBreakpointTriggered(true);
#ifndef PCSX2_CORE
GetCoreThread().PauseSelfDebug(); GetCoreThread().PauseSelfDebug();
#endif
throw Exception::ExitCpuExecute(); throw Exception::ExitCpuExecute();
} }
@ -582,8 +588,13 @@ static void intExecute()
static void intCheckExecutionState() static void intCheckExecutionState()
{ {
#ifndef PCSX2_CORE
if( GetCoreThread().HasPendingStateChangeRequest() ) if( GetCoreThread().HasPendingStateChangeRequest() )
throw Exception::ExitCpuExecute(); throw Exception::ExitCpuExecute();
#else
if (VMManager::Internal::IsExecutionInterrupted())
throw Exception::ExitCpuExecute();
#endif
} }
static void intStep() static void intStep()

View File

@ -316,9 +316,11 @@ void FileMemoryCard::Open()
if (!Create(str, 8)) if (!Create(str, 8))
{ {
#ifndef PCSX2_CORE
Msgbox::Alert( Msgbox::Alert(
wxsFormat(_("Could not create a memory card: \n\n%s\n\n"), str.c_str()) + wxsFormat(_("Could not create a memory card: \n\n%s\n\n"), str.c_str()) +
GetDisabledMessage(slot)); GetDisabledMessage(slot));
#endif
} }
} }
@ -345,9 +347,11 @@ void FileMemoryCard::Open()
{ {
// Translation note: detailed description should mention that the memory card will be disabled // Translation note: detailed description should mention that the memory card will be disabled
// for the duration of this session. // for the duration of this session.
#ifndef PCSX2_CORE
Msgbox::Alert( Msgbox::Alert(
wxsFormat(_("Access denied to memory card: \n\n%s\n\n"), str.c_str()) + wxsFormat(_("Access denied to memory card: \n\n%s\n\n"), str.c_str()) +
GetDisabledMessage(slot)); GetDisabledMessage(slot));
#endif
} }
else // Load checksum else // Load checksum
{ {

View File

@ -126,8 +126,10 @@ extern void ForgetLoadedPatches();
extern const IConsoleWriter *PatchesCon; extern const IConsoleWriter *PatchesCon;
#ifndef PCSX2_CORE
// Patch loading is verbose only once after the crc changes, this makes it think that the crc changed. // Patch loading is verbose only once after the crc changes, this makes it think that the crc changed.
extern void PatchesVerboseReset(); extern void PatchesVerboseReset();
#endif
// The following prototypes seem unused in PCSX2, but maybe part of the cheats browser? // The following prototypes seem unused in PCSX2, but maybe part of the cheats browser?
// regardless, they don't seem to have an implementation anywhere. // regardless, they don't seem to have an implementation anywhere.

View File

@ -17,7 +17,7 @@
#include "PrecompiledHeader.h" #include "PrecompiledHeader.h"
#include "IopCommon.h" #include "IopCommon.h"
#include "Config.h" #include "Config.h"
#include "gui/AppCoreThread.h" #include "System/SysThreads.h"
#include "R5900OpcodeTables.h" #include "R5900OpcodeTables.h"
#include "DebugTools/Breakpoints.h" #include "DebugTools/Breakpoints.h"
@ -141,7 +141,9 @@ void psxBreakpoint(bool memcheck)
} }
CBreakPoints::SetBreakpointTriggered(true); CBreakPoints::SetBreakpointTriggered(true);
#ifndef PCSX2_CORE
GetCoreThread().PauseSelfDebug(); GetCoreThread().PauseSelfDebug();
#endif
throw Exception::ExitCpuExecute(); throw Exception::ExitCpuExecute();
} }

View File

@ -17,6 +17,7 @@
#include "PrecompiledHeader.h" #include "PrecompiledHeader.h"
#include "Common.h" #include "Common.h"
#include "common/StringUtil.h"
#include "ps2/BiosTools.h" #include "ps2/BiosTools.h"
#include "R5900.h" #include "R5900.h"
#include "R3000A.h" #include "R3000A.h"
@ -25,7 +26,11 @@
#include "COP0.h" #include "COP0.h"
#include "MTVU.h" #include "MTVU.h"
#ifndef PCSX2_CORE
#include "System/SysThreads.h" #include "System/SysThreads.h"
#else
#include "VMManager.h"
#endif
#include "R5900Exceptions.h" #include "R5900Exceptions.h"
#include "Hardware.h" #include "Hardware.h"
@ -38,6 +43,8 @@
#include "GameDatabase.h" #include "GameDatabase.h"
#include "DebugTools/Breakpoints.h" #include "DebugTools/Breakpoints.h"
#include "DebugTools/MIPSAnalyst.h"
#include "DebugTools/SymbolMap.h"
#include "R5900OpcodeTables.h" #include "R5900OpcodeTables.h"
using namespace R5900; // for R5900 disasm tools using namespace R5900; // for R5900 disasm tools
@ -547,7 +554,12 @@ void __fastcall eeGameStarting()
//Console.WriteLn( Color_Green, "(R5900) ELF Entry point! [addr=0x%08X]", ElfEntry ); //Console.WriteLn( Color_Green, "(R5900) ELF Entry point! [addr=0x%08X]", ElfEntry );
g_GameStarted = true; g_GameStarted = true;
g_GameLoading = false; g_GameLoading = false;
#ifndef PCSX2_CORE
GetCoreThread().GameStartingInThread(); GetCoreThread().GameStartingInThread();
#else
VMManager::Internal::GameStartingOnCPUThread();
#endif
// GameStartingInThread may issue a reset of the cpu and/or recompilers. Check for and // GameStartingInThread may issue a reset of the cpu and/or recompilers. Check for and
// handle such things here: // handle such things here:
@ -605,7 +617,11 @@ int ParseArgumentString(u32 arg_block)
// Called from recompilers; __fastcall define is mandatory. // Called from recompilers; __fastcall define is mandatory.
void __fastcall eeloadHook() void __fastcall eeloadHook()
{ {
#ifndef PCSX2_CORE
const wxString &elf_override = GetCoreThread().GetElfOverride(); const wxString &elf_override = GetCoreThread().GetElfOverride();
#else
const wxString elf_override(StringUtil::UTF8StringToWxString(VMManager::Internal::GetElfOverride()));
#endif
if (!elf_override.IsEmpty()) if (!elf_override.IsEmpty())
cdvdReloadElfInfo(L"host:" + elf_override); cdvdReloadElfInfo(L"host:" + elf_override);

View File

@ -16,13 +16,16 @@
#include "PrecompiledHeader.h" #include "PrecompiledHeader.h"
#include "common/StringUtil.h" #include "common/StringUtil.h"
#include "SaveState.h"
#include "Counters.h" #include "Counters.h"
#include "SaveState.h" #include "SaveState.h"
#ifndef DISABLE_RECORDING #ifndef DISABLE_RECORDING
#include "GameDatabase.h" #include "gui/App.h"
#include "gui/AppSaveStates.h"
#include "DebugTools/Debug.h" #include "DebugTools/Debug.h"
#include "GameDatabase.h"
#include "InputRecording.h" #include "InputRecording.h"
#include "InputRecordingControls.h" #include "InputRecordingControls.h"

View File

@ -106,9 +106,11 @@ static const TraceLogDescriptor
TLD_sysoutConsole = {L"SYSout", L"System Out", pxDt("Shows strings printed to the system output stream.")}, TLD_sysoutConsole = {L"SYSout", L"System Out", pxDt("Shows strings printed to the system output stream.")},
TLD_Pgif = {L"PGIFout", L"&PGIF Console", pxDt("Shows output from pgif the emulated ps1 gpu")}, TLD_Pgif = {L"PGIFout", L"&PGIF Console", pxDt("Shows output from pgif the emulated ps1 gpu")}
#ifndef DISABLE_RECORDING #ifndef DISABLE_RECORDING
,
TLD_recordingConsole = {L"Input Recording", L"Input Recording Console", pxDt("Shows recording related logs and information.")}, TLD_recordingConsole = {L"Input Recording", L"Input Recording Console", pxDt("Shows recording related logs and information.")},
TLD_controlInfo = {L"Controller Info", L"Controller Info", pxDt("Shows detailed controller input values for port 1, every frame.")} TLD_controlInfo = {L"Controller Info", L"Controller Info", pxDt("Shows detailed controller input values for port 1, every frame.")}

View File

@ -241,7 +241,7 @@ void SysLogMachineCaps()
Console.Newline(); Console.Newline();
#ifdef _WIN32 #if defined(_WIN32) && !defined(PCSX2_CORE)
CheckIsUserOnHighPerfPowerPlan(); CheckIsUserOnHighPerfPowerPlan();
#endif #endif
} }

View File

@ -332,6 +332,7 @@ bool SysThreadBase::StateCheckInThread()
m_RunningLock.Acquire(); m_RunningLock.Acquire();
if (m_ExecMode != ExecMode_Closing) if (m_ExecMode != ExecMode_Closing)
{ {
#ifndef PCSX2_CORE
if (g_CDVDReset) if (g_CDVDReset)
// AppCoreThread deals with Reseting CDVD // AppCoreThread deals with Reseting CDVD
// Reinit all but GS, USB, DEV9, CDVD (just like with isSuspend = false previously) // Reinit all but GS, USB, DEV9, CDVD (just like with isSuspend = false previously)
@ -341,6 +342,7 @@ bool SysThreadBase::StateCheckInThread()
OnResumeInThread(systemsToTearDown); OnResumeInThread(systemsToTearDown);
g_CDVDReset = false; g_CDVDReset = false;
#endif
break; break;
} }
m_sem_ChangingExecMode.Post(); m_sem_ChangingExecMode.Post();
@ -363,7 +365,9 @@ 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,7 @@ protected:
virtual void OnResumeInThread(SystemsMask systemsToReinstate) = 0; virtual void OnResumeInThread(SystemsMask systemsToReinstate) = 0;
}; };
#ifndef PCSX2_CORE
// -------------------------------------------------------------------------------------- // --------------------------------------------------------------------------------------
// SysCoreThread class // SysCoreThread class
// -------------------------------------------------------------------------------------- // --------------------------------------------------------------------------------------
@ -249,6 +249,7 @@ private:
}; };
struct SysStateUnlockedParams struct SysStateUnlockedParams
{ {
SysStateUnlockedParams() {} SysStateUnlockedParams() {}
@ -288,3 +289,5 @@ namespace PINESettings
{ {
extern unsigned int slot; extern unsigned int slot;
}; };
#endif

View File

@ -16,6 +16,7 @@
#include "PrecompiledHeader.h" #include "PrecompiledHeader.h"
#ifdef _WIN32 #ifdef _WIN32
#include "common/RedtapeWindows.h"
//This ensures that the nVidia graphics card is used for PCSX2 on an Optimus-enabled system. //This ensures that the nVidia graphics card is used for PCSX2 on an Optimus-enabled system.
//302 or higher driver required. //302 or higher driver required.

View File

@ -1127,7 +1127,9 @@ void psxDynarecCheckBreakpoint()
return; return;
CBreakPoints::SetBreakpointTriggered(true); CBreakPoints::SetBreakpointTriggered(true);
#ifndef PCSX2_CORE
GetCoreThread().PauseSelfDebug(); GetCoreThread().PauseSelfDebug();
#endif
iopBreakpoint = true; iopBreakpoint = true;
} }
@ -1138,7 +1140,9 @@ void psxDynarecMemcheck()
return; return;
CBreakPoints::SetBreakpointTriggered(true); CBreakPoints::SetBreakpointTriggered(true);
#ifndef PCSX2_CORE
GetCoreThread().PauseSelfDebug(); GetCoreThread().PauseSelfDebug();
#endif
iopBreakpoint = true; iopBreakpoint = true;
} }

View File

@ -27,7 +27,11 @@
#include "vtlb.h" #include "vtlb.h"
#include "Dump.h" #include "Dump.h"
#ifndef PCSX2_CORE
#include "System/SysThreads.h" #include "System/SysThreads.h"
#else
#include "VMManager.h"
#endif
#include "GS.h" #include "GS.h"
#include "CDVD/CDVD.h" #include "CDVD/CDVD.h"
#include "Elfheader.h" #include "Elfheader.h"
@ -727,7 +731,11 @@ static void recExitExecution()
static void recCheckExecutionState() static void recCheckExecutionState()
{ {
#ifndef PCSX2_CORE
if (SETJMP_CODE(m_cpuException || m_Exception ||) eeRecIsReset || GetCoreThread().HasPendingStateChangeRequest()) if (SETJMP_CODE(m_cpuException || m_Exception ||) eeRecIsReset || GetCoreThread().HasPendingStateChangeRequest())
#else
if (SETJMP_CODE(m_cpuException || m_Exception ||) eeRecIsReset || VMManager::Internal::IsExecutionInterrupted())
#endif
{ {
recExitExecution(); recExitExecution();
} }
@ -1307,7 +1315,9 @@ void dynarecCheckBreakpoint()
return; return;
CBreakPoints::SetBreakpointTriggered(true); CBreakPoints::SetBreakpointTriggered(true);
#ifndef PCSX2_CORE
GetCoreThread().PauseSelfDebug(); GetCoreThread().PauseSelfDebug();
#endif
recExitExecution(); recExitExecution();
} }
@ -1318,7 +1328,9 @@ void dynarecMemcheck()
return; return;
CBreakPoints::SetBreakpointTriggered(true); CBreakPoints::SetBreakpointTriggered(true);
#ifndef PCSX2_CORE
GetCoreThread().PauseSelfDebug(); GetCoreThread().PauseSelfDebug();
#endif
recExitExecution(); recExitExecution();
} }