mirror of
https://github.com/RetroDECK/Duckstation.git
synced 2024-11-27 08:05:41 +00:00
System: Add non-persistent memory card type
This commit is contained in:
parent
3dc7ef92c2
commit
d9a655fb41
|
@ -21,6 +21,7 @@ public:
|
||||||
static std::unique_ptr<MemoryCard> Open(std::string_view filename);
|
static std::unique_ptr<MemoryCard> Open(std::string_view filename);
|
||||||
|
|
||||||
const MemoryCardImage::DataArray& GetData() const { return m_data; }
|
const MemoryCardImage::DataArray& GetData() const { return m_data; }
|
||||||
|
MemoryCardImage::DataArray& GetData() { return m_data; }
|
||||||
const std::string& GetFilename() const { return m_filename; }
|
const std::string& GetFilename() const { return m_filename; }
|
||||||
void SetFilename(std::string filename) { m_filename = std::move(filename); }
|
void SetFilename(std::string filename) { m_filename = std::move(filename); }
|
||||||
|
|
||||||
|
|
|
@ -910,13 +910,14 @@ const char* Settings::GetControllerTypeDisplayName(ControllerType type)
|
||||||
return s_controller_display_names[static_cast<int>(type)];
|
return s_controller_display_names[static_cast<int>(type)];
|
||||||
}
|
}
|
||||||
|
|
||||||
static std::array<const char*, 5> s_memory_card_type_names = {
|
static std::array<const char*, 6> s_memory_card_type_names = {
|
||||||
{"None", "Shared", "PerGame", "PerGameTitle", "PerGameFileTitle"}};
|
{"None", "Shared", "PerGame", "PerGameTitle", "PerGameFileTitle", "NonPersistent"}};
|
||||||
static std::array<const char*, 5> s_memory_card_type_display_names = {
|
static std::array<const char*, 6> s_memory_card_type_display_names = {
|
||||||
{TRANSLATABLE("MemoryCardType", "No Memory Card"), TRANSLATABLE("MemoryCardType", "Shared Between All Games"),
|
{TRANSLATABLE("MemoryCardType", "No Memory Card"), TRANSLATABLE("MemoryCardType", "Shared Between All Games"),
|
||||||
TRANSLATABLE("MemoryCardType", "Separate Card Per Game (Game Code)"),
|
TRANSLATABLE("MemoryCardType", "Separate Card Per Game (Game Code)"),
|
||||||
TRANSLATABLE("MemoryCardType", "Separate Card Per Game (Game Title)"),
|
TRANSLATABLE("MemoryCardType", "Separate Card Per Game (Game Title)"),
|
||||||
TRANSLATABLE("MemoryCardType", "Separate Card Per Game (File Title)")}};
|
TRANSLATABLE("MemoryCardType", "Separate Card Per Game (File Title)"),
|
||||||
|
TRANSLATABLE("MemoryCardType", "Non-Persistent Card (Do Not Save)")}};
|
||||||
|
|
||||||
std::optional<MemoryCardType> Settings::ParseMemoryCardTypeName(const char* str)
|
std::optional<MemoryCardType> Settings::ParseMemoryCardTypeName(const char* str)
|
||||||
{
|
{
|
||||||
|
|
|
@ -1871,6 +1871,12 @@ void UpdateMemoryCards()
|
||||||
card = MemoryCard::Open(g_settings.memory_card_paths[i]);
|
card = MemoryCard::Open(g_settings.memory_card_paths[i]);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case MemoryCardType::NonPersistent:
|
||||||
|
{
|
||||||
|
card = MemoryCard::Create();
|
||||||
|
}
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (card)
|
if (card)
|
||||||
|
|
|
@ -135,6 +135,7 @@ enum class MemoryCardType
|
||||||
PerGame,
|
PerGame,
|
||||||
PerGameTitle,
|
PerGameTitle,
|
||||||
PerGameFileTitle,
|
PerGameFileTitle,
|
||||||
|
NonPersistent,
|
||||||
Count
|
Count
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue