Core: Port memory card size override setting to new config system.

This commit is contained in:
Admiral H. Curtiss 2022-01-25 23:50:03 +01:00
parent b237c7479e
commit b88507a3ed
No known key found for this signature in database
GPG Key ID: F051B4C4044F33FB
3 changed files with 4 additions and 4 deletions

View File

@ -88,6 +88,8 @@ const Info<std::string>& GetInfoForGCIPathOverride(ExpansionInterface::Slot slot
return *infos[slot];
}
const Info<int> MAIN_MEMORY_CARD_SIZE{{System::Main, "Core", "MemoryCardSize"}, -1};
const Info<ExpansionInterface::EXIDeviceType> MAIN_SLOT_A{
{System::Main, "Core", "SlotA"}, ExpansionInterface::EXIDeviceType::MemoryCardFolder};
const Info<ExpansionInterface::EXIDeviceType> MAIN_SLOT_B{{System::Main, "Core", "SlotB"},

View File

@ -73,6 +73,7 @@ const Info<std::string>& GetInfoForAGPCartPath(ExpansionInterface::Slot slot);
extern const Info<std::string> MAIN_GCI_FOLDER_A_PATH_OVERRIDE;
extern const Info<std::string> MAIN_GCI_FOLDER_B_PATH_OVERRIDE;
const Info<std::string>& GetInfoForGCIPathOverride(ExpansionInterface::Slot slot);
extern const Info<int> MAIN_MEMORY_CARD_SIZE;
extern const Info<ExpansionInterface::EXIDeviceType> MAIN_SLOT_A;
extern const Info<ExpansionInterface::EXIDeviceType> MAIN_SLOT_B;
extern const Info<ExpansionInterface::EXIDeviceType> MAIN_SERIAL_PORT_1;

View File

@ -8,7 +8,6 @@
#include "Common/ChunkFile.h"
#include "Common/CommonTypes.h"
#include "Common/IniFile.h"
#include "Core/Config/MainSettings.h"
#include "Core/ConfigManager.h"
@ -114,9 +113,7 @@ void Init()
{
u16 size_mbits = Memcard::MBIT_SIZE_MEMORY_CARD_2043;
int size_override;
IniFile gameIni = SConfig::GetInstance().LoadGameIni();
gameIni.GetOrCreateSection("Core")->Get("MemoryCardSize", &size_override, -1);
int size_override = Config::Get(Config::MAIN_MEMORY_CARD_SIZE);
if (size_override >= 0 && size_override <= 4)
size_mbits = Memcard::MBIT_SIZE_MEMORY_CARD_59 << size_override;
const bool shift_jis =