| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
| |
Fixes build issues on clang.
|
|
|
|
| |
We should not apply any mods when dumping a game's RomFS.
|
|
|
|
| |
This prevents mod files from being locked due to the read-only share flag in Windows.
|
|
|
|
|
|
|
|
|
|
| |
If someone else wants to support other mod formats in the SDMC
directory, that can be added later. For now, just allow RomFS modding
here and force people to do other types of mods the old way.
Addresses review comments.
Co-authored-by: LC <mathew1800@gmail.com>
|
|
|
|
|
|
| |
Enables loading a mod directly from `[yuzu data
directory]/sdmc/atmosphere/contents/[title_id]`. For use with some
homebrew mod managers.
|
|
|
|
| |
Also removes some deprecated API usages.
|
|\
| |
| | |
common: fs: Miscellaneous changes
|
| |
| |
| |
| | |
These enforce requiring the file to exist prior to opening.
|
|/ |
|
| |
|
|
|
|
|
|
|
|
|
| |
* Wrong alignment in u64 LOG_DEBUG -> memcpy.
* Huge shift exponent in stride calculation for linear buffer, unused result -> skipped.
* Large shift in buffer cache if word = 0, skip checking for set bits.
Non of those were critical, so this should not change any behavior.
At least with the assumption, that the last one used masking behavior, which always yield continuous_bits = 0.
|
|
|
| |
- Used by Mii Edit
|
|
|
|
| |
Transition to PascalCase for result names.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* common: fs: fs_types: Create filesystem types
Contains various filesystem types used by the Common::FS library
* common: fs: fs_util: Add std::string to std::u8string conversion utility
* common: fs: path_util: Add utlity functions for paths
Contains various utility functions for getting or manipulating filesystem paths used by the Common::FS library
* common: fs: file: Rewrite the IOFile implementation
* common: fs: Reimplement Common::FS library using std::filesystem
* common: fs: fs_paths: Add fs_paths to replace common_paths
* common: fs: path_util: Add the rest of the path functions
* common: Remove the previous Common::FS implementation
* general: Remove unused fs includes
* string_util: Remove unused function and include
* nvidia_flags: Migrate to the new Common::FS library
* settings: Migrate to the new Common::FS library
* logging: backend: Migrate to the new Common::FS library
* core: Migrate to the new Common::FS library
* perf_stats: Migrate to the new Common::FS library
* reporter: Migrate to the new Common::FS library
* telemetry_session: Migrate to the new Common::FS library
* key_manager: Migrate to the new Common::FS library
* bis_factory: Migrate to the new Common::FS library
* registered_cache: Migrate to the new Common::FS library
* xts_archive: Migrate to the new Common::FS library
* service: acc: Migrate to the new Common::FS library
* applets/profile: Migrate to the new Common::FS library
* applets/web: Migrate to the new Common::FS library
* service: filesystem: Migrate to the new Common::FS library
* loader: Migrate to the new Common::FS library
* gl_shader_disk_cache: Migrate to the new Common::FS library
* nsight_aftermath_tracker: Migrate to the new Common::FS library
* vulkan_library: Migrate to the new Common::FS library
* configure_debug: Migrate to the new Common::FS library
* game_list_worker: Migrate to the new Common::FS library
* config: Migrate to the new Common::FS library
* configure_filesystem: Migrate to the new Common::FS library
* configure_per_game_addons: Migrate to the new Common::FS library
* configure_profile_manager: Migrate to the new Common::FS library
* configure_ui: Migrate to the new Common::FS library
* input_profiles: Migrate to the new Common::FS library
* yuzu_cmd: config: Migrate to the new Common::FS library
* yuzu_cmd: Migrate to the new Common::FS library
* vfs_real: Migrate to the new Common::FS library
* vfs: Migrate to the new Common::FS library
* vfs_libzip: Migrate to the new Common::FS library
* service: bcat: Migrate to the new Common::FS library
* yuzu: main: Migrate to the new Common::FS library
* vfs_real: Delete the contents of an existing file in CreateFile
Current usages of CreateFile expect to delete the contents of an existing file, retain this behavior for now.
* input_profiles: Don't iterate the input profile dir if it does not exist
Silences an error produced in the log if the directory does not exist.
* game_list_worker: Skip parsing file if the returned VfsFile is nullptr
Prevents crashes in GetLoader when the virtual file is nullptr
* common: fs: Validate paths for path length
* service: filesystem: Open the mod load directory as read only
|
|\
| |
| | |
main: Prevent installing base titles into NAND
|
| |
| |
| |
| | |
Many users have been installing their base titles into NAND instead of adding them into the games list. This prevents users from installing any base titles and warns the user about the action.
|
|/
|
|
|
|
| |
Now that we have most of core free of shadowing, we can enable the
warning as an error to catch anything that may be remaining and also
eliminate this class of logic bug entirely.
|
| |
|
|\
| |
| | |
file_sys: Resolve cases of variable shadowing
|
| |
| |
| |
| | |
Brings us closer to enabling -Wshadow as an error in the core code.
|
|/
|
|
|
|
| |
This improves the accuracy of CreateFile by returning the correct error codes on certain conditions (parent directory does not exist, path already exists).
This fixes saving and the loading of existing saves in New Pokemon Snap
|
|\
| |
| | |
program_metadata: Set a default resource size when a NPDM is not present
|
| |
| |
| |
| | |
Sets a default size of 0x1FE00000 bytes (510 MiB) for the system_resource_size when a NPDM is not present.
|
|/
|
|
|
|
|
|
| |
The generation of the copy assignment operators are deprecated on being
generated when a user-provided destructor is present.
We can explicitly specify that we desire this behavior to keep the class
forward compatible with future standards.
|
|
|
|
| |
- Removes a dependency on core and input_common from common.
|
|
|
|
| |
Introduces the usage of compatibilities to allow it the module to be closer to how it works on hardware.
|
|\
| |
| | |
system_version: Update to 11.0.1
|
| | |
|
|/ |
|
|
|
|
|
|
|
| |
Found this via a warning, but it's a substantive fix.
Since this is only for a cache, it should be safe to silently drop the
entry if opening fails. I think.
|
|
|
|
|
| |
This requires making several types trivial and properly initialize
them whenever they are called.
|
|
|
|
| |
INSERT_PADDING_BYTES_NOINIT is more descriptive of the underlying behavior.
|
| |
|
| |
|
| |
|
|
|
|
| |
Co-authored-by: Its-Rei <kupfel@gmail.com>
|
|\
| |
| | |
fsp_srv: Implement OpenDataStorageWithProgramIndex
|
| |
| |
| |
| | |
- Used by RollerCoaster Tycoon 3: Complete Edition
|
| | |
|
|\ \
| | |
| | | |
vfs: Use existing type aliases consistently
|
| | |
| | |
| | |
| | |
| | | |
Makes use of the VirtualDir and VirtualFile aliases across the board
instead of having a few isolated places that don't use it.
|
|/ /
| |
| |
| |
| | |
This reverts commit 6d6115475b4edccdf1bb4e96ecc3d3b1be319e76, reversing
changes made to 5fe55b16a11d9ec607fb8a3fdddc77a4393cd96a.
|
| | |
|
|/
|
|
|
| |
Follows the video core PR. fmt doesn't require casts for enum classes
anymore, so we can remove quite a few casts.
|
|
|
|
|
| |
Cleans out the rest of the occurrences of variable shadowing and makes
any further occurrences of shadowing compiler errors.
|
| |
|
|
|
|
| |
Now there's only two meaningful instances left in core.
|
| |
|
|
|
|
|
|
|
| |
With this, only 19 usages of the global system instance remain within
the core library.
We're almost there.
|
| |
|
|
|
|
|
|
|
| |
Recent changes to the build system that made more warnings be flagged as
errors caused building via clang to break.
Fixes #4795
|
|
|
|
|
|
|
|
|
| |
Makes our error coverage a little more consistent across the board by
applying it to Linux side of things as well. This also makes it more
consistent with the warning settings in other libraries in the project.
This also updates httplib to 0.7.9, as there are several warning
cleanups made that allow us to enable several warnings as errors.
|
|\
| |
| | |
file_sys/nsp: Make SetTicketKeys actually do something
|
| |
| |
| |
| |
| | |
Previously, the method wasn't modifying any class state and therefore not having any effects when called.
Since this has been the case for a very long time now, I'm not sure if we couldn't just remove this method altogether.
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| | |
Allows some implementations to avoid completely zeroing out the internal
buffer of the optional, and instead only set the validity byte within
the structure.
This also makes it consistent how we return empty optionals.
|
| |
| |
| |
| | |
Prevents unnecessary copying of the line being parsed.
|
|\ \
| | |
| | | |
submission_package: Account for multi-content NSPs
|
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Previously we assumed a submission package can only contain one Program NCA with a single TitleID.
However, Super Mario 3D All-Stars contains four Program NCAs, each with their unique TitleIDs.
This accounts for the existence of multi-content games such as this one.
- Fixes booting Super Mario 3D All-Stars from the games list.
|
| | |
| | |
| | |
| | | |
This isn't used anywhere, so this is a trivial fix.
|
| | | |
|
| | | |
|
|\ \ \
| | | |
| | | | |
nca_patch: Reduce stack usage size within SearchBucketEntry()
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
Previously this function was using ~16KB of stack (16528 bytes), which
was caused by the function arguments being taken by value rather than by
reference.
We can make this significantly lighter on the stack by taking them by
reference.
|
| | | |
| | | |
| | | |
| | | |
| | | | |
This is only used internally and doesn't depend on any class state, so
we can make it fully internal.
|
|/ / /
| | |
| | |
| | |
| | | |
This isn't used within the function at all in any implementations, so we
can remove it entirely.
|
| | |
| | |
| | |
| | |
| | |
| | | |
We make it explicit that we're truncating arithmetic here to resolve
compiler warnings (even if the sizes weren't u32/u64 arithmetic
generally promotes to int :<)
|
| | |
| | |
| | |
| | |
| | | |
We can use these to avoid typing the same type redundantly. This way, if
these ever change, only a single location needs to be modified.
|
|/ /
| |
| |
| |
| | |
These functions are only used within this translation unit, so we can
make them internally linked.
|
| |
| |
| |
| | |
Fixes build issues
|
|\ \
| | |
| | | |
file_sys: Replace inclusions with forward declarations where applicable
|
| | |
| | |
| | |
| | | |
Same behavior, minus unnecessary inclusions where not necessary.
|
|\ \ \
| | | |
| | | | |
registered_cache: Make use of designated initializers
|
| | | |
| | | |
| | | |
| | | | |
Simplifies code.
|
| |/ /
| | |
| | |
| | | |
Removes the need for comments to indicate the fields being assigned.
|
| | | |
|
|/ /
| |
| |
| |
| | |
Avoids some trivially avoidable map lookups by keeping the result of
find operations around and querying them.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Migrates a remaining common file over to the Common namespace, making it
consistent with the rest of common files.
This also allows for high-traffic FS related code to alias the
filesystem function namespace as
namespace FS = Common::FS;
for more concise typing.
|
| | |
|
|\ \
| | |
| | | |
vfs_vector: Make creation of array vfs files less verbose
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
We can add a helper function to make creation of these files nicer.
While we're at it, we can eliminate an unnecessary std::array copy in
the constructor. This makes the overhead on some of these functions way
less intensive, given some arrays were quite large.
e.g. The timezone location names are 9633 bytes in size.
|
|\ \ \
| |/ /
|/| | |
aes_util: Allow SetIV() to be non-allocating
|
| | |
| | |
| | |
| | |
| | |
| | | |
In a few places, the data to be set as the IV is already within an array.
We shouldn't require this data to be heap-allocated if it doesn't need
to be. This allows certain callers to reduce heap churn.
|
|\ \ \
| | | |
| | | | |
time_zone_binary: Make use of designated initializers
|
| |/ / |
|
|\ \ \
| | | |
| | | | |
patch_manager: Resolve -Wignored-qualifier warnings
|
| | |/
| |/|
| | |
| | |
| | | |
Top level const will always be ignored in this case, so it can be
removed.
|
|\ \ \
| | | |
| | | | |
fsp-srv: Stub Read/WriteSaveDataFileSystemExtraDataWithMaskBySaveDataAttribute
|
| | |/
| |/| |
|
|\ \ \
| | | |
| | | | |
registered_cache: Resolve -Wmaybe_uninitialized warnings
|
| | |/
| |/|
| | |
| | | |
While we're at it, we can avoid a redundant map lookup.
|
|\ \ \
| |_|/
|/| | |
file_sys/mode: Make use of DECLARE_ENUM_FLAG_OPERATORS with Mode
|
| |/
| |
| |
| | |
Same behavior, minus a hand-rolled operator.
|
| |
| |
| |
| | |
Fixes an access violation where the file no longer exists at the specified path while being parsed.
|
|/ |
|
|\
| |
| | |
fs: Fix RomFS building when zero byte files are present
|
| |
| |
| |
| |
| |
| | |
When zero byte files are present, the key (offset) for that file is identical to the file right after. A std::map isn't able to fit key-value pairs with identical keys (offsets), therefore, the solution is to use std::multimap which permits multiple entries with the same key.
This most prominently fixes Pokemon Sword and Shield weather with any RomFS mod applied.
|
| | |
|
| | |
|
| | |
|
| | |
|
| |
| |
| |
| | |
- This checks for and removes old updates or dlc based on title id. If a content meta nca exists within the registered cache, it will attempt to remove all the ncas associated with the content meta before installing a new update/dlc
|
|\ \
| | |
| | | |
filesystem: Set various NAND partition sizes to their defaults
|
| | | |
|
| | |
| | |
| | |
| | | |
We should not be limited by the SDMC's partition size, set this to 1 TiB. Hardware is limited to the max allowed by the MBR partition table which is 2 TiB.
|
| |/
| |
| |
| |
| |
| | |
Sets the total space of user and system partitions to their hardware defaults.
Furthermore, return the total space as free space for the user partition to prevent it from reaching zero.
Some games like Bioshock 2 check for the available free space prior to save creation, and we should not be limited by arbitrary limits.
|
|/
|
|
|
|
| |
The file wasn't closed prior to being renamed / moved, throwing an error that states "The process cannot access the file because it is being used by another process." Fix this by closing the file prior to a rename / move operation.
Fixes saving in Luigi's Mansion 3 and KATANA KAMI: A Way of the Samurai Story.
|
|
|
|
| |
Our codebase uppercases member function names.
|
|\
| |
| | |
crypto: Make KeyManager a singleton class
|
| |
| |
| |
| |
| |
| | |
Previously, we were reading the keys everytime a KeyManager object was created, causing yuzu to reread the keys file multiple hundreds of times when loading the game list.
With this change, it is only loaded once.
On my system, this decreased game list loading times by a factor of 20.
|
|\ \
| | |
| | | |
Fix compilation on macOS
|
| | | |
|
|/ /
| |
| |
| | |
Named return value optimization automatically applies here.
|
| | |
|
| | |
|
| |
| |
| |
| |
| |
| | |
Changes many patch_manager functions to use a case-less variant of
GetSubdirectory. Fixes patches not showing up on *nix systems when
patch directories are named with odd cases, i.e. `exeFS'.
|
|\ \
| | |
| | | |
file_sys: Update SystemVersion archive to version 10.0.2
|
| |/ |
|
| | |
|
|/ |
|
|
|
|
| |
- We need this for homebrew process initialization.
|
|
|
|
| |
- helpful to disambiguate Kernel::Memory namespace.
|
|
|
|
|
|
|
|
|
|
|
| |
Allows reporting more cases where logic errors may exist, such as
implicit fallthrough cases, etc.
We currently ignore unused parameters, since we currently have many
cases where this is intentional (virtual interfaces).
While we're at it, we can also tidy up any existing code that causes
warnings. This also uncovered a few bugs as well.
|
| |
|
|
|
| |
* fix LayeredFS error when loading some games made with the Unity
|
| |
|
|\
| |
| | |
system_archive: Fix Korean and Chinese fonts
|
| | |
|
| |
| |
| |
| | |
Adds the proper OSS font for the Chinese language.
|
| |
| |
| |
| | |
Fixes Korean fonts when using Open-source system archives.
|
|/ |
|
|\
| |
| | |
filesys/romfs: Make ProcessFile and ProcessDirectory internally linked
|
| |
| |
| |
| |
| | |
These inclusions aren't used at all within the public interface, so they
can be removed.
|
| |
| |
| |
| |
| | |
These functions aren't used outside of this file, so we can place them
within an anonymous namespace.
|
| |
| |
| |
| |
| |
| | |
* Adds check for disabled cheats to prevent them from being added to the CheatList
* Address feedback
|
|/
|
|
|
| |
This can trivially be an enum class rather than a regular enum, making
it more strongly typed.
|
|\
| |
| | |
core: Make most implicit type conversion warnings errors on MSVC
|
| | |
|
| |
| |
| |
| | |
Resolves a few trivial sign conversion/mismatch errors.
|
|\ \
| | |
| | | |
core: Migrate off deprecated mbedtls functions
|
| |/
| |
| |
| |
| | |
These functions are marked for deprecation and it's recommended that the
*_ret variants be used instead.
|
|/
|
|
|
| |
We can just call the .data() member of path instead of constructing a
completely new string.
|
|
|
|
| |
- Zero initialization here is useful for determinism.
|
|
|
|
|
| |
After further hardware investigation, it appears that some games, perhaps those more lazily coded, will not call EnsureSaveData, meaning that they expect the normal (current) save to be automatically made. Additionally, some games do not create a cache or temporary save before use.
In these 3 specific instances, the save is created automatically for the game if it doesn't exist.
|
|\
| |
| | |
pl_u: Move open source font archives and fix NAND error
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
|\ \
| |/
|/| |
file_sys: Add code to access raw gamecard partitions and lazily load them
|
| | |
|
| | |
|
| | |
|
| | |
|
| |
| |
| |
| |
| |
| | |
This only encourages the use of the global system instance (which will
be phased out long-term). Instead, we use the direct system function
call directly to remove the appealing but discouraged short-hand.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Migrates the HLE service code off the use of directly accessing the
global system instance where trivially able to do so.
This removes all usages of Core::CurrentProcess from the service code,
only 8 occurrences of this function exist elsewhere. There's still quite
a bit of "System::GetInstance()" being used, however this was able to
replace a few instances.
|
| |
| |
| | |
Huge thanks to lioncash for re-ing this for me.
|
| | |
|
| | |
|
|/ |
|
|
|
|
|
| |
This reverts commit fa1c60c33ef88c6cd0b72da46842dc9098db712d, reversing
changes made to e34899067b60a69bca02761bd1290c6824bb559a.
|
|\
| |
| | |
cheat_engine: Use Atmosphere's Cheat VM and fix cheat crash
|
| | |
|
| | |
|
| |
| |
| | |
This is to go with the Atmosphere VM port, now it just contains the callbacks needed for the interface between DmntCheatVm and yuzu, along with the cheat parsers.
|
|\ \
| |/
|/| |
system_archive: Move shared font data to system_archive and fix extended font data
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| |
| |
| |
| | |
Used by fsp-srv/IDeviceOperator
|
| |
| |
| |
| | |
Includes version and meta title ID, used by fsp-srv/IDeviceOperator
|
| | |
|
| | |
|
| | |
|
| |
| |
| | |
Prevents a crash if the filename is less than 9 characters long.
|
| | |
|
| | |
|
| | |
|
| |
| |
| | |
Matches hardware behavior and eliminates some nasty behavior we were doing that wasn't hw-accurate at all.
|
| |
| |
| | |
If title ID is 0, there are no add ons, prevents wasting time looking for them.
|
| |
| |
| | |
Prevents a crash if the load dir would be nullptr, instead logs an error and returns appropriately.
|
| |
| |
| | |
Needed to use the RegisteredCache/PlaceholderCache on gamecards.
|
| | |
|
| |
| |
| | |
Fixes a bug where homebrew that has a title ID with the update bit set can cause issues with the PatchManager
|
| | |
|
| | |
|
| | |
|
|/ |
|
|\
| |
| | |
nsp: Fix various errors with loading and processing of extracted NSPs
|
| |
| |
| |
| | |
Avoids all extracted NSPs being marked as error file type because they don't have program NCAs.
|
| |
| |
| |
| | |
Avoids 0 being used as title ID for all extracted NSPs.
|
|\ \
| | |
| | | |
system_archive: Add open-source reimplementation of MiiModel data
|
| | | |
|
|/ /
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This implements svcMapPhysicalMemory/svcUnmapPhysicalMemory for Yuzu,
which can be used to map memory at a desired address by games since
3.0.0.
It also properly parses SystemResourceSize from NPDM, and makes
information available via svcGetInfo.
This is needed for games like Super Smash Bros. and Diablo 3 -- this
PR's implementation does not run into the "ASCII reads" issue mentioned
in the comments of #2626, which was caused by the following bugs in
Yuzu's memory management that this PR also addresses:
* Yuzu's memory coalescing does not properly merge blocks. This results
in a polluted address space/svcQueryMemory results that would be
impossible to replicate on hardware, which can lead to game code making
the wrong assumptions about memory layout.
* This implements better merging for AllocatedMemoryBlocks.
* Yuzu's implementation of svcMirrorMemory unprotected the entire
virtual memory range containing the range being mirrored. This could
lead to games attempting to map data at that unprotected
range/attempting to access that range after yuzu improperly unmapped
it.
* This PR fixes it by simply calling ReprotectRange instead of
Reprotect.
|
| | |
|
| |
| |
| |
| | |
This can happen when installing NSPs too, not just XCIs.
|
| |
| |
| |
| | |
DeltaFragments are not useful to us and are often not included in patch NSPs.
|
| |
| |
| |
| | |
DeltaFragments are only used to download and apply partial patches on a real console, and are not useful to us at all. Most patch NSPs do not include them, and when they do, it's a waste of space to install them.
|
| |
| |
| |
| | |
Avoids potential confusion, since patches and DeltaFragments are not the same thing. Actual full patches are listed under the Program type.
|
| | |
|
| |
| |
| |
| | |
Used to determine StorageId source for application data.
|
| | |
|
|\ \
| | |
| | | |
loader, file_sys: Add support for parsing and loading KIP (Kernel Internal Process) files
|
| | | |
|
| | | |
|
| | |
| | |
| | |
| | | |
Needed for KIP loading as KIPs do not have an NPDM but do have the essential parts of the data within.
|
| | | |
|
| | |
| | |
| | | |
log clutter in debug logs when theres really no need
|
| | | |
|
| | |
| | |
| | |
| | | |
IPC-100 was changed to InitializeApplicationInfoOld instead of InitializeApplicationInfo. IPC-150 makes an indentical call to IPC-100 however does extra processing. They should not have the same name as it's quite confusing to debug.
|
|\ \ \
| | | |
| | | | |
common/hex_util: Combine HexVectorToString() and HexArrayToString()
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
These can be generified together by using a concept type to designate
them. This also has the benefit of not making copies of potentially very
large arrays.
|
|\ \ \ \
| | | | |
| | | | | |
file_sys/ips_layer: Remove unnecessary reserve() call
|
| |/ / /
| | | |
| | | |
| | | |
| | | |
| | | | |
Given 'replace' is assigned to on the following line, this isn't
necessary, given the underlying data is going to be overwritten
entirely.
|
|\ \ \ \
| |/ / /
|/| | | |
file_sys/card_image: Minor cleanup
|
| | | |
| | | |
| | | |
| | | | |
We already support Rev 1+.
|
| | | |
| | | |
| | | |
| | | | |
Makes for nicer reading.
|
| | | |
| | | |
| | | |
| | | | |
Makes for more consistent reading.
|
| | | |
| | | |
| | | |
| | | | |
Same thing, significantly less noisy.
|
| | | |
| | | |
| | | |
| | | |
| | | | |
Same thing, less duplication. We can also std::move raw into the
PartitionFilesystem constructor.
|
| | | |
| | | |
| | | |
| | | | |
We can just use the size of the array to dehardcode it.
|
| | |/
| |/|
| | |
| | | |
Same thing, less code.
|
|/ /
| |
| |
| |
| | |
Names a few more entries in relevant structures. Information based off
SwitchBrew and my own RE.
|
|/ |
|
|\
| |
| | |
file_sys: Provide generic interface for accessing game data
|
| | |
|
| | |
|
| | |
|
|\ \
| | |
| | | |
file_sys/fsmitm_romfsbuild: Utilize a string_view in romfs_calc_path_hash
|
| | |
| | |
| | |
| | |
| | | |
The given string instance doesn't need to be copied entirely, we can
just use a view instead.
|
|\ \ \
| | | |
| | | | |
file_sys/nca_metadata: Remove unnecessary comparison operators for TitleType
|
| |/ /
| | |
| | |
| | |
| | |
| | | |
enum class elements from the same enum can already be compared against
one another without the need for explicitly defined comparison
operators.
|
|\ \ \
| | | |
| | | | |
service/fsp_srv: Update SaveDataInfo and SaveDataDescriptor structs
|
| | | |
| | | |
| | | |
| | | |
| | | | |
Passing around a 64 byte data struct by value is kind of wasteful,
instead pass a reference to the struct.
|
| | |/
| |/|
| | |
| | |
| | | |
I realized that I updated the documentation on SwitchBrew a while ago,
but never actually updated the structs within yuzu.
|
| |/
|/|
| |
| |
| |
| |
| | |
BitField has been trivially copyable since
e99a14862841841d74be8d0ea9426c2d23546b5e, so we can eliminate these
TODO comments and use ReadObject() directly instead of memcpying the
data.
|
|/
|
|
|
|
|
|
|
|
|
| |
Quite a bit of these were out of sync with Switchbrew (and in some cases
entirely wrong). While we're at it, also expand the section of named
members. A segment within the control metadata is used to specify
maximum values for the user, device, and cache storage max sizes and
journal sizes.
These appear to be generally used by the am service (e.g. in
CreateCacheStorage, etc).
|
|
|
|
|
| |
These don't need to be visible outside of the translation unit, so they
can be enclosed within an anonymous namespace.
|
|\
| |
| | |
set_sys: Implement GetFirmwareVersion(2) for libnx hosversion
|
| | |
|
| | |
|
| |
| |
| | |
Uses the synthesized system archive 9 (SystemVersion) and reports v5.1.0-0.0
|
|\ \
| | |
| | | |
loader/nso: Minor refactoring
|
| | |
| | |
| | |
| | |
| | |
| | | |
This source file was utilizing its own version of the NSO header.
Instead of keeping this around, we can have the patch manager also use
the version of the header that we have defined in loader/nso.h
|
| | |
| | |
| | |
| | | |
These correspond to the NSOBuildHeader.
|
| | | |
|
|/ /
| |
| |
| |
| | |
Instead, pass in the core timing instance and make the dependency
explicit in the interface.
|
|\ \
| | |
| | | |
file_sys: Implement parser and interpreter for game memory cheats
|
| | | |
|
| | | |
|
| | | |
|
| |/
| |
| |
| | |
Uses load/<title_id>/<mod_name>/cheats as root dir, file name is all upper or lower hex first 8 bytes build ID.
|
|/
|
|
| |
While we're at it, give each entry some documentation.
|
| |
|
|\
| |
| | |
loader: Add getters for application banner and logo
|
| | |
|
|/
|
|
| |
This isn't used at all, so we can just get rid of it.
|
|
|
|
| |
Needed for manual RomFS extraction, as Full generates an extra directory and Truncated generates variable results.
|
|
|
|
|
|
|
| |
Provides extra information that makes it easier to tell if an executable
being run is using a 36-bit address space or a 39-bit address space.
While we don't support AArch32 executables yet, this also puts in
distinguishing information for the 32-bit address space types as well.
|
|\
| |
| | |
kernel: Handle kernel capability descriptors
|
| |
| |
| |
| |
| | |
While we're at it, we can also toss out the leftover capability parsing
from Citra.
|
| |
| |
| | |
These functions come in a pair and are needed by Smash Ultimate, Minecraft, and Skyrim, amongst others.
|
| |
| |
| | |
This stores a file in the save directory called '.yuzu_save_size' which stores the two save sizes (normal area and journaled area) sequentially as u64s.
|
| | |
|
| |
| |
| | |
Serves no actual purpose in this instance besides making NACP's copy assignment deleted, which is not intended behavior.
|
| |
| |
| | |
Allows these functions to compile when T is not u8.
|
|/
|
|
| |
Functions which are suppose to crash on non canary builds usually don't return anything which lead to uninitialized memory being used.
|
|
|
|
|
|
|
|
|
|
|
| |
fmt::format() returns a std::string instance by value, so calling
.c_str() on it here is equivalent to doing:
auto* ptr = std::string{}.c_str();
The data being pointed to isn't guaranteed to actually be valid anymore
after that expression ends. Instead, we can just take the string as is,
and provide the necessary formatting parameters.
|
|\
| |
| | |
file_sys/directory: Amend path buffer size for directory entries
|
| |
| |
| |
| |
| | |
The path buffer is actually 0x301 (769) characters in length, with the
extra character being intended for the null-terminator.
|
|\ \
| | |
| | | |
patch_manager: Add support for disabling patches
|
| | | |
|
|\ \ \
| | | |
| | | | |
file_sys/save_data_factory: Update SaveDataSpaceId enum
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
Amends it with missing values deduced from RE (ProperSystem being from
SwitchBrew for naming)
(SdCardUser wasn't that difficult to discern given it's used alongside
SdCardSystem when creating the save data indexer, based off the usage of
the string "saveDataIxrDbSd" nearby).
|
| | | | |
|
| | | |
| | | |
| | | |
| | | | |
Mimics hardware behavior.
|
|/ / / |
|
| | |
| | |
| | |
| | |
| | | |
We've already given the constant to the vector itself, so we don't need
to re-hardcode it in the array.
|
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
This allows the array to be constexpr. std::function is also allowed to
allocate memory, which makes its constructor non-trivial, we definitely
don't want to have all of these execute at runtime, taking up time
before the application can actually load.
|
|\ \ \
| | | |
| | | | |
file_sys: Implement open source system archives
|
| | | | |
|
| | | | |
|
| | | |
| | | |
| | | |
| | | | |
Allows using constexpr/static const data with VFS.
|
|\ \ \ \
| |_|/ /
|/| | | |
file_sys/registered_cache: Eliminate variable shadowing
|
| | |/
| |/|
| | |
| | |
| | | |
Also inverts if statements where applicable to allow unindenting code a
little bit.
|
|\ \ \
| | | |
| | | | |
filesystem: De-globalize registered_cache_union
|
| |/ /
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
We can just return a new instance of this when it's requested. This only
ever holds pointers to the existing registed caches, so it's not a large
object. Plus, this also gets rid of the need to keep around a separate
member function just to properly clear out the union.
Gets rid of one of five globals in the filesystem code.
|
| | |
| | |
| | |
| | | |
Ensures that read only indeed means read only.
|
|/ /
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This is the same behavior-wise as DeleteDirectoryRecursively, with the
only difference being that it doesn't delete the top level directory in
the hierarchy, so given:
root_dir/
- some_dir/
- File.txt
- OtherFile.txt
The end result is just:
root_dir/
|
|\ \
| | |
| | | |
file_sys/registered_cache: Use regular const references instead of std::shared_ptr for InstallEntry()
|
| | | |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
These parameters don't need to utilize a shared lifecycle directly in
the interface. Instead, the caller should provide a regular reference
for the function to use. This also allows the type system to flag
attempts to pass nullptr and makes it more generic, since it can now be
used in contexts where a shared_ptr isn't being used (in other words, we
don't constrain the usage of the interface to a particular mode of
memory management).
|
|/ /
| |
| |
| |
| |
| |
| |
| |
| | |
While we're at it, organize the array linearly, since clang formats the
array elements quite wide length-wise with the addition of the missing
'u'.
Technically also fixes patch lookup and icon lookup with Portuguese,
though I doubt anyone has actually run into this issue.
|
|\ \
| | |
| | | |
patch_manager: Add support for applying LayeredFS patches to ExeFS
|
| | |
| | |
| | | |
The decision was made to name them LayeredExeFS instead of just LayeredFS to differentiate from normal RomFS-based mods. The name may be long/unweildy, but conveys the meaning well.
|
| | |
| | |
| | |
| | | |
This will scan the <mod>/exefs dir for all files and then layer those on top of the game's exefs and use this as the new exefs. This allows for overriding of the compressed NSOs or adding new files. This does use the same dir as IPS/IPSwitch patch, but since the loader will not look for those they are ignored.
|
| | |
| | |
| | |
| | | |
When enabled, all exefs(es) will be copied to yuzu/dump/<title_id>/exefs.
|
|/ /
| |
| |
| | |
Fills out the struct according to information provided by SwitchBrew
|
|\ \
| | |
| | | |
game_list: Optimize game list refresh
|
| | |
| | |
| | |
| | | |
Creates a single KeyManager for the entire container and then passes it into the NCA constructor, eliminating several unnecessary KeyManager reads.
|
| |/
| |
| |
| | |
Allows resuing a common KeyManager when a large amount of NCAs are handled by the same class. Should the parameter not be provided, a new KeyManager will be constructed, as was the default behavior prior to this.
|
| |
| |
| |
| |
| | |
Rather than keeping around unused values, we can just introduce them as
needed.
|
| |
| |
| |
| |
| |
| | |
There's no real point to keeping the separate enum around, especially
given the name of the error code itself is supposed to document what the
value actually represents.
|
| |
| |
| |
| | |
Keeps filesystem-related error codes in one spot.
|
|\ \
| | |
| | | |
patch_manager: Add support for dumping uncompressed NSOs
|
| | |
| | |
| | |
| | | |
When enabled in settings, PatchNSO will dump the unmodified NSO that it was passed to a file named <build id>.nso in the dump root for the current title ID.
|
| | |
| | |
| | |
| | | |
Equates to yuzu_dir/dump/<title id>/
|
|\ \ \
| |_|/
|/| | |
[ns|fsp_srv]: Implement various functions to boot Checkpoint
|
| | |
| | |
| | | |
Returns the raw NACP bytes and the raw icon bytes into a title-provided buffer. Pulls from Registration Cache for control data, returning all zeros should it not exist.
|
| | | |
|
| |/
| |
| |
| | |
Returns the raw bytes of the NACP file. Needed for GetApplicationControlData which returns the raw, unprocessed NACP to the game.
|
| |
| |
| |
| | |
Cleans up unused includes and trims off some dependencies on externals.
|
|/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* get rid of boost::optional
* Remove optional references
* Use std::reference_wrapper for optional references
* Fix clang format
* Fix clang format part 2
* Adressed feedback
* Fix clang format and MacOS build
|
|
|
|
|
|
| |
* remove unnecessary if-statements
* Addressed feedback
|
|\
| |
| | |
vfs: Remove InterpretAsDirectory and related functions
|
| |
| |
| |
| | |
When writing VFS, it initally seemed useful to include a function to in-place convert container files into directories in one homogenous directory structure, but re-evaluating it now there have been plenty of chances to use it and there has always been a better way. Removing as it is unused and likely will not be used.
|
| |
| |
| |
| | |
Prevents a potential bug when using RLE records in an IPS patch.
|
| |
| |
| |
| | |
Also gets rid of an unused variable.
|
|\ \
| |/
|/| |
patch_manager: Add support for LayeredFS on DLC RomFS
|
| | |
|
| |
| |
| |
| | |
Prevents a Entry from appearing in the list twice if the user has it installed in two places (e.g. User NAND and SDMC)
|
| | |
|
|\ \
| | |
| | | |
content_archive: Minor reorganization changes
|
| | |
| | |
| | |
| | |
| | | |
std::move doesn't actually dereference the data, so it doesn't matter
whether or not the type is null.
|
| | |
| | |
| | |
| | |
| | | |
This is only ever used within the cpp file, so it can just be an
internal function.
|
| | |
| | |
| | |
| | | |
This is the same as using std::any_of with an inverted predicate.
|
| | |
| | |
| | |
| | |
| | |
| | | |
The constructor alone is pretty large, the reading code should be split
into its consistuent parts to make it easier to understand it without
having to build a mental model of a 300+ line function.
|
| |/
| |
| |
| |
| | |
Each header is 512 bytes in size, which is kind of an excessive amount
to copy all the time when it's possible to avoid doing so.
|
|\ \
| | |
| | | |
XCI: Add function for checking the existence of the program NCA
|
| |/
| |
| |
| |
| |
| | |
The only reason the getter existed was to check whether or not the
program NCA was null. Instead, we can just provide a function to query
for the existence of it, instead of exposing it entirely.
|
|\ \
| |/
|/| |
savedata_factory: Add DeviceSaveData and fix TemporaryStorage
|
| |
| |
| |
| | |
Required for TemporaryStorage saves (in addition to SaveDataType)
|
| |
| |
| |
| | |
Uses the same path as SaveData except with UID 0. Adds a warning if UID is not 0.
|
|\ \
| | |
| | | |
content_archive/patch_manager: Lower log levels to eliminate some unnecessary logs
|
| | |
| | |
| | |
| | | |
Normal Program-type patches will still be logged to aid in debugging, but for others (mainly Control), it was moved to Debug.
|
| | |
| | |
| | |
| | | |
Avoids printing live keys in the general log.
|
| |/
|/|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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.
|
| |
| |
| |
| |
| | |
These are just the size of the data being passed in, so we can specify
that via the size() member function.
|
| |
| |
| | |
Falls back to title ID + 0x1000, which is what HOS does.
|
|\ \
| |/
|/| |
crypto: Add support for full key derivation
|
| | |
|
|\ \
| | |
| | | |
ips_layer: Silence truncation and conversion warnings
|
| | |
| | |
| | |
| | | |
Makes type conversions explicit to avoid compiler warnings.
|
|\ \ \
| | | |
| | | | |
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.
|
| | |
| | |
| | |
| | |
| | |
| | | |
We can just compare the existing std::vector instance with a constexpr
std::array containing the desired match. This is lighter resource-wise,
as we don't need to allocate on the heap.
|
| | |
| | |
| | |
| | |
| | | |
Makes the layout of the array consistent, by making all elements match,
instead of special-casing the first one.
|
| | |
| | |
| | |
| | |
| | |
| | | |
Adds missing includes to prevent potential compilation issues in the
future. Also moves the definition of a struct into the cpp file, so that
some includes don't need to be introduced within the header.
|
|/ /
| |
| |
| |
| | |
We don't need to make a copy of the read data, so we can std::move it
into the make_shared call here.
|
|\ \
| | |
| | | |
fsmitm_romfsbuild: Add support for stubbing and IPS patches in LFS
|
| | | |
|
| | | |
|
| | | |
|
|\ \ \
| |_|/
|/| | |
ips_layer: Add support for IPSwitch executable patches
|
| | |
| | |
| | | |
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.
|
| | | |
|
| | |
| | |
| | |
| | | |
More accurately follows IPSwitch specification.
|
| | | |
|
| |/ |
|
| | |
|
| |
| |
| |
| | |
Reads as Update (NSP) in add-ons
|
|/
|
|
| |
Will prefer any installed update over the packed version.
|
|\
| |
| | |
file_sys: Add support for loading IPS patches
|
| |
| |
| |
| | |
Avoid resource-heavy classes and remove quasi-duplicated code.
|
| |
| |
| |
| | |
While PatchExeFS operated on the entire directory, this function operates on the uncompressed NSO. Avoids copying decompression code to PatchManager.
|
| | |
|
| | |
|
|\ \
| | |
| | | |
submission_package: Cleanup and bug fixes
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
GetName() returns a std::string by value, not by reference, so after the
std::string_view is constructed, it's not well defined to actually
execute any member functions of std::string_view that attempt to access
the data, as the std::string has already been destroyed. Instead, we can
just use a std::string and erase the last four characters.
|
| | |
| | |
| | |
| | |
| | | |
If a ticket file was ever a null pointer, we'd cause a null pointer
dereference, as we were calling GetExtension() on the pointer instance.
|
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
When searching for a file extension, it's generally preferable to begin
the search at the end of the string rather than the beginning, as the
whole string isn't going to be walked just to check for something at the
end of it.
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
If an error occurs when constructing the PartitionFilesystem instance,
the constructor would be exited early, which wouldn't initialize the
extracted data member, making it possible for other code to perform an
uninitialized read by calling the public IsExtractedType() member
function. This prevents that.
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Like the other two bits of factored out code, this can also be put
within its own function. We can also modify the code so that it accepts
a const reference to a std::vector of files, this way, we can
deduplicate the file retrieval.
Now the constructor for NSP isn't a combination of multiple behaviors in
one spot. It's nice and separate.
|
| | |
| | |
| | |
| | |
| | |
| | | |
This too, is completely separate behavior from what is in the
constructor, so we can move this to its own isolated function to keep
everything self-contained.
|
| | |
| | |
| | |
| | |
| | | |
This behavior is entirely independent of the surrounding code, so it can
be put in its own function to keep the behavior separate.
|
| | |
| | |
| | |
| | | |
We can use early continues here to reduce the amount of nesting.
|
|\ \ \
| |_|/
|/| | |
card_image: Ensure program_nca_status is always initialized
|
| |/
| |
| |
| |
| |
| | |
If any of the error paths before the NCA retrieval are taken, it'll
result in program_nca_status being left in an inconsistent state. So we
initialize it by default with a value indicating an error.
|
| | |
|
| |
| |
| | |
Command #5
|
| |
| |
| |
| | |
Previous behavior was to assert. Seems to mirror expected game behavior.
|
|/ |
|
|
|
|
|
|
|
| |
Makes the public interface consistent in terms of how accesses are done
on a process object. It also makes it slightly nicer to reason about the
logic of the process class, as we don't want to expose everything to
external code.
|
|\
| |
| | |
process/vm_manager: Initial modifications to load NPDM metadata
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Rather than hard-code the address range to be 36-bit, we can derive the
parameters from supplied NPDM metadata if the supplied exectuable
supports it. This is the bare minimum necessary for this to be possible.
The following commits will rework the memory code further to adjust to
this.
|
| |
| |
| |
| |
| | |
Avoids making copies of large std::vector instances where it's trivially
avoidable to do so.
|
| |
| |
| |
| |
| | |
Theres no need to do explicit bitwise arithmetic here, when we have a
function that does this with a more descriptive name.
|
| |
| |
| |
| |
| | |
Avoids the need to nest code quite a bit by early-exiting in error
cases.
|
| |
| |
| |
| |
| | |
Orders the initializer list members to be in the same order that they
would be initialized in. Avoids compiler warnings.
|
| |
| |
| |
| |
| | |
Cast where explicitly necessary and in other cases we can simply modify
the algorithm to accomodate larger data.
|
| |
| |
| |
| |
| | |
There's no need to duplicate in-class initializers with a constructor
initializer list. std::strings also initialize to empty by default.
|
| |
| |
| |
| |
| |
| | |
The std::vector instances are already initially allocated with all
entries having these values, there's no need to loop through and fill
them with it again when they aren't modified.
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
auto x = 0;
auto-deduces x to be an int. This is undesirable when working with
unsigned values. It also causes sign conversion warnings. Instead, we
can make it a proper unsigned value with the correct width that the
following expressions operate on.
|
| |
| |
| |
| |
| | |
Given we just recently had a patch backport this from citra, let's try
and keep the convention uniform.
|
| |
| |
| |
| |
| |
| | |
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.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This converts it into a regular constructor parameter. There's no need
to make this a template parameter on the class when it functions
perfectly well as a constructor argument.
This also reduces the amount of code bloat produced by the compiler, as
it doesn't need to generate the same code for multiple different
instantiations of the same class type, but with a different fill value.
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| |
| |
| |
| | |
Reads multiple dirs through as if a waterfall.
|
| |
| |
| |
| | |
Maps a vector into the VFS interface.
|
| |
| |
| |
| | |
Always returns the template argument byte for all reads. Doesn't support writes.
|
| | |
|
|/
|
|
| |
Maps name string to directory or file.
|
|\
| |
| | |
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.
|
|\ \
| | |
| | | |
savedata_factory: Add TemporaryStorage SaveDataType
|
| | |
| | |
| | | |
Seems to be used by NSO NES Emulator
|
|\ \ \
| | | |
| | | | |
control_metadata: Move language name array definition to the cpp file
|
| | | |
| | | |
| | | |
| | | |
| | | | |
There's no need to indent the code here, given the if case contains a
return statement at the end of it.
|
| | |/
| |/|
| | |
| | |
| | |
| | |
| | | |
This was used in two different translation units
(deconstructed_rom_directory and patch_manager). This means we'd be
pointlessly duplicating the whole array twice due to it being defined
within the header.
|
| | |
| | |
| | |
| | |
| | |
| | | |
These variables aren't used, which still has an impact, as std::vector
cannot be optimized away by the compiler (it's constructor and
destructor are both non-trivial), so this was just wasting memory.
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
std::shared_ptr isn't strictly necessary here and is only ever used in
contexts where the object doesn't depend on being shared. This also
makes the interface more flexible, as it's possible to create a
std::shared_ptr from a std::unique_ptr (std::shared_ptr has a
constructor that accepts a std::unique_ptr), but not the other way
around.
|
| | |
| | |
| | |
| | | |
Ensures that the member always has a deterministic value.
|
|/ /
| |
| |
| |
| | |
Orders the initializer list in the same order the members would be
initialized. Avoids compiler warnings.
|
|/ |
|
|
|
|
|
|
| |
Orders the elements in the initializer list in the order they're
specified in the class. This prevents compiler warnings about
initialization order.
|
|
|
|
|
| |
romfs.h doesn't need to be included in the header, the only real
dependency here is common's swap.h that needs to be included.
|
|
|
|
| |
These includes were previously being satisfied indirectly.
|
|\
| |
| | |
file_sys/submission_package: Replace includes with forward declarations where applicable
|
| |
| |
| |
| |
| | |
Orders the elements in the sequence to match the order in which they'll
actually be initialized in.
|
| | |
|
| | |
|
| | |
|
| |
| |
| |
| | |
Now display correct error instead of catch-all MissingProgramNCA
|
| | |
|
| | |
|
| |
| |
| |
| | |
Fixes base game read errors
|
| | |
|
| | |
|
| |
| |
| |
| | |
Right now only includes Updates, but should eventually contain all of the other patches we need.
|
| | |
|
| | |
|
|/
|
|
| |
Aggregates multiple caches into one interface
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
| |
Eliminated duplicate code and adds support for Rev1+ carts
|
| |
|
|
|
|
|
| |
Cuts down on include dependencies, resulting in less files that need to
be rebuilt when certain things are changed.
|
|
|
|
|
|
| |
Eliminates the need to rebuild some source files if the file_util header
ever changes. This also uncovered some indirect inclusions, which have
also been fixed.
|
|
|
|
|
|
|
|
|
|
|
| |
The follow-up to e2457418dae19b889b2ad85255bb95d4cd0e4bff, which
replaces most of the includes in the core header with forward declarations.
This makes it so that if any of the headers the core header was
previously including change, then no one will need to rebuild the bulk
of the core, due to core.h being quite a prevalent inclusion.
This should make turnaround for changes much faster for developers.
|
|\
| |
| | |
vfs_real: Remove unused variable in CreateDirectoryRelative()
|
| | |
|
|/
|
|
| |
Prevents compiler warnings.
|
| |
|
| |
|
|
|
|
| |
This is needed because the title IDs of update NCAs will not use the update title ID. The only sure way to tell is to look for a partition with BKTR crypto.
|
|
|
|
| |
On call to WriteKeyToFile, so that the autogenerated file can be written.
|
| |
|
| |
|
| |
|
|
|
|
| |
Returns the file before calling parser on it.
|
| |
|
| |
|
| |
|
|
|
|
| |
Prevents NCA-related errors from being masked into MissingProgramNCA or MissingKeyFile
|
|\
| |
| | |
qt/main: Port part of citra(#3411), open savedata works
|
| | |
|
| |
| |
| |
| |
| | |
Avoids the need to rebuild these source files if the mode header
changes.
|
|/
|
|
|
| |
This doesn't require the central core header to be included, it just
needs the vfs headers.
|
|
|
|
|
|
|
|
| |
Avoids the need to rebuild multiple source files if the filesystem code
headers change.
This also gets rid of a few instances of indirect inclusions being
relied upon
|
|
|
|
|
|
| |
Avoids the need to rebuild whatever includes the romfs factory header if
the loader header ever changes. We also don't need to include the main
core header. We can instead include the headers we specifically need.
|
| |
|
| |
|
|
|
|
|
| |
It's in the common code, so it should be under the Common namespace like
everything else.
|
|\
| |
| | |
file_sys: Add support for registration format
|
| |
| |
| |
| |
| |
| | |
Fix logic in RealVfsFilesystem Create methods
Remove magic numbers
Fix regex errors
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| |
| |
| |
| | |
Instead of defaulting to VfsRawCopy
|
| | |
|
| | |
|
| |
| |
| |
| | |
Prompts for title type on NCA files.
|
| |
| |
| |
| | |
Manages NAND NCA get and install.
|
| | |
|
| | |
|
| |
| |
| |
| | |
Fixes bugs with calling CreateFile when the immediate directory does not exist.
|
| |
| |
| |
| | |
Creates and stores RegisteredCaches for user and system NAND, as creation of a RegisteredCache is expensive.
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
We can make the enum class type compatible with fmt by providing an
overload of operator<<.
While we're at it, perform proper bounds checking. If something exceeds
the array, it should be a hard fail, because it's, without a doubt, a
programmer error in this case.
|
|\ \
| | |
| | | |
vfs: Use sanitized paths within MoveFile() and MoveDirectory()
|
| |/
| |
| |
| |
| |
| | |
Previously these were being unused (or partially unused). While we're at
it, use better naming to make it visibly obvious which variant of the
path is being used.
|
|\ \
| | |
| | | |
card_image: Simplify return statement of GetSubdirectories()
|
| | |
| | |
| | |
| | | |
We have the aliases, so we may as well use 'em.
|
| |/
| |
| |
| |
| | |
We don't need to write out the construction long-form, we can just let
the language itself work it out off the return type.
|
| |
| |
| |
| |
| | |
Makes it consistent with the other VFS interfaces and prevents implicit
construction.
|
| |
| |
| |
| |
| |
| | |
struct should be used when the data type is very simple or otherwise has
no invariants associated with it. Given these are used to form a
hierarchy, class should be used instead.
|
|/ |
|
|
|
| |
Full list of new errors and descriptions in core/loader/loader.h
|
|\
| |
| | |
fsp_srv: Emplace entries first when building index instead of emplacing last
|
| |
| |
| |
| |
| |
| | |
Given elements inserted into a vector are zeroed out, we can just copy
MAX_LEN - 1 elements and the data will already be properly null
terminated.
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
|/ |
|
|\
| |
| | |
Add Icons and Metadata Support
|
| | |
|
| | |
|
| | |
|
|/ |
|
|\
| |
| | |
XCI and Encrypted NCA Support
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| |
| |
| |
| | |
This wasn't being used for anything, so it can be removed.
|
|/
|
|
|
| |
The lambda elements should be taken by const reference here, and we can
move the virtual directory passed to ReplaceFileWithSubdirectory()
|
|
|
|
|
|
|
| |
We shouldn't be upcasting our file instances. Given a
PartitionFilesystem is currently designed to accept any arbitrary
VfsFile instances, casting to a more specific type than that is just bad
design, and shows an interface design issue.
|
| |
|
|\
| |
| | |
partition_filesystem: Use std::move where applicable
|
| |
| |
| |
| |
| | |
Avoids copying a std::string instance and avoids unnecessary atomic
reference count incrementing and decrementing.
|
|/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Regression and Mode Fixes
* Review Fixes
* string_view correction
* Add operator& for FileSys::Mode
* Return std::string from SanitizePath
* Farming Simulator Fix
* Use != With mode operator&
|
|
|
|
|
|
| |
Cleanup
Review fixes
|
|
|
|
|
|
|
|
|
| |
ReplaceFileWithSubdirectory() takes a VirtualFile and a VirtualDir, but
it was being passed a string as one of its arguments. The only reason
this never caused issues is because this template isn't instantiated
anywhere yet.
This corrects an issue before it occurs.
|
|
|
|
|
| |
Avoids unnecessary construction of std::string instances where
applicable.
|
|
|
|
|
| |
This avoids a truncating cast on size. I doubt we'd ever traverse a
directory this large, however we also shouldn't truncate sizes away.
|
|\
| |
| | |
partition_filesystem, vfs_real: Minor changes
|
| |
| |
| |
| |
| | |
We already return by value, so we don't explicitly need to make the
copy.
|
| | |
|
| |
| |
| |
| | |
Avoids unnecessary atomic increment and decrement operations.
|
| |
| |
| |
| | |
This is a little bit more self-documenting on what is being done here.
|
|\ \
| | |
| | | |
file_sys/errors: Remove redundant object constructor calls
|
| |/
| |
| |
| |
| | |
Given we're already constructing the error code, we don't need to call
the constructor inside of it.
|
| |
| |
| |
| |
| | |
We can simply use std::clamp() here, instead of using an equivalent
with std::max() and std::min().
|
| |
| |
| |
| |
| | |
Given the data is intended to be directly written, there's no need to
take the std::vector by value and copy the data.
|
| |
| |
| |
| | |
Provides the same behavior, but with less writing
|
|/
|
|
|
| |
These functions don't modify the data being pointed to, so these can be
pointers to const data
|
|\
| |
| | |
filesys/loader: std::move VirtualFile instances in constructors where applicable
|
| |
| |
| |
| |
| | |
Avoids potentially unnecessary atomic reference count incrementing and
decrementing, as well as string copying.
|
|/
|
|
|
| |
This should be returned here, otherwise pfs_dirs is effectively only
ever added to, but never read.
|
|\
| |
| | |
savedata_factory: Make SaveDataDescriptor's DebugInfo() function a const member function
|
| |
| |
| |
| | |
This function doesn't alter class state.
|
|\ \
| | |
| | | |
partition_filesystem: Ensure all class members of PartitionFilesystem are initialized
|
| |/
| |
| |
| |
| |
| |
| |
| |
| | |
Previously is_hfs and pfs_header members wouldn't be initialized in the
constructor, as they were stored in locals instead. This would result in
things like GetName() and PrintDebugInfo() behaving incorrectly.
While we're at it, initialize the members to deterministic values as
well, in case loading ever fails.
|
|\ \
| | |
| | | |
content_archive: Minor changes
|
| | |
| | |
| | |
| | |
| | | |
There's no need to take this by value when it's possible to avoid
unnecessary copies entirely like this.
|
| | | |
|
| |/
| |
| |
| |
| | |
Gets rid of unnecessary atomic reference count incrementing and
decrementing.
|
|/
|
|
| |
We can just use a generic lambda to avoid writing the same thing twice.
|
|
|
|
|
|
|
|
|
|
| |
* Virtual Filesystem
* Fix delete bug and documentate
* Review fixes + other stuff
* Fix puyo regression
|
| |
|
|
|
|
| |
We were trying to delete things in the current directory instead of the actual filesystem directory. This may fix some savedata issues in some games.
|
|\
| |
| | |
Services/FS: Return the correct error code when trying to mount a nonexistent savedata.
|
| | |
|
| | |
|
| |
| |
| |
| | |
This reverts commit 77c684c1140f6bf3fb7d4560d06d2efb1a2ee5e2.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
* Add VfsFile and VfsDirectory classes
* Finish abstract Vfs classes
* Implement RealVfsFile (computer fs backend)
* Finish RealVfsFile and RealVfsDirectory
* Finished OffsetVfsFile
* More changes
* Fix import paths
* Major refactor
* Remove double const
* Use experimental/filesystem or filesystem depending on compiler
* Port partition_filesystem
* More changes
* More Overhaul
* FSP_SRV fixes
* Fixes and testing
* Try to get filesystem to compile
* Filesystem on linux
* Remove std::filesystem and document/test
* Compile fixes
* Missing include
* Bug fixes
* Fixes
* Rename v_file and v_dir
* clang-format fix
* Rename NGLOG_* to LOG_*
* Most review changes
* Fix TODO
* Guess 'main' to be Directory by filename
|
| | |
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
* Start to add NCA support in loader
* More nca stuff
* More changes to nca.cpp
* Now identifies decrypted NCA cont.
* Game list fixes and more structs and stuff
* More updates to Nca class
* Now reads ExeFs (i think)
* ACTUALLY LOADS EXEFS!
* RomFS loads and games execute
* Cleanup and Finalize
* plumbing, cleanup and testing
* fix some things that i didnt think of before
* Preliminary Review Changes
* Review changes for bunnei and subv
|
|/ |
|
|
|
|
|
|
| |
This makes the formatting expectations more obvious (e.g. any zero padding specified
is padding that's entirely dedicated to the value being printed, not any pretty-printing
that also gets tacked on).
|
|
|
|
|
| |
Lessens the amount to read and gets rid of the PRIX64 macro, allowing us to use a single string
for the whole path, making it easier to read.
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
| |
- Used by Binding of Isaac.
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
| |
Asdf
|
| |
|
| |
|
|
|
|
| |
file_sys: Add factory class for RomFS file system.
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|\
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
# Conflicts:
# src/core/CMakeLists.txt
# src/core/arm/dynarmic/arm_dynarmic.cpp
# src/core/arm/dyncom/arm_dyncom.cpp
# src/core/hle/kernel/process.cpp
# src/core/hle/kernel/thread.cpp
# src/core/hle/kernel/thread.h
# src/core/hle/kernel/vm_manager.cpp
# src/core/loader/3dsx.cpp
# src/core/loader/elf.cpp
# src/core/loader/ncch.cpp
# src/core/memory.cpp
# src/core/memory.h
# src/core/memory_setup.h
|
| | |
|
| | |
|
| | |
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| | |
The loaders now register each loaded ROM with the SelfNCCH factory, which keeps the data around for the duration of the emulation session.
When opening the SelfNCCH archive, the factory queries the current program's programid and uses that as a key to the map that contains the NCCHData structure (RomFS, Icon, Banner, etc).
3dsx files do not have a programid and will use a default of 0 for this value, thus, only 1 3dsx file with RomFS is loadable at the same time.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
* loader/ncch: split NCCH parsing into its own file
* loader/ncch: add support for loading update NCCHs from the SD card
* loader/ncch: fix formatting
* file_sys/ncch_container: Return a value for OpenFile
* loader/ncch: cleanup, always instantiate overlay_ncch to base_ncch
* file_sys/ncch_container: better encryption checks, allow non-app NCCHs to load properly and for the existence of NCCH structures to be checked
* file_sys/ncch_container: pass filepath as a const reference
|
| | |
|
| | |
|
|/ |
|
|
|
|
|
| |
- Deleted GetStatus() because it wasn't used anywhere outside of Core::System.
- Fixed design flaw where the message bar status could be set despite the game being stopped.
|
| |
|
| |
|
|
|
|
|
|
|
|
| |
- Made LoadKernelSystemMode return a pair consisting of a system mode and a result code (Could use review).
- Deleted ErrorOpenGL error code in favor of just having ErrorVideoCore.
- Made dialog messages more clear.
- Compared archive ID in fs_user.cpp to ArchiveIdCode::NCCH as opposed to hex magic.
- Cleaned up some other stuff.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
| |
Corrects a few issues with regards to Doxygen documentation, for example:
- Incorrect parameter referencing.
- Missing @param tags.
- Typos in @param tags.
and a few minor other issues.
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
| |
Prevents implicit conversions.
|
| |
|
| |
|
|
|
|
| |
According to the observation from game and 3dbrew "Used for accessing general NCCH data"
|
|
|
|
| |
All "subclasses" of DiskArchive are splitted out. This class is useless
|
| |
|
| |
|
|
|
|
| |
Now DiskArchive only serves for SDMC, then it should be just a "SDMCArchive"
|
|
|
|
| |
ExtSaveData is more similar to SaveData, so let it be a subclass of SaveData
|
|
|
|
| |
The error checking of SaveDataArchive is completely different from DiskArchive, so it has to be a new class instead of a subclass of DiskArchive.
|
|
|
|
| |
Same as directory, file shouldn't expose Open either.
|
|
|
|
| |
Open should not be an interface exposed by Directory because it is the Archive thats implement the methed to open the directory. The service API of 3DS also implies this - Open is not a function of directory service, but is of FS main service
|
| |
|
|
|
|
| |
and make the mode parameter a reference since it is a BitField union
|
| |
|
| |
|
|
|
|
|
|
|
| |
This makes clang-format useful on those.
Also add a bunch of forgotten transitive includes, which otherwise
prevented compilation.
|
| |
|
| |
|
| |
|
|\
| |
| | |
Common: Remove Common::make_unique, use std::make_unique
|
| | |
|
|/
|
|
| |
shared appears in the initializer list before mount_point
|
|
|
|
| |
This allows Fire Emblem to boot again.
|
| |
|
|
|
|
| |
Format information is currently only implemented for the ExtSaveData, SharedExtSaveData and SaveData archives, the information is stored in a file alongside the root folder of the archive.
|
| |
|
|
|
|
| |
These operations are limited by the open flags specified while opening the file.
|
| |
|
| |
|
| |
|
|\
| |
| | |
DiskDirectory: Initialize the directory member with valid info.
|
| | |
|
|/
|
|
| |
This doesn't return by reference so const isn't really necessary
|
| |
|
| |
|
| |
|
|
|
|
| |
Closes #1067
|
|
|
|
| |
Buffer lengths should be size_t, and file offsets should be u64.
|
| |
|
| |
|
|
|
|
|
|
| |
The code now properly configures the process image to match the loaded
binary segments (code, rodata, data) instead of just blindly allocating
a large chunk of dummy memory.
|
| |
|
| |
|
| |
|
| |
|
|
|
|
| |
Organize the ExtSaveData folders as they are stored in the console.
|
| |
|
|
|
|
|
|
|
| |
memory.cpp/h contains definitions related to acessing memory and
configuring the address space
mem_map.cpp/h contains higher-level definitions related to configuring
the address space accoording to the kernel and allocating memory.
|
|
|
|
| |
This has been obsoleted by the field in Process.
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
| |
Also fixed a bug with CreateExtSaveData that made it unable to create ExtSaveData archives in the SDMC directory.
|
|
|
|
| |
Ported to the new factory pattern we have for archives.
|
| |
|
|
|
|
| |
Implemented FSUser::CreateExtSaveData
|
|\
| |
| | |
Archives: Change the folder layout of some archives.
|
| | |
|
| | |
|
| | |
|
| | |
|
| |
| |
| |
| | |
Each archive now takes a mount point of either NAND or SDMC, and builds its own directory structure there, trying to simulate an HLE-friendly hardware layout
|
| |
| |
| |
| | |
under /nand/title/high/low/content/00000000.app.romfs
|
| |
| |
| |
| | |
This is to better represent the hardware layout, they are still aren't quite accurate, but this better and will help a bit when implementing the other archives like NAND-RO and NAND-RW
|
| | |
|
|/ |
|
| |
|
| |
|
| |
|
|
|
|
| |
Fixed a few warnings and cleaned up the code
|
|
|
|
|
|
| |
This allows Steel Diver to boot further, some files are needed.
This is still not ready and needs a big cleanup, this will possibly be delayed until the way we handle archives is fixed (with factory classes instead of ahead-of-time creation of archives)
|
|
|
|
|
|
|
|
| |
They will be stored in /extsavedata/SDMC and /extsavedata/NAND respectively.
Also redirect some APT_A functions to their APT_U equivalents.
Implemented the gamecoin.dat file in SharedExtSaveData in the PTM module.
Implemented formatting the savegame.
Retake a previous savegame if it exists instead of reporting them as not formatted every time a game is loaded.
|
| |
|
|
|
|
| |
Moved most of the shared CFG code there, implemented a few CFG:I functions
|
| |
|
|
|
|
| |
It is now kept in memory as per 3dbrew, all updates happen on memory, then they can be saved using UpdateConfigNANDSavegame.
|
|
|
|
|
|
| |
Added a "config" file to the CFG process service (CFG:U), and added a few default blocks to it.
Implemented GetSystemModel and GetModelNintendo2DS
|
|\
| |
| | |
License change
|
| | |
|
|\ \
| | |
| | | |
Added CreateFile to the FS_USER service
|
| | |
| | |
| | |
| | | |
Tested with hwtests.
|
|\ \ \
| |/ /
|/| | |
Clean up some warnings
|
| |/ |
|
|/ |
|
|
|
|
| |
Maybe sometime when we actually implement that
|
|
|
|
| |
It will be stored in the /syssavedata folder. This archive is user by various Services and possibly games via the FS:U service.
|
|
|
|
|
|
|
|
|
|
| |
The savedata for each game is stored in /savedata/<ProgramID> for NCCH files. ELF files and 3DSX files use the folder 0 because they have no ID information
Got rid of the code duplication in File and Directory
Files that deal with the host machine's file system now live in DiskFile, similarly for directories and DiskDirectory and archives with DiskArchive.
FS_U: Use the correct error code when a file wasn't found
|
|
|
|
|
|
|
| |
- Refactor FS::Archive internals to make Archive creation and lifetime
management clearer.
- Remove the "Archive as a File" hack.
- Implement 64-bit Archive handles.
|
| |
|
| |
|
| |
|
| |
|
| |
|
|\
| |
| | |
Kernel/File: Fixed file read/write hwtests
|
| |
| |
| |
| |
| |
| | |
The 3DS allows the user to read from files opened with the Write access modifier, even if he did not specify the Read access modifier.
Open the files in binary mode so that we can prevent CR/LF problems in Windows, where a line-end is replaced by these two bytes instead of just 0xA, this was causing problems with the GetSize test
|
|/
|
|
|
|
|
| |
This is in line with what the hardware itself does.
It does this by splitting the initial directory opening into Directory.Open(), which will return false if a stat fails.
Then, Archive::OpenDirectory will return nullptr, and archive.cpp will return an error code .
|
|\
| |
| | |
Implemented RenameFile and RenameDirectory in FS:USER
|
| | |
|
| | |
|
| | |
|
|/ |
|
|\
| |
| | |
Added DeleteFile and DeleteDirectory functions to FS:USER and the archives.
|
| | |
|
| | |
|
|\ \
| | |
| | | |
directory_sdmc: Fix a signed/unsigned mismatch comparison
|
| |/ |
|
|/ |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
| |
Before, it used to use whether the directory actually existed. As a result, .citra-emu/sdmc was never auto-created (something quite confusing to me until I read through the logs).
|
|
|
|
| |
Core: Fix the SDMC Directory implementation to make blargSnes work.
|
| |
|
|
|
|
| |
Kernel: Return an invalid handle to OpenFile when it failed to open.
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
| |
- Required "file" handle to be made local and explicitly opened/closed as needed
|
|
|
|
|
|
|
|
|
|
| |
Archive: Fixed brace ugliness for neobrain :)
FS: Commented out unused local variables to prevent warnings.
...But keeping them here for future use.
archive_romfs: Removed unused #include.
|
|
|
|
| |
Core: Updated CMakeLists.txt to remove directory_file_system and meta_file_system modules.
|
| |
|
| |
|
|
|