diff --git a/pcsx2/CDVD/CDVDaccess.cpp b/pcsx2/CDVD/CDVDaccess.cpp index b673cfb55f..7b4c5c28aa 100644 --- a/pcsx2/CDVD/CDVDaccess.cpp +++ b/pcsx2/CDVD/CDVDaccess.cpp @@ -293,30 +293,29 @@ static void DetectDiskType() diskTypeCached = FindDiskType(mType); } -static wxString m_SourceFilename[3]; +static std::string m_SourceFilename[3]; static CDVD_SourceType m_CurrentSourceType = CDVD_SourceType::NoDisc; -void CDVDsys_SetFile(CDVD_SourceType srctype, const wxString& newfile) +void CDVDsys_SetFile(CDVD_SourceType srctype, std::string newfile) { - m_SourceFilename[enum_cast(srctype)] = newfile; + m_SourceFilename[enum_cast(srctype)] = std::move(newfile); // look for symbol file if (symbolMap.IsEmpty()) { - wxString symName; - int n = newfile.Last('.'); - if (n == wxNOT_FOUND) - symName = newfile + L".sym"; + std::string symName; + std::string::size_type n = m_SourceFilename[enum_cast(srctype)].rfind('.'); + if (n == std::string::npos) + symName = m_SourceFilename[enum_cast(srctype)] + ".sym"; else - symName = newfile.substr(0, n) + L".sym"; + symName = m_SourceFilename[enum_cast(srctype)].substr(0, n) + ".sym"; - wxCharBuffer buf = symName.ToUTF8(); - symbolMap.LoadNocashSym(buf); + symbolMap.LoadNocashSym(symName.c_str()); symbolMap.UpdateActiveSymbols(); } } -const wxString& CDVDsys_GetFile(CDVD_SourceType srctype) +const std::string& CDVDsys_GetFile(CDVD_SourceType srctype) { return m_SourceFilename[enum_cast(srctype)]; } @@ -364,10 +363,7 @@ bool DoCDVDopen() //TODO_CDVD check if ISO and Disc use UTF8 auto CurrentSourceType = enum_cast(m_CurrentSourceType); - int ret = CDVD->open(!m_SourceFilename[CurrentSourceType].IsEmpty() ? - static_cast(m_SourceFilename[CurrentSourceType].ToUTF8()) : - (char*)NULL); - + int ret = CDVD->open(!m_SourceFilename[CurrentSourceType].empty() ? m_SourceFilename[CurrentSourceType].c_str() : nullptr); if (ret == -1) return false; // error! (handled by caller) @@ -388,8 +384,8 @@ bool DoCDVDopen() else if (somepick.IsEmpty()) somepick = L"Untitled"; - if (EmuConfig.CurrentBlockdump.IsEmpty()) - EmuConfig.CurrentBlockdump = wxGetCwd(); + if (EmuConfig.CurrentBlockdump.empty()) + EmuConfig.CurrentBlockdump = wxGetCwd().ToStdString(); wxString temp(Path::Combine(EmuConfig.CurrentBlockdump, somepick)); diff --git a/pcsx2/CDVD/CDVDaccess.h b/pcsx2/CDVD/CDVDaccess.h index 2a73e44d19..00dd6d1939 100644 --- a/pcsx2/CDVD/CDVDaccess.h +++ b/pcsx2/CDVD/CDVDaccess.h @@ -14,6 +14,7 @@ */ #pragma once +#include typedef struct _cdvdSubQ { @@ -151,8 +152,8 @@ extern CDVD_API CDVDapi_NoDisc; extern const wxChar* CDVD_SourceLabels[]; extern void CDVDsys_ChangeSource(CDVD_SourceType type); -extern void CDVDsys_SetFile(CDVD_SourceType srctype, const wxString& newfile); -extern const wxString& CDVDsys_GetFile(CDVD_SourceType srctype); +extern void CDVDsys_SetFile(CDVD_SourceType srctype, std::string newfile); +extern const std::string& CDVDsys_GetFile(CDVD_SourceType srctype); extern CDVD_SourceType CDVDsys_GetSourceType(); extern bool DoCDVDopen(); diff --git a/pcsx2/Config.h b/pcsx2/Config.h index 32211a9eb6..fe23dea6b8 100644 --- a/pcsx2/Config.h +++ b/pcsx2/Config.h @@ -19,6 +19,7 @@ #include "common/General.h" #include "common/Path.h" #include +#include class IniInterface; @@ -585,16 +586,16 @@ struct Pcsx2Config // Memorycard options - first 2 are default slots, last 6 are multitap 1 and 2 // slots (3 each) McdOptions Mcd[8]; - wxString GzipIsoIndexTemplate; // for quick-access index with gzipped ISO + std::string GzipIsoIndexTemplate; // for quick-access index with gzipped ISO // Set at runtime, not loaded from config. CDVD_SourceType CdvdSource; - wxString CurrentIso; - wxString CurrentDiscDrive; - wxString CurrentBlockdump; - wxString CurrentELF; - wxString CurrentIRX; - wxString CurrentGameArgs; + std::string CurrentIso; + std::string CurrentDiscDrive; + std::string CurrentBlockdump; + std::string CurrentELF; + std::string CurrentIRX; + std::string CurrentGameArgs; AspectRatioType CurrentAspectRatio = AspectRatioType::R4_3; LimiterModeType LimiterMode = LimiterModeType::Nominal; diff --git a/pcsx2/Pcsx2Config.cpp b/pcsx2/Pcsx2Config.cpp index cdc2db4773..67b02da613 100644 --- a/pcsx2/Pcsx2Config.cpp +++ b/pcsx2/Pcsx2Config.cpp @@ -508,7 +508,7 @@ Pcsx2Config::Pcsx2Config() Mcd[slot].Type = MemoryCardType::MemoryCard_File; } - GzipIsoIndexTemplate = L"$(f).pindex.tmp"; + GzipIsoIndexTemplate = "$(f).pindex.tmp"; CdvdSource = CDVD_SourceType::Iso; } diff --git a/pcsx2/R3000AInterpreter.cpp b/pcsx2/R3000AInterpreter.cpp index 9bd43c3060..b15ca2b0c5 100644 --- a/pcsx2/R3000AInterpreter.cpp +++ b/pcsx2/R3000AInterpreter.cpp @@ -224,7 +224,7 @@ static __fi void execI() #endif // Inject IRX hack - if (psxRegs.pc == 0x1630 && EmuConfig.CurrentIRX.Length() > 3) { + if (psxRegs.pc == 0x1630 && EmuConfig.CurrentIRX.length() > 3) { if (iopMemRead32(0x20018) == 0x1F) { // FIXME do I need to increase the module count (0x1F -> 0x20) iopMemWrite32(0x20094, 0xbffc0000); diff --git a/pcsx2/Recording/InputRecording.cpp b/pcsx2/Recording/InputRecording.cpp index dcd310a6f5..05326e3eb7 100644 --- a/pcsx2/Recording/InputRecording.cpp +++ b/pcsx2/Recording/InputRecording.cpp @@ -292,7 +292,7 @@ void InputRecording::SetupInitialState(u32 newStartingFrame) else { // Check if the current game matches with the one used to make the original recording - if (!EmuConfig.CurrentIso.IsEmpty()) + if (!EmuConfig.CurrentIso.empty()) if (resolveGameName() != inputRecordingData.GetHeader().gameName) inputRec::consoleLog("Input recording was possibly constructed for a different game."); diff --git a/pcsx2/gui/AppConfig.cpp b/pcsx2/gui/AppConfig.cpp index 003cad2a7e..c304530bc0 100644 --- a/pcsx2/gui/AppConfig.cpp +++ b/pcsx2/gui/AppConfig.cpp @@ -671,7 +671,7 @@ void AppConfig::FolderOptions::LoadSave( IniInterface& ini ) operator[]( (FoldersEnum_t)i ).Normalize(); EmuConfig.Folders.Settings = GetSettingsFolder(); - EmuConfig.CurrentDiscDrive = RunDisc; + EmuConfig.CurrentDiscDrive = RunDisc.ToStdString(); EmuConfig.Folders.Bios = Bios; EmuConfig.Folders.Snapshots = Snapshots; EmuConfig.Folders.Savestates = Savestates; diff --git a/pcsx2/gui/AppMain.cpp b/pcsx2/gui/AppMain.cpp index 80e43213b6..bf5898c8a8 100644 --- a/pcsx2/gui/AppMain.cpp +++ b/pcsx2/gui/AppMain.cpp @@ -969,7 +969,7 @@ protected: bool m_UseCDVDsrc; bool m_UseELFOverride; CDVD_SourceType m_cdvdsrc_type; - wxString m_elf_override; + std::string m_elf_override; public: virtual ~SysExecEvent_Execute() = default; @@ -992,11 +992,11 @@ public: { } - SysExecEvent_Execute( CDVD_SourceType srctype, const wxString& elf_override ) + SysExecEvent_Execute( CDVD_SourceType srctype, std::string elf_override ) : m_UseCDVDsrc(true) , m_UseELFOverride(true) , m_cdvdsrc_type(srctype) - , m_elf_override( elf_override ) + , m_elf_override( std::move(elf_override) ) { } @@ -1039,7 +1039,7 @@ void Pcsx2App::SysExecute() // sources. void Pcsx2App::SysExecute( CDVD_SourceType cdvdsrc, const wxString& elf_override ) { - SysExecutorThread.PostEvent( new SysExecEvent_Execute(cdvdsrc, elf_override) ); + SysExecutorThread.PostEvent( new SysExecEvent_Execute(cdvdsrc, elf_override.ToStdString()) ); #ifndef DISABLE_RECORDING if (g_Conf->EmuOptions.EnableRecordingTools) { diff --git a/pcsx2/gui/MainMenuClicks.cpp b/pcsx2/gui/MainMenuClicks.cpp index b33106218c..a5fd88a3c7 100644 --- a/pcsx2/gui/MainMenuClicks.cpp +++ b/pcsx2/gui/MainMenuClicks.cpp @@ -454,7 +454,7 @@ void MainEmuFrame::_DoBootCdvd() if (EmuConfig.CdvdSource == CDVD_SourceType::Iso) { - bool selector = EmuConfig.CurrentIso.IsEmpty(); + bool selector = EmuConfig.CurrentIso.empty(); if (!selector && !wxFileExists(EmuConfig.CurrentIso)) { diff --git a/pcsx2/ps2/BiosTools.cpp b/pcsx2/ps2/BiosTools.cpp index da78662025..851963c964 100644 --- a/pcsx2/ps2/BiosTools.cpp +++ b/pcsx2/ps2/BiosTools.cpp @@ -221,14 +221,14 @@ static void LoadExtraRom( const wxChar* ext, u8 (&dest)[_size] ) } } -static void LoadIrx( const wxString& filename, u8* dest ) +static void LoadIrx( const std::string& filename, u8* dest ) { s64 filesize = 0; try { wxFile irx(filename); if( (filesize=Path::GetFileSize( filename ) ) <= 0 ) { - Console.Warning(L"IRX Warning: %s could not be read", WX_STR(filename)); + Console.Warning("IRX Warning: %s could not be read", filename.c_str()); return; } @@ -236,7 +236,7 @@ static void LoadIrx( const wxString& filename, u8* dest ) } catch (Exception::BadStream& ex) { - Console.Warning(L"IRX Warning: %s could not be read", WX_STR(filename)); + Console.Warning("IRX Warning: %s could not be read", filename.c_str()); Console.Indent().WriteLn(L"Details: %s", WX_STR(ex.FormatDiagnosticMessage())); } } @@ -299,7 +299,7 @@ void LoadBIOS() LoadExtraRom( L"rom2", eeMem->ROM2 ); LoadExtraRom( L"erom", eeMem->EROM ); - if (EmuConfig.CurrentIRX.Length() > 3) + if (EmuConfig.CurrentIRX.length() > 3) LoadIrx(EmuConfig.CurrentIRX, &eeMem->ROM[0x3C0000]); CurrentBiosInformation.threadListAddr = 0; diff --git a/pcsx2/x86/iR3000A.cpp b/pcsx2/x86/iR3000A.cpp index f60373ea95..298be705a1 100644 --- a/pcsx2/x86/iR3000A.cpp +++ b/pcsx2/x86/iR3000A.cpp @@ -1300,7 +1300,7 @@ static void __fastcall iopRecRecompile(const u32 startpc) u32 willbranch3 = 0; // Inject IRX hack - if (startpc == 0x1630 && EmuConfig.CurrentIRX.Length() > 3) + if (startpc == 0x1630 && EmuConfig.CurrentIRX.length() > 3) { if (iopMemRead32(0x20018) == 0x1F) {