Commit Graph

35 Commits

Author SHA1 Message Date
Frederic L
788e8f4e4b file_sys/patch_manager: Remove unnecessary if-statements (#1586)
* remove unnecessary if-statements

* Addressed feedback
2018-10-28 02:30:29 -04:00
Zach Hilman
f7205296d8 patch_manager: Add support for using LayeredFS with Data 2018-10-17 09:03:56 -04:00
bunnei
388078469b Merge pull request #1443 from DarkLordZach/lower-loader-logs-1
content_archive/patch_manager: Lower log levels to eliminate some unnecessary logs
2018-10-16 11:26:54 -04:00
Lioncash
042cb07ed3 file_sys/registered_cache: Use unique_ptr and regular pointers instead of shared_ptrs where applicable
The data retrieved in these cases are ultimately chiefly owned by either
the RegisteredCache instance itself, or the filesystem factories. Both
these should live throughout the use of their contained data. If they
don't, it should be considered an interface/design issue, and using
shared_ptr instances here would mask that, as the data would always be
prolonged after the main owner's lifetime ended.

This makes the lifetime of the data explicit and makes it harder to
accidentally create cyclic references. It also makes the interface
slightly more flexible than the previous API, as a shared_ptr can be
created from a unique_ptr, but not the other way around, so this allows
for that use-case if it ever becomes necessary in some form.
2018-10-16 09:38:52 -04:00
Zach Hilman
d93bc98bdb patch_manager: Move non-Program RomFS patch log to Debug
Normal Program-type patches will still be logged to aid in debugging, but for others (mainly Control), it was moved to Debug.
2018-10-12 23:27:19 -04:00
Lioncash
ffbec666b8 patch_manager: Return a std::unique_ptr from ParseControlNCA() and GetControlMetadata() instead of a std::shared_ptr
Neither of these functions require the use of shared ownership of the
returned pointer. This makes it more difficult to create reference
cycles with, and makes the interface more generic, as std::shared_ptr
instances can be created from a std::unique_ptr, but the vice-versa
isn't possible. This also alters relevant functions to take NCA
arguments by const reference rather than a const reference to a
std::shared_ptr. These functions don't alter the ownership of the memory
used by the NCA instance, so we can make the interface more generic by
not assuming anything about the type of smart pointer the NCA is
contained within and make it the caller's responsibility to ensure the
supplied NCA is valid.
2018-10-09 14:38:03 -04:00
bunnei
a651976b3f Merge pull request #1423 from DarkLordZach/romfs-file-exts
fsmitm_romfsbuild: Add support for stubbing and IPS patches in LFS
2018-10-08 12:31:27 -04:00
bunnei
a96f640079 Merge pull request #1424 from DarkLordZach/ips-witch
ips_layer: Add support for IPSwitch executable patches
2018-10-08 12:30:33 -04:00
Zach Hilman
e8c951867d romfs_factory: Extract packed update setter to new function 2018-10-05 08:53:51 -04:00
Zach Hilman
61fd61db25 patch_manager: Add support for NSP packed updates
Reads as Update (NSP) in add-ons
2018-10-05 08:48:44 -04:00
Zach Hilman
ee54733eb6 patch_manager: Add support for packed updates
Will prefer any installed update over the packed version.
2018-10-05 08:47:24 -04:00
Zach Hilman
5c0bb2c21e patch_manager: Avoid romfs_ext requirement for patching 2018-10-04 14:09:11 -04:00
Zach Hilman
4a56550240 fsmitm_romfsbuild: Extract stubs and IPS to romfs_ext dir 2018-10-04 12:29:20 -04:00
Zach Hilman
3b352ad5e1 ips_layer: Fix inaccuracies with comments and flags
Specifically bugs/crashes that arise when putting them in positions that are legal but not typical, such as midline, between patch data, or between patch records.
2018-10-04 12:23:27 -04:00
Zach Hilman
b0ed0cd81c ips_layer: Deduplicate resource usage 2018-10-04 11:34:36 -04:00
Zach Hilman
ab443f84a6 patch_manager: Add support for IPSwitch format patches 2018-10-04 11:34:06 -04:00
Zach Hilman
bfb8b8b86e nso: Optimize loading of IPS patches
Avoid resource-heavy classes and remove quasi-duplicated code.
2018-10-02 17:03:38 -04:00
Zach Hilman
0932855c72 patch_manager: Add PatchNSO function
While PatchExeFS operated on the entire directory, this function operates on the uncompressed NSO. Avoids copying decompression code to PatchManager.
2018-10-01 16:02:50 -04:00
Zach Hilman
8bb4aa19e7 patch_manager: Use strings for patch type instead of enum 2018-10-01 16:02:50 -04:00
Zach Hilman
b04f67963a aoc_u: Extract AccumulateAOCTitleIDs to separate function 2018-09-30 21:07:22 -04:00
Zach Hilman
a79cc36195 aoc_u: Implement GetAddOnContentBaseId
Command #5
2018-09-30 21:01:35 -04:00
Zach Hilman
389d2d1268 patch_manager: Add DLC recognition to PatchManager 2018-09-30 21:01:35 -04:00
Lioncash
25192be482 patch_manager: Invert conditionals within ApplyLayeredFS()
Avoids the need to nest code quite a bit by early-exiting in error
cases.
2018-09-25 20:09:23 -04:00
Lioncash
ca724cff46 vfs_concat/vfs_layered: Remove friend declarations from ConcatenatedVfsFile
Given these are only added to the class to allow those functions to
access the private constructor, it's a better approach to just make them
static functions in the interface, to make the dependency explicit.
2018-09-25 20:06:01 -04:00
Zach Hilman
041d0b88d9 fsmitm: Cleanup and modernize fsmitm port 2018-09-23 21:50:20 -04:00
Zach Hilman
35544ae7b5 patch_manager: Add LayeredFS mods support 2018-09-21 19:53:33 -04:00
Lioncash
cc635db969 file-sys: Default heavy-weight class destructors in the cpp file
Several classes have a lot of non-trivial members within them, or don't
but likely should have the destructor defaulted in the cpp file for
future-proofing/being more friendly to forward declarations.

Leaving the destructor unspecified allows the compiler to inline the
destruction code all over the place, which is generally undesirable from
a code bloat perspective.
2018-09-19 19:34:08 -04:00
fearlessTobi
ac0723e7be Port #4182 from Citra: "Prefix all size_t with std::" 2018-09-15 15:21:06 +02:00
Lioncash
6bab4fa777 file_sys/patch_manager: Add missing includes
These includes were previously being satisfied indirectly.
2018-09-06 13:53:23 -04:00
Zach Hilman
d51f937e3e bktr: Fix bucket overlap error 2018-09-04 17:01:54 -04:00
Zach Hilman
0f87428fa1 patch_manager: Centralize Control-type NCA parsing 2018-09-04 16:25:10 -04:00
Zach Hilman
55e1e9559e game_list: Fix version display on non-NAND titles 2018-09-04 16:24:02 -04:00
Zach Hilman
13a60cd9de bktr: Add logging on successful patch 2018-09-04 16:24:02 -04:00
Zach Hilman
c13664fec3 bktr: Fix missing includes and optimize style 2018-09-04 16:24:02 -04:00
Zach Hilman
e739316884 file_sys: Add class to manage game patches
Right now only includes Updates, but should eventually contain all of the other patches we need.
2018-09-04 16:22:25 -04:00