mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2024-11-14 21:37:52 -07:00
Config: Add setting for SD card file size when converting.
This commit is contained in:
parent
1a2dcc53f2
commit
d861b8caca
@ -26,6 +26,8 @@
|
||||
#include "Common/ScopeGuard.h"
|
||||
#include "Common/StringUtil.h"
|
||||
|
||||
#include "Core/Config/MainSettings.h"
|
||||
|
||||
enum : u32
|
||||
{
|
||||
SECTOR_SIZE = 512,
|
||||
@ -513,9 +515,13 @@ bool SyncSDFolderToSDImage(const std::function<bool()>& cancelled, bool determin
|
||||
if (!CheckIfFATCompatible(root))
|
||||
return false;
|
||||
|
||||
u64 size = GetSize(root);
|
||||
// Allocate a reasonable amount of free space
|
||||
size += std::clamp(size / 2, MebibytesToBytes(512), GibibytesToBytes(8));
|
||||
u64 size = Config::Get(Config::MAIN_WII_SD_CARD_FILESIZE);
|
||||
if (size == 0)
|
||||
{
|
||||
size = GetSize(root);
|
||||
// Allocate a reasonable amount of free space
|
||||
size += std::clamp(size / 2, MebibytesToBytes(512), GibibytesToBytes(8));
|
||||
}
|
||||
size = AlignUp(size, MAX_CLUSTER_SIZE);
|
||||
|
||||
std::lock_guard lk(s_fatfs_mutex);
|
||||
|
@ -10,6 +10,7 @@
|
||||
#include "AudioCommon/AudioCommon.h"
|
||||
#include "Common/Assert.h"
|
||||
#include "Common/CommonPaths.h"
|
||||
#include "Common/CommonTypes.h"
|
||||
#include "Common/Config/Config.h"
|
||||
#include "Common/EnumMap.h"
|
||||
#include "Common/FileUtil.h"
|
||||
@ -175,6 +176,7 @@ const Info<bool>& GetInfoForSimulateKonga(int channel)
|
||||
const Info<bool> MAIN_WII_SD_CARD{{System::Main, "Core", "WiiSDCard"}, true};
|
||||
const Info<bool> MAIN_WII_SD_CARD_ENABLE_FOLDER_SYNC{
|
||||
{System::Main, "Core", "WiiSDCardEnableFolderSync"}, false};
|
||||
const Info<u64> MAIN_WII_SD_CARD_FILESIZE{{System::Main, "Core", "WiiSDCardFilesize"}, 0};
|
||||
const Info<bool> MAIN_WII_KEYBOARD{{System::Main, "Core", "WiiKeyboard"}, false};
|
||||
const Info<bool> MAIN_WIIMOTE_CONTINUOUS_SCANNING{
|
||||
{System::Main, "Core", "WiimoteContinuousScanning"}, false};
|
||||
|
@ -9,6 +9,7 @@
|
||||
#include <utility>
|
||||
|
||||
#include "Common/Common.h"
|
||||
#include "Common/CommonTypes.h"
|
||||
#include "Common/Config/Config.h"
|
||||
#include "DiscIO/Enums.h"
|
||||
|
||||
@ -98,6 +99,7 @@ const Info<bool>& GetInfoForAdapterRumble(int channel);
|
||||
const Info<bool>& GetInfoForSimulateKonga(int channel);
|
||||
extern const Info<bool> MAIN_WII_SD_CARD;
|
||||
extern const Info<bool> MAIN_WII_SD_CARD_ENABLE_FOLDER_SYNC;
|
||||
extern const Info<u64> MAIN_WII_SD_CARD_FILESIZE;
|
||||
extern const Info<bool> MAIN_WII_KEYBOARD;
|
||||
extern const Info<bool> MAIN_WIIMOTE_CONTINUOUS_SCANNING;
|
||||
extern const Info<bool> MAIN_WIIMOTE_ENABLE_SPEAKER;
|
||||
|
Loading…
Reference in New Issue
Block a user