mirror of
https://github.com/Atmosphere-NX/Atmosphere
synced 2024-11-10 07:06:34 +00:00
loader: make ShouldOverrideContents take a tid argument
This commit is contained in:
parent
a502d31cd1
commit
376feb63bd
4 changed files with 7 additions and 7 deletions
|
@ -56,7 +56,7 @@ Result ContentManagement::MountCode(u64 tid, FsStorageId sid) {
|
||||||
RefreshConfigurationData();
|
RefreshConfigurationData();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ShouldOverrideContents() && R_SUCCEEDED(MountCodeNspOnSd(tid))) {
|
if (ShouldOverrideContents(tid) && R_SUCCEEDED(MountCodeNspOnSd(tid))) {
|
||||||
return 0x0;
|
return 0x0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -302,7 +302,7 @@ bool ContentManagement::ShouldReplaceWithHBL(u64 tid) {
|
||||||
return g_mounted_hbl_nsp && tid == g_override_hbl_tid;
|
return g_mounted_hbl_nsp && tid == g_override_hbl_tid;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ContentManagement::ShouldOverrideContents() {
|
bool ContentManagement::ShouldOverrideContents(u64 tid) {
|
||||||
if (HasCreatedTitle(0x0100000000001000)) {
|
if (HasCreatedTitle(0x0100000000001000)) {
|
||||||
u64 kDown = 0;
|
u64 kDown = 0;
|
||||||
bool keys_triggered = (R_SUCCEEDED(HidManagement::GetKeysDown(&kDown)) && ((kDown & g_override_key_combination) != 0));
|
bool keys_triggered = (R_SUCCEEDED(HidManagement::GetKeysDown(&kDown)) && ((kDown & g_override_key_combination) != 0));
|
||||||
|
|
|
@ -38,5 +38,5 @@ class ContentManagement {
|
||||||
static void TryMountSdCard();
|
static void TryMountSdCard();
|
||||||
|
|
||||||
static bool ShouldReplaceWithHBL(u64 tid);
|
static bool ShouldReplaceWithHBL(u64 tid);
|
||||||
static bool ShouldOverrideContents();
|
static bool ShouldOverrideContents(u64 tid);
|
||||||
};
|
};
|
||||||
|
|
|
@ -53,7 +53,7 @@ FILE *NpdmUtils::OpenNpdmFromSdCard(u64 title_id) {
|
||||||
|
|
||||||
|
|
||||||
FILE *NpdmUtils::OpenNpdm(u64 title_id) {
|
FILE *NpdmUtils::OpenNpdm(u64 title_id) {
|
||||||
if (ContentManagement::ShouldOverrideContents()) {
|
if (ContentManagement::ShouldOverrideContents(title_id)) {
|
||||||
if (ContentManagement::ShouldReplaceWithHBL(title_id)) {
|
if (ContentManagement::ShouldReplaceWithHBL(title_id)) {
|
||||||
return OpenNpdmFromHBL();
|
return OpenNpdmFromHBL();
|
||||||
}
|
}
|
||||||
|
@ -182,7 +182,7 @@ Result NpdmUtils::LoadNpdm(u64 tid, NpdmInfo *out) {
|
||||||
info->acid->title_id_range_max = tid;
|
info->acid->title_id_range_max = tid;
|
||||||
info->aci0->title_id = tid;
|
info->aci0->title_id = tid;
|
||||||
|
|
||||||
if (ContentManagement::ShouldOverrideContents() && ContentManagement::ShouldReplaceWithHBL(tid)
|
if (ContentManagement::ShouldOverrideContents(tid) && ContentManagement::ShouldReplaceWithHBL(tid)
|
||||||
&& R_SUCCEEDED(LoadNpdmInternal(OpenNpdmFromExeFS(), &g_original_npdm_cache))) {
|
&& R_SUCCEEDED(LoadNpdmInternal(OpenNpdmFromExeFS(), &g_original_npdm_cache))) {
|
||||||
NpdmInfo *original_info = &g_original_npdm_cache.info;
|
NpdmInfo *original_info = &g_original_npdm_cache.info;
|
||||||
/* Fix pool partition. */
|
/* Fix pool partition. */
|
||||||
|
|
|
@ -61,7 +61,7 @@ bool NsoUtils::CheckNsoStubbed(unsigned int index, u64 title_id) {
|
||||||
}
|
}
|
||||||
|
|
||||||
FILE *NsoUtils::OpenNso(unsigned int index, u64 title_id) {
|
FILE *NsoUtils::OpenNso(unsigned int index, u64 title_id) {
|
||||||
if (ContentManagement::ShouldOverrideContents()) {
|
if (ContentManagement::ShouldOverrideContents(title_id)) {
|
||||||
if (ContentManagement::ShouldReplaceWithHBL(title_id)) {
|
if (ContentManagement::ShouldReplaceWithHBL(title_id)) {
|
||||||
return OpenNsoFromHBL(index);
|
return OpenNsoFromHBL(index);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue