diff options
| author | 2018-08-28 22:37:42 -0400 | |
|---|---|---|
| committer | 2018-09-04 16:24:02 -0400 | |
| commit | a6e75cd45b75a202eed1a68692e33e7732789dd2 (patch) | |
| tree | 48af4f9227030e247474334067515a5cdd0f5283 /src/core/loader | |
| parent | bktr: Fix missing includes and optimize style (diff) | |
| download | yuzu-a6e75cd45b75a202eed1a68692e33e7732789dd2.tar.gz yuzu-a6e75cd45b75a202eed1a68692e33e7732789dd2.tar.xz yuzu-a6e75cd45b75a202eed1a68692e33e7732789dd2.zip | |
bktr: Implement IVFC offset shifting
Fixes base game read errors
Diffstat (limited to 'src/core/loader')
| -rw-r--r-- | src/core/loader/loader.h | 9 | ||||
| -rw-r--r-- | src/core/loader/nca.cpp | 6 | ||||
| -rw-r--r-- | src/core/loader/nca.h | 1 |
3 files changed, 16 insertions, 0 deletions
diff --git a/src/core/loader/loader.h b/src/core/loader/loader.h index 225c05127..843c4bb91 100644 --- a/src/core/loader/loader.h +++ b/src/core/loader/loader.h | |||
| @@ -215,6 +215,15 @@ public: | |||
| 215 | } | 215 | } |
| 216 | 216 | ||
| 217 | /** | 217 | /** |
| 218 | * Gets the difference between the start of the IVFC header and the start of level 6 (RomFS) | ||
| 219 | * data. Needed for bktr patching. | ||
| 220 | * @return IVFC offset for romfs. | ||
| 221 | */ | ||
| 222 | virtual u64 ReadRomFSIVFCOffset() const { | ||
| 223 | return 0; | ||
| 224 | } | ||
| 225 | |||
| 226 | /** | ||
| 218 | * Get the title of the application | 227 | * Get the title of the application |
| 219 | * @param title Reference to store the application title into | 228 | * @param title Reference to store the application title into |
| 220 | * @return ResultStatus result of function | 229 | * @return ResultStatus result of function |
diff --git a/src/core/loader/nca.cpp b/src/core/loader/nca.cpp index 6b1c27b47..6aaffae59 100644 --- a/src/core/loader/nca.cpp +++ b/src/core/loader/nca.cpp | |||
| @@ -71,6 +71,12 @@ ResultStatus AppLoader_NCA::ReadRomFS(FileSys::VirtualFile& dir) { | |||
| 71 | return ResultStatus::Success; | 71 | return ResultStatus::Success; |
| 72 | } | 72 | } |
| 73 | 73 | ||
| 74 | u64 AppLoader_NCA::ReadRomFSIVFCOffset() const { | ||
| 75 | if (nca == nullptr) | ||
| 76 | return 0; | ||
| 77 | return nca->GetBaseIVFCOffset(); | ||
| 78 | } | ||
| 79 | |||
| 74 | ResultStatus AppLoader_NCA::ReadProgramId(u64& out_program_id) { | 80 | ResultStatus AppLoader_NCA::ReadProgramId(u64& out_program_id) { |
| 75 | if (nca == nullptr || nca->GetStatus() != ResultStatus::Success) | 81 | if (nca == nullptr || nca->GetStatus() != ResultStatus::Success) |
| 76 | return ResultStatus::ErrorNotInitialized; | 82 | return ResultStatus::ErrorNotInitialized; |
diff --git a/src/core/loader/nca.h b/src/core/loader/nca.h index 326f84857..10be197c4 100644 --- a/src/core/loader/nca.h +++ b/src/core/loader/nca.h | |||
| @@ -37,6 +37,7 @@ public: | |||
| 37 | ResultStatus Load(Kernel::SharedPtr<Kernel::Process>& process) override; | 37 | ResultStatus Load(Kernel::SharedPtr<Kernel::Process>& process) override; |
| 38 | 38 | ||
| 39 | ResultStatus ReadRomFS(FileSys::VirtualFile& dir) override; | 39 | ResultStatus ReadRomFS(FileSys::VirtualFile& dir) override; |
| 40 | u64 ReadRomFSIVFCOffset() const override; | ||
| 40 | ResultStatus ReadProgramId(u64& out_program_id) override; | 41 | ResultStatus ReadProgramId(u64& out_program_id) override; |
| 41 | 42 | ||
| 42 | private: | 43 | private: |