From d861b8caca1f4a8725ae72f936c492faf9c37502 Mon Sep 17 00:00:00 2001 From: "Admiral H. Curtiss" Date: Sun, 26 Feb 2023 22:45:55 +0100 Subject: Config: Add setting for SD card file size when converting. --- Source/Core/Common/FatFsUtil.cpp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'Source/Core/Common/FatFsUtil.cpp') diff --git a/Source/Core/Common/FatFsUtil.cpp b/Source/Core/Common/FatFsUtil.cpp index f194dc22a3..88d746e8ea 100644 --- a/Source/Core/Common/FatFsUtil.cpp +++ b/Source/Core/Common/FatFsUtil.cpp @@ -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& 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); -- cgit v1.2.3