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"
#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.
// (examples: SLUS-2113, etc).
// 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)
{
#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!");
Cpu->ThrowException(e);
#endif
}
}
@ -2146,7 +2162,11 @@ static void cdvdWrite16(u8 rt) // SCOMMAND
case 0x0F: // sceCdPowerOff (0:1)- Call74 from Xcdvdman
Console.WriteLn(Color_StrongBlack, "sceCdPowerOff called. Resetting VM.");
#ifndef PCSX2_CORE
GetCoreThread().Reset();
#else
VMManager::Reset();
#endif
break;
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)
{
#ifndef PCSX2_CORE
//testTemplate(isoname);
wxDirName appRoot = // TODO: have only one of this in PCSX2. Right now have few...
(wxDirName)(wxFileName(wxStandardPaths::Get().GetExecutablePath()).GetPath());
#else
const wxDirName& appRoot = EmuFolders::DataRoot;
#endif
//TestTemplate(appRoot, 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
#ifndef PCSX2_CORE
#include "gui/App.h"
#include "gui/Debugger/DisassemblyDialog.h"
#endif
void CBreakPoints::Update(BreakPointCpu cpu, u32 addr)
{
@ -427,7 +429,10 @@ void CBreakPoints::Update(BreakPointCpu cpu, u32 addr)
if (resume)
r5900Debug.resumeCpu();
#ifndef PCSX2_CORE
auto disassembly_window = wxGetApp().GetDisassemblyPtr();
if (disassembly_window) // make sure that valid pointer is recieved to prevent potential NULL dereference.
disassembly_window->update();
#endif
}

View File

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

View File

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

View File

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

View File

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

View File

@ -126,8 +126,10 @@ extern void ForgetLoadedPatches();
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.
extern void PatchesVerboseReset();
#endif
// The following prototypes seem unused in PCSX2, but maybe part of the cheats browser?
// regardless, they don't seem to have an implementation anywhere.

View File

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

View File

@ -17,6 +17,7 @@
#include "PrecompiledHeader.h"
#include "Common.h"
#include "common/StringUtil.h"
#include "ps2/BiosTools.h"
#include "R5900.h"
#include "R3000A.h"
@ -25,7 +26,11 @@
#include "COP0.h"
#include "MTVU.h"
#ifndef PCSX2_CORE
#include "System/SysThreads.h"
#else
#include "VMManager.h"
#endif
#include "R5900Exceptions.h"
#include "Hardware.h"
@ -38,6 +43,8 @@
#include "GameDatabase.h"
#include "DebugTools/Breakpoints.h"
#include "DebugTools/MIPSAnalyst.h"
#include "DebugTools/SymbolMap.h"
#include "R5900OpcodeTables.h"
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 );
g_GameStarted = true;
g_GameLoading = false;
#ifndef PCSX2_CORE
GetCoreThread().GameStartingInThread();
#else
VMManager::Internal::GameStartingOnCPUThread();
#endif
// GameStartingInThread may issue a reset of the cpu and/or recompilers. Check for and
// handle such things here:
@ -605,7 +617,11 @@ int ParseArgumentString(u32 arg_block)
// Called from recompilers; __fastcall define is mandatory.
void __fastcall eeloadHook()
{
#ifndef PCSX2_CORE
const wxString &elf_override = GetCoreThread().GetElfOverride();
#else
const wxString elf_override(StringUtil::UTF8StringToWxString(VMManager::Internal::GetElfOverride()));
#endif
if (!elf_override.IsEmpty())
cdvdReloadElfInfo(L"host:" + elf_override);

View File

@ -16,13 +16,16 @@
#include "PrecompiledHeader.h"
#include "common/StringUtil.h"
#include "SaveState.h"
#include "Counters.h"
#include "SaveState.h"
#ifndef DISABLE_RECORDING
#include "GameDatabase.h"
#include "gui/App.h"
#include "gui/AppSaveStates.h"
#include "DebugTools/Debug.h"
#include "GameDatabase.h"
#include "InputRecording.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_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
,
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.")}

View File

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

View File

@ -332,6 +332,7 @@ bool SysThreadBase::StateCheckInThread()
m_RunningLock.Acquire();
if (m_ExecMode != ExecMode_Closing)
{
#ifndef PCSX2_CORE
if (g_CDVDReset)
// AppCoreThread deals with Reseting CDVD
// Reinit all but GS, USB, DEV9, CDVD (just like with isSuspend = false previously)
@ -341,6 +342,7 @@ bool SysThreadBase::StateCheckInThread()
OnResumeInThread(systemsToTearDown);
g_CDVDReset = false;
#endif
break;
}
m_sem_ChangingExecMode.Post();
@ -363,7 +365,9 @@ bool SysThreadBase::StateCheckInThread()
m_RunningLock.Acquire();
OnResumeInThread(static_cast<SystemsMask>(-1)); // All systems
#ifndef PCSX2_CORE
g_CDVDReset = false;
#endif
break;
jNO_DEFAULT;

View File

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

View File

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

View File

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

View File

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