Core: Remove PCSX2_CORE define and leftovers from wx

This commit is contained in:
Stenzek 2022-12-24 14:54:21 +10:00 committed by refractionpcsx2
parent 9a3e7eecd9
commit 96a1c77577
81 changed files with 48 additions and 1858 deletions

View File

@ -52,7 +52,7 @@
<PrecompiledHeader>Use</PrecompiledHeader>
<PrecompiledHeaderFile>PrecompiledHeader.h</PrecompiledHeaderFile>
<EnableEnhancedInstructionSet>NoExtensions</EnableEnhancedInstructionSet>
<PreprocessorDefinitions>WIN32_LEAN_AND_MEAN;LZMA_API_STATIC;BUILD_DX=1;ENABLE_RAINTEGRATION;ENABLE_ACHIEVEMENTS;ENABLE_DISCORD_PRESENCE;ENABLE_OPENGL;ENABLE_VULKAN;DIRECTINPUT_VERSION=0x0800;SDL_BUILD;PCSX2_CORE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>WIN32_LEAN_AND_MEAN;LZMA_API_STATIC;BUILD_DX=1;ENABLE_RAINTEGRATION;ENABLE_ACHIEVEMENTS;ENABLE_DISCORD_PRESENCE;ENABLE_OPENGL;ENABLE_VULKAN;DIRECTINPUT_VERSION=0x0800;SDL_BUILD;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions Condition="$(Configuration.Contains(Debug))">PCSX2_DEBUG;PCSX2_DEVBUILD;_SECURE_SCL_=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions Condition="$(Configuration.Contains(Devel))">PCSX2_DEVEL;PCSX2_DEVBUILD;NDEBUG;_SECURE_SCL_=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions Condition="$(Configuration.Contains(Release))">NDEBUG;_SECURE_SCL_=0;%(PreprocessorDefinitions)</PreprocessorDefinitions>

View File

@ -16,8 +16,7 @@
#pragma once
#ifdef _WIN32
# include <Windows.h>
# undef Yield
# include "common/RedtapeWindows.h"
#elif defined(__linux__)
# include <libaio.h>
#elif defined(__POSIX__)

View File

@ -41,11 +41,7 @@
#include "Recording/InputRecording.h"
#endif
#ifndef PCSX2_CORE
#include "gui/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).
@ -557,7 +553,6 @@ void cdvdReloadElfInfo(std::string elfoverride)
}
catch ([[maybe_unused]] Exception::FileNotFound& e)
{
#ifdef PCSX2_CORE
Console.Error("Failed to load ELF info");
LastELF.clear();
DiscSerial.clear();
@ -565,10 +560,6 @@ void cdvdReloadElfInfo(std::string elfoverride)
ElfEntry = 0;
ElfTextRange = {};
return;
#else
pxFail("Not in my back yard!");
Cpu->ThrowException(e);
#endif
}
}
@ -881,11 +872,7 @@ void cdvdReset()
// If we are recording, always use the same RTC setting
// for games that use the RTC to seed their RNG -- this is very important to be the same everytime!
bool input_recording_active = false;
#ifdef PCSX2_CORE
input_recording_active = g_InputRecording.isActive();
#endif
if (input_recording_active)
if (g_InputRecording.isActive())
{
Console.WriteLn("Input Recording Active - Using Constant RTC of 04-03-2020 (DD-MM-YYYY)");
// Why not just 0 everything? Some games apparently require the date to be valid in terms of when
@ -2458,11 +2445,7 @@ 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

@ -428,9 +428,7 @@ bool DoCDVDopen()
cdvdTD td;
CDVD->getTD(0, &td);
#ifdef PCSX2_CORE
Host::AddKeyedOSDMessage("BlockDumpCreate", fmt::format("Saving CDVD block dump to '{}'.", temp), Host::OSD_INFO_DURATION);
#endif
blockDumpFile.Create(std::move(temp), 2);
@ -463,11 +461,7 @@ void DoCDVDclose()
{
CheckNullCDVD();
#ifdef PCSX2_CORE
// This was commented out, presumably because pausing/resuming in wx reopens CDVD.
// This is a non-issue in Qt, so we'll leave it behind the ifdef.
blockDumpFile.Close();
#endif
if (CDVD->close != NULL)
CDVD->close();

View File

@ -21,15 +21,8 @@
#include "Config.h"
#include "ChunksCache.h"
#include "GzippedFileReader.h"
#include "zlib_indexed.h"
#ifndef PCSX2_CORE
#include "gui/StringHelpers.h"
#include "gui/wxDirName.h"
#include <wx/stdpaths.h>
#else
#include "HostSettings.h"
#endif
#include "zlib_indexed.h"
#define CLAMP(val, minval, maxval) (std::min(maxval, std::max(minval, val)))
@ -181,14 +174,8 @@ static void TestTemplate(const wxDirName &base, const wxString &fname, bool canE
static std::string iso2indexname(const std::string& isoname)
{
#ifndef PCSX2_CORE
std::string appRoot = // TODO: have only one of this in PCSX2. Right now have few...
StringUtil::wxStringToUTF8String(((wxDirName)(wxFileName(wxStandardPaths::Get().GetExecutablePath()).GetPath())).ToString());
return ApplyTemplate("gzip index", appRoot, EmuConfig.GzipIsoIndexTemplate, isoname, false);
#else
const std::string& appRoot = EmuFolders::DataRoot;
return ApplyTemplate("gzip index", appRoot, Host::GetBaseStringSettingValue("EmuCore", "GzipIsoIndexTemplate", "$(f).pindex.tmp"), isoname, false);
#endif
}

View File

@ -7,9 +7,6 @@ if(DISABLE_ADVANCE_SIMD OR LTO_PCSX2_CORE)
else()
add_library(PCSX2)
endif()
target_compile_definitions(PCSX2_FLAGS INTERFACE
"PCSX2_CORE"
)
target_link_libraries(PCSX2 PRIVATE PCSX2_FLAGS)
target_compile_features(PCSX2_FLAGS INTERFACE cxx_std_17)

View File

@ -755,14 +755,6 @@ struct Pcsx2Config
void LoadSave(SettingsWrapper& wrap);
#ifndef PCSX2_CORE
/// Because some GS settings are stored in a separate INI in wx, we need a way to reload them.
/// This is because the SettingsWrapper is only created on full save/load.
void ReloadIniSettings();
#else
void LoadSaveIniSettings(SettingsWrapper& wrap);
#endif
/// Sets user hack values to defaults when user hacks are not enabled.
void MaskUserHacks();
@ -882,7 +874,6 @@ struct Pcsx2Config
};
static const char* DnsModeNames[];
#ifdef PCSX2_CORE
struct HostEntry
{
std::string Url;
@ -903,7 +894,6 @@ struct Pcsx2Config
return !this->operator==(right);
}
};
#endif
bool EthEnable{false};
NetApi EthApi{NetApi::Unset};
@ -921,9 +911,7 @@ struct Pcsx2Config
DnsMode ModeDNS1{DnsMode::Auto};
DnsMode ModeDNS2{DnsMode::Auto};
#ifdef PCSX2_CORE
std::vector<HostEntry> EthHosts;
#endif
bool HddEnable{false};
std::string HddFile;
@ -956,9 +944,7 @@ struct Pcsx2Config
OpEqu(ModeDNS1) &&
OpEqu(ModeDNS2) &&
#ifdef PCSX2_CORE
OpEqu(EthHosts) &&
#endif
OpEqu(HddEnable) &&
OpEqu(HddFile) &&
@ -1123,7 +1109,6 @@ struct Pcsx2Config
}
};
#ifdef PCSX2_CORE
// ------------------------------------------------------------------------
struct USBOptions
{
@ -1149,8 +1134,6 @@ struct Pcsx2Config
bool operator==(const USBOptions& right) const;
bool operator!=(const USBOptions& right) const;
};
#endif
// ------------------------------------------------------------------------
// Options struct for each memory card.
@ -1209,12 +1192,10 @@ struct Pcsx2Config
EnableNoInterlacingPatches : 1,
// TODO - Vaser - where are these settings exposed in the Qt UI?
EnableRecordingTools : 1,
#ifdef PCSX2_CORE
EnableGameFixes : 1, // enables automatic game fixes
SaveStateOnShutdown : 1, // default value for saving state on shutdown
EnableDiscordPresence : 1, // enables discord rich presence integration
InhibitScreensaver : 1,
#endif
// when enabled uses BOOT2 injection, skipping sony bios splashes
UseBOOT2Injection : 1,
BackupSavestate : 1,
@ -1246,9 +1227,7 @@ struct Pcsx2Config
FramerateOptions Framerate;
SPU2Options SPU2;
DEV9Options DEV9;
#ifdef PCSX2_CORE
USBOptions USB;
#endif
TraceLogFilters Trace;

View File

@ -33,15 +33,9 @@
#include "Sio.h"
#include "HostDisplay.h"
#include "SPU2/spu2.h"
#ifndef PCSX2_CORE
#include "gui/App.h"
#include "Recording/InputRecordingControls.h"
#else
#include "PAD/Host/PAD.h"
#include "Recording/InputRecording.h"
#include "VMManager.h"
#endif
using namespace Threading;
@ -548,15 +542,9 @@ static __fi void frameLimitUpdateCore()
{
DoFMVSwitch();
#ifndef PCSX2_CORE
GetCoreThread().VsyncInThread();
if (GetCoreThread().HasPendingStateChangeRequest())
Cpu->ExitExecution();
#else
VMManager::Internal::VSyncOnCPUThread();
if (VMManager::Internal::IsExecutionInterrupted())
Cpu->ExitExecution();
#endif
}
// Framelimiter - Measures the delta time between calls and stalls until a
@ -608,10 +596,8 @@ static __fi void frameLimit()
static __fi void VSyncStart(u32 sCycle)
{
#ifdef PCSX2_CORE
// Update vibration at the end of a frame.
PAD::Update();
#endif
frameLimit(); // limit FPS
gsPostVsyncStart(); // MUST be after framelimit; doing so before causes funk with frame times!

View File

@ -21,9 +21,6 @@
#include "ATA.h"
#include "DEV9/DEV9.h"
#ifndef PCSX2_CORE
#include "HddCreateWx.h"
#endif
#if _WIN32
#include "pathcch.h"
@ -61,19 +58,7 @@ int ATA::Open(const std::string& hddPath)
//Open File
if (!FileSystem::FileExists(hddPath.c_str()))
{
#ifndef PCSX2_CORE
HddCreateWx hddCreator;
hddCreator.filePath = hddPath;
hddCreator.neededSize = ((u64)EmuConfig.DEV9.HddSizeSectors) * 512;
hddCreator.Start();
if (hddCreator.errored)
return -1;
#else
return -1;
#endif
}
hddImage = FileSystem::OpenCFile(hddPath.c_str(), "r+b");
const s64 size = hddImage ? FileSystem::FSize64(hddImage) : -1;

View File

@ -34,20 +34,16 @@
#include <string.h>
#include <errno.h>
#include <stdarg.h>
#define EXTERN
#include "DEV9.h"
#undef EXTERN
#include "Config.h"
#include "DEV9Config.h"
#include "smap.h"
#ifdef _WIN32
#pragma warning(disable : 4244)
HINSTANCE hInst = NULL;
#endif
dev9Struct dev9;
//#define HDD_48BIT
#if defined(__i386__) && !defined(_WIN32)
@ -200,9 +196,6 @@ void DEV9shutdown()
s32 DEV9open()
{
DevCon.WriteLn("DEV9: DEV9open");
#ifndef PCSX2_CORE
LoadDnsHosts();
#endif
DevCon.WriteLn("DEV9: open r+: %s", EmuConfig.DEV9.HddFile.c_str());
std::string hddPath(GetHDDPath());

View File

@ -17,12 +17,6 @@
#include <stdio.h>
#include <string>
#ifndef EXTERN
#define EXTERN extern
#endif
#define DEV9defs
//#define WINVER 0x0600
//#define _WIN32_WINNT 0x0500
#include "net.h"
#include "PacketReader/IP/IP_Address.h"
@ -54,23 +48,6 @@ bool rx_fifo_can_rx();
#define HDD_MIN_GB 40
#define HDD_MAX_GB 120
#ifndef PCSX2_CORE
struct ConfigHost
{
std::string Url;
std::string Desc;
u8 Address[4];
bool Enabled;
};
struct ConfigDEV9
{
std::vector<ConfigHost> EthHosts;
};
EXTERN ConfigDEV9 config;
#endif
typedef struct
{
ATA* ata;
@ -121,7 +98,7 @@ typedef struct
#define EEPROM_ADDR5 8
#define EEPROM_TDATA 9 //ready to send/receive data
EXTERN dev9Struct dev9;
extern dev9Struct dev9;
#define dev9_rxfifo_write(x) (dev9.rxfifo[dev9.rxfifo_wr_ptr++] = x)
@ -132,7 +109,7 @@ EXTERN dev9Struct dev9;
#define dev9Ru16(mem) (*(u16*)&dev9.dev9R[(mem)&0xffff])
#define dev9Ru32(mem) (*(u32*)&dev9.dev9R[(mem)&0xffff])
EXTERN int ThreadRun;
extern int ThreadRun;
#define DEV9_R_REV 0x1f80146e
@ -696,7 +673,6 @@ static flash_info_t devices[] = {
#define FLASH_REGSIZE 0x20
extern void dev9Irq(int cycles);
extern void DEV9configure();
void FLASHinit();
s32 DEV9init();

View File

@ -116,19 +116,11 @@ namespace InternalServers
void DNS_Server::LoadHostList()
{
hosts.clear();
#ifndef PCSX2_CORE
for (const ConfigHost& entry : config.EthHosts)
{
if (entry.Enabled)
hosts.insert_or_assign(entry.Url, *(IP_Address*)entry.Address);
}
#else
for (const Pcsx2Config::DEV9Options::HostEntry& entry : EmuConfig.DEV9.EthHosts)
{
if (entry.Enabled)
hosts.insert_or_assign(entry.Url, *(IP_Address*)entry.Address);
}
#endif
}
UDP_Packet* DNS_Server::Recv()

View File

@ -24,6 +24,7 @@
#include <condition_variable>
#ifdef _WIN32
#include "common/RedtapeWindows.h"
#include <winsock2.h>
#include <iphlpapi.h>
#elif defined(__POSIX__)

View File

@ -399,12 +399,6 @@ const std::vector<BreakPoint> CBreakPoints::GetBreakpoints()
return breakPoints_;
}
// 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)
{
bool resume = false;
@ -423,12 +417,6 @@ 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();
#else
if(cb_bpUpdated_)
cb_bpUpdated_();
#endif
}

View File

@ -30,10 +30,6 @@
#include "common/StringUtil.h"
#ifndef PCSX2_CORE
#include "gui/SysThreads.h"
#endif
R5900DebugInterface r5900Debug;
R3000DebugInterface r3000Debug;
@ -174,45 +170,24 @@ private:
bool DebugInterface::isAlive()
{
#ifndef PCSX2_CORE
return GetCoreThread().IsOpen() && g_FrameCount > 0;
#else
return VMManager::HasValidVM() && g_FrameCount > 0;
#endif
}
bool DebugInterface::isCpuPaused()
{
#ifndef PCSX2_CORE
return GetCoreThread().IsPaused();
#else
return VMManager::GetState() == VMState::Paused;
#endif
}
void DebugInterface::pauseCpu()
{
#ifndef PCSX2_CORE
SysCoreThread& core = GetCoreThread();
if (!core.IsPaused())
core.Pause({}, true);
#else
VMManager::SetPaused(true);
#endif
}
void DebugInterface::resumeCpu()
{
#ifndef PCSX2_CORE
SysCoreThread& core = GetCoreThread();
if (core.IsPaused())
core.Resume();
#else
VMManager::SetPaused(false);
#endif
}
char* DebugInterface::stringFromPointer(u32 p)
{
const int BUFFER_LEN = 25;

View File

@ -22,10 +22,6 @@
#include "Elfheader.h"
#include "DebugTools/SymbolMap.h"
#ifndef PCSX2_CORE
#include "gui/AppCoreThread.h"
#endif
u32 ElfCRC;
u32 ElfEntry;
std::pair<u32,u32> ElfTextRange;
@ -369,9 +365,6 @@ int GetPS2ElfName( std::string& name )
{
Console.WriteLn( Color_Blue, "(SYSTEM.CNF) Software version = %.*s",
static_cast<int>(value.size()), value.data());
#ifndef PCSX2_CORE
GameInfo::gameVersion = StringUtil::UTF8StringToWxString(value);
#endif
}
}

View File

@ -26,15 +26,15 @@
#include "common/StringUtil.h"
#include "common/Timer.h"
#include "imgui.h"
#ifdef PCSX2_CORE
#include "imgui_internal.h"
#endif
#include "Config.h"
#include "Counters.h"
#include "Frontend/FullscreenUI.h"
#include "Frontend/ImGuiFullscreen.h"
#include "Frontend/ImGuiManager.h"
#include "Frontend/ImGuiOverlays.h"
#include "Frontend/InputManager.h"
#include "GS.h"
#include "GS/GS.h"
#include "Host.h"
@ -42,13 +42,7 @@
#include "IconsFontAwesome5.h"
#include "PerformanceMetrics.h"
#include "Recording/InputRecording.h"
#ifdef PCSX2_CORE
#include "Frontend/FullscreenUI.h"
#include "Frontend/ImGuiFullscreen.h"
#include "Frontend/InputManager.h"
#include "VMManager.h"
#endif
namespace ImGuiManager
{
@ -77,7 +71,6 @@ static std::vector<u8> s_icon_font_data;
static Common::Timer s_last_render_time;
#ifdef PCSX2_CORE
// cached copies of WantCaptureKeyboard/Mouse, used to know when to dispatch events
static std::atomic_bool s_imgui_wants_keyboard{false};
static std::atomic_bool s_imgui_wants_mouse{false};
@ -88,7 +81,6 @@ static std::unordered_map<u32, ImGuiKey> s_imgui_key_map;
// need to keep track of this, so we can reinitialize on renderer switch
static bool s_fullscreen_ui_was_initialized = false;
#endif
bool ImGuiManager::Initialize()
{
@ -104,12 +96,10 @@ bool ImGuiManager::Initialize()
ImGuiIO& io = ImGui::GetIO();
io.IniFilename = nullptr;
#ifdef PCSX2_CORE
io.BackendFlags |= ImGuiBackendFlags_HasGamepad;
io.BackendUsingLegacyKeyArrays = 0;
io.BackendUsingLegacyNavInputArray = 0;
io.ConfigFlags |= ImGuiConfigFlags_NavEnableKeyboard | ImGuiConfigFlags_NavEnableGamepad;
#endif
io.DisplayFramebufferScale = ImVec2(1, 1); // We already scale things ourselves, this would double-apply scaling
io.DisplaySize.x = static_cast<float>(g_host_display->GetWindowWidth());
@ -118,12 +108,8 @@ bool ImGuiManager::Initialize()
SetKeyMap();
SetStyle();
#ifdef PCSX2_CORE
const bool add_fullscreen_fonts = s_fullscreen_ui_was_initialized;
pxAssertRel(!FullscreenUI::IsInitialized(), "Fullscreen UI is not initialized on ImGui init");
#else
const bool add_fullscreen_fonts = false;
#endif
if (!g_host_display->CreateImGuiContext())
{
@ -149,32 +135,24 @@ bool ImGuiManager::Initialize()
NewFrame();
// reinitialize fsui if it was previously enabled
#ifdef PCSX2_CORE
if (add_fullscreen_fonts)
InitializeFullscreenUI();
#endif
return true;
}
bool ImGuiManager::InitializeFullscreenUI()
{
#ifdef PCSX2_CORE
s_fullscreen_ui_was_initialized = FullscreenUI::Initialize();
return s_fullscreen_ui_was_initialized;
#else
return false;
#endif
}
void ImGuiManager::Shutdown(bool clear_state)
{
#ifdef PCSX2_CORE
FullscreenUI::Shutdown(clear_state);
ImGuiFullscreen::SetFonts(nullptr, nullptr, nullptr);
if (clear_state)
s_fullscreen_ui_was_initialized = false;
#endif
if (g_host_display)
g_host_display->DestroyImGuiContext();
@ -209,13 +187,8 @@ void ImGuiManager::UpdateScale()
const float window_scale = g_host_display ? g_host_display->GetWindowScale() : 1.0f;
const float scale = std::max(window_scale * (EmuConfig.GS.OsdScale / 100.0f), 1.0f);
#ifdef PCSX2_CORE
if (scale == s_global_scale && (!HasFullscreenFonts() || !ImGuiFullscreen::UpdateLayoutScale()))
return;
#else
if (scale == s_global_scale)
return;
#endif
// This is assumed to be called mid-frame.
ImGui::EndFrame();
@ -239,7 +212,6 @@ void ImGuiManager::NewFrame()
ImGui::NewFrame();
#ifdef PCSX2_CORE
// Disable nav input on the implicit (Debug##Default) window. Otherwise we end up requesting keyboard
// focus when there's nothing there. We use GetCurrentWindowRead() because otherwise it'll make it visible.
ImGui::GetCurrentWindowRead()->Flags |= ImGuiWindowFlags_NoNavInputs;
@ -255,7 +227,6 @@ void ImGuiManager::NewFrame()
else
Host::EndTextInput();
}
#endif
}
void ImGuiManager::SetStyle()
@ -319,7 +290,6 @@ void ImGuiManager::SetStyle()
void ImGuiManager::SetKeyMap()
{
#ifdef PCSX2_CORE
struct KeyMapping
{
int index;
@ -361,7 +331,6 @@ void ImGuiManager::SetKeyMap()
if (map.has_value())
s_imgui_key_map[map.value()] = km.index;
}
#endif
}
bool ImGuiManager::LoadFontData()
@ -471,7 +440,6 @@ bool ImGuiManager::AddImGuiFonts(bool fullscreen_fonts)
if (!s_fixed_font)
return false;
#ifdef PCSX2_CORE
if (fullscreen_fonts)
{
const float medium_font_size = std::ceil(ImGuiFullscreen::LayoutScale(ImGuiFullscreen::LAYOUT_MEDIUM_FONT_SIZE));
@ -491,7 +459,6 @@ bool ImGuiManager::AddImGuiFonts(bool fullscreen_fonts)
}
ImGuiFullscreen::SetFonts(s_standard_font, s_medium_font, s_large_font);
#endif
return io.Fonts->Build();
}
@ -703,13 +670,9 @@ void ImGuiManager::RenderOSD()
// acquire for IO.MousePos.
std::atomic_thread_fence(std::memory_order_acquire);
#ifdef PCSX2_CORE
// Don't draw OSD when we're just running big picture.
if (VMManager::HasValidVM())
RenderOverlays();
#else
RenderOverlays();
#endif
AcquirePendingOSDMessages();
DrawOSDMessages();
@ -742,8 +705,6 @@ ImFont* ImGuiManager::GetLargeFont()
return s_large_font;
}
#ifdef PCSX2_CORE
bool ImGuiManager::WantsTextInput()
{
return s_imgui_wants_text.load(std::memory_order_acquire);
@ -853,5 +814,3 @@ bool ImGuiManager::ProcessGenericInputEvent(GenericInputBinding key, float value
return true;
}
#endif // PCSX2_CORE

View File

@ -66,7 +66,6 @@ namespace ImGuiManager
/// This font is allocated on demand.
ImFont* GetLargeFont();
#ifdef PCSX2_CORE
/// Returns true if imgui wants to intercept text input.
bool WantsTextInput();
@ -90,7 +89,6 @@ namespace ImGuiManager
/// Called on the CPU thread when any input event fires. Allows imgui to take over controller navigation.
bool ProcessGenericInputEvent(GenericInputBinding key, float value);
#endif
} // namespace ImGuiManager
namespace Host

View File

@ -33,8 +33,11 @@
#include "Config.h"
#include "Counters.h"
#include "Frontend/FullscreenUI.h"
#include "Frontend/ImGuiManager.h"
#include "Frontend/ImGuiFullscreen.h"
#include "Frontend/ImGuiOverlays.h"
#include "Frontend/InputManager.h"
#include "GS.h"
#include "GS/GS.h"
#include "GS/GSVector.h"
@ -42,28 +45,20 @@
#include "HostDisplay.h"
#include "IconsFontAwesome5.h"
#include "PerformanceMetrics.h"
#ifdef PCSX2_CORE
#include "PAD/Host/PAD.h"
#include "PAD/Host/KeyStatus.h"
#include "USB/USB.h"
#include "Frontend/FullscreenUI.h"
#include "Frontend/ImGuiManager.h"
#include "Frontend/ImGuiFullscreen.h"
#include "Frontend/InputManager.h"
#include "VMManager.h"
#include "pcsx2/Recording/InputRecording.h"
#endif
namespace ImGuiManager
{
static void FormatProcessorStat(std::string& text, double usage, double time);
static void DrawPerformanceOverlay();
#ifdef PCSX2_CORE
static void DrawSettingsOverlay();
static void DrawInputsOverlay();
static void DrawInputRecordingOverlay();
#endif
} // namespace ImGuiManager
static std::tuple<float, float> GetMinMax(gsl::span<const float> values)
@ -132,13 +127,8 @@ void ImGuiManager::DrawPerformanceOverlay()
position_y += text_size.y + spacing; \
} while (0)
#ifdef PCSX2_CORE
const bool paused = (VMManager::GetState() == VMState::Paused);
const bool fsui_active = FullscreenUI::HasActiveWindow();
#else
const bool paused = false;
const bool fsui_active = false;
#endif
if (!paused)
{
@ -257,7 +247,6 @@ void ImGuiManager::DrawPerformanceOverlay()
}
}
#ifdef PCSX2_CORE
if (GSConfig.OsdShowFrameTimes)
{
const ImVec2 history_size(200.0f * scale, 50.0f * scale);
@ -318,7 +307,6 @@ void ImGuiManager::DrawPerformanceOverlay()
ImGui::PopStyleVar(5);
ImGui::PopStyleColor(3);
}
#endif
}
else if (!fsui_active)
{
@ -331,8 +319,6 @@ void ImGuiManager::DrawPerformanceOverlay()
#undef DRAW_LINE
}
#ifdef PCSX2_CORE
void ImGuiManager::DrawSettingsOverlay()
{
if (!GSConfig.OsdShowSettings || VMManager::GetState() != VMState::Running)
@ -606,9 +592,6 @@ void ImGuiManager::DrawInputsOverlay()
}
}
#endif
#ifdef PCSX2_CORE
void ImGuiManager::DrawInputRecordingOverlay()
{
const float scale = ImGuiManager::GetGlobalScale();
@ -657,14 +640,11 @@ void ImGuiManager::DrawInputRecordingOverlay()
#undef DRAW_LINE
}
#endif
void ImGuiManager::RenderOverlays()
{
DrawPerformanceOverlay();
#ifdef PCSX2_CORE
DrawInputRecordingOverlay();
DrawSettingsOverlay();
DrawInputsOverlay();
#endif
}

View File

@ -74,10 +74,7 @@ void gsUpdateFrequency(Pcsx2Config& config)
config.GS.LimitScalar = 0.0f;
}
#ifdef PCSX2_CORE
GetMTGS().UpdateVSyncMode();
#endif
UpdateVSyncRate();
}

View File

@ -15,14 +15,6 @@
#include "PrecompiledHeader.h"
#ifndef PCSX2_CORE
#ifdef _WIN32
// Need to ensure we include windows.h and set _WIN32_WINNT before wx does..
#include "common/RedtapeWindows.h"
#endif
#include "GS/Window/GSwxDialog.h"
#endif
#include "GS.h"
#include "GSCapture.h"
#include "GSGL.h"
@ -43,12 +35,10 @@
#include "pcsx2/Counters.h"
#include "pcsx2/Host.h"
#include "pcsx2/HostDisplay.h"
#include "pcsx2/GS.h"
#ifdef PCSX2_CORE
#include "pcsx2/HostSettings.h"
#include "pcsx2/Frontend/FullscreenUI.h"
#include "pcsx2/Frontend/InputManager.h"
#endif
#include "pcsx2/GS.h"
#ifdef ENABLE_OPENGL
#include "Renderers/OpenGL/GSDeviceOGL.h"
@ -87,17 +77,6 @@ static u64 s_next_manual_present_time;
int GSinit()
{
if (!GSUtil::CheckSSE())
{
return -1;
}
// Vector instructions must be avoided when initialising GS since PCSX2
// can crash if the CPU does not support the instruction set.
// Initialise it here instead - it's not ideal since we have to strip the
// const type qualifier from all the affected variables.
GSinitConfig();
GSVertexSW::InitStatic();
GSUtil::Init();
@ -109,19 +88,6 @@ int GSinit()
return 0;
}
void GSinitConfig()
{
#ifndef PCSX2_CORE
static bool config_inited = false;
if (config_inited)
return;
config_inited = true;
theApp.SetConfigDir();
theApp.Init();
#endif
}
void GSshutdown()
{
GSclose();
@ -593,52 +559,6 @@ void GSThrottlePresentation()
Threading::SleepUntil(s_next_manual_present_time);
}
#ifndef PCSX2_CORE
void GSkeyEvent(const HostKeyEvent& e)
{
try
{
if (g_gs_renderer)
g_gs_renderer->KeyEvent(e);
}
catch (GSRecoverableError)
{
}
}
void GSconfigure()
{
try
{
if (!GSUtil::CheckSSE())
return;
theApp.SetConfigDir();
theApp.Init();
if (RunwxDialog())
{
theApp.ReloadConfig();
// Force a reload of the gs state
//theApp.SetCurrentRendererType(GSRendererType::Undefined);
}
}
catch (GSRecoverableError)
{
}
}
#endif
int GStest()
{
if (!GSUtil::CheckSSE())
return -1;
return 0;
}
void GSsetGameCRC(u32 crc, int options)
{
g_gs_renderer->SetGameCRC(crc, options);
@ -728,16 +648,9 @@ void GSgetTitleStats(std::string& info)
const char* hw_sw_name = (GSConfig.Renderer == GSRendererType::Null) ? " Null" : (GSConfig.UseHardwareRenderer() ? " HW" : " SW");
const char* deinterlace_mode = deinterlace_modes[static_cast<int>(GSConfig.InterlaceMode)];
#ifndef PCSX2_CORE
int iwidth, iheight;
GSgetInternalResolution(&iwidth, &iheight);
info = StringUtil::StdStringFromFormat("%s%s | %s | %dx%d", api_name, hw_sw_name, deinterlace_mode, iwidth, iheight);
#else
const char* interlace_mode = ReportInterlaceMode();
const char* video_mode = ReportVideoMode();
info = StringUtil::StdStringFromFormat("%s%s | %s | %s | %s", api_name, hw_sw_name, video_mode, interlace_mode, deinterlace_mode);
#endif
}
void GSUpdateConfig(const Pcsx2Config::GSOptions& new_config)
@ -890,24 +803,6 @@ bool GSSaveSnapshotToMemory(u32 window_width, u32 window_height, bool apply_aspe
width, height, pixels);
}
std::string format(const char* fmt, ...)
{
va_list args;
va_start(args, fmt);
int size = vsnprintf(nullptr, 0, fmt, args) + 1;
va_end(args);
assert(size > 0);
std::vector<char> buffer(std::max(1, size));
va_start(args, fmt);
vsnprintf(buffer.data(), size, fmt, args);
va_end(args);
return {buffer.data()};
}
#ifdef _WIN32
static HANDLE s_fh = NULL;
@ -1031,466 +926,6 @@ void GSFreeWrappedMemory(void* ptr, size_t size, size_t repeat)
#endif
#ifndef PCSX2_CORE
size_t GSApp::GetIniString(const char* lpAppName, const char* lpKeyName, const char* lpDefault, char* lpReturnedString, size_t nSize, const char* lpFileName)
{
BuildConfigurationMap(lpFileName);
std::string key(lpKeyName);
std::string value = m_configuration_map[key];
if (value.empty())
{
// save the value for futur call
m_configuration_map[key] = std::string(lpDefault);
strcpy(lpReturnedString, lpDefault);
}
else
strcpy(lpReturnedString, value.c_str());
return 0;
}
bool GSApp::WriteIniString(const char* lpAppName, const char* lpKeyName, const char* pString, const char* lpFileName)
{
BuildConfigurationMap(lpFileName);
std::string key(lpKeyName);
std::string value(pString);
m_configuration_map[key] = value;
// Save config to a file
FILE* f = FileSystem::OpenCFile(lpFileName, "w");
if (f == NULL)
return false; // FIXME print a nice message
// Maintain compatibility with GSDumpGUI/old Windows ini.
#ifdef _WIN32
fprintf(f, "[Settings]\n");
#endif
for (const auto& entry : m_configuration_map)
{
// Do not save the inifile key which is not an option
if (entry.first.compare("inifile") == 0)
continue;
// Only keep option that have a default value (allow to purge old option of the GS.ini)
if (!entry.second.empty() && m_default_configuration.find(entry.first) != m_default_configuration.end())
fprintf(f, "%s = %s\n", entry.first.c_str(), entry.second.c_str());
}
fclose(f);
return false;
}
int GSApp::GetIniInt(const char* lpAppName, const char* lpKeyName, int nDefault, const char* lpFileName)
{
BuildConfigurationMap(lpFileName);
std::string value = m_configuration_map[std::string(lpKeyName)];
if (value.empty())
{
// save the value for futur call
SetConfig(lpKeyName, nDefault);
return nDefault;
}
else
return atoi(value.c_str());
}
GSApp theApp;
GSApp::GSApp()
{
// Empty constructor causes an illegal instruction exception on an SSE4.2 machine on Windows.
// Non-empty doesn't, but raises a SIGILL signal when compiled against GCC 6.1.1.
// So here's a compromise.
#ifdef _WIN32
Init();
#endif
}
void GSApp::Init()
{
static bool is_initialised = false;
if (is_initialised)
return;
is_initialised = true;
m_section = "Settings";
m_gs_renderers.push_back(GSSetting(static_cast<u32>(GSRendererType::Auto), "Automatic", "Default"));
#ifdef _WIN32
m_gs_renderers.push_back(GSSetting(static_cast<u32>(GSRendererType::DX11), "Direct3D 11", ""));
m_gs_renderers.push_back(GSSetting(static_cast<u32>(GSRendererType::DX12), "Direct3D 12", ""));
#endif
#ifdef __APPLE__
m_gs_renderers.push_back(GSSetting(static_cast<u32>(GSRendererType::Metal), "Metal", ""));
#endif
#ifdef ENABLE_OPENGL
m_gs_renderers.push_back(GSSetting(static_cast<u32>(GSRendererType::OGL), "OpenGL", ""));
#endif
#ifdef ENABLE_VULKAN
m_gs_renderers.push_back(GSSetting(static_cast<u32>(GSRendererType::VK), "Vulkan", ""));
#endif
m_gs_renderers.push_back(GSSetting(static_cast<u32>(GSRendererType::SW), "Software", ""));
// The null renderer goes last, it has use for benchmarking purposes in a release build
m_gs_renderers.push_back(GSSetting(static_cast<u32>(GSRendererType::Null), "Null", ""));
m_gs_deinterlace.push_back(GSSetting(static_cast<u32>(GSInterlaceMode::Automatic), "Automatic", "Default"));
m_gs_deinterlace.push_back(GSSetting(static_cast<u32>(GSInterlaceMode::Off), "None", ""));
m_gs_deinterlace.push_back(GSSetting(static_cast<u32>(GSInterlaceMode::WeaveTFF), "Weave tff", "saw-tooth"));
m_gs_deinterlace.push_back(GSSetting(static_cast<u32>(GSInterlaceMode::WeaveBFF), "Weave bff", "saw-tooth"));
m_gs_deinterlace.push_back(GSSetting(static_cast<u32>(GSInterlaceMode::BobTFF), "Bob tff", "use adaptive or blend if shaking"));
m_gs_deinterlace.push_back(GSSetting(static_cast<u32>(GSInterlaceMode::BobBFF), "Bob bff", "use adaptive or blend if shaking"));
m_gs_deinterlace.push_back(GSSetting(static_cast<u32>(GSInterlaceMode::BlendTFF), "Blend tff", "slight blur, 1/2 fps"));
m_gs_deinterlace.push_back(GSSetting(static_cast<u32>(GSInterlaceMode::BlendBFF), "Blend bff", "slight blur, 1/2 fps"));
m_gs_deinterlace.push_back(GSSetting(static_cast<u32>(GSInterlaceMode::AdaptiveTFF), "Adaptive tff", "minor artifacts"));
m_gs_deinterlace.push_back(GSSetting(static_cast<u32>(GSInterlaceMode::AdaptiveBFF), "Adaptive bff", "minor artifacts"));
m_gs_upscale_multiplier.push_back(GSSetting(1, "Native", "PS2"));
m_gs_upscale_multiplier.push_back(GSSetting(2, "2x Native", "~720p"));
m_gs_upscale_multiplier.push_back(GSSetting(3, "3x Native", "~1080p"));
m_gs_upscale_multiplier.push_back(GSSetting(4, "4x Native", "~1440p 2K"));
m_gs_upscale_multiplier.push_back(GSSetting(5, "5x Native", "~1620p"));
m_gs_upscale_multiplier.push_back(GSSetting(6, "6x Native", "~2160p 4K"));
m_gs_upscale_multiplier.push_back(GSSetting(7, "7x Native", "~2520p"));
m_gs_upscale_multiplier.push_back(GSSetting(8, "8x Native", "~2880p"));
m_gs_max_anisotropy.push_back(GSSetting(0, "Off", "Default"));
m_gs_max_anisotropy.push_back(GSSetting(2, "2x", ""));
m_gs_max_anisotropy.push_back(GSSetting(4, "4x", ""));
m_gs_max_anisotropy.push_back(GSSetting(8, "8x", ""));
m_gs_max_anisotropy.push_back(GSSetting(16, "16x", ""));
m_gs_dithering.push_back(GSSetting(0, "Off", ""));
m_gs_dithering.push_back(GSSetting(2, "Unscaled", "Default"));
m_gs_dithering.push_back(GSSetting(1, "Scaled", ""));
m_gs_bifilter.push_back(GSSetting(static_cast<u32>(BiFiltering::Nearest), "Nearest", ""));
m_gs_bifilter.push_back(GSSetting(static_cast<u32>(BiFiltering::Forced_But_Sprite), "Bilinear", "Forced excluding sprite"));
m_gs_bifilter.push_back(GSSetting(static_cast<u32>(BiFiltering::Forced), "Bilinear", "Forced"));
m_gs_bifilter.push_back(GSSetting(static_cast<u32>(BiFiltering::PS2), "Bilinear", "PS2"));
m_gs_trifilter.push_back(GSSetting(static_cast<u32>(TriFiltering::Automatic), "Automatic", "Default"));
m_gs_trifilter.push_back(GSSetting(static_cast<u32>(TriFiltering::Off), "None", ""));
m_gs_trifilter.push_back(GSSetting(static_cast<u32>(TriFiltering::PS2), "Trilinear", ""));
m_gs_trifilter.push_back(GSSetting(static_cast<u32>(TriFiltering::Forced), "Trilinear", "Ultra/Slow"));
m_gs_texture_preloading.push_back(GSSetting(static_cast<u32>(TexturePreloadingLevel::Off), "None", ""));
m_gs_texture_preloading.push_back(GSSetting(static_cast<u32>(TexturePreloadingLevel::Partial), "Partial", ""));
m_gs_texture_preloading.push_back(GSSetting(static_cast<u32>(TexturePreloadingLevel::Full), "Full", "Hash Cache"));
m_gs_tex_display_list.push_back(GSSetting(static_cast<u32>(GSPostBilinearMode::Off), "None", ""));
m_gs_tex_display_list.push_back(GSSetting(static_cast<u32>(GSPostBilinearMode::BilinearSmooth), "Bilinear (Smooth)", ""));
m_gs_tex_display_list.push_back(GSSetting(static_cast<u32>(GSPostBilinearMode::BilinearSharp), "Bilinear (Sharp)", ""));
m_gs_generic_list.push_back(GSSetting(-1, "Automatic", "Default"));
m_gs_generic_list.push_back(GSSetting(0, "Force-Disabled", ""));
m_gs_generic_list.push_back(GSSetting(1, "Force-Enabled", ""));
m_gs_hack.push_back(GSSetting(0, "Off", "Default"));
m_gs_hack.push_back(GSSetting(1, "Half", ""));
m_gs_hack.push_back(GSSetting(2, "Full", ""));
m_gs_offset_hack.push_back(GSSetting(0, "Off", "Default"));
m_gs_offset_hack.push_back(GSSetting(1, "Normal", "Vertex"));
m_gs_offset_hack.push_back(GSSetting(2, "Special", "Texture"));
m_gs_offset_hack.push_back(GSSetting(3, "Special", "Texture - aggressive"));
m_gs_hw_mipmapping = {
GSSetting(HWMipmapLevel::Automatic, "Automatic", "Default"),
GSSetting(HWMipmapLevel::Off, "Off", ""),
GSSetting(HWMipmapLevel::Basic, "Basic", "Fast"),
GSSetting(HWMipmapLevel::Full, "Full", "Slow"),
};
m_gs_crc_level = {
GSSetting(CRCHackLevel::Automatic, "Automatic", "Default"),
GSSetting(CRCHackLevel::Off, "None", "Debug"),
GSSetting(CRCHackLevel::Minimum, "Minimum", "Debug"),
#ifdef _DEBUG
GSSetting(CRCHackLevel::Partial, "Partial", "OpenGL"),
GSSetting(CRCHackLevel::Full, "Full", "Direct3D"),
#endif
GSSetting(CRCHackLevel::Aggressive, "Aggressive", ""),
};
m_gs_acc_blend_level.push_back(GSSetting(static_cast<u32>(AccBlendLevel::Minimum), "Minimum", ""));
m_gs_acc_blend_level.push_back(GSSetting(static_cast<u32>(AccBlendLevel::Basic), "Basic", "Recommended"));
m_gs_acc_blend_level.push_back(GSSetting(static_cast<u32>(AccBlendLevel::Medium), "Medium", ""));
m_gs_acc_blend_level.push_back(GSSetting(static_cast<u32>(AccBlendLevel::High), "High", ""));
m_gs_acc_blend_level.push_back(GSSetting(static_cast<u32>(AccBlendLevel::Full), "Full", "Slow"));
m_gs_acc_blend_level.push_back(GSSetting(static_cast<u32>(AccBlendLevel::Maximum), "Maximum", "Very Slow"));
m_gs_tv_shaders.push_back(GSSetting(0, "None", "Default"));
m_gs_tv_shaders.push_back(GSSetting(1, "Scanline filter", ""));
m_gs_tv_shaders.push_back(GSSetting(2, "Diagonal filter", ""));
m_gs_tv_shaders.push_back(GSSetting(3, "Triangular filter", ""));
m_gs_tv_shaders.push_back(GSSetting(4, "Wave filter", ""));
m_gs_tv_shaders.push_back(GSSetting(5, "Lottes CRT filter", ""));
m_gs_casmode.push_back(GSSetting(static_cast<u32>(GSCASMode::Disabled), "None", "Default"));
m_gs_casmode.push_back(GSSetting(static_cast<u32>(GSCASMode::SharpenOnly), "Sharpen Only", "Internal Resolution"));
m_gs_casmode.push_back(GSSetting(static_cast<u32>(GSCASMode::SharpenAndResize), "Sharpen And Resize", "Display Resolution"));
m_gs_hw_download_mode.push_back(GSSetting(static_cast<u32>(GSHardwareDownloadMode::Enabled), "Accurate", "Recommended"));
m_gs_hw_download_mode.push_back(GSSetting(static_cast<u32>(GSHardwareDownloadMode::NoReadbacks), "Disable Readbacks", "Synchronize GS Thread"));
m_gs_hw_download_mode.push_back(GSSetting(static_cast<u32>(GSHardwareDownloadMode::Unsynchronized), "Unsynchronized", "Non-Deterministic"));
m_gs_hw_download_mode.push_back(GSSetting(static_cast<u32>(GSHardwareDownloadMode::Disabled), "Disabled", "Ignore Transfers"));
m_gs_dump_compression.push_back(GSSetting(static_cast<u32>(GSDumpCompressionMethod::Uncompressed), "Uncompressed", ""));
m_gs_dump_compression.push_back(GSSetting(static_cast<u32>(GSDumpCompressionMethod::LZMA), "LZMA (xz)", ""));
m_gs_dump_compression.push_back(GSSetting(static_cast<u32>(GSDumpCompressionMethod::Zstandard), "Zstandard (zst)", ""));
// clang-format off
// Avoid to clutter the ini file with useless options
#if defined(ENABLE_VULKAN) || defined(_WIN32)
m_default_configuration["Adapter"] = "";
#endif
#ifdef _WIN32
// Per OS option.
m_default_configuration["CaptureFileName"] = "";
m_default_configuration["CaptureVideoCodecDisplayName"] = "";
#else
m_default_configuration["linux_replay"] = "1";
#endif
m_default_configuration["accurate_blending_unit"] = std::to_string(static_cast<u8>(AccBlendLevel::Basic));
m_default_configuration["AspectRatio"] = "1";
m_default_configuration["autoflush_sw"] = "1";
m_default_configuration["capture_enabled"] = "0";
m_default_configuration["capture_out_dir"] = "/tmp/GS_Capture";
m_default_configuration["capture_threads"] = "4";
m_default_configuration["CaptureHeight"] = "480";
m_default_configuration["CaptureWidth"] = "640";
m_default_configuration["crc_hack_level"] = std::to_string(static_cast<s8>(CRCHackLevel::Automatic));
m_default_configuration["CrcHacksExclusions"] = "";
m_default_configuration["disable_shader_cache"] = "0";
m_default_configuration["DisableDualSourceBlend"] = "0";
m_default_configuration["DisableFramebufferFetch"] = "0";
m_default_configuration["dithering_ps2"] = "2";
m_default_configuration["dump"] = "0";
m_default_configuration["DumpReplaceableTextures"] = "0";
m_default_configuration["DumpReplaceableMipmaps"] = "0";
m_default_configuration["DumpTexturesWithFMVActive"] = "0";
m_default_configuration["DumpDirectTextures"] = "1";
m_default_configuration["DumpPaletteTextures"] = "1";
m_default_configuration["extrathreads"] = "2";
m_default_configuration["extrathreads_height"] = "4";
m_default_configuration["filter"] = std::to_string(static_cast<u8>(BiFiltering::PS2));
m_default_configuration["FullscreenMode"] = "";
m_default_configuration["fxaa"] = "0";
m_default_configuration["HWDownloadMode"] = std::to_string(static_cast<u8>(GSHardwareDownloadMode::Enabled));
m_default_configuration["GSDumpCompression"] = std::to_string(static_cast<u8>(GSDumpCompressionMethod::Zstandard));
m_default_configuration["HWSpinGPUForReadbacks"] = "0";
m_default_configuration["HWSpinCPUForReadbacks"] = "0";
m_default_configuration["pcrtc_antiblur"] = "1";
m_default_configuration["disable_interlace_offset"] = "0";
m_default_configuration["pcrtc_offsets"] = "0";
m_default_configuration["pcrtc_overscan"] = "0";
m_default_configuration["IntegerScaling"] = "0";
m_default_configuration["deinterlace_mode"] = std::to_string(static_cast<s8>(GSInterlaceMode::Automatic));
m_default_configuration["linear_present_mode"] = std::to_string(static_cast<s8>(GSPostBilinearMode::BilinearSmooth));
m_default_configuration["LoadTextureReplacements"] = "0";
m_default_configuration["LoadTextureReplacementsAsync"] = "1";
m_default_configuration["MaxAnisotropy"] = "0";
m_default_configuration["mipmap"] = "1";
m_default_configuration["mipmap_hw"] = std::to_string(static_cast<int>(HWMipmapLevel::Automatic));
m_default_configuration["OsdShowMessages"] = "1";
m_default_configuration["OsdShowSpeed"] = "0";
m_default_configuration["OsdShowFPS"] = "0";
m_default_configuration["OsdShowCPU"] = "0";
m_default_configuration["OsdShowGPU"] = "0";
m_default_configuration["OsdShowResolution"] = "0";
m_default_configuration["OsdShowGSStats"] = "0";
m_default_configuration["OsdShowIndicators"] = "1";
m_default_configuration["OsdShowSettings"] = "0";
m_default_configuration["OsdShowInputs"] = "0";
m_default_configuration["OsdShowFrameTimes"] = "0";
m_default_configuration["OsdScale"] = "100";
m_default_configuration["override_GL_ARB_copy_image"] = "-1";
m_default_configuration["override_GL_ARB_clip_control"] = "-1";
m_default_configuration["override_GL_ARB_direct_state_access"] = "-1";
m_default_configuration["override_GL_ARB_draw_buffers_blend"] = "-1";
m_default_configuration["override_GL_ARB_gpu_shader5"] = "-1";
m_default_configuration["override_GL_ARB_texture_barrier"] = "-1";
m_default_configuration["OverrideTextureBarriers"] = "-1";
m_default_configuration["OverrideGeometryShaders"] = "-1";
m_default_configuration["paltex"] = "0";
m_default_configuration["png_compression_level"] = std::to_string(Z_BEST_SPEED);
m_default_configuration["PointListPalette"] = "0";
m_default_configuration["PrecacheTextureReplacements"] = "0";
m_default_configuration["preload_frame_with_gs_data"] = "0";
m_default_configuration["Renderer"] = std::to_string(static_cast<int>(GSRendererType::Auto));
m_default_configuration["save"] = "0";
m_default_configuration["savef"] = "0";
m_default_configuration["savel"] = "5000";
m_default_configuration["saven"] = "0";
m_default_configuration["savet"] = "0";
m_default_configuration["savez"] = "0";
m_default_configuration["ShadeBoost"] = "0";
m_default_configuration["ShadeBoost_Brightness"] = "50";
m_default_configuration["ShadeBoost_Contrast"] = "50";
m_default_configuration["ShadeBoost_Saturation"] = "50";
m_default_configuration["SkipDuplicateFrames"] = "0";
m_default_configuration["texture_preloading"] = "2";
m_default_configuration["ThreadedPresentation"] = "0";
m_default_configuration["TriFilter"] = std::to_string(static_cast<s8>(TriFiltering::Automatic));
m_default_configuration["TVShader"] = "0";
m_default_configuration["CASMode"] = std::to_string(static_cast<u8>(GSCASMode::Disabled));
m_default_configuration["CASSharpness"] = "50";
m_default_configuration["upscale_multiplier"] = "1";
m_default_configuration["UseBlitSwapChain"] = "0";
m_default_configuration["UseDebugDevice"] = "0";
m_default_configuration["UserHacks"] = "0";
m_default_configuration["UserHacks_align_sprite_X"] = "0";
m_default_configuration["UserHacks_AutoFlush"] = "0";
m_default_configuration["UserHacks_DisableDepthSupport"] = "0";
m_default_configuration["UserHacks_Disable_Safe_Features"] = "0";
m_default_configuration["UserHacks_DisablePartialInvalidation"] = "0";
m_default_configuration["UserHacks_CPUSpriteRenderBW"] = "0";
m_default_configuration["UserHacks_CPUCLUTRender"] = "0";
m_default_configuration["UserHacks_CPU_FB_Conversion"] = "0";
m_default_configuration["UserHacks_Half_Bottom_Override"] = "-1";
m_default_configuration["UserHacks_HalfPixelOffset"] = "0";
m_default_configuration["UserHacks_merge_pp_sprite"] = "0";
m_default_configuration["UserHacks_round_sprite_offset"] = "0";
m_default_configuration["UserHacks_SkipDraw_Start"] = "0";
m_default_configuration["UserHacks_SkipDraw_End"] = "0";
m_default_configuration["UserHacks_TCOffsetX"] = "0";
m_default_configuration["UserHacks_TCOffsetY"] = "0";
m_default_configuration["UserHacks_TextureInsideRt"] = "0";
m_default_configuration["UserHacks_WildHack"] = "0";
m_default_configuration["vsync"] = "0";
// clang-format on
}
void GSApp::ReloadConfig()
{
if (m_configuration_map.empty())
return;
auto file = m_configuration_map.find("inifile");
if (file == m_configuration_map.end())
return;
// A map was built so reload it
std::string filename = file->second;
m_configuration_map.clear();
BuildConfigurationMap(filename.c_str());
}
void GSApp::BuildConfigurationMap(const char* lpFileName)
{
// Check if the map was already built
std::string inifile_value(lpFileName);
if (inifile_value.compare(m_configuration_map["inifile"]) == 0)
return;
m_configuration_map["inifile"] = inifile_value;
// Load config from file
#ifdef _WIN32
std::ifstream file(StringUtil::UTF8StringToWideString(lpFileName));
#else
std::ifstream file(lpFileName);
#endif
if (!file.is_open())
return;
std::string line;
while (std::getline(file, line))
{
const auto separator = line.find('=');
if (separator == std::string::npos)
continue;
std::string key = line.substr(0, separator);
// Trim trailing whitespace
key.erase(key.find_last_not_of(" \r\t") + 1);
if (key.empty())
continue;
// Only keep options that have a default value so older, no longer used
// ini options can be purged.
if (m_default_configuration.find(key) == m_default_configuration.end())
continue;
std::string value = line.substr(separator + 1);
// Trim leading whitespace
value.erase(0, value.find_first_not_of(" \r\t"));
m_configuration_map[key] = value;
}
}
void GSApp::SetConfigDir()
{
// we need to initialize the ini folder later at runtime than at theApp init, as
// core settings aren't populated yet, thus we do populate it if needed either when
// opening GS settings or init -- govanify
m_ini = Path::Combine(EmuFolders::Settings, "GS.ini");
}
std::string GSApp::GetConfigS(const char* entry)
{
char buff[4096] = {0};
auto def = m_default_configuration.find(entry);
if (def != m_default_configuration.end())
{
GetIniString(m_section.c_str(), entry, def->second.c_str(), buff, std::size(buff), m_ini.c_str());
}
else
{
fprintf(stderr, "Option %s doesn't have a default value\n", entry);
GetIniString(m_section.c_str(), entry, "", buff, std::size(buff), m_ini.c_str());
}
return {buff};
}
void GSApp::SetConfig(const char* entry, const char* value)
{
WriteIniString(m_section.c_str(), entry, value, m_ini.c_str());
}
int GSApp::GetConfigI(const char* entry)
{
auto def = m_default_configuration.find(entry);
if (def != m_default_configuration.end())
{
return GetIniInt(m_section.c_str(), entry, std::stoi(def->second), m_ini.c_str());
}
else
{
fprintf(stderr, "Option %s doesn't have a default value\n", entry);
return GetIniInt(m_section.c_str(), entry, 0, m_ini.c_str());
}
}
bool GSApp::GetConfigB(const char* entry)
{
return !!GetConfigI(entry);
}
void GSApp::SetConfig(const char* entry, int value)
{
char buff[32] = {0};
sprintf(buff, "%d", value);
SetConfig(entry, buff);
}
#endif // PCSX2_CORE
#ifdef PCSX2_CORE
static void HotkeyAdjustUpscaleMultiplier(s32 delta)
{
const u32 new_multiplier = static_cast<u32>(std::clamp(static_cast<s32>(EmuConfig.GS.UpscaleMultiplier) + delta, 1, 8));
@ -1639,5 +1074,3 @@ BEGIN_HOTKEY_LIST(g_gs_hotkeys)
}
}},
END_HOTKEY_LIST()
#endif

View File

@ -23,15 +23,6 @@
#include <map>
#ifndef PCSX2_CORE
#include "Window/GSSetting.h"
#endif
#ifdef None
// X11 seems to like to define this, not fun
#undef None
#endif
// ST_WRITE is defined in libc, avoid this
enum stateType
{
@ -53,11 +44,9 @@ enum class GSVideoMode : u8
extern Pcsx2Config::GSOptions GSConfig;
struct HostKeyEvent;
class HostDisplay;
int GSinit();
void GSinitConfig();
void GSshutdown();
bool GSopen(const Pcsx2Config::GSOptions& config, GSRendererType renderer, u8* basemem);
bool GSreopen(bool recreate_display, const Pcsx2Config::GSOptions& old_config);
@ -80,11 +69,6 @@ bool GSBeginCapture(std::string filename);
void GSEndCapture();
void GSPresentCurrentFrame();
void GSThrottlePresentation();
#ifndef PCSX2_CORE
void GSkeyEvent(const HostKeyEvent& e);
void GSconfigure();
int GStest();
#endif
void GSsetGameCRC(u32 crc, int options);
GSVideoMode GSgetDisplayMode();
@ -104,68 +88,6 @@ bool GSSaveSnapshotToMemory(u32 window_width, u32 window_height, bool apply_aspe
u32* width, u32* height, std::vector<u32>* pixels);
void GSJoinSnapshotThreads();
#ifndef PCSX2_CORE
class GSApp
{
std::string m_section;
std::map<std::string, std::string> m_default_configuration;
std::map<std::string, std::string> m_configuration_map;
public:
std::string m_ini;
GSApp();
void Init();
#ifndef PCSX2_CORE
void BuildConfigurationMap(const char* lpFileName);
void ReloadConfig();
int GetIniInt(const char* lpAppName, const char* lpKeyName, int nDefault, const char* lpFileName);
#endif
size_t GetIniString(const char* lpAppName, const char* lpKeyName, const char* lpDefault, char* lpReturnedString, size_t nSize, const char* lpFileName);
bool WriteIniString(const char* lpAppName, const char* lpKeyName, const char* pString, const char* lpFileName);
void SetConfig(const char* entry, const char* value);
void SetConfig(const char* entry, int value);
// Avoid issue with overloading
template <typename T>
T GetConfigT(const char* entry)
{
return static_cast<T>(GetConfigI(entry));
}
int GetConfigI(const char* entry);
bool GetConfigB(const char* entry);
std::string GetConfigS(const char* entry);
void SetConfigDir();
std::vector<GSSetting> m_gs_renderers;
std::vector<GSSetting> m_gs_deinterlace;
std::vector<GSSetting> m_gs_upscale_multiplier;
std::vector<GSSetting> m_gs_max_anisotropy;
std::vector<GSSetting> m_gs_dithering;
std::vector<GSSetting> m_gs_bifilter;
std::vector<GSSetting> m_gs_trifilter;
std::vector<GSSetting> m_gs_texture_preloading;
std::vector<GSSetting> m_gs_hack;
std::vector<GSSetting> m_gs_generic_list;
std::vector<GSSetting> m_gs_tex_display_list;
std::vector<GSSetting> m_gs_offset_hack;
std::vector<GSSetting> m_gs_hw_mipmapping;
std::vector<GSSetting> m_gs_crc_level;
std::vector<GSSetting> m_gs_acc_blend_level;
std::vector<GSSetting> m_gs_tv_shaders;
std::vector<GSSetting> m_gs_casmode;
std::vector<GSSetting> m_gs_hw_download_mode;
std::vector<GSSetting> m_gs_dump_compression;
};
extern GSApp theApp;
#endif
struct GSError
{
};

View File

@ -17,11 +17,8 @@
#include "GSCrc.h"
#include "GSExtra.h"
#include "GS.h"
#include "common/StringUtil.h"
#ifdef PCSX2_CORE
#include "HostSettings.h"
#endif
#include "common/StringUtil.h"
const CRC::Game CRC::m_games[] =
{
@ -341,11 +338,7 @@ const CRC::Game& CRC::Lookup(u32 crc)
printf("GS Lookup CRC:%08X\n", crc);
if (m_map.empty())
{
#ifndef PCSX2_CORE
std::string exclusions = theApp.GetConfigS("CrcHacksExclusions");
#else
std::string exclusions = Host::GetStringSettingValue("EmuCore/GS", "CrcHacksExclusions");
#endif
if (exclusions.length() != 0)
printf("GS: CrcHacksExclusions: %s\n", exclusions.c_str());
int crcDups = 0;

View File

@ -137,12 +137,7 @@ std::string GSState::GetDrawDumpPath(const char* format, ...)
{
std::va_list ap;
va_start(ap, format);
#ifdef PCSX2_CORE
const std::string& base = GSConfig.UseHardwareRenderer() ? GSConfig.HWDumpDirectory : GSConfig.SWDumpDirectory;
#else
// Buzz off wx
const char* base = GSConfig.UseHardwareRenderer() ? "C:\\temp2" : "C:\\temp1";
#endif
std::string ret(Path::Combine(base, StringUtil::StdStringFromFormatV(format, ap)));
va_end(ap);
return ret;

View File

@ -21,13 +21,12 @@
#include "common/StringUtil.h"
#ifdef _WIN32
#include "common/RedtapeWindows.h"
#include <d3dcommon.h>
#include <dxgi.h>
#include <VersionHelpers.h>
#include "svnrev.h"
#include "Renderers/DX11/D3D.h"
#include <wil/com.h>
#else
#define SVN_REV 0
#define SVN_MODS 0
#endif
static class GSUtilMaps
@ -146,34 +145,6 @@ bool GSUtil::HasCompatibleBits(u32 spsm, u32 dpsm)
return (s_maps.CompatibleBitsField[spsm][dpsm >> 5] & (1 << (dpsm & 0x1f))) != 0;
}
bool GSUtil::CheckSSE()
{
struct ISA
{
ProcessorFeatures::VectorISA isa;
const char* name;
};
ISA checks[] = {
{ProcessorFeatures::VectorISA::SSE4, "SSE 4.1"},
#if _M_SSE >= 0x500
{ProcessorFeatures::VectorISA::AVX, "AVX"},
#endif
#if _M_SSE >= 0x501
{ProcessorFeatures::VectorISA::AVX2, "AVX2"},
#endif
};
for (const ISA& check : checks)
{
if (g_cpu.vectorISA < check.isa)
{
Console.Error("This CPU does not support %s", check.name);
return false;
}
}
return true;
}
CRCHackLevel GSUtil::GetRecommendedCRCHackLevel(GSRendererType type)
{
return (type == GSRendererType::DX11 || type == GSRendererType::DX12) ? CRCHackLevel::Full : CRCHackLevel::Partial;

View File

@ -17,10 +17,6 @@
#include "GS.h"
#include "GSRegs.h"
#ifdef _WIN32
#include <d3dcommon.h>
#include <dxgi.h>
#endif
class GSUtil
{
@ -37,7 +33,6 @@ public:
static bool HasSharedBits(u32 sbp, u32 spsm, u32 dbp, u32 dpsm);
static bool HasCompatibleBits(u32 spsm, u32 dpsm);
static bool CheckSSE();
static CRCHackLevel GetRecommendedCRCHackLevel(GSRendererType type);
static GSRendererType GetPreferredRenderer();
};

View File

@ -563,34 +563,6 @@ void GSDevice::CAS(GSTexture*& tex, GSVector4i& src_rect, GSVector4& src_uv, con
src_uv = GSVector4(0.0f, 0.0f, 1.0f, 1.0f);
}
GSAdapter::operator std::string() const
{
char buf[sizeof "12345678:12345678:12345678:12345678"];
sprintf(buf, "%.4X:%.4X:%.8X:%.2X", vendor, device, subsys, rev);
return buf;
}
bool GSAdapter::operator==(const GSAdapter& desc_dxgi) const
{
return vendor == desc_dxgi.vendor
&& device == desc_dxgi.device
&& subsys == desc_dxgi.subsys
&& rev == desc_dxgi.rev;
}
#ifdef _WIN32
GSAdapter::GSAdapter(const DXGI_ADAPTER_DESC1& desc_dxgi)
: vendor(desc_dxgi.VendorId)
, device(desc_dxgi.DeviceId)
, subsys(desc_dxgi.SubSysId)
, rev(desc_dxgi.Revision)
{
}
#endif
#ifdef __linux__
// TODO
#endif
// clang-format off
const std::array<u8, 16> GSDevice::m_replaceDualSrcBlendMap =

View File

@ -23,9 +23,6 @@
#include "GS/GSAlignedClass.h"
#include "GS/GSExtra.h"
#include <array>
#ifdef _WIN32
#include <dxgi.h>
#endif
class HostDisplay;
@ -901,32 +898,6 @@ public:
GSHWDrawConfig::DepthStencilSelector* dss);
};
struct GSAdapter
{
u32 vendor;
u32 device;
u32 subsys;
u32 rev;
operator std::string() const;
bool operator==(const GSAdapter&) const;
bool operator==(const std::string& s) const
{
return (std::string)*this == s;
}
bool operator==(const char* s) const
{
return (std::string)*this == s;
}
#ifdef _WIN32
GSAdapter(const DXGI_ADAPTER_DESC1& desc_dxgi);
#endif
#ifdef __linux__
// TODO
#endif
};
template <>
struct std::hash<GSHWDrawConfig::PSSelector> : public GSHWDrawConfig::PSSelectorHash {};

View File

@ -22,46 +22,19 @@
#include "PerformanceMetrics.h"
#include "pcsx2/Config.h"
#include "IconsFontAwesome5.h"
#include "VMManager.h"
#include "common/FileSystem.h"
#include "common/Image.h"
#include "common/Path.h"
#include "common/StringUtil.h"
#include "common/Timer.h"
#include "fmt/core.h"
#include <algorithm>
#include <array>
#include <deque>
#include <thread>
#include <mutex>
#ifndef PCSX2_CORE
#include "gui/AppCoreThread.h"
#if defined(__unix__)
#include <X11/keysym.h>
#elif defined(__APPLE__)
#include <Carbon/Carbon.h>
#endif
static std::string GetDumpName()
{
return StringUtil::wxStringToUTF8String(GameInfo::gameName);
}
static std::string GetDumpSerial()
{
return StringUtil::wxStringToUTF8String(GameInfo::gameSerial);
}
#else
#include "VMManager.h"
static std::string GetDumpName()
{
return VMManager::GetGameName();
}
static std::string GetDumpSerial()
{
return VMManager::GetGameSerial();
}
#endif
static constexpr std::array<PresentShader, 6> s_tv_shader_indices = {
PresentShader::COPY, PresentShader::SCANLINE,
PresentShader::DIAGONAL_FILTER, PresentShader::TRIANGULAR_FILTER,
@ -737,11 +710,6 @@ void GSRenderer::VSync(u32 field, bool registers_written)
PerformanceMetrics::Update(registers_written, fb_sprite_frame, false);
// snapshot
// wx is dumb and call this from the UI thread...
#ifndef PCSX2_CORE
std::unique_lock snapshot_lock(m_snapshot_mutex);
#endif
if (!m_snapshot.empty())
{
u32 screenshot_width, screenshot_height;
@ -763,7 +731,7 @@ void GSRenderer::VSync(u32 field, bool registers_written)
std::string_view compression_str;
if (GSConfig.GSDumpCompression == GSDumpCompressionMethod::Uncompressed)
{
m_dump = std::unique_ptr<GSDumpBase>(new GSDumpUncompressed(m_snapshot, GetDumpSerial(), m_crc,
m_dump = std::unique_ptr<GSDumpBase>(new GSDumpUncompressed(m_snapshot, VMManager::GetGameSerial(), m_crc,
screenshot_width, screenshot_height,
screenshot_pixels.empty() ? nullptr : screenshot_pixels.data(),
fd, m_regs));
@ -771,7 +739,7 @@ void GSRenderer::VSync(u32 field, bool registers_written)
}
else if (GSConfig.GSDumpCompression == GSDumpCompressionMethod::LZMA)
{
m_dump = std::unique_ptr<GSDumpBase>(new GSDumpXz(m_snapshot, GetDumpSerial(), m_crc,
m_dump = std::unique_ptr<GSDumpBase>(new GSDumpXz(m_snapshot, VMManager::GetGameSerial(), m_crc,
screenshot_width, screenshot_height,
screenshot_pixels.empty() ? nullptr : screenshot_pixels.data(),
fd, m_regs));
@ -779,7 +747,7 @@ void GSRenderer::VSync(u32 field, bool registers_written)
}
else
{
m_dump = std::unique_ptr<GSDumpBase>(new GSDumpZst(m_snapshot, GetDumpSerial(), m_crc,
m_dump = std::unique_ptr<GSDumpBase>(new GSDumpZst(m_snapshot, VMManager::GetGameSerial(), m_crc,
screenshot_width, screenshot_height,
screenshot_pixels.empty() ? nullptr : screenshot_pixels.data(),
fd, m_regs));
@ -865,9 +833,7 @@ void GSRenderer::QueueSnapshot(const std::string& path, u32 gsdump_frames)
}
// this is really gross, but wx we get the snapshot request after shift...
#ifdef PCSX2_CORE
m_dump_frames = gsdump_frames;
#endif
}
std::string GSGetBaseSnapshotFilename()
@ -875,14 +841,14 @@ std::string GSGetBaseSnapshotFilename()
std::string filename;
// append the game serial and title
if (std::string name(GetDumpName()); !name.empty())
if (std::string name(VMManager::GetGameName()); !name.empty())
{
Path::SanitizeFileName(&name);
if (name.length() > 219)
name.resize(219);
filename += name;
}
if (std::string serial(GetDumpSerial()); !serial.empty())
if (std::string serial(VMManager::GetGameSerial()); !serial.empty())
{
Path::SanitizeFileName(&serial);
filename += '_';
@ -979,82 +945,6 @@ void GSRenderer::EndCapture()
GSCapture::EndCapture();
}
#ifndef PCSX2_CORE
void GSRenderer::KeyEvent(const HostKeyEvent& e)
{
#ifdef _WIN32
m_shift_key = !!(::GetAsyncKeyState(VK_SHIFT) & 0x8000);
m_control_key = !!(::GetAsyncKeyState(VK_CONTROL) & 0x8000);
#elif defined(__APPLE__)
m_shift_key = CGEventSourceKeyState(kCGEventSourceStateHIDSystemState, kVK_Shift)
|| CGEventSourceKeyState(kCGEventSourceStateHIDSystemState, kVK_RightShift);
m_control_key = CGEventSourceKeyState(kCGEventSourceStateHIDSystemState, kVK_Control)
|| CGEventSourceKeyState(kCGEventSourceStateHIDSystemState, kVK_RightControl)
|| CGEventSourceKeyState(kCGEventSourceStateHIDSystemState, kVK_Command)
|| CGEventSourceKeyState(kCGEventSourceStateHIDSystemState, kVK_RightCommand);
#else
switch (e.key)
{
case XK_Shift_L:
case XK_Shift_R:
m_shift_key = (e.type == HostKeyEvent::Type::KeyPressed);
return;
case XK_Control_L:
case XK_Control_R:
m_control_key = (e.type == HostKeyEvent::Type::KeyReleased);
return;
}
#endif
if (m_dump_frames == 0)
{
// start dumping
if (m_shift_key)
m_dump_frames = m_control_key ? std::numeric_limits<u32>::max() : 1;
}
else
{
// stop dumping
if (m_dump && !m_control_key)
m_dump_frames = 0;
}
if (e.type == HostKeyEvent::Type::KeyPressed)
{
int step = m_shift_key ? -1 : 1;
#if defined(__unix__)
#define VK_F5 XK_F5
#define VK_DELETE XK_Delete
#define VK_NEXT XK_Next
#elif defined(__APPLE__)
#define VK_F5 kVK_F5
#define VK_DELETE kVK_ForwardDelete
#define VK_NEXT kVK_PageDown
#endif
// NOTE: These are all BROKEN! They mess with GS thread state from the UI thread.
switch (e.key)
{
case VK_F5:
GSConfig.InterlaceMode = static_cast<GSInterlaceMode>((static_cast<int>(GSConfig.InterlaceMode) + static_cast<int>(GSInterlaceMode::Count) + step) % static_cast<int>(GSInterlaceMode::Count));
theApp.SetConfig("deinterlace_mode", static_cast<int>(GSConfig.InterlaceMode));
printf("GS: Set deinterlace mode to %d (%s).\n", static_cast<int>(GSConfig.InterlaceMode), theApp.m_gs_deinterlace.at(static_cast<int>(GSConfig.InterlaceMode)).name.c_str());
return;
case VK_NEXT: // As requested by Prafull, to be removed later
char dither_msg[3][16] = {"disabled", "auto", "auto unscaled"};
GSConfig.Dithering = (GSConfig.Dithering + 1) % 3;
printf("GS: Dithering is now %s.\n", dither_msg[GSConfig.Dithering]);
return;
}
}
}
#endif // PCSX2_CORE
void GSRenderer::PurgePool()
{
g_gs_device->PurgePool();

View File

@ -19,12 +19,6 @@
#include <memory>
#include <string>
#ifndef PCSX2_CORE
#include <mutex>
#endif
struct HostKeyEvent;
class GSRenderer : public GSState
{
private:
@ -32,11 +26,6 @@ private:
u64 m_shader_time_start = 0;
#ifndef PCSX2_CORE
std::mutex m_snapshot_mutex;
bool m_shift_key = false;
bool m_control_key = false;
#endif
std::string m_snapshot;
u32 m_dump_frames = 0;
u32 m_skipped_duplicate_frames = 0;
@ -74,9 +63,6 @@ public:
bool BeginCapture(std::string filename);
void EndCapture();
#ifndef PCSX2_CORE
void KeyEvent(const HostKeyEvent& e);
#endif
};
extern std::unique_ptr<GSRenderer> g_gs_renderer;

View File

@ -15,6 +15,8 @@
#pragma once
#include "common/RedtapeWindows.h"
#include <dxgi1_3.h>
#include <vector>
#include <string>

View File

@ -27,12 +27,7 @@
#include "IconsFontAwesome5.h"
#include "GS/GSLocalMemory.h"
#include "GS/Renderers/HW/GSTextureReplacements.h"
#ifndef PCSX2_CORE
#include "gui/AppCoreThread.h"
#else
#include "VMManager.h"
#endif
#include <cinttypes>
#include <cstring>
@ -115,7 +110,6 @@ namespace GSTextureReplacements
static std::optional<TextureName> ParseReplacementName(const std::string& filename);
static std::string GetGameTextureDirectory();
static std::string GetDumpFilename(const TextureName& name, u32 level);
static std::string GetGameSerial();
static std::optional<ReplacementTexture> LoadReplacementTexture(const TextureName& name, const std::string& filename, bool only_base_image);
static void QueueAsyncReplacementTextureLoad(const TextureName& name, const std::string& filename, bool mipmap);
static void PrecacheReplacementTextures();
@ -255,19 +249,10 @@ std::string GSTextureReplacements::GetDumpFilename(const TextureName& name, u32
return ret;
}
std::string GSTextureReplacements::GetGameSerial()
{
#ifndef PCSX2_CORE
return StringUtil::wxStringToUTF8String(GameInfo::gameSerial);
#else
return VMManager::GetGameSerial();
#endif
}
void GSTextureReplacements::Initialize(GSTextureCache* tc)
{
s_tc = tc;
s_current_serial = GetGameSerial();
s_current_serial = VMManager::GetGameSerial();
if (GSConfig.DumpReplaceableTextures || GSConfig.LoadTextureReplacements)
StartWorkerThread();
@ -280,7 +265,7 @@ void GSTextureReplacements::GameChanged()
if (!s_tc)
return;
std::string new_serial(GetGameSerial());
std::string new_serial(VMManager::GetGameSerial());
if (s_current_serial == new_serial)
return;

View File

@ -19,6 +19,10 @@
#include "GS/Renderers/Common/GSFunctionMap.h"
#include "GS/GSUtil.h"
#include "GS/MultiISA.h"
#ifdef _WIN32
#include "common/RedtapeWindows.h"
#endif
#include <xbyak/xbyak.h>
#if defined(_M_AMD64) || defined(_WIN64)

View File

@ -21,10 +21,7 @@
#include "PerformanceMetrics.h"
#include "common/AlignedMalloc.h"
#include "common/StringUtil.h"
#ifdef PCSX2_CORE
#include "VMManager.h"
#endif
#define ENABLE_DRAW_STATS 0
@ -1185,7 +1182,6 @@ void GSRasterizerList::OnWorkerStartup(int i)
Threading::ThreadHandle handle(Threading::ThreadHandle::GetForCallingThread());
#ifdef PCSX2_CORE
if (EmuConfig.Cpu.AffinityControlMode != 0)
{
const std::vector<u32>& procs = VMManager::GetSortedProcessorList();
@ -1198,7 +1194,6 @@ void GSRasterizerList::OnWorkerStartup(int i)
handle.SetAffinity(affinity);
}
}
#endif
PerformanceMetrics::SetGSSWThread(i, std::move(handle));
}

View File

@ -18,6 +18,10 @@
#include "GSScanlineEnvironment.h"
#include "GS/GSUtil.h"
#include "GS/MultiISA.h"
#ifdef _WIN32
#include "common/RedtapeWindows.h"
#endif
#include <xbyak/xbyak.h>
MULTI_ISA_UNSHARED_START

View File

@ -671,7 +671,6 @@ u32 GameDatabaseSchema::GameEntry::applyGSHardwareFixes(Pcsx2Config::GSOptions&
// fixup skipdraw range just in case the db has a bad range (but the linter should catch this)
config.SkipDrawEnd = std::max(config.SkipDrawStart, config.SkipDrawEnd);
#ifdef PCSX2_CORE
if (!disabled_fixes.empty())
{
Host::AddKeyedOSDMessage("HWFixesWarning",
@ -683,7 +682,6 @@ u32 GameDatabaseSchema::GameEntry::applyGSHardwareFixes(Pcsx2Config::GSOptions&
{
Host::RemoveKeyedOSDMessage("HWFixesWarning");
}
#endif
return num_applied_fixes;
}

View File

@ -24,28 +24,6 @@
#include <optional>
#include <vector>
#ifndef PCSX2_CORE
struct HostKeyEvent
{
enum class Type
{
NoEvent,
KeyPressed,
KeyReleased,
MousePressed,
MouseReleased,
MouseWheelDown,
MouseWheelUp,
MouseMove,
FocusGained,
FocustLost,
};
Type type;
u32 key;
};
#endif
namespace Host
{
/// Typical durations for OSD messages.

View File

@ -16,10 +16,7 @@
#include "PrecompiledHeader.h"
#include "HostDisplay.h"
#ifdef PCSX2_CORE
#include "VMManager.h"
#endif
#include "common/Assertions.h"
#include "common/Console.h"
@ -136,11 +133,7 @@ std::string HostDisplay::GetFullscreenModeString(u32 width, u32 height, float re
VsyncMode Host::GetEffectiveVSyncMode()
{
#ifdef PCSX2_CORE
const bool has_vm = VMManager::GetState() != VMState::Shutdown;
#else
const bool has_vm = false;
#endif
// Force vsync off when not running at 100% speed.
if (has_vm && EmuConfig.GS.LimitScalar != 1.0f)

View File

@ -20,12 +20,7 @@
#include "newVif.h"
#include "Gif_Unit.h"
#include "SPU2/spu2.h"
#ifdef PCSX2_CORE
#include "USB/USB.h"
#else
#include "USB/USBNull.h"
#endif
#include "fmt/core.h"

View File

@ -19,11 +19,7 @@
#include "R5900OpcodeTables.h"
#include "R5900Exceptions.h"
#ifndef PCSX2_CORE
#include "gui/SysThreads.h"
#else
#include "VMManager.h"
#endif
#include "Elfheader.h"
@ -58,11 +54,7 @@ void intBreakpoint(bool memcheck)
}
CBreakPoints::SetBreakpointTriggered(true);
#ifndef PCSX2_CORE
GetCoreThread().PauseSelfDebug();
#else
VMManager::SetPaused(true);
#endif
throw Exception::ExitCpuExecute();
}

View File

@ -24,11 +24,7 @@
#include "Common.h"
#include "SPU2/spu2.h"
#include "DEV9/DEV9.h"
#ifdef PCSX2_CORE
#include "USB/USB.h"
#else
#include "USB/USBNull.h"
#endif
#include "IopHw.h"
#include "IopDma.h"
#include "CDVD/CDVD.h"

View File

@ -15,11 +15,7 @@
#include "PrecompiledHeader.h"
#include "DEV9/DEV9.h"
#ifdef PCSX2_CORE
#include "USB/USB.h"
#else
#include "USB/USBNull.h"
#endif
#include "IopHw.h"
#include "IopDma.h"
#include "Common.h"

View File

@ -29,12 +29,7 @@
#include "Host.h"
#include "HostDisplay.h"
#include "IconsFontAwesome5.h"
#ifndef PCSX2_CORE
#include "gui/Dialogs/ModalPopups.h"
#else
#include "VMManager.h"
#endif
// Uncomment this to enable profiling of the GS RingBufferCopy function.
//#define PCSX2_GSRING_SAMPLING_STATS
@ -298,7 +293,6 @@ void SysMtgsThread::MainLoop()
while (true)
{
#ifdef PCSX2_CORE
if (m_run_idle_flag.load(std::memory_order_acquire) && VMManager::GetState() != VMState::Running)
{
if (!m_sem_event.CheckForWork())
@ -313,11 +307,6 @@ void SysMtgsThread::MainLoop()
m_sem_event.WaitForWork();
mtvu_lock.lock();
}
#else
mtvu_lock.unlock();
m_sem_event.WaitForWork();
mtvu_lock.lock();
#endif
if (!m_open_flag.load(std::memory_order_acquire))
break;
@ -592,10 +581,6 @@ void SysMtgsThread::MainLoop()
void SysMtgsThread::CloseGS()
{
#ifndef PCSX2_CORE
if (GSDump::isRunning)
return;
#endif
GSclose();
}
@ -890,11 +875,6 @@ bool SysMtgsThread::WaitForOpen()
if (!result)
Console.Error("GS failed to open.");
#ifndef PCSX2_CORE
if (!result) // EE thread will continue running and explode everything if we don't throw an exception
throw Exception::RuntimeError(std::runtime_error("GS failed to open."));
#endif
return result;
}
@ -953,11 +933,9 @@ void SysMtgsThread::ResizeDisplayWindow(int width, int height, float scale)
Host::ResizeHostDisplay(width, height, scale);
GSRestoreAPIState();
#ifdef PCSX2_CORE
// If we're paused, re-present the current frame at the new window size.
if (VMManager::GetState() == VMState::Paused)
GSPresentCurrentFrame();
#endif
});
}
@ -969,11 +947,9 @@ void SysMtgsThread::UpdateDisplayWindow()
Host::UpdateHostDisplay();
GSRestoreAPIState();
#ifdef PCSX2_CORE
// If we're paused, re-present the current frame at the new window size.
if (VMManager::GetState() == VMState::Paused)
GSPresentCurrentFrame();
#endif
});
}

View File

@ -49,9 +49,7 @@ BIOS
#include "common/AlignedMalloc.h"
#include "common/PageFaultSource.h"
#ifdef PCSX2_CORE
#include "GSDumpReplayer.h"
#endif
#ifdef ENABLECACHE
#include "Cache.h"
@ -858,11 +856,7 @@ void eeMemoryReserve::Reset()
vtlb_VMap(0x00000000,0x00000000,0x20000000);
vtlb_VMapUnmap(0x20000000,0x60000000);
#ifdef PCSX2_CORE
const bool needs_bios = !GSDumpReplayer::IsReplayingDump();
#else
constexpr bool needs_bios = true;
#endif
// TODO(Stenzek): Move BIOS loading out and far away...
if (needs_bios && !LoadBIOS())

View File

@ -31,12 +31,3 @@ void PADconfigure();
s32 PADfreeze(FreezeAction mode, freezeData* data);
s32 PADsetSlot(u8 port, u8 slot);
#ifndef PCSX2_CORE
HostKeyEvent* PADkeyEvent();
#if defined(__unix__) || defined(__APPLE__)
void PADWriteEvent(HostKeyEvent& evt);
#endif
#endif

View File

@ -15,7 +15,7 @@
#include "PrecompiledHeader.h"
#ifndef PCSX2_CORE
#ifdef PCSX2_LEFTOVER_FROM_WX
#include <stdio.h>
#include <stdlib.h>

View File

@ -18,7 +18,7 @@
#pragma once
#ifndef PCSX2_CORE
#ifdef PCSX2_LEFTOVER_FROM_WX
// PINE uses a concept of "slot" to be able to communicate with multiple
// emulators at the same time, each slot should be unique to each emulator to

View File

@ -126,11 +126,6 @@ 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.
// extern int AddPatch(int Mode, int Place, int Address, int Size, u64 data);

View File

@ -25,14 +25,7 @@
#include "HostDisplay.h"
#include "CDVD/CDVDcommon.h"
#include "MemoryCardFile.h"
#ifdef PCSX2_CORE
#include "USB/USB.h"
#else
#include "USB/USBNull.h"
#include "gui/AppConfig.h"
#include "GS/GS.h"
#endif
const char* SettingInfo::StringDefaultValue() const
{
@ -542,8 +535,6 @@ void Pcsx2Config::GSOptions::LoadSave(SettingsWrapper& wrap)
SettingsWrapEntry(FramerateNTSC);
SettingsWrapEntry(FrameratePAL);
#ifdef PCSX2_CORE
// These are loaded from GSWindow in wx.
SettingsWrapBitBool(SyncToHostRefreshRate);
SettingsWrapEnumEx(AspectRatio, "AspectRatio", AspectRatioNames);
SettingsWrapEnumEx(FMVAspectRatioSwitch, "FMVAspectRatioSwitch", FMVAspectRatioSwitchNames);
@ -555,20 +546,6 @@ void Pcsx2Config::GSOptions::LoadSave(SettingsWrapper& wrap)
SettingsWrapEntryEx(Crop[1], "CropTop");
SettingsWrapEntryEx(Crop[2], "CropRight");
SettingsWrapEntryEx(Crop[3], "CropBottom");
#endif
#ifndef PCSX2_CORE
if (wrap.IsLoading())
ReloadIniSettings();
#else
LoadSaveIniSettings(wrap);
#endif
}
#ifdef PCSX2_CORE
void Pcsx2Config::GSOptions::LoadSaveIniSettings(SettingsWrapper& wrap)
{
SettingsWrapSection("EmuCore/GS");
#define GSSettingInt(var) SettingsWrapBitfield(var)
#define GSSettingIntEx(var, name) SettingsWrapBitfieldEx(var, name)
@ -579,22 +556,6 @@ void Pcsx2Config::GSOptions::LoadSaveIniSettings(SettingsWrapper& wrap)
#define GSSettingIntEnumEx(var, name) SettingsWrapIntEnumEx(var, name)
#define GSSettingString(var) SettingsWrapEntry(var)
#define GSSettingStringEx(var, name) SettingsWrapEntryEx(var, name)
#else
void Pcsx2Config::GSOptions::ReloadIniSettings()
{
// ensure theApp is loaded.
GSinitConfig();
#define GSSettingInt(var) var = theApp.GetConfigI(#var)
#define GSSettingIntEx(var, name) var = theApp.GetConfigI(name)
#define GSSettingBool(var) var = theApp.GetConfigB(#var)
#define GSSettingBoolEx(var, name) var = theApp.GetConfigB(name)
#define GSSettingFloat(var) var = static_cast<float>(theApp.GetConfigI(#var))
#define GSSettingFloatEx(var, name) var = static_cast<float>(theApp.GetConfigI(name))
#define GSSettingIntEnumEx(var, name) var = static_cast<decltype(var)>(theApp.GetConfigI(name))
#define GSSettingString(var) var = theApp.GetConfigS(#var)
#define GSSettingStringEx(var, name) var = theApp.GetConfigS(name)
#endif
// Unfortunately, because code in the GS still reads the setting by key instead of
// using these variables, we need to use the old names. Maybe post 2.0 we can change this.
@ -723,7 +684,6 @@ void Pcsx2Config::GSOptions::ReloadIniSettings()
#undef GSSettingString
#undef GSSettingStringEx
#ifdef PCSX2_CORE
// Sanity check: don't dump a bunch of crap in the current working directory.
const std::string& dump_dir = UseHardwareRenderer() ? HWDumpDirectory : SWDumpDirectory;
if (DumpGSData && dump_dir.empty())
@ -731,7 +691,6 @@ void Pcsx2Config::GSOptions::ReloadIniSettings()
Console.Error("Draw dumping is enabled but directory is unconfigured, please set one.");
DumpGSData = false;
}
#endif
}
void Pcsx2Config::GSOptions::MaskUserHacks()
@ -879,7 +838,6 @@ void Pcsx2Config::DEV9Options::LoadSave(SettingsWrapper& wrap)
SettingsWrapEnumEx(ModeDNS2, "ModeDNS2", DnsModeNames);
}
#ifdef PCSX2_CORE
if (wrap.IsLoading())
EthHosts.clear();
@ -918,7 +876,6 @@ void Pcsx2Config::DEV9Options::LoadSave(SettingsWrapper& wrap)
Console.WriteLn("DEV9: Host entry %i: url %s mapped to %s", i, entry.Url.c_str(), addrStr.c_str());
}
}
#endif
{
SettingsWrapSection("DEV9/Hdd");
@ -1116,8 +1073,6 @@ void Pcsx2Config::FramerateOptions::LoadSave(SettingsWrapper& wrap)
SettingsWrapEntry(SlomoScalar);
}
#ifdef PCSX2_CORE
Pcsx2Config::USBOptions::USBOptions()
{
for (u32 i = 0; i < static_cast<u32>(Ports.size()); i++)
@ -1173,8 +1128,6 @@ bool Pcsx2Config::USBOptions::operator!=(const USBOptions& right) const
return !this->operator==(right);
}
#endif
#ifdef ENABLE_ACHIEVEMENTS
Pcsx2Config::AchievementsOptions::AchievementsOptions()
@ -1215,10 +1168,8 @@ Pcsx2Config::Pcsx2Config()
McdFolderAutoManage = true;
EnablePatches = true;
EnableRecordingTools = true;
#ifdef PCSX2_CORE
EnableGameFixes = true;
InhibitScreensaver = true;
#endif
BackupSavestate = true;
SavestateZstdCompression = true;
@ -1259,12 +1210,10 @@ void Pcsx2Config::LoadSave(SettingsWrapper& wrap)
SettingsWrapBitBool(EnableWideScreenPatches);
SettingsWrapBitBool(EnableNoInterlacingPatches);
SettingsWrapBitBool(EnableRecordingTools);
#ifdef PCSX2_CORE
SettingsWrapBitBool(EnableGameFixes);
SettingsWrapBitBool(SaveStateOnShutdown);
SettingsWrapBitBool(EnableDiscordPresence);
SettingsWrapBitBool(InhibitScreensaver);
#endif
SettingsWrapBitBool(ConsoleToStdio);
SettingsWrapBitBool(HostFs);
@ -1272,11 +1221,6 @@ void Pcsx2Config::LoadSave(SettingsWrapper& wrap)
SettingsWrapBitBool(SavestateZstdCompression);
SettingsWrapBitBool(McdEnableEjection);
SettingsWrapBitBool(McdFolderAutoManage);
#ifndef PCSX2_CORE
// We put mtap in the Pad section for Qt to make it easier to manually edit input profiles.
SettingsWrapBitBool(MultitapPort0_Enabled);
SettingsWrapBitBool(MultitapPort1_Enabled);
#endif
SettingsWrapBitBool(WarnAboutUnsafeSettings);
@ -1285,19 +1229,14 @@ void Pcsx2Config::LoadSave(SettingsWrapper& wrap)
Speedhacks.LoadSave(wrap);
Cpu.LoadSave(wrap);
GS.LoadSave(wrap);
#ifdef PCSX2_CORE
// SPU2 is in a separate ini in wx.
SPU2.LoadSave(wrap);
#endif
DEV9.LoadSave(wrap);
Gamefixes.LoadSave(wrap);
Profiler.LoadSave(wrap);
Debugger.LoadSave(wrap);
Trace.LoadSave(wrap);
#ifdef PCSX2_CORE
USB.LoadSave(wrap);
#endif
#ifdef ENABLE_ACHIEVEMENTS
Achievements.LoadSave(wrap);
@ -1306,7 +1245,6 @@ void Pcsx2Config::LoadSave(SettingsWrapper& wrap)
SettingsWrapEntry(GzipIsoIndexTemplate);
// For now, this in the derived config for backwards ini compatibility.
#ifdef PCSX2_CORE
SettingsWrapEntryEx(CurrentBlockdump, "BlockDumpSaveDirectory");
BaseFilenames.LoadSave(wrap);
@ -1315,7 +1253,6 @@ void Pcsx2Config::LoadSave(SettingsWrapper& wrap)
#ifdef _WIN32
SettingsWrapEntry(McdCompressNTFS);
#endif
#endif
if (wrap.IsLoading())

View File

@ -26,10 +26,7 @@
#include "GS.h"
#include "MTVU.h"
#ifdef PCSX2_CORE
#include "VMManager.h"
#endif
static const float UPDATE_INTERVAL = 0.5f;
@ -227,9 +224,7 @@ void PerformanceMetrics::Update(bool gs_register_write, bool fb_blit, bool is_sk
s_unskipped_frames_since_last_update = 0;
s_presents_since_last_update = 0;
#ifdef PCSX2_CORE
Host::OnPerformanceMetricsUpdated();
#endif
}
void PerformanceMetrics::OnGPUPresent(float gpu_time)

View File

@ -24,32 +24,6 @@
#include "common/Pcsx2Defs.h"
#define NOMINMAX // Disables other libs inclusion of their own min/max macros (we use std instead)
//////////////////////////////////////////////////////////////////////////////////////////
// Welcome wxWidgets to the party! How about no? Only for the old UI.
#if !defined(PCSX2_CORE) && defined(_WIN32)
// This deals with a mode_t redefinition conflict. The mode_t doesn't seem to be
// used anywhere in w32pthreads, so I've chosen to use the wxWidgets mode_t
// (I think it's unsigned int vs signed int)
#include <wx/filefn.h>
#define HAVE_MODE_T
#endif
#ifndef PCSX2_CORE
#include <wx/gdicmn.h>
#include <wx/gdiobj.h>
#include <wx/string.h>
#include <wx/tokenzr.h>
#include <wx/intl.h>
#include <wx/log.h>
#include <wx/filename.h>
// pthreadsw32 is not needed when compiling PCSX2-Qt.
#include <pthread.h>
#endif
//////////////////////////////////////////////////////////////////////////////////////////
// Include the STL that's actually handy.

View File

@ -18,20 +18,13 @@
#include "R3000A.h"
#include "Common.h"
#include "Config.h"
#ifdef PCSX2_CORE
#include "VMManager.h"
#endif
#include "R5900OpcodeTables.h"
#include "DebugTools/Breakpoints.h"
#include "IopBios.h"
#include "IopHw.h"
#ifndef PCSX2_CORE
#include "gui/SysThreads.h"
#endif
using namespace R3000A;
// Used to flag delay slot instructions when throwig exceptions.
@ -151,11 +144,7 @@ void psxBreakpoint(bool memcheck)
}
CBreakPoints::SetBreakpointTriggered(true);
#ifndef PCSX2_CORE
GetCoreThread().PauseSelfDebug();
#else
VMManager::SetPaused(true);
#endif
throw Exception::ExitCpuExecute();
}

View File

@ -25,13 +25,8 @@
#include "VUmicro.h"
#include "COP0.h"
#include "MTVU.h"
#ifndef PCSX2_CORE
#include "gui/SysThreads.h"
#else
#include "VMManager.h"
#endif
#include "R5900Exceptions.h"
#include "VMManager.h"
#include "Hardware.h"
#include "IPU/IPUdma.h"
@ -584,15 +579,9 @@ void eeGameStarting()
// GameStartingInThread may issue a reset of the cpu and/or recompilers. Check for and
// handle such things here:
#ifndef PCSX2_CORE
GetCoreThread().GameStartingInThread();
if (GetCoreThread().HasPendingStateChangeRequest())
Cpu->ExitExecution();
#else
VMManager::Internal::GameStartingOnCPUThread();
if (VMManager::Internal::IsExecutionInterrupted())
Cpu->ExitExecution();
#endif
}
else
{
@ -646,11 +635,7 @@ int ParseArgumentString(u32 arg_block)
// Called from recompilers; define is mandatory.
void eeloadHook()
{
#ifndef PCSX2_CORE
const std::string elf_override(StringUtil::wxStringToUTF8String(GetCoreThread().GetElfOverride()));
#else
const std::string& elf_override(VMManager::Internal::GetElfOverride());
#endif
if (!elf_override.empty())
cdvdReloadElfInfo(StringUtil::StdStringFromFormat("host:%s", elf_override.c_str()));

View File

@ -26,8 +26,6 @@ void SaveStateBase::InputRecordingFreeze()
Freeze(g_FrameCount);
}
#ifdef PCSX2_CORE
#include "InputRecording.h"
#include "InputRecordingControls.h"
@ -394,5 +392,3 @@ void InputRecording::initializeState()
m_frame_counter = 0;
m_watching_for_rerecords = false;
}
#endif

View File

@ -15,8 +15,6 @@
#pragma once
#ifdef PCSX2_CORE
#include <queue>
#include "Recording/InputRecordingFile.h"
@ -80,5 +78,3 @@ private:
};
extern InputRecording g_InputRecording;
#endif

View File

@ -13,8 +13,6 @@
* If not, see <http://www.gnu.org/licenses/>.
*/
#ifdef PCSX2_CORE
#include "PrecompiledHeader.h"
#include "DebugTools/Debug.h"
@ -111,5 +109,3 @@ bool InputRecordingControls::isRecording() const
// }
// }*/
//}
#endif

View File

@ -15,8 +15,6 @@
#pragma once
#ifdef PCSX2_CORE
#include <queue>
// TODO:
@ -45,4 +43,3 @@ private:
std::queue<std::function<void()>> m_controlQueue;
};
#endif

View File

@ -13,8 +13,6 @@
* If not, see <http://www.gnu.org/licenses/>.
*/
#ifdef PCSX2_CORE
#include "PrecompiledHeader.h"
#include "InputRecordingFile.h"
@ -290,5 +288,3 @@ bool InputRecordingFile::verifyRecordingFileHeader()
}
return true;
}
#endif

View File

@ -15,8 +15,6 @@
#pragma once
#ifdef PCSX2_CORE
#include "System.h"
#include "PadData.h"
@ -108,5 +106,3 @@ private:
size_t getRecordingBlockSeekPoint(const u32 frame) const noexcept;
bool verifyRecordingFileHeader();
};
#endif

View File

@ -13,8 +13,6 @@
* If not, see <http://www.gnu.org/licenses/>.
*/
#ifdef PCSX2_CORE
#include "PrecompiledHeader.h"
#include "DebugTools/Debug.h"
@ -178,5 +176,3 @@ void PadData::LogPadData() const
const std::string finalLog = fmt::format("[PAD {}:{}:{}]\n\t[Buttons]: {}\n\t[Analogs]: {}\n", m_ext_port, m_port, m_slot, pressedButtons, analogs);
controlLog(finalLog);
}
#endif

View File

@ -15,8 +15,6 @@
#pragma once
#ifdef PCSX2_CORE
class PadData
{
public:
@ -68,4 +66,3 @@ public:
void LogPadData() const;
};
#endif

View File

@ -84,13 +84,6 @@ extern u32 OutputModule;
extern int SndOutLatencyMS;
extern int SynchMode;
#if defined(_WIN32) && !defined(PCSX2_CORE)
extern wchar_t dspPlugin[];
extern int dspPluginModule;
extern bool dspPluginEnabled;
#endif
namespace SoundtouchCfg
{
extern void ApplySettings(soundtouch::SoundTouch& sndtouch);

View File

@ -452,43 +452,6 @@ void SndBuffer::Write(const StereoOut32& Sample)
// Play silence
std::fill_n(sndTempBuffer, SndOutPacketSize, StereoOut32{});
}
#if defined(_WIN32) && !defined(PCSX2_CORE)
if (dspPluginEnabled)
{
// Convert in, send to winamp DSP, and convert out.
int ei = m_dsp_progress;
for (int i = 0; i < SndOutPacketSize; ++i, ++ei)
{
sndTempBuffer16[ei] = sndTempBuffer[i].DownSample();
}
m_dsp_progress += DspProcess((s16*)sndTempBuffer16 + m_dsp_progress, SndOutPacketSize);
// Some ugly code to ensure full packet handling:
ei = 0;
while (m_dsp_progress >= SndOutPacketSize)
{
for (int i = 0; i < SndOutPacketSize; ++i, ++ei)
{
sndTempBuffer[i] = sndTempBuffer16[ei].UpSample();
}
if (SynchMode == 0) // TimeStrech on
timeStretchWrite();
else
_WriteSamples(sndTempBuffer, SndOutPacketSize);
m_dsp_progress -= SndOutPacketSize;
}
// copy any leftovers to the front of the dsp buffer.
if (m_dsp_progress > 0)
{
memcpy(sndTempBuffer16, &sndTempBuffer16[ei],
sizeof(sndTempBuffer16[0]) * m_dsp_progress);
}
}
#endif
else
{
if (SynchMode == 0) // TimeStrech on

View File

@ -675,10 +675,3 @@ extern bool WavRecordEnabled;
extern bool RecordStart(const std::string* filename);
extern void RecordStop();
extern void RecordWrite(const StereoOut16& sample);
#ifndef PCSX2_CORE
extern s32 DspLoadLibrary(wchar_t* fileName, int modNum);
extern void DspCloseLibrary();
extern int DspProcess(s16* buffer, int samples);
extern void DspUpdate(); // to let the Dsp process window messages
#endif

View File

@ -28,20 +28,8 @@
#include <objbase.h>
#endif
#ifdef PCSX2_CORE
#include "HostSettings.h"
#else
#include "gui/StringHelpers.h"
extern bool CfgReadBool(const wchar_t* Section, const wchar_t* Name, bool Default);
extern int CfgReadInt(const wchar_t* Section, const wchar_t* Name, int Default);
extern void CfgReadStr(const wchar_t* Section, const wchar_t* Name, wxString& Data, const wchar_t* Default);
#endif
class Cubeb : public SndOutModule
{
private:
@ -375,19 +363,9 @@ public:
void ReadSettings()
{
#ifndef PCSX2_CORE
m_SuggestedLatencyMinimal = CfgReadBool(L"Cubeb", L"MinimalSuggestedLatency", false);
m_SuggestedLatencyMS = std::clamp(CfgReadInt(L"Cubeb", L"ManualSuggestedLatencyMS", MINIMUM_LATENCY_MS), MINIMUM_LATENCY_MS, MAXIMUM_LATENCY_MS);
// TODO: Once the config stuff gets merged, drop the wxString here.
wxString backend;
CfgReadStr(L"SPU2/Output", L"BackendName", backend, L"");
m_Backend = StringUtil::wxStringToUTF8String(backend);
#else
m_SuggestedLatencyMinimal = Host::GetBoolSettingValue("Cubeb", "MinimalSuggestedLatency", false);
m_SuggestedLatencyMS = std::clamp(Host::GetIntSettingValue("Cubeb", "ManualSuggestedLatencyMS", MINIMUM_LATENCY_MS), MINIMUM_LATENCY_MS, MAXIMUM_LATENCY_MS);
m_Backend = Host::GetStringSettingValue("SPU2/Output", "BackendName", "");
#endif
}
};

View File

@ -15,10 +15,8 @@
#include "PrecompiledHeader.h"
#include "SPU2/Global.h"
#ifndef PCSX2_CORE
#include "Dialogs.h"
#endif
#include "common/Console.h"
#include "common/RedtapeWindows.h"
#include <memory>
#include <sstream>
@ -28,16 +26,6 @@
#include <wil/com.h>
#include <wil/resource.h>
#include <wil/win32_helpers.h>
// We set _WIN32_WINNT to Win10, which means that xaudio2.h tries to use
// the Windows 10 version. For wx, we still need to support Win8, so we
// cheekily redefine _WIN32_WINNT before xaudio2.h is included, so that
// it uses the older DLL.
#ifndef PCSX2_CORE
#undef _WIN32_WINNT
#define _WIN32_WINNT _WIN32_WINNT_WIN8
#endif
#include <xaudio2.h>
//#define XAUDIO2_DEBUG
@ -70,11 +58,7 @@ private:
}
BaseStreamingVoice(uint numChannels)
#ifndef PCSX2_CORE
: m_nBuffers(Config_XAudio2.NumBuffers)
#else
: m_nBuffers(2)
#endif
, m_nChannels(numChannels)
, m_BufferSize(SndOutPacketSize * m_nChannels * PacketsPerBuffer)
, m_BufferSizeBytes(m_BufferSize * sizeof(s16))

View File

@ -17,16 +17,7 @@
#include "Global.h"
#include "spu2.h"
#include "Dma.h"
#ifndef PCSX2_CORE
#if defined(_WIN32)
#include "Windows/Dialogs.h"
#else // BSD, Macos
#include "Linux/Dialogs.h"
#include "Linux/Config.h"
#endif
#else
#include "Host/Dialogs.h"
#endif
#include "R3000A.h"
using namespace Threading;
@ -38,22 +29,6 @@ static double DeviceSampleRateMultiplier = 1.0;
u32 lClocks = 0;
#ifndef PCSX2_CORE
#include "gui/AppCoreThread.h"
static bool IsOpened = false;
std::recursive_mutex mtx_SPU2Status;
void SPU2configure()
{
ScopedCoreThreadPause paused_core(SystemsMask::System_SPU2);
configure();
paused_core.AllowResume();
}
#endif
// --------------------------------------------------------------------------------------
// DMA 4/7 Callbacks from Core Emulator
// --------------------------------------------------------------------------------------
@ -227,74 +202,9 @@ bool SPU2init()
return true;
}
#if defined(_MSC_VER) && !defined(PCSX2_CORE)
// Bit ugly to have this here instead of in RealttimeDebugger.cpp, but meh :p
extern bool debugDialogOpen;
extern HWND hDebugDialog;
static INT_PTR CALLBACK DebugProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
int wmId;
switch (uMsg)
{
case WM_PAINT:
return FALSE;
case WM_INITDIALOG:
{
debugDialogOpen = true;
}
break;
case WM_COMMAND:
wmId = LOWORD(wParam);
// Parse the menu selections:
switch (wmId)
{
case IDOK:
case IDCANCEL:
debugDialogOpen = false;
EndDialog(hWnd, 0);
break;
default:
return FALSE;
}
break;
default:
return FALSE;
}
return TRUE;
}
#endif
bool SPU2open(PS2Modes isRunningPSXMode)
{
#ifndef PCSX2_CORE
std::unique_lock lock(mtx_SPU2Status);
if (IsOpened)
return true;
#if defined(_MSC_VER) && defined(PCSX2_DEVBUILD) // Define may not be needed but not tested yet. Better make sure.
IsOpened = true;
if (IsDevBuild && VisualDebug())
{
if (debugDialogOpen == 0)
{
hDebugDialog = CreateDialogParam(nullptr, MAKEINTRESOURCE(IDD_DEBUG), 0, DebugProc, 0);
ShowWindow(hDebugDialog, SW_SHOWNORMAL);
debugDialogOpen = 1;
}
}
else if (debugDialogOpen)
{
DestroyWindow(hDebugDialog);
debugDialogOpen = 0;
}
#endif
#endif
ReadSettings();
#ifdef SPU2_LOG
@ -318,10 +228,6 @@ bool SPU2open(PS2Modes isRunningPSXMode)
{
SampleRate = static_cast<int>(std::round(static_cast<double>(ConsoleSampleRate) * DeviceSampleRateMultiplier));
SPU2InitSndBuffer();
#if defined(_WIN32) && !defined(PCSX2_CORE)
DspLoadLibrary(dspPlugin, dspPluginModule);
#endif
WaveDump::Open();
}
catch (std::exception& ex)
@ -336,19 +242,8 @@ bool SPU2open(PS2Modes isRunningPSXMode)
void SPU2close()
{
#ifndef PCSX2_CORE
std::unique_lock lock(mtx_SPU2Status);
if (!IsOpened)
return;
IsOpened = false;
#endif
FileLog("[%10d] SPU2 Close\n", Cycles);
#if defined(_WIN32) && !defined(PCSX2_CORE)
DspCloseLibrary();
#endif
SndBuffer::Cleanup();
}
@ -402,10 +297,6 @@ static bool lState[6];
void SPU2async(u32 cycles)
{
#ifndef PCSX2_CORE
DspUpdate();
#endif
TimeUpdate(psxRegs.cycle);
#ifdef DEBUG_KEYS

View File

@ -19,10 +19,6 @@
#include "IopCounters.h"
#include <mutex>
#ifndef PCSX2_CORE
extern std::recursive_mutex mtx_SPU2Status;
#endif
enum class PS2Modes
{
PS2,
@ -48,10 +44,6 @@ void SPU2endRecording();
void SPU2async(u32 cycles);
s32 SPU2freeze(FreezeAction mode, freezeData* data);
#ifndef PCSX2_CORE
void SPU2configure();
#endif
void SPU2setSettingsDir(const char* dir);
void SPU2setLogDir(const char* dir);
void SPU2readDMA4Mem(u16* pMem, u32 size);

View File

@ -342,7 +342,6 @@ void V_Voice::Stop()
uint TickInterval = 768;
static const int SanityInterval = 4800;
extern void UpdateDebugDialog();
__forceinline bool StartQueuedVoice(uint coreidx, uint voiceidx)
{
@ -403,11 +402,6 @@ __forceinline void TimeUpdate(u32 cClocks)
lClocks = cClocks - dClocks;
}
// Visual debug display showing all core's activity! Disabled via #define on release builds.
#if defined(_WIN32) && !defined(PCSX2_CORE)
UpdateDebugDialog();
#endif
if (SynchMode == 1) // AsyncMix on
SndBuffer::UpdateTempoChangeAsyncMixing();
else

View File

@ -41,16 +41,8 @@
#include "GS/GS.h"
#include "SPU2/spu2.h"
#include "PAD/Gamepad.h"
#ifndef PCSX2_CORE
#include "gui/App.h"
#include "gui/ConsoleLogger.h"
#include "gui/SysThreads.h"
#include "USB/USBNull.h"
#else
#include "USB/USB.h"
#include "VMManager.h"
#endif
#ifdef ENABLE_ACHIEVEMENTS
#include "Frontend/Achievements.h"
@ -79,9 +71,6 @@ static void PreLoadPrep()
mmap_ResetBlockTracking();
SysClearExecutionCache();
#ifndef PCSX2_CORE
PatchesVerboseReset();
#endif
}
static void PostLoadPrep()
@ -107,55 +96,6 @@ static void PostLoadPrep()
// --------------------------------------------------------------------------------------
// SaveStateBase (implementations)
// --------------------------------------------------------------------------------------
#ifndef PCSX2_CORE
std::string SaveStateBase::GetSavestateFolder(int slot, bool isSavingOrLoading)
{
std::string CRCvalue(StringUtil::StdStringFromFormat("%08X", ElfCRC));
std::string serialName;
if (g_GameStarted || g_GameLoading)
{
if (DiscSerial.empty())
{
// Running homebrew/standalone ELF, return only the ELF name.
// can't use FileSystem here because it's DOS paths
const std::string::size_type pos = std::min(DiscSerial.rfind('/'), DiscSerial.rfind('\\'));
if (pos != std::string::npos)
serialName = DiscSerial.substr(pos + 1);
else
serialName = DiscSerial;
}
else
{
// Running a normal retail game
// Folder format is "SLXX-XXXX - (00000000)"
serialName = DiscSerial;
}
}
else
{
// Still inside the BIOS/not running a game (why would anyone want to do this?)
serialName = StringUtil::StdStringFromFormat("BIOS (%s v%u.%u)", BiosZone.c_str(), (BiosVersion >> 8), BiosVersion & 0xff);
CRCvalue = "None";
}
const std::string dir(StringUtil::StdStringFromFormat("%s" FS_OSPATH_SEPARATOR_STR "%s - (%s)",
g_Conf->Folders.Savestates.ToUTF8().data(), serialName.c_str(), CRCvalue.c_str()));
if (isSavingOrLoading)
{
if (!FileSystem::DirectoryExists(dir.c_str()))
{
// sstates should exist, no need to create it
FileSystem::CreateDirectoryPath(dir.c_str(), false);
}
}
return Path::Combine(dir, StringUtil::StdStringFromFormat("%s (%s).%02d.p2s",
serialName.c_str(), CRCvalue.c_str(), slot));
}
#endif
SaveStateBase::SaveStateBase( SafeArray<u8>& memblock )
{
Init( &memblock );
@ -237,9 +177,7 @@ SaveStateBase& SaveStateBase::FreezeBios()
SaveStateBase& SaveStateBase::FreezeInternals()
{
#ifdef PCSX2_CORE
const u32 previousCRC = ElfCRC;
#endif
// Print this until the MTVU problem in gifPathFreeze is taken care of (rama)
if (THREAD_VU1) Console.Warning("MTVU speedhack is enabled, saved states may not be stable");
@ -264,7 +202,6 @@ SaveStateBase& SaveStateBase::FreezeInternals()
{
DiscSerial = localDiscSerial;
#ifdef PCSX2_CORE
if (ElfCRC != previousCRC)
{
// HACK: LastELF isn't in the save state... Load it before we go too far into restoring state.
@ -275,7 +212,6 @@ SaveStateBase& SaveStateBase::FreezeInternals()
else
cdvdReloadElfInfo();
}
#endif
}
@ -412,14 +348,8 @@ struct SysState_Component
static int SysState_MTGSFreeze(FreezeAction mode, freezeData* fP)
{
#ifndef PCSX2_CORE
ScopedCoreThreadPause paused_core;
#endif
MTGS_FreezeData sstate = { fP, 0 };
GetMTGS().Freeze(mode, sstate);
#ifndef PCSX2_CORE
paused_core.AllowResume();
#endif
return sstate.retval;
}
@ -727,9 +657,7 @@ static const std::unique_ptr<BaseSavestateEntry> SavestateEntries[] = {
std::unique_ptr<BaseSavestateEntry>(new SavestateEntry_VU0prog),
std::unique_ptr<BaseSavestateEntry>(new SavestateEntry_VU1prog),
std::unique_ptr<BaseSavestateEntry>(new SavestateEntry_SPU2),
#ifdef PCSX2_CORE
std::unique_ptr<BaseSavestateEntry>(new SavestateEntry_USB),
#endif
std::unique_ptr<BaseSavestateEntry>(new SavestateEntry_PAD),
std::unique_ptr<BaseSavestateEntry>(new SavestateEntry_GS),
#ifdef ENABLE_ACHIEVEMENTS
@ -739,13 +667,6 @@ static const std::unique_ptr<BaseSavestateEntry> SavestateEntries[] = {
std::unique_ptr<ArchiveEntryList> SaveState_DownloadState()
{
#ifndef PCSX2_CORE
if (!GetCoreThread().HasActiveMachine())
throw Exception::RuntimeError()
.SetDiagMsg("SysExecEvent_DownloadState: Cannot freeze/download an invalid VM state!")
.SetUserMsg("There is no active virtual machine state to download or save.");
#endif
std::unique_ptr<ArchiveEntryList> destlist = std::make_unique<ArchiveEntryList>(new VmStateBuffer("Zippable Savestate"));
memSavingState saveme(destlist->GetBuffer());

View File

@ -89,10 +89,6 @@ public:
SaveStateBase( VmStateBuffer* memblock );
virtual ~SaveStateBase() { }
#ifndef PCSX2_CORE
static std::string GetSavestateFolder(int slot, bool isSavingOrLoading = false);
#endif
// Gets the version of savestate that this object is acting on.
// The version refers to the low 16 bits only (high 16 bits classifies Pcsx2 build types)
u32 GetVersion() const

View File

@ -32,11 +32,9 @@
#include "common/emitter/x86_intrin.h"
#ifdef PCSX2_CORE
#include "GSDumpReplayer.h"
extern R5900cpu GSDumpReplayerCpu;
#endif
SSE_MXCSR g_sseMXCSR = {DEFAULT_sseMXCSR};
SSE_MXCSR g_sseVUMXCSR = {DEFAULT_sseVUMXCSR};
@ -220,10 +218,6 @@ void SysLogMachineCaps()
Console.Indent().WriteLn("%s", features.c_str());
Console.Newline();
#if defined(_WIN32) && !defined(PCSX2_CORE)
CheckIsUserOnHighPerfPowerPlan();
#endif
}
namespace HostMemoryMap {
@ -395,10 +389,8 @@ void SysCpuProviderPack::ApplyConfig() const
if( EmuConfig.Cpu.Recompiler.EnableVU1 )
CpuVU1 = &CpuMicroVU1;
#ifdef PCSX2_CORE
if (GSDumpReplayer::IsReplayingDump())
Cpu = &GSDumpReplayerCpu;
#endif
}
// Resets all PS2 cpu execution caches, which does not affect that actual PS2 state/condition.
@ -408,11 +400,6 @@ void SysCpuProviderPack::ApplyConfig() const
// Use this method to reset the recs when important global pointers like the MTGS are re-assigned.
void SysClearExecutionCache()
{
// Done by VMManager in Qt.
#ifndef PCSX2_CORE
GetCpuProviders().ApplyConfig();
#endif
Cpu->Reset();
psxCpu->Reset();

View File

@ -122,19 +122,6 @@ public:
void Release();
};
// --------------------------------------------------------------------------------------
// SysAllocVM
// --------------------------------------------------------------------------------------
class SysAllocVM
{
public:
SysAllocVM();
virtual ~SysAllocVM();
protected:
void CleanupMess() noexcept;
};
// --------------------------------------------------------------------------------------
// SysCpuProviderPack
// --------------------------------------------------------------------------------------
@ -159,39 +146,5 @@ extern std::string SysGetDiscID();
extern SysMainMemory& GetVmMemory();
// special macro which disables inlining on functions that require their own function stackframe.
// This is due to how Win32 handles structured exception handling. Linux uses signals instead
// of SEH, and so these functions can be inlined.
#ifdef _WIN32
# define __unique_stackframe __noinline
#else
# define __unique_stackframe
#endif
//////////////////////////////////////////////////////////////////////////////////////////
// Different types of message boxes that the emulator can employ from the friendly confines
// of it's blissful unawareness of whatever GUI it runs under. :) All message boxes exhibit
// blocking behavior -- they prompt the user for action and only return after the user has
// responded to the prompt.
//
#ifndef PCSX2_CORE
#include <wx/string.h>
namespace Msgbox
{
extern bool Alert( const wxString& text, const wxString& caption="PCSX2 Message", int icon=wxICON_EXCLAMATION );
extern bool OkCancel( const wxString& text, const wxString& caption="PCSX2 Message", int icon=0 );
extern bool YesNo( const wxString& text, const wxString& caption="PCSX2 Message", int icon=wxICON_QUESTION );
extern int Assertion( const wxString& text, const wxString& stacktrace );
}
#endif
#ifdef _WIN32
extern void CheckIsUserOnHighPerfPowerPlan();
#endif
extern void SetCPUState(SSE_MXCSR sseMXCSR, SSE_MXCSR sseVUMXCSR);
extern SSE_MXCSR g_sseVUMXCSR, g_sseMXCSR;

View File

@ -59,7 +59,7 @@
<ForcedIncludeFiles>PrecompiledHeader.h;%(ForcedIncludeFiles)</ForcedIncludeFiles>
<EnableEnhancedInstructionSet>NoExtensions</EnableEnhancedInstructionSet>
<AdditionalOptions>/Zc:externConstexpr %(AdditionalOptions)</AdditionalOptions>
<PreprocessorDefinitions>WIN32_LEAN_AND_MEAN;ZIP_STATIC;LZMA_API_STATIC;BUILD_DX=1;ENABLE_DISCORD_PRESENCE;ENABLE_RAINTEGRATION;ENABLE_ACHIEVEMENTS;ENABLE_OPENGL;ENABLE_VULKAN;SPU2X_CUBEB;SDL_BUILD;PCSX2_CORE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>WIN32_LEAN_AND_MEAN;ZIP_STATIC;LZMA_API_STATIC;BUILD_DX=1;ENABLE_DISCORD_PRESENCE;ENABLE_RAINTEGRATION;ENABLE_ACHIEVEMENTS;ENABLE_OPENGL;ENABLE_VULKAN;SPU2X_CUBEB;SDL_BUILD;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions Condition="$(Configuration.Contains(Debug))">PCSX2_DEBUG;PCSX2_DEVBUILD;_SECURE_SCL_=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions Condition="$(Configuration.Contains(Devel))">PCSX2_DEVEL;PCSX2_DEVBUILD;NDEBUG;_SECURE_SCL_=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions Condition="$(Configuration.Contains(Release))">NDEBUG;_SECURE_SCL_=0;%(PreprocessorDefinitions)</PreprocessorDefinitions>

View File

@ -2399,4 +2399,4 @@
<Filter>System\Ps2\Debug\rdebug</Filter>
</CustomBuildStep>
</ItemGroup>
</Project>
</Project>

View File

@ -303,11 +303,6 @@ bool LoadBIOS()
ChecksumIt(BiosChecksum, eeMem->ROM);
BiosPath = std::move(path);
#ifndef PCSX2_CORE
Console.SetTitle(StringUtil::StdStringFromFormat("Running BIOS (%s v%u.%u)",
BiosZone.c_str(), BiosVersion >> 8, BiosVersion & 0xff).c_str());
#endif
//injectIRX("host.irx"); //not fully tested; still buggy
LoadExtraRom("rom1", eeMem->ROM1);

View File

@ -22,11 +22,7 @@
#include "FW.h"
#include "SPU2/spu2.h"
#include "DEV9/DEV9.h"
#ifdef PCSX2_CORE
#include "USB/USB.h"
#else
#include "USB/USBNull.h"
#endif
#include "IopCounters.h"
#include "IopDma.h"

View File

@ -21,11 +21,7 @@
#include "CDVD/Ps1CD.h"
#include "SPU2/spu2.h"
#include "DEV9/DEV9.h"
#ifdef PCSX2_CORE
#include "USB/USB.h"
#else
#include "USB/USBNull.h"
#endif
#include "IopCounters.h"
#include "IopDma.h"
#include "R3000A.h"

View File

@ -13,8 +13,7 @@
* If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef _PCSX2_CORE_RECOMPILER_
#define _PCSX2_CORE_RECOMPILER_
#pragma once
#include "common/emitter/x86emitter.h"
#include "VUmicro.h"
@ -324,4 +323,3 @@ int _allocIfUsedFPUtoXMM(int fpureg, int mode);
// no freeing, used when callee won't destroy xmm regs
#define FLUSH_NODESTROY (FLUSH_CONSTANT_REGS | FLUSH_FLUSH_XMM | FLUSH_ALL_X86)
#endif

View File

@ -28,6 +28,7 @@
#include "IopBios.h"
#include "IopHw.h"
#include "Common.h"
#include "VMManager.h"
#include <time.h>
@ -35,10 +36,6 @@
#include <sys/types.h>
#endif
#ifdef PCSX2_CORE
#include "VMManager.h"
#endif
#include "iCore.h"
#include "Config.h"
@ -49,10 +46,6 @@
#include "common/Perf.h"
#include "DebugTools/Breakpoints.h"
#ifndef PCSX2_CORE
#include "gui/SysThreads.h"
#endif
#include "fmt/core.h"
// #define DUMP_BLOCKS 1
@ -1420,11 +1413,7 @@ static bool psxDynarecCheckBreakpoint()
return false;
CBreakPoints::SetBreakpointTriggered(true);
#ifndef PCSX2_CORE
GetCoreThread().PauseSelfDebug();
#else
VMManager::SetPaused(true);
#endif
// Exit the EE too.
Cpu->ExitExecution();
@ -1438,11 +1427,7 @@ static bool psxDynarecMemcheck()
return false;
CBreakPoints::SetBreakpointTriggered(true);
#ifndef PCSX2_CORE
GetCoreThread().PauseSelfDebug();
#else
VMManager::SetPaused(true);
#endif
// Exit the EE too.
Cpu->ExitExecution();

View File

@ -29,12 +29,7 @@
#include "vtlb.h"
#include "Dump.h"
#ifndef PCSX2_CORE
#include "gui/SysThreads.h"
#include <pthread.h>
#else
#include "VMManager.h"
#endif
#include "GS.h"
#include "CDVD/CDVD.h"
#include "Elfheader.h"
@ -71,9 +66,6 @@ static std::atomic<bool> eeRecNeedsReset(false);
static bool eeCpuExecuting = false;
static bool eeRecExitRequested = false;
static bool g_resetEeScalingStats = false;
#ifndef PCSX2_CORE
static int g_patchesNeedRedo = 0;
#endif
#define PC_GETBLOCK(x) PC_GETBLOCK_(x, recLUT)
@ -663,9 +655,6 @@ static void recResetRaw()
g_branch = 0;
g_resetEeScalingStats = true;
#ifndef PCSX2_CORE
g_patchesNeedRedo = 1;
#endif
}
static void recShutdown()
@ -741,9 +730,6 @@ static void recExecute()
// setjmp will save the register context and will return 0
// A call to longjmp will restore the context (included the eip/rip)
// but will return the longjmp 2nd parameter (here 1)
#ifndef PCSX2_CORE
int oldstate;
#endif
if (!fastjmp_set(&m_SetJmp_StateCheck))
{
eeCpuExecuting = true;
@ -753,19 +739,10 @@ static void recExecute()
// in Linux, which cannot have a C++ exception cross the recompiler. Hence the changing
// of the cancelstate here!
#ifndef PCSX2_CORE
pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, &oldstate);
#endif
EnterRecompiledCode();
// Generally unreachable code here ...
}
else
{
#ifndef PCSX2_CORE
pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, &oldstate);
#endif
}
eeCpuExecuting = false;
@ -1615,11 +1592,7 @@ void dynarecCheckBreakpoint()
return;
CBreakPoints::SetBreakpointTriggered(true);
#ifndef PCSX2_CORE
GetCoreThread().PauseSelfDebug();
#else
VMManager::SetPaused(true);
#endif
recExitExecution();
}
@ -1630,11 +1603,7 @@ void dynarecMemcheck()
return;
CBreakPoints::SetBreakpointTriggered(true);
#ifndef PCSX2_CORE
GetCoreThread().PauseSelfDebug();
#else
VMManager::SetPaused(true);
#endif
recExitExecution();
}
@ -2232,17 +2201,6 @@ bool skipMPEG_By_Pattern(u32 sPC)
return 0;
}
#ifndef PCSX2_CORE
// defined at AppCoreThread.cpp but unclean and should not be public. We're the only
// consumers of it, so it's declared only here.
void LoadAllPatchesAndStuff(const Pcsx2Config&);
static void doPlace0Patches()
{
LoadAllPatchesAndStuff(EmuConfig);
ApplyLoadedPatches(PPT_ONCE_ON_LOAD);
}
#endif
static void recRecompile(const u32 startpc)
{
u32 i = 0;
@ -2305,16 +2263,6 @@ static void recRecompile(const u32 startpc)
else // There might be other types of EELOAD, because these models' BIOSs have not been examined: 18000, 3500x, 3700x, 5500x, and 7900x. However, all BIOS versions have been examined except for v1.01 and v1.10.
Console.WriteLn("recRecompile: Could not enable launch arguments for fast boot mode; unidentified BIOS version! Please report this to the PCSX2 developers.");
}
#ifndef PCSX2_CORE
// On fast/full boot this will have a crc of 0x0. But when the game/elf itself is
// recompiled (below - ElfEntry && g_GameLoading), then the crc would be from the elf.
// g_patchesNeedRedo is set on rec reset, and this is the only consumer.
// Also makes sure that patches from the previous elf/game are not applied on boot.
if (g_patchesNeedRedo)
doPlace0Patches();
g_patchesNeedRedo = 0;
#endif
}
if (g_eeloadExec && HWADDR(startpc) == HWADDR(g_eeloadExec))
@ -2325,14 +2273,7 @@ static void recRecompile(const u32 startpc)
{
Console.WriteLn("Elf entry point @ 0x%08x about to get recompiled. Load patches first.", startpc);
xFastCall((void*)eeGameStarting);
#ifndef PCSX2_CORE
// Apply patch as soon as possible. Normally it is done in
// eeGameStarting but first block is already compiled.
doPlace0Patches();
#else
VMManager::Internal::EntryPointCompilingOnCPUThread();
#endif
}
g_branch = 0;