diff --git a/pcsx2/CMakeLists.txt b/pcsx2/CMakeLists.txt index e3f9715bf1..7c9266e4f1 100644 --- a/pcsx2/CMakeLists.txt +++ b/pcsx2/CMakeLists.txt @@ -130,6 +130,8 @@ set(pcsx2Sources IPC.cpp Mdec.cpp Memory.cpp + MemoryCardFile.cpp + MemoryCardFolder.cpp MMI.cpp MTGS.cpp MTVU.cpp @@ -204,6 +206,8 @@ set(pcsx2Headers Mdec.h MTVU.h Memory.h + MemoryCardFile.h + MemoryCardFolder.h MemoryTypes.h Patch.h PathDefs.h @@ -1010,8 +1014,6 @@ set(pcsx2GuiSources gui/IsoDropTarget.cpp gui/MainFrame.cpp gui/MainMenuClicks.cpp - gui/MemoryCardFile.cpp - gui/MemoryCardFolder.cpp gui/MessageBoxes.cpp gui/MSWstuff.cpp gui/Panels/BaseApplicableConfigPanel.cpp @@ -1068,8 +1070,6 @@ set(pcsx2GuiHeaders gui/i18n.h gui/IsoDropTarget.h gui/MainFrame.h - gui/MemoryCardFile.h - gui/MemoryCardFolder.h gui/MSWstuff.h gui/Panels/ConfigurationPanels.h gui/Panels/LogOptionsPanels.h diff --git a/pcsx2/Config.h b/pcsx2/Config.h index 1dc7810fff..32211a9eb6 100644 --- a/pcsx2/Config.h +++ b/pcsx2/Config.h @@ -528,6 +528,16 @@ struct Pcsx2Config } }; + // ------------------------------------------------------------------------ + // Options struct for each memory card. + // + struct McdOptions + { + wxFileName Filename; // user-configured location of this memory card + bool Enabled; // memory card enabled (if false, memcard will not show up in-game) + MemoryCardType Type; // the memory card implementation that should be used + }; + BITFIELD32() bool CdvdVerboseReads :1, // enables cdvd read activity verbosely dumped to the console @@ -552,6 +562,11 @@ struct Pcsx2Config ConsoleToStdio :1, HostFs :1; + + // uses automatic ntfs compression when creating new memory cards (Win32 only) +#ifdef __WXMSW__ + bool McdCompressNTFS; +#endif BITFIELD_END CpuOptions Cpu; @@ -566,7 +581,10 @@ struct Pcsx2Config FolderOptions Folders; FilenameOptions BaseFilenames; - + + // 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 // Set at runtime, not loaded from config. @@ -582,6 +600,7 @@ struct Pcsx2Config Pcsx2Config(); void LoadSave( IniInterface& ini ); + void LoadSaveMemcards( IniInterface& ini ); void Load( const wxString& srcfile ); void Load( const wxInputStream& srcstream ); @@ -589,6 +608,7 @@ struct Pcsx2Config void Save( const wxOutputStream& deststream ); wxString FullpathToBios() const; + wxString FullpathToMcd(uint slot) const; bool MultitapEnabled( uint port ) const; diff --git a/pcsx2/gui/MemoryCardFile.cpp b/pcsx2/MemoryCardFile.cpp similarity index 95% rename from pcsx2/gui/MemoryCardFile.cpp rename to pcsx2/MemoryCardFile.cpp index 0d8269f18a..12d0cb7178 100644 --- a/pcsx2/gui/MemoryCardFile.cpp +++ b/pcsx2/MemoryCardFile.cpp @@ -27,11 +27,11 @@ struct Component_FileMcd; #include "MemoryCardFolder.h" #include "System.h" -#include "AppConfig.h" +#include "Config.h" #include "svnrev.h" -#include "ConsoleLogger.h" +#include "gui/ConsoleLogger.h" #include #include @@ -280,7 +280,7 @@ void FileMemoryCard::Open() continue; } - wxFileName fname(g_Conf->FullpathToMcd(slot)); + wxFileName fname(EmuConfig.FullpathToMcd(slot)); wxString str(fname.GetFullPath()); bool cont = false; @@ -290,13 +290,13 @@ void FileMemoryCard::Open() cont = true; } - if (!g_Conf->Mcd[slot].Enabled) + if (!EmuConfig.Mcd[slot].Enabled) { str = L"[disabled]"; cont = true; } - if (g_Conf->Mcd[slot].Type != MemoryCardType::MemoryCard_File) + if (EmuConfig.Mcd[slot].Type != MemoryCardType::MemoryCard_File) { str = L"[is not memcard file]"; cont = true; @@ -325,7 +325,7 @@ void FileMemoryCard::Open() // (8MB, 256Mb, formatted, unformatted, etc ...) #ifdef __WXMSW__ - NTFS_CompressFile(str, g_Conf->McdCompressNTFS); + NTFS_CompressFile(str, EmuConfig.McdCompressNTFS); #endif if (str.EndsWith(".bin")) @@ -604,11 +604,11 @@ void FileMcd_EmuOpen() // detect inserted memory card types for (uint slot = 0; slot < 8; ++slot) { - if (g_Conf->Mcd[slot].Enabled) + if (EmuConfig.Mcd[slot].Enabled) { MemoryCardType type = MemoryCardType::MemoryCard_File; // default to file if we can't find anything at the path so it gets auto-generated - const wxString path = g_Conf->FullpathToMcd(slot); + const wxString path = EmuConfig.FullpathToMcd(slot); if (wxFileExists(path)) { type = MemoryCardType::MemoryCard_File; @@ -618,12 +618,12 @@ void FileMcd_EmuOpen() type = MemoryCardType::MemoryCard_Folder; } - g_Conf->Mcd[slot].Type = type; + EmuConfig.Mcd[slot].Type = type; } } Mcd::impl.Open(); - Mcd::implFolder.SetFiltering(g_Conf->EmuOptions.McdFolderAutoManage); + Mcd::implFolder.SetFiltering(EmuConfig.McdFolderAutoManage); Mcd::implFolder.Open(); } @@ -639,7 +639,7 @@ void FileMcd_EmuClose() s32 FileMcd_IsPresent(uint port, uint slot) { const uint combinedSlot = FileMcd_ConvertToSlot(port, slot); - switch (g_Conf->Mcd[combinedSlot].Type) + switch (EmuConfig.Mcd[combinedSlot].Type) { case MemoryCardType::MemoryCard_File: return Mcd::impl.IsPresent(combinedSlot); @@ -653,7 +653,7 @@ s32 FileMcd_IsPresent(uint port, uint slot) void FileMcd_GetSizeInfo(uint port, uint slot, McdSizeInfo* outways) { const uint combinedSlot = FileMcd_ConvertToSlot(port, slot); - switch (g_Conf->Mcd[combinedSlot].Type) + switch (EmuConfig.Mcd[combinedSlot].Type) { case MemoryCardType::MemoryCard_File: Mcd::impl.GetSizeInfo(combinedSlot, *outways); @@ -669,7 +669,7 @@ void FileMcd_GetSizeInfo(uint port, uint slot, McdSizeInfo* outways) bool FileMcd_IsPSX(uint port, uint slot) { const uint combinedSlot = FileMcd_ConvertToSlot(port, slot); - switch (g_Conf->Mcd[combinedSlot].Type) + switch (EmuConfig.Mcd[combinedSlot].Type) { case MemoryCardType::MemoryCard_File: return Mcd::impl.IsPSX(combinedSlot); @@ -683,7 +683,7 @@ bool FileMcd_IsPSX(uint port, uint slot) s32 FileMcd_Read(uint port, uint slot, u8* dest, u32 adr, int size) { const uint combinedSlot = FileMcd_ConvertToSlot(port, slot); - switch (g_Conf->Mcd[combinedSlot].Type) + switch (EmuConfig.Mcd[combinedSlot].Type) { case MemoryCardType::MemoryCard_File: return Mcd::impl.Read(combinedSlot, dest, adr, size); @@ -697,7 +697,7 @@ s32 FileMcd_Read(uint port, uint slot, u8* dest, u32 adr, int size) s32 FileMcd_Save(uint port, uint slot, const u8* src, u32 adr, int size) { const uint combinedSlot = FileMcd_ConvertToSlot(port, slot); - switch (g_Conf->Mcd[combinedSlot].Type) + switch (EmuConfig.Mcd[combinedSlot].Type) { case MemoryCardType::MemoryCard_File: return Mcd::impl.Save(combinedSlot, src, adr, size); @@ -711,7 +711,7 @@ s32 FileMcd_Save(uint port, uint slot, const u8* src, u32 adr, int size) s32 FileMcd_EraseBlock(uint port, uint slot, u32 adr) { const uint combinedSlot = FileMcd_ConvertToSlot(port, slot); - switch (g_Conf->Mcd[combinedSlot].Type) + switch (EmuConfig.Mcd[combinedSlot].Type) { case MemoryCardType::MemoryCard_File: return Mcd::impl.EraseBlock(combinedSlot, adr); @@ -725,7 +725,7 @@ s32 FileMcd_EraseBlock(uint port, uint slot, u32 adr) u64 FileMcd_GetCRC(uint port, uint slot) { const uint combinedSlot = FileMcd_ConvertToSlot(port, slot); - switch (g_Conf->Mcd[combinedSlot].Type) + switch (EmuConfig.Mcd[combinedSlot].Type) { case MemoryCardType::MemoryCard_File: return Mcd::impl.GetCRC(combinedSlot); @@ -739,7 +739,7 @@ u64 FileMcd_GetCRC(uint port, uint slot) void FileMcd_NextFrame(uint port, uint slot) { const uint combinedSlot = FileMcd_ConvertToSlot(port, slot); - switch (g_Conf->Mcd[combinedSlot].Type) + switch (EmuConfig.Mcd[combinedSlot].Type) { //case MemoryCardType::MemoryCard_File: // Mcd::impl.NextFrame( combinedSlot ); @@ -755,13 +755,13 @@ void FileMcd_NextFrame(uint port, uint slot) bool FileMcd_ReIndex(uint port, uint slot, const wxString& filter) { const uint combinedSlot = FileMcd_ConvertToSlot(port, slot); - switch (g_Conf->Mcd[combinedSlot].Type) + switch (EmuConfig.Mcd[combinedSlot].Type) { //case MemoryCardType::MemoryCard_File: // return Mcd::impl.ReIndex( combinedSlot, filter ); // break; case MemoryCardType::MemoryCard_Folder: - return Mcd::implFolder.ReIndex(combinedSlot, g_Conf->EmuOptions.McdFolderAutoManage, filter); + return Mcd::implFolder.ReIndex(combinedSlot, EmuConfig.McdFolderAutoManage, filter); break; default: return false; diff --git a/pcsx2/gui/MemoryCardFile.h b/pcsx2/MemoryCardFile.h similarity index 100% rename from pcsx2/gui/MemoryCardFile.h rename to pcsx2/MemoryCardFile.h diff --git a/pcsx2/gui/MemoryCardFolder.cpp b/pcsx2/MemoryCardFolder.cpp similarity index 99% rename from pcsx2/gui/MemoryCardFolder.cpp rename to pcsx2/MemoryCardFolder.cpp index 92735f3e4e..e6f7369635 100644 --- a/pcsx2/gui/MemoryCardFolder.cpp +++ b/pcsx2/MemoryCardFolder.cpp @@ -20,7 +20,7 @@ #include "MemoryCardFolder.h" #include "System.h" -#include "AppConfig.h" +#include "Config.h" #include "yaml-cpp/yaml.h" @@ -91,10 +91,10 @@ bool FolderMemoryCard::IsFormatted() const void FolderMemoryCard::Open(const bool enableFiltering, const wxString& filter) { - Open(g_Conf->FullpathToMcd(m_slot), g_Conf->Mcd[m_slot], 0, enableFiltering, filter, false); + Open(EmuConfig.FullpathToMcd(m_slot), EmuConfig.Mcd[m_slot], 0, enableFiltering, filter, false); } -void FolderMemoryCard::Open(const wxString& fullPath, const AppConfig::McdOptions& mcdOptions, const u32 sizeInClusters, const bool enableFiltering, const wxString& filter, bool simulateFileWrites) +void FolderMemoryCard::Open(const wxString& fullPath, const Pcsx2Config::McdOptions& mcdOptions, const u32 sizeInClusters, const bool enableFiltering, const wxString& filter, bool simulateFileWrites) { InitializeInternalData(); m_performFileWrites = !simulateFileWrites; diff --git a/pcsx2/gui/MemoryCardFolder.h b/pcsx2/MemoryCardFolder.h similarity index 99% rename from pcsx2/gui/MemoryCardFolder.h rename to pcsx2/MemoryCardFolder.h index 9b33660572..e2cc7ee140 100644 --- a/pcsx2/gui/MemoryCardFolder.h +++ b/pcsx2/MemoryCardFolder.h @@ -21,7 +21,7 @@ #include #include -#include "AppConfig.h" +#include "Config.h" //#define DEBUG_WRITE_FOLDER_CARD_IN_MEMORY_TO_FILE_ON_CHANGE @@ -379,7 +379,7 @@ public: // Initialize & Load Memory Card with values configured in the Memory Card Manager void Open(const bool enableFiltering, const wxString& filter); // Initialize & Load Memory Card with provided custom values - void Open(const wxString& fullPath, const AppConfig::McdOptions& mcdOptions, const u32 sizeInClusters, const bool enableFiltering, const wxString& filter, bool simulateFileWrites = false); + void Open(const wxString& fullPath, const Pcsx2Config::McdOptions& mcdOptions, const u32 sizeInClusters, const bool enableFiltering, const wxString& filter, bool simulateFileWrites = false); // Close the memory card and flush changes to the file system. Set flush to false to not store changes. void Close(bool flush = true); diff --git a/pcsx2/Pcsx2Config.cpp b/pcsx2/Pcsx2Config.cpp index 6a19d0e4ed..cdc2db4773 100644 --- a/pcsx2/Pcsx2Config.cpp +++ b/pcsx2/Pcsx2Config.cpp @@ -21,6 +21,7 @@ #include "Config.h" #include "GS.h" #include "CDVD/CDVDaccess.h" +#include "MemoryCardFile.h" #ifndef PCSX2_CORE #include "gui/AppConfig.h" @@ -493,6 +494,20 @@ Pcsx2Config::Pcsx2Config() EnablePatches = true; BackupSavestate = true; +#ifdef __WXMSW__ + McdCompressNTFS = true; +#endif + + // To be moved to FileMemoryCard pluign (someday) + for (uint slot = 0; slot < 8; ++slot) + { + Mcd[slot].Enabled = !FileMcd_IsMultitapSlot(slot); // enables main 2 slots + Mcd[slot].Filename = FileMcd_GetDefaultName(slot); + + // Folder memory card is autodetected later. + Mcd[slot].Type = MemoryCardType::MemoryCard_File; + } + GzipIsoIndexTemplate = L"$(f).pindex.tmp"; CdvdSource = CDVD_SourceType::Iso; @@ -538,6 +553,13 @@ void Pcsx2Config::LoadSave( IniInterface& ini ) #ifdef PCSX2_CORE BaseFilenames.LoadSave(ini); Framerate.LoadSave(ini); + LoadSaveMemcards(ini); + + IniEntry(GzipIsoIndexTemplate); + +#ifdef __WXMSW__ + IniEntry(McdCompressNTFS); +#endif #endif if (ini.IsLoading()) @@ -548,6 +570,30 @@ void Pcsx2Config::LoadSave( IniInterface& ini ) ini.Flush(); } +void Pcsx2Config::LoadSaveMemcards( IniInterface& ini ) +{ + ScopedIniGroup path( ini, L"MemoryCards" ); + + for( uint slot=0; slot<2; ++slot ) + { + ini.Entry( pxsFmt( L"Slot%u_Enable", slot+1 ), + Mcd[slot].Enabled, Mcd[slot].Enabled ); + ini.Entry( pxsFmt( L"Slot%u_Filename", slot+1 ), + Mcd[slot].Filename, Mcd[slot].Filename ); + } + + for( uint slot=2; slot<8; ++slot ) + { + int mtport = FileMcd_GetMtapPort(slot)+1; + int mtslot = FileMcd_GetMtapSlot(slot)+1; + + ini.Entry( pxsFmt( L"Multitap%u_Slot%u_Enable", mtport, mtslot ), + Mcd[slot].Enabled, Mcd[slot].Enabled ); + ini.Entry( pxsFmt( L"Multitap%u_Slot%u_Filename", mtport, mtslot ), + Mcd[slot].Filename, Mcd[slot].Filename ); + } +} + bool Pcsx2Config::MultitapEnabled( uint port ) const { pxAssert( port < 2 ); @@ -577,6 +623,11 @@ wxString Pcsx2Config::FullpathToBios() const return Path::Combine(Folders.Bios, BaseFilenames.Bios); } +wxString Pcsx2Config::FullpathToMcd(uint slot) const +{ + return Path::Combine(Folders.MemoryCards, Mcd[slot].Filename); +} + void Pcsx2Config::CopyConfig(const Pcsx2Config& cfg) { Cpu = cfg.Cpu; @@ -588,6 +639,8 @@ void Pcsx2Config::CopyConfig(const Pcsx2Config& cfg) Trace = cfg.Trace; BaseFilenames = cfg.BaseFilenames; Framerate = cfg.Framerate; + for (u32 i = 0; i < sizeof(Mcd) / sizeof(Mcd[0]); i++) + Mcd[i] = cfg.Mcd[i]; GzipIsoIndexTemplate = cfg.GzipIsoIndexTemplate; @@ -609,4 +662,7 @@ void Pcsx2Config::CopyConfig(const Pcsx2Config& cfg) MultitapPort1_Enabled = cfg.MultitapPort1_Enabled; ConsoleToStdio = cfg.ConsoleToStdio; HostFs = cfg.HostFs; +#ifdef __WXMSW__ + McdCompressNTFS = cfg.McdCompressNTFS; +#endif } diff --git a/pcsx2/Sio.h b/pcsx2/Sio.h index 34873bb8b9..8d03c6e737 100644 --- a/pcsx2/Sio.h +++ b/pcsx2/Sio.h @@ -15,7 +15,7 @@ #pragma once -#include "gui/MemoryCardFile.h" +#include "MemoryCardFile.h" struct _mcd { diff --git a/pcsx2/System/SysCoreThread.cpp b/pcsx2/System/SysCoreThread.cpp index 9d3501baad..ebe06c964e 100644 --- a/pcsx2/System/SysCoreThread.cpp +++ b/pcsx2/System/SysCoreThread.cpp @@ -30,7 +30,7 @@ #include "SPU2/spu2.h" #include "DEV9/DEV9.h" #include "USB/USB.h" -#include "gui/MemoryCardFile.h" +#include "MemoryCardFile.h" #ifdef _WIN32 #include "PAD/Windows/PAD.h" #else diff --git a/pcsx2/gui/AppConfig.cpp b/pcsx2/gui/AppConfig.cpp index 55616e0cc3..003cad2a7e 100644 --- a/pcsx2/gui/AppConfig.cpp +++ b/pcsx2/gui/AppConfig.cpp @@ -17,8 +17,6 @@ #include "App.h" #include "MainFrame.h" -#include "MemoryCardFile.h" - #include "common/IniInterface.h" #include @@ -436,11 +434,6 @@ wxString GetUiKeysFilename() return GetSettingsFolder().Combine( fname ).GetFullPath(); } -wxString AppConfig::FullpathToMcd( uint slot ) const -{ - return Path::Combine( Folders.MemoryCards, Mcd[slot].Filename ); -} - bool IsPortable() { return InstallationMode==InstallMode_Portable; @@ -460,25 +453,12 @@ AppConfig::AppConfig() Toolbar_ImageSize = 24; Toolbar_ShowLabels = true; - #ifdef __WXMSW__ - McdCompressNTFS = true; - #endif EnableSpeedHacks = true; EnableGameFixes = false; EnableFastBoot = true; EnablePresets = true; PresetIndex = 1; - - // To be moved to FileMemoryCard pluign (someday) - for( uint slot=0; slot<8; ++slot ) - { - Mcd[slot].Enabled = !FileMcd_IsMultitapSlot(slot); // enables main 2 slots - Mcd[slot].Filename = FileMcd_GetDefaultName( slot ); - - // Folder memory card is autodetected later. - Mcd[slot].Type = MemoryCardType::MemoryCard_File; - } } // ------------------------------------------------------------------------ @@ -529,30 +509,6 @@ void App_SaveInstallSettings( wxConfigBase* ini ) } // ------------------------------------------------------------------------ -void AppConfig::LoadSaveMemcards( IniInterface& ini ) -{ - ScopedIniGroup path( ini, L"MemoryCards" ); - - for( uint slot=0; slot<2; ++slot ) - { - ini.Entry( pxsFmt( L"Slot%u_Enable", slot+1 ), - Mcd[slot].Enabled, Mcd[slot].Enabled ); - ini.Entry( pxsFmt( L"Slot%u_Filename", slot+1 ), - Mcd[slot].Filename, Mcd[slot].Filename ); - } - - for( uint slot=2; slot<8; ++slot ) - { - int mtport = FileMcd_GetMtapPort(slot)+1; - int mtslot = FileMcd_GetMtapSlot(slot)+1; - - ini.Entry( pxsFmt( L"Multitap%u_Slot%u_Enable", mtport, mtslot ), - Mcd[slot].Enabled, Mcd[slot].Enabled ); - ini.Entry( pxsFmt( L"Multitap%u_Slot%u_Filename", mtport, mtslot ), - Mcd[slot].Filename, Mcd[slot].Filename ); - } -} - void AppConfig::LoadSaveRootItems( IniInterface& ini ) { IniEntry( MainGuiPosition ); @@ -588,7 +544,7 @@ void AppConfig::LoadSaveRootItems( IniInterface& ini ) IniEntry( AskOnBoot ); #ifdef __WXMSW__ - IniEntry( McdCompressNTFS ); + ini.Entry(wxT("McdCompressNTFS"), EmuOptions.McdCompressNTFS, EmuOptions.McdCompressNTFS); #endif } @@ -596,7 +552,7 @@ void AppConfig::LoadSaveRootItems( IniInterface& ini ) void AppConfig::LoadSave( IniInterface& ini ) { LoadSaveRootItems( ini ); - LoadSaveMemcards( ini ); + EmuOptions.LoadSaveMemcards( ini ); // Process various sub-components: ProgLogBox .LoadSave( ini, L"ProgramLog" ); diff --git a/pcsx2/gui/AppConfig.h b/pcsx2/gui/AppConfig.h index ada274f2c9..79ce2a2787 100644 --- a/pcsx2/gui/AppConfig.h +++ b/pcsx2/gui/AppConfig.h @@ -153,16 +153,6 @@ public: bool IsDefault( FoldersEnum_t folderidx ) const; }; - // ------------------------------------------------------------------------ - // Options struct for each memory card. - // - struct McdOptions - { - wxFileName Filename; // user-configured location of this memory card - bool Enabled; // memory card enabled (if false, memcard will not show up in-game) - MemoryCardType Type; // the memory card implementation that should be used - }; - // ------------------------------------------------------------------------ // The GS window receives much love from the land of Options and Settings. // @@ -260,11 +250,6 @@ public: // Enables display of toolbar text labels. bool Toolbar_ShowLabels; - // uses automatic ntfs compression when creating new memory cards (Win32 only) -#ifdef __WXMSW__ - bool McdCompressNTFS; -#endif - // Master toggle for enabling or disabling all speedhacks in one fail-free swoop. // (the toggle is applied when a new EmuConfig is sent through AppCoreThread::ApplySettings) bool EnableSpeedHacks; @@ -283,10 +268,6 @@ public: bool AskOnBoot; - // Memorycard options - first 2 are default slots, last 6 are multitap 1 and 2 - // slots (3 each) - McdOptions Mcd[8]; - ConsoleLogOptions ProgLogBox; FolderOptions Folders; GSWindowOptions GSWindow; @@ -305,11 +286,8 @@ public: public: AppConfig(); - wxString FullpathToMcd( uint slot ) const; - void LoadSave( IniInterface& ini ); void LoadSaveRootItems( IniInterface& ini ); - void LoadSaveMemcards( IniInterface& ini ); static int GetMaxPresetIndex(); static bool isOkGetPresetTextAndColor(int n, wxString& label, wxColor& c); diff --git a/pcsx2/gui/AppMain.cpp b/pcsx2/gui/AppMain.cpp index ec35f5b167..018daadce4 100644 --- a/pcsx2/gui/AppMain.cpp +++ b/pcsx2/gui/AppMain.cpp @@ -745,7 +745,7 @@ void AppApplySettings( const AppConfig* oldconf ) // Memcards generally compress very well via NTFS compression. #ifdef __WXMSW__ - NTFS_CompressFile( g_Conf->Folders.MemoryCards.ToString(), g_Conf->McdCompressNTFS ); + NTFS_CompressFile( g_Conf->Folders.MemoryCards.ToString(), g_Conf->EmuOptions.McdCompressNTFS ); #endif sApp.DispatchEvent( AppStatus_SettingsApplied ); diff --git a/pcsx2/gui/Dialogs/ConfigurationDialog.h b/pcsx2/gui/Dialogs/ConfigurationDialog.h index bad3c2700f..66bde6cf9b 100644 --- a/pcsx2/gui/Dialogs/ConfigurationDialog.h +++ b/pcsx2/gui/Dialogs/ConfigurationDialog.h @@ -196,7 +196,7 @@ namespace Dialogs public: virtual ~ConvertMemoryCardDialog() = default; - ConvertMemoryCardDialog( wxWindow* parent, const wxDirName& mcdPath, const AppConfig::McdOptions& mcdSourceConfig ); + ConvertMemoryCardDialog( wxWindow* parent, const wxDirName& mcdPath, const Pcsx2Config::McdOptions& mcdSourceConfig ); protected: void CreateControls( const MemoryCardType sourceType ); diff --git a/pcsx2/gui/Dialogs/ConvertMemoryCardDialog.cpp b/pcsx2/gui/Dialogs/ConvertMemoryCardDialog.cpp index 822e607a51..cc63132833 100644 --- a/pcsx2/gui/Dialogs/ConvertMemoryCardDialog.cpp +++ b/pcsx2/gui/Dialogs/ConvertMemoryCardDialog.cpp @@ -19,8 +19,8 @@ #include "gui/MSWstuff.h" -#include "gui/MemoryCardFile.h" -#include "gui/MemoryCardFolder.h" +#include "MemoryCardFile.h" +#include "MemoryCardFolder.h" #include enum MemoryCardConversionType { @@ -32,7 +32,7 @@ enum MemoryCardConversionType { MemoryCardConversion_MaxCount }; -Dialogs::ConvertMemoryCardDialog::ConvertMemoryCardDialog( wxWindow* parent, const wxDirName& mcdPath, const AppConfig::McdOptions& mcdSourceConfig ) +Dialogs::ConvertMemoryCardDialog::ConvertMemoryCardDialog( wxWindow* parent, const wxDirName& mcdPath, const Pcsx2Config::McdOptions& mcdSourceConfig ) : wxDialogWithHelpers( parent, _( "Convert a memory card to a different format" ) ) , m_mcdPath( mcdPath ) , m_mcdSourceFilename( mcdSourceConfig.Filename.GetFullName() ) @@ -175,7 +175,7 @@ bool Dialogs::ConvertMemoryCardDialog::ConvertToFile( const wxFileName& sourcePa } FolderMemoryCard sourceFolderMemoryCard; - AppConfig::McdOptions config; + Pcsx2Config::McdOptions config; config.Enabled = true; config.Type = MemoryCardType::MemoryCard_Folder; sourceFolderMemoryCard.Open( sourcePath.GetFullPath(), config, ( sizeInMB * 1024 * 1024 ) / FolderMemoryCard::ClusterSize, false, L"" ); @@ -204,7 +204,7 @@ bool Dialogs::ConvertMemoryCardDialog::ConvertToFolder( const wxFileName& source u8 buffer[FolderMemoryCard::PageSizeRaw]; FolderMemoryCard targetFolderMemoryCard; - AppConfig::McdOptions config; + Pcsx2Config::McdOptions config; config.Enabled = true; config.Type = MemoryCardType::MemoryCard_Folder; u32 adr = 0; diff --git a/pcsx2/gui/Dialogs/CreateMemoryCardDialog.cpp b/pcsx2/gui/Dialogs/CreateMemoryCardDialog.cpp index 14b8aec7e4..891e1198a9 100644 --- a/pcsx2/gui/Dialogs/CreateMemoryCardDialog.cpp +++ b/pcsx2/gui/Dialogs/CreateMemoryCardDialog.cpp @@ -18,7 +18,7 @@ #include "System.h" #include "gui/MSWstuff.h" -#include "gui/MemoryCardFile.h" +#include "MemoryCardFile.h" //#include #include @@ -158,7 +158,7 @@ void Dialogs::CreateMemoryCardDialog::OnOk_Click( wxCommandEvent& evt ) // [TODO] Remove g_Conf->McdCompressNTFS, and have this dialog load/save directly from the ini. #ifdef __WXMSW__ - g_Conf->McdCompressNTFS = m_check_CompressNTFS->GetValue(); + g_Conf->EmuOptions.McdCompressNTFS = m_check_CompressNTFS->GetValue(); #endif result_createdMcdFilename=L"_INVALID_FILE_NAME_"; @@ -220,7 +220,7 @@ void Dialogs::CreateMemoryCardDialog::CreateControls() // Initial value of the checkbox is saved between calls to the dialog box. If the user checks // the option, it remains checked for future dialog. If the user unchecks it, ditto. - m_check_CompressNTFS->SetValue( g_Conf->McdCompressNTFS ); + m_check_CompressNTFS->SetValue( g_Conf->EmuOptions.McdCompressNTFS ); #endif m_text_filenameInput = new wxTextCtrl(this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_PROCESS_ENTER); diff --git a/pcsx2/gui/Panels/MemoryCardListPanel.cpp b/pcsx2/gui/Panels/MemoryCardListPanel.cpp index 15c55b8574..790016fadc 100644 --- a/pcsx2/gui/Panels/MemoryCardListPanel.cpp +++ b/pcsx2/gui/Panels/MemoryCardListPanel.cpp @@ -16,7 +16,7 @@ #include "PrecompiledHeader.h" #include "gui/AppCoreThread.h" #include "System.h" -#include "gui/MemoryCardFile.h" +#include "MemoryCardFile.h" #include "ConfigurationPanels.h" #include "MemoryCardPanels.h" @@ -546,17 +546,17 @@ void Panels::MemoryCardListPanel_Simple::Apply() Console.WriteLn(L"Apply memory cards:"); for (uint slot = 0; slot < 8; ++slot) { - g_Conf->Mcd[slot].Type = m_Cards[slot].Type; - g_Conf->Mcd[slot].Enabled = m_Cards[slot].IsEnabled && m_Cards[slot].IsPresent; + g_Conf->EmuOptions.Mcd[slot].Type = m_Cards[slot].Type; + g_Conf->EmuOptions.Mcd[slot].Enabled = m_Cards[slot].IsEnabled && m_Cards[slot].IsPresent; if (m_Cards[slot].IsPresent) - g_Conf->Mcd[slot].Filename = m_Cards[slot].Filename; + g_Conf->EmuOptions.Mcd[slot].Filename = m_Cards[slot].Filename; else - g_Conf->Mcd[slot].Filename = L""; + g_Conf->EmuOptions.Mcd[slot].Filename = L""; - if (g_Conf->Mcd[slot].Enabled) + if (g_Conf->EmuOptions.Mcd[slot].Enabled) { used++; - Console.WriteLn(L"slot[%d]='%s'", slot, WX_STR(g_Conf->Mcd[slot].Filename.GetFullName())); + Console.WriteLn(L"slot[%d]='%s'", slot, WX_STR(g_Conf->EmuOptions.Mcd[slot].Filename.GetFullName())); } } if (!used) @@ -569,8 +569,8 @@ void Panels::MemoryCardListPanel_Simple::AppStatusEvent_OnSettingsApplied() { for (uint slot = 0; slot < 8; ++slot) { - m_Cards[slot].IsEnabled = g_Conf->Mcd[slot].Enabled; - m_Cards[slot].Filename = g_Conf->Mcd[slot].Filename; + m_Cards[slot].IsEnabled = g_Conf->EmuOptions.Mcd[slot].Enabled; + m_Cards[slot].Filename = g_Conf->EmuOptions.Mcd[slot].Filename; // Automatically create the enabled but non-existing file such that it can be managed (else will get created anyway on boot) wxString targetFile = (GetMcdPath() + m_Cards[slot].Filename.GetFullName()).GetFullPath(); @@ -697,7 +697,7 @@ void Panels::MemoryCardListPanel_Simple::UiConvertCard(McdSlotItem& card) return; } - AppConfig::McdOptions config; + Pcsx2Config::McdOptions config; config.Filename = card.Filename.GetFullName(); config.Enabled = card.IsEnabled; config.Type = card.Type; diff --git a/pcsx2/pcsx2.vcxproj b/pcsx2/pcsx2.vcxproj index 9d6a70caf2..2a8100789f 100644 --- a/pcsx2/pcsx2.vcxproj +++ b/pcsx2/pcsx2.vcxproj @@ -323,6 +323,8 @@ + + @@ -660,8 +662,6 @@ - - @@ -772,6 +772,8 @@ + + @@ -1082,8 +1084,6 @@ - - diff --git a/pcsx2/pcsx2.vcxproj.filters b/pcsx2/pcsx2.vcxproj.filters index 1f87e014f4..6288065600 100644 --- a/pcsx2/pcsx2.vcxproj.filters +++ b/pcsx2/pcsx2.vcxproj.filters @@ -761,12 +761,6 @@ AppHost - - AppHost - - - AppHost - AppHost @@ -1667,6 +1661,12 @@ AppHost + + System\Ps2\Iop + + + System\Ps2\Iop + @@ -1993,12 +1993,6 @@ AppHost\Include - - AppHost\Include - - - AppHost\Include - AppHost\Include @@ -2767,6 +2761,12 @@ AppHost + + System\Ps2\Iop + + + System\Ps2\Iop +