1
0
Fork 0
mirror of https://github.com/Atmosphere-NX/Atmosphere.git synced 2024-11-26 13:52:21 +00:00

loader: make ShouldOverrideContents take a tid argument

This commit is contained in:
misson20000 2018-10-10 20:45:54 -07:00 committed by SciresM
parent a502d31cd1
commit 376feb63bd
4 changed files with 7 additions and 7 deletions

View file

@ -56,7 +56,7 @@ Result ContentManagement::MountCode(u64 tid, FsStorageId sid) {
RefreshConfigurationData();
}
if (ShouldOverrideContents() && R_SUCCEEDED(MountCodeNspOnSd(tid))) {
if (ShouldOverrideContents(tid) && R_SUCCEEDED(MountCodeNspOnSd(tid))) {
return 0x0;
}
@ -302,7 +302,7 @@ bool ContentManagement::ShouldReplaceWithHBL(u64 tid) {
return g_mounted_hbl_nsp && tid == g_override_hbl_tid;
}
bool ContentManagement::ShouldOverrideContents() {
bool ContentManagement::ShouldOverrideContents(u64 tid) {
if (HasCreatedTitle(0x0100000000001000)) {
u64 kDown = 0;
bool keys_triggered = (R_SUCCEEDED(HidManagement::GetKeysDown(&kDown)) && ((kDown & g_override_key_combination) != 0));
@ -311,4 +311,4 @@ bool ContentManagement::ShouldOverrideContents() {
/* Always redirect before qlaunch. */
return g_has_initialized_fs_dev;
}
}
}

View file

@ -38,5 +38,5 @@ class ContentManagement {
static void TryMountSdCard();
static bool ShouldReplaceWithHBL(u64 tid);
static bool ShouldOverrideContents();
static bool ShouldOverrideContents(u64 tid);
};

View file

@ -53,7 +53,7 @@ FILE *NpdmUtils::OpenNpdmFromSdCard(u64 title_id) {
FILE *NpdmUtils::OpenNpdm(u64 title_id) {
if (ContentManagement::ShouldOverrideContents()) {
if (ContentManagement::ShouldOverrideContents(title_id)) {
if (ContentManagement::ShouldReplaceWithHBL(title_id)) {
return OpenNpdmFromHBL();
}
@ -182,7 +182,7 @@ Result NpdmUtils::LoadNpdm(u64 tid, NpdmInfo *out) {
info->acid->title_id_range_max = 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))) {
NpdmInfo *original_info = &g_original_npdm_cache.info;
/* Fix pool partition. */

View file

@ -61,7 +61,7 @@ bool NsoUtils::CheckNsoStubbed(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)) {
return OpenNsoFromHBL(index);
}