summaryrefslogtreecommitdiffstats
path: root/src/core/file_sys
diff options
context:
space:
mode:
authorliamwhite <liamwhite@users.noreply.github.com>2023-10-07 18:49:32 +0200
committerGitHub <noreply@github.com>2023-10-07 18:49:32 +0200
commitbf15aa093cee23c6e3f954d21ef2f7381da2778b (patch)
tree395e65a8bfcb5d1bd834c9a098f037e758bd91b0 /src/core/file_sys
parentMerge pull request #11648 from liamwhite/unicode-nonsense (diff)
parentloader: don't reassign program ID on npdm reparse (diff)
downloadyuzu-bf15aa093cee23c6e3f954d21ef2f7381da2778b.tar
yuzu-bf15aa093cee23c6e3f954d21ef2f7381da2778b.tar.gz
yuzu-bf15aa093cee23c6e3f954d21ef2f7381da2778b.tar.bz2
yuzu-bf15aa093cee23c6e3f954d21ef2f7381da2778b.tar.lz
yuzu-bf15aa093cee23c6e3f954d21ef2f7381da2778b.tar.xz
yuzu-bf15aa093cee23c6e3f954d21ef2f7381da2778b.tar.zst
yuzu-bf15aa093cee23c6e3f954d21ef2f7381da2778b.zip
Diffstat (limited to 'src/core/file_sys')
-rw-r--r--src/core/file_sys/program_metadata.cpp8
-rw-r--r--src/core/file_sys/program_metadata.h1
2 files changed, 9 insertions, 0 deletions
diff --git a/src/core/file_sys/program_metadata.cpp b/src/core/file_sys/program_metadata.cpp
index f00479bd3..8e291ff67 100644
--- a/src/core/file_sys/program_metadata.cpp
+++ b/src/core/file_sys/program_metadata.cpp
@@ -5,6 +5,7 @@
#include <vector>
#include "common/logging/log.h"
+#include "common/scope_exit.h"
#include "core/file_sys/program_metadata.h"
#include "core/file_sys/vfs.h"
#include "core/loader/loader.h"
@@ -95,6 +96,13 @@ Loader::ResultStatus ProgramMetadata::Load(VirtualFile file) {
return Loader::ResultStatus::Success;
}
+Loader::ResultStatus ProgramMetadata::Reload(VirtualFile file) {
+ const u64 original_program_id = aci_header.title_id;
+ SCOPE_EXIT({ aci_header.title_id = original_program_id; });
+
+ return this->Load(file);
+}
+
/*static*/ ProgramMetadata ProgramMetadata::GetDefault() {
// Allow use of cores 0~3 and thread priorities 1~63.
constexpr u32 default_thread_info_capability = 0x30007F7;
diff --git a/src/core/file_sys/program_metadata.h b/src/core/file_sys/program_metadata.h
index 2e8960b07..9f8e74b13 100644
--- a/src/core/file_sys/program_metadata.h
+++ b/src/core/file_sys/program_metadata.h
@@ -56,6 +56,7 @@ public:
static ProgramMetadata GetDefault();
Loader::ResultStatus Load(VirtualFile file);
+ Loader::ResultStatus Reload(VirtualFile file);
/// Load from parameters instead of NPDM file, used for KIP
void LoadManual(bool is_64_bit, ProgramAddressSpaceType address_space, s32 main_thread_prio,