System: Support per-game memory cards

This commit is contained in:
Connor McLaughlin
2020-04-27 16:15:38 +10:00
parent 39498849bd
commit 74e455a5f7
6 changed files with 125 additions and 18 deletions

View File

@ -92,8 +92,14 @@ struct Settings
bool bios_patch_fast_boot = false;
std::array<ControllerType, NUM_CONTROLLER_AND_CARD_PORTS> controller_types{};
std::array<MemoryCardType, NUM_CONTROLLER_AND_CARD_PORTS> memory_card_types{};
std::array<std::string, NUM_CONTROLLER_AND_CARD_PORTS> memory_card_paths{};
ALWAYS_INLINE bool HasAnyPerGameMemoryCards() const
{
return (memory_card_types[0] == MemoryCardType::PerGame || memory_card_types[1] == MemoryCardType::PerGame);
}
void Load(SettingsInterface& si);
void Save(SettingsInterface& si) const;
@ -129,6 +135,10 @@ struct Settings
static const char* GetControllerTypeName(ControllerType type);
static const char* GetControllerTypeDisplayName(ControllerType type);
static std::optional<MemoryCardType> ParseMemoryCardTypeName(const char* str);
static const char* GetMemoryCardTypeName(MemoryCardType type);
static const char* GetMemoryCardTypeDisplayName(MemoryCardType type);
// Default to D3D11 on Windows as it's more performant and at this point, less buggy.
#ifdef WIN32
static constexpr GPURenderer DEFAULT_GPU_RENDERER = GPURenderer::HardwareD3D11;