mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-08-22 10:19:01 +00:00
Merge pull request #11609 from AdmiralCurtiss/sd-size-select
Add SD card size option for converting folder -> file.
This commit is contained in:
commit
ca484c7a65
5 changed files with 70 additions and 3 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue