FSC: Use utf8 for mounting and internal target path

This commit is contained in:
Exzap 2022-09-09 00:18:37 +02:00
parent cf598e38c1
commit 0e0602e8d9
10 changed files with 40 additions and 47 deletions

View file

@ -109,7 +109,7 @@ namespace coreinit
std::error_code ec;
const auto path = ActiveSettings::GetPath("sdcard/");
fs::create_directories(path, ec);
FSCDeviceHostFS_Mount("/vol/external01", path.generic_wstring().c_str() , FSC_PRIORITY_BASE);
FSCDeviceHostFS_Mount("/vol/external01", _utf8Wrapper(path), FSC_PRIORITY_BASE);
_sdCard01Mounted = true;
}
@ -142,7 +142,7 @@ namespace coreinit
std::error_code ec;
const auto path = ActiveSettings::GetPath("sdcard/");
fs::create_directories(path, ec);
if (!FSCDeviceHostFS_Mount(mountPathOut, path.generic_wstring().c_str(), FSC_PRIORITY_BASE))
if (!FSCDeviceHostFS_Mount(mountPathOut, _utf8Wrapper(path), FSC_PRIORITY_BASE))
return FS_RESULT::ERR_PLACEHOLDER;
_sdCard01Mounted = true;
}
@ -150,7 +150,7 @@ namespace coreinit
if (_mlc01Mounted)
return FS_RESULT::ERR_PLACEHOLDER;
if (!FSCDeviceHostFS_Mount(mountPathOut, ActiveSettings::GetMlcPath().generic_wstring().c_str(), FSC_PRIORITY_BASE))
if (!FSCDeviceHostFS_Mount(mountPathOut, _utf8Wrapper(ActiveSettings::GetMlcPath()), FSC_PRIORITY_BASE))
return FS_RESULT::ERR_PLACEHOLDER;
_mlc01Mounted = true;
}

View file

@ -51,7 +51,7 @@ namespace acp
// mount save path
const auto mlc = ActiveSettings::GetMlcPath("usr/save/{:08x}/{:08x}/user/", high, low);
FSCDeviceHostFS_Mount("/vol/save/", mlc.generic_wstring().c_str(), FSC_PRIORITY_BASE);
FSCDeviceHostFS_Mount("/vol/save/", _utf8Wrapper(mlc), FSC_PRIORITY_BASE);
nnResult mountResult = BUILD_NN_RESULT(NN_RESULT_LEVEL_SUCCESS, NN_RESULT_MODULE_NN_ACP, 0);
return _ACPConvertResultToACPStatus(&mountResult, "ACPMountSaveDir", 0x60);
}