Move MemoryCard{File,Folder} out of GUI

This commit is contained in:
Connor McLaughlin 2021-09-17 18:42:39 +10:00 committed by Kojin
parent 307feefa87
commit 640e955c38
18 changed files with 146 additions and 136 deletions

View File

@ -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

View File

@ -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;

View File

@ -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 <wx/ffile.h>
#include <map>
@ -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;

View File

@ -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;

View File

@ -21,7 +21,7 @@
#include <map>
#include <vector>
#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);

View File

@ -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
}

View File

@ -15,7 +15,7 @@
#pragma once
#include "gui/MemoryCardFile.h"
#include "MemoryCardFile.h"
struct _mcd
{

View File

@ -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

View File

@ -17,8 +17,6 @@
#include "App.h"
#include "MainFrame.h"
#include "MemoryCardFile.h"
#include "common/IniInterface.h"
#include <wx/stdpaths.h>
@ -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" );

View File

@ -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);

View File

@ -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 );

View File

@ -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 );

View File

@ -19,8 +19,8 @@
#include "gui/MSWstuff.h"
#include "gui/MemoryCardFile.h"
#include "gui/MemoryCardFolder.h"
#include "MemoryCardFile.h"
#include "MemoryCardFolder.h"
#include <wx/ffile.h>
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;

View File

@ -18,7 +18,7 @@
#include "System.h"
#include "gui/MSWstuff.h"
#include "gui/MemoryCardFile.h"
#include "MemoryCardFile.h"
//#include <wx/filepicker.h>
#include <wx/ffile.h>
@ -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);

View File

@ -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;

View File

@ -323,6 +323,8 @@
<ClCompile Include="IopGte.cpp" />
<ClCompile Include="IPC.cpp" />
<ClCompile Include="FW.cpp" />
<ClCompile Include="MemoryCardFile.cpp" />
<ClCompile Include="MemoryCardFolder.cpp" />
<ClCompile Include="PAD\Windows\PADConfig.cpp" />
<ClCompile Include="PAD\Windows\DeviceEnumerator.cpp" />
<ClCompile Include="PAD\Windows\Diagnostics.cpp" />
@ -660,8 +662,6 @@
<ClCompile Include="gui\IsoDropTarget.cpp" />
<ClCompile Include="gui\MainFrame.cpp" />
<ClCompile Include="gui\MainMenuClicks.cpp" />
<ClCompile Include="gui\MemoryCardFile.cpp" />
<ClCompile Include="gui\MemoryCardFolder.cpp" />
<ClCompile Include="gui\MessageBoxes.cpp" />
<ClCompile Include="gui\MSWstuff.cpp" />
<ClCompile Include="gui\RecentIsoList.cpp" />
@ -772,6 +772,8 @@
<ClInclude Include="IopGte.h" />
<ClInclude Include="IPC.h" />
<ClInclude Include="FW.h" />
<ClInclude Include="MemoryCardFile.h" />
<ClInclude Include="MemoryCardFolder.h" />
<ClInclude Include="PAD\Windows\PAD.h" />
<ClInclude Include="PAD\Windows\PADConfig.h" />
<ClInclude Include="PAD\Windows\DeviceEnumerator.h" />
@ -1082,8 +1084,6 @@
<ClInclude Include="gui\GSFrame.h" />
<ClInclude Include="gui\IsoDropTarget.h" />
<ClInclude Include="gui\MainFrame.h" />
<ClInclude Include="gui\MemoryCardFile.h" />
<ClInclude Include="gui\MemoryCardFolder.h" />
<ClInclude Include="gui\pxEventThread.h" />
<ClInclude Include="gui\RecentIsoList.h" />
<ClInclude Include="PathDefs.h" />

View File

@ -761,12 +761,6 @@
<ClCompile Include="gui\MainMenuClicks.cpp">
<Filter>AppHost</Filter>
</ClCompile>
<ClCompile Include="gui\MemoryCardFile.cpp">
<Filter>AppHost</Filter>
</ClCompile>
<ClCompile Include="gui\MemoryCardFolder.cpp">
<Filter>AppHost</Filter>
</ClCompile>
<ClCompile Include="gui\MessageBoxes.cpp">
<Filter>AppHost</Filter>
</ClCompile>
@ -1667,6 +1661,12 @@
<ClCompile Include="gui\pxRadioPanel.cpp">
<Filter>AppHost</Filter>
</ClCompile>
<ClCompile Include="MemoryCardFile.cpp">
<Filter>System\Ps2\Iop</Filter>
</ClCompile>
<ClCompile Include="MemoryCardFolder.cpp">
<Filter>System\Ps2\Iop</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="Patch.h">
@ -1993,12 +1993,6 @@
<ClInclude Include="gui\MainFrame.h">
<Filter>AppHost\Include</Filter>
</ClInclude>
<ClInclude Include="gui\MemoryCardFile.h">
<Filter>AppHost\Include</Filter>
</ClInclude>
<ClInclude Include="gui\MemoryCardFolder.h">
<Filter>AppHost\Include</Filter>
</ClInclude>
<ClInclude Include="gui\RecentIsoList.h">
<Filter>AppHost\Include</Filter>
</ClInclude>
@ -2767,6 +2761,12 @@
<ClInclude Include="gui\pxEvents.h">
<Filter>AppHost</Filter>
</ClInclude>
<ClInclude Include="MemoryCardFolder.h">
<Filter>System\Ps2\Iop</Filter>
</ClInclude>
<ClInclude Include="MemoryCardFile.h">
<Filter>System\Ps2\Iop</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="windows\wxResources.rc">