mirror of
https://github.com/Atmosphere-NX/Atmosphere.git
synced 2025-05-28 13:44:11 -04:00
strat: go all in on ncm::TitleId
This commit is contained in:
parent
c916a7db88
commit
2d0c881ffe
33 changed files with 191 additions and 186 deletions
|
@ -43,8 +43,8 @@ namespace sts::ldr {
|
|||
/* This is necessary to prevent circular dependencies. */
|
||||
namespace sts::pm::info {
|
||||
|
||||
Result HasLaunchedTitle(bool *out, u64 title_id) {
|
||||
*out = ldr::HasLaunchedTitle(ncm::TitleId{title_id});
|
||||
Result HasLaunchedTitle(bool *out, ncm::TitleId title_id) {
|
||||
*out = ldr::HasLaunchedTitle(title_id);
|
||||
return ResultSuccess;
|
||||
}
|
||||
|
||||
|
|
|
@ -50,7 +50,7 @@ namespace sts::ldr {
|
|||
|
||||
if (loc.storage_id != static_cast<u8>(ncm::StorageId::None) && loc.title_id != out->title_id) {
|
||||
char path[FS_MAX_PATH];
|
||||
const ncm::TitleLocation new_loc = ncm::MakeTitleLocation(out->title_id, static_cast<ncm::StorageId>(loc.storage_id));
|
||||
const ncm::TitleLocation new_loc = ncm::TitleLocation::Make(out->title_id, static_cast<ncm::StorageId>(loc.storage_id));
|
||||
|
||||
R_TRY(ResolveContentPath(path, loc));
|
||||
R_TRY(RedirectContentPath(path, new_loc));
|
||||
|
|
|
@ -44,10 +44,11 @@ extern "C" {
|
|||
alignas(16) u8 __nx_exception_stack[0x1000];
|
||||
u64 __nx_exception_stack_size = sizeof(__nx_exception_stack);
|
||||
void __libnx_exception_handler(ThreadExceptionDump *ctx);
|
||||
u64 __stratosphere_title_id = TitleId_Loader;
|
||||
void __libstratosphere_exception_handler(AtmosphereFatalErrorContext *ctx);
|
||||
}
|
||||
|
||||
sts::ncm::TitleId __stratosphere_title_id = sts::ncm::TitleId::Loader;
|
||||
|
||||
void __libnx_exception_handler(ThreadExceptionDump *ctx) {
|
||||
StratosphereCrashHandler(ctx);
|
||||
}
|
||||
|
|
|
@ -196,17 +196,17 @@ namespace sts::ldr {
|
|||
return static_cast<Acid::PoolPartition>((meta->acid->flags & Acid::AcidFlag_PoolPartitionMask) >> Acid::AcidFlag_PoolPartitionShift);
|
||||
}
|
||||
|
||||
constexpr bool IsDisallowedVersion810(const u64 title_id, const u32 version) {
|
||||
constexpr bool IsDisallowedVersion810(const ncm::TitleId title_id, const u32 version) {
|
||||
return version == 0 &&
|
||||
(title_id == TitleId_Settings ||
|
||||
title_id == TitleId_Bus ||
|
||||
title_id == TitleId_Audio ||
|
||||
title_id == TitleId_NvServices ||
|
||||
title_id == TitleId_Ns ||
|
||||
title_id == TitleId_Ssl ||
|
||||
title_id == TitleId_Es ||
|
||||
title_id == TitleId_Creport ||
|
||||
title_id == TitleId_Ro);
|
||||
(title_id == ncm::TitleId::Settings ||
|
||||
title_id == ncm::TitleId::Bus ||
|
||||
title_id == ncm::TitleId::Audio ||
|
||||
title_id == ncm::TitleId::NvServices ||
|
||||
title_id == ncm::TitleId::Ns ||
|
||||
title_id == ncm::TitleId::Ssl ||
|
||||
title_id == ncm::TitleId::Es ||
|
||||
title_id == ncm::TitleId::Creport ||
|
||||
title_id == ncm::TitleId::Ro);
|
||||
}
|
||||
|
||||
Result ValidateTitleVersion(ncm::TitleId title_id, u32 version) {
|
||||
|
@ -214,7 +214,7 @@ namespace sts::ldr {
|
|||
return ResultSuccess;
|
||||
} else {
|
||||
#ifdef LDR_VALIDATE_PROCESS_VERSION
|
||||
if (IsDisallowedVersion810(static_cast<u64>(title_id), version)) {
|
||||
if (IsDisallowedVersion810(title_id, version)) {
|
||||
return ResultLoaderInvalidVersion;
|
||||
} else {
|
||||
return ResultSuccess;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue