summaryrefslogtreecommitdiff
path: root/src/core
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
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')
-rw-r--r--src/core/file_sys/archive_source_sd_savedata.cpp5
-rw-r--r--src/core/file_sys/archive_source_sd_savedata.h2
-rw-r--r--src/core/loader/loader.h9
-rw-r--r--src/core/loader/ncch.cpp12
-rw-r--r--src/core/loader/ncch.h7
5 files changed, 35 insertions, 0 deletions
diff --git a/src/core/file_sys/archive_source_sd_savedata.cpp b/src/core/file_sys/archive_source_sd_savedata.cpp
index 2d8a950a3..287322d3e 100644
--- a/src/core/file_sys/archive_source_sd_savedata.cpp
+++ b/src/core/file_sys/archive_source_sd_savedata.cpp
@@ -90,4 +90,9 @@ ResultVal<ArchiveFormatInfo> ArchiveSource_SDSaveData::GetFormatInfo(u64 program
90 return MakeResult<ArchiveFormatInfo>(info); 90 return MakeResult<ArchiveFormatInfo>(info);
91} 91}
92 92
93std::string ArchiveSource_SDSaveData::GetSaveDataPathFor(const std::string& mount_point,
94 u64 program_id) {
95 return GetSaveDataPath(GetSaveDataContainerPath(mount_point), program_id);
96}
97
93} // namespace FileSys 98} // namespace FileSys
diff --git a/src/core/file_sys/archive_source_sd_savedata.h b/src/core/file_sys/archive_source_sd_savedata.h
index b33126c31..b5fe43cc1 100644
--- a/src/core/file_sys/archive_source_sd_savedata.h
+++ b/src/core/file_sys/archive_source_sd_savedata.h
@@ -23,6 +23,8 @@ public:
23 ResultCode Format(u64 program_id, const FileSys::ArchiveFormatInfo& format_info); 23 ResultCode Format(u64 program_id, const FileSys::ArchiveFormatInfo& format_info);
24 ResultVal<ArchiveFormatInfo> GetFormatInfo(u64 program_id) const; 24 ResultVal<ArchiveFormatInfo> GetFormatInfo(u64 program_id) const;
25 25
26 static std::string GetSaveDataPathFor(const std::string& mount_point, u64 program_id);
27
26private: 28private:
27 std::string mount_point; 29 std::string mount_point;
28}; 30};
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