mirror of
https://github.com/Atmosphere-NX/Atmosphere.git
synced 2025-05-28 13:44:11 -04:00
loader: add SetExternalContentSource extension
This commit is contained in:
parent
18f51e9b2e
commit
5c147e5188
9 changed files with 132 additions and 4 deletions
|
@ -31,6 +31,12 @@ static bool g_nso_present[NSO_NUM_MAX] = {0};
|
|||
|
||||
static char g_nso_path[FS_MAX_PATH] = {0};
|
||||
|
||||
FILE *NsoUtils::OpenNsoFromECS(unsigned int index, ContentManagement::ExternalContentSource *ecs) {
|
||||
std::fill(g_nso_path, g_nso_path + FS_MAX_PATH, 0);
|
||||
snprintf(g_nso_path, FS_MAX_PATH, "%s:/%s", ecs->mountpoint, NsoUtils::GetNsoFileName(index));
|
||||
return fopen(g_nso_path, "rb");
|
||||
}
|
||||
|
||||
FILE *NsoUtils::OpenNsoFromHBL(unsigned int index) {
|
||||
std::fill(g_nso_path, g_nso_path + FS_MAX_PATH, 0);
|
||||
snprintf(g_nso_path, FS_MAX_PATH, "hbl:/%s", NsoUtils::GetNsoFileName(index));
|
||||
|
@ -61,6 +67,11 @@ bool NsoUtils::CheckNsoStubbed(unsigned int index, u64 title_id) {
|
|||
}
|
||||
|
||||
FILE *NsoUtils::OpenNso(unsigned int index, u64 title_id) {
|
||||
ContentManagement::ExternalContentSource *ecs = nullptr;
|
||||
if ((ecs = ContentManagement::GetExternalContentSource(title_id)) != nullptr) {
|
||||
return OpenNsoFromECS(index, ecs);
|
||||
}
|
||||
|
||||
if (ContentManagement::ShouldOverrideContents(title_id)) {
|
||||
if (ContentManagement::ShouldReplaceWithHBL(title_id)) {
|
||||
return OpenNsoFromHBL(index);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue