summaryrefslogtreecommitdiff
path: root/src/core/loader
diff options
context:
space:
mode:
authorGravatar Merry2016-12-16 15:08:04 +0000
committerGravatar GitHub2016-12-16 15:08:04 +0000
commitacc83a1c32ef43c6ff84926ff21dc5ef872decc0 (patch)
tree95c20b3525c9e3a92444d45d3b5e071cea4e7dd7 /src/core/loader
parentMerge pull request #2338 from wwylele/fix-dead (diff)
parentmain: Open folder when open save folder location context menu is clicked (diff)
downloadyuzu-acc83a1c32ef43c6ff84926ff21dc5ef872decc0.tar.gz
yuzu-acc83a1c32ef43c6ff84926ff21dc5ef872decc0.tar.xz
yuzu-acc83a1c32ef43c6ff84926ff21dc5ef872decc0.zip
Merge pull request #2322 from MerryMage/ctx-mnu
game_list: Add a context menu with "Open Save Location" option
Diffstat (limited to 'src/core/loader')
-rw-r--r--src/core/loader/loader.h9
-rw-r--r--src/core/loader/ncch.cpp12
-rw-r--r--src/core/loader/ncch.h7
3 files changed, 28 insertions, 0 deletions
diff --git a/src/core/loader/loader.h b/src/core/loader/loader.h
index 5e3d46638..a6c2a745f 100644
--- a/src/core/loader/loader.h
+++ b/src/core/loader/loader.h
@@ -144,6 +144,15 @@ public:
144 } 144 }
145 145
146 /** 146 /**
147 * Get the program id of the application
148 * @param out_program_id Reference to store program id into
149 * @return ResultStatus result of function
150 */
151 virtual ResultStatus ReadProgramId(u64& out_program_id) {
152 return ResultStatus::ErrorNotImplemented;
153 }
154
155 /**
147 * Get the RomFS of the application 156 * Get the RomFS of the application
148 * Since the RomFS can be huge, we return a file reference instead of copying to a buffer 157 * Since the RomFS can be huge, we return a file reference instead of copying to a buffer
149 * @param romfs_file The file containing the RomFS 158 * @param romfs_file The file containing the RomFS
diff --git a/src/core/loader/ncch.cpp b/src/core/loader/ncch.cpp
index d4be61e0e..6f2164428 100644
--- a/src/core/loader/ncch.cpp
+++ b/src/core/loader/ncch.cpp
@@ -344,6 +344,18 @@ ResultStatus AppLoader_NCCH::ReadLogo(std::vector<u8>& buffer) {
344 return LoadSectionExeFS("logo", buffer); 344 return LoadSectionExeFS("logo", buffer);
345} 345}
346 346
347ResultStatus AppLoader_NCCH::ReadProgramId(u64& out_program_id) {
348 if (!file.IsOpen())
349 return ResultStatus::Error;
350
351 ResultStatus result = LoadExeFS();
352 if (result != ResultStatus::Success)
353 return result;
354
355 out_program_id = ncch_header.program_id;
356 return ResultStatus::Success;
357}
358
347ResultStatus AppLoader_NCCH::ReadRomFS(std::shared_ptr<FileUtil::IOFile>& romfs_file, u64& offset, 359ResultStatus AppLoader_NCCH::ReadRomFS(std::shared_ptr<FileUtil::IOFile>& romfs_file, u64& offset,
348 u64& size) { 360 u64& size) {
349 if (!file.IsOpen()) 361 if (!file.IsOpen())
diff --git a/src/core/loader/ncch.h b/src/core/loader/ncch.h
index bcf3ae6e3..6c93d46d8 100644
--- a/src/core/loader/ncch.h
+++ b/src/core/loader/ncch.h
@@ -220,6 +220,13 @@ public:
220 ResultStatus ReadLogo(std::vector<u8>& buffer) override; 220 ResultStatus ReadLogo(std::vector<u8>& buffer) override;
221 221
222 /** 222 /**
223 * Get the program id of the application
224 * @param out_program_id Reference to store program id into
225 * @return ResultStatus result of function
226 */
227 ResultStatus ReadProgramId(u64& out_program_id) override;
228
229 /**
223 * Get the RomFS of the application 230 * Get the RomFS of the application
224 * @param romfs_file Reference to buffer to store data 231 * @param romfs_file Reference to buffer to store data
225 * @param offset Offset in the file to the RomFS 232 * @param offset Offset in the file to the RomFS