aboutsummaryrefslogtreecommitdiff
path: root/src/core/hle/service/filesystem
AgeCommit message (Collapse)Author
2018-11-18filesystem: Clear registered union paths on factory creationZach Hilman
2018-11-16Merge pull request #1632 from DarkLordZach/keys-manager-optimizationsbunnei
game_list: Optimize game list refresh
2018-11-16file_sys/errors: Extract FS-related error codes to file_sys/errors.hLioncash
Keeps filesystem-related error codes in one spot.
2018-11-15fsp_srv: Add support for using open source archive if not found in NANDZach Hilman
2018-11-15Merge pull request #1618 from DarkLordZach/dump-nsobunnei
patch_manager: Add support for dumping uncompressed NSOs
2018-11-01filesystem: Cache RegisteredCacheUnion instead of constructing on demandZach Hilman
Prevents unnecessary re-reads of the metadata and unnecessary temporary objects.
2018-10-29ns: Implement command 400: GetApplicationControlDataZach Hilman
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.
2018-10-29bis_factory: Add getter for mod dump root for a title IDZach Hilman
Equates to yuzu_dir/dump/<title id>/
2018-10-29fsp_srv: Implement ISaveDataInfoReaderZach Hilman
An object to read SaveDataInfo objects, which describe a unique save on the system. This implementation iterates through all the directories in the save data space and uses the paths to reconstruct the metadata.
2018-10-29fsp_srv: Implement command 61: OpenSaveDataInfoReaderBySaveDataSpaceIdZach Hilman
Needed by Checkpoint. Returns an object that can iterate through all savedata on the system.
2018-10-29savedata_factory: Expose accessors for SaveDataSpaceZach Hilman
2018-10-27service/filesystem: Add DirectoryDelete & DirectoryDeleteRecursivelyDeeJayBro
2018-10-17fsp_srv: Apply patches to Data storage in OpenDataStorageByDataIdZach Hilman
2018-10-16file_sys/registered_cache: Use unique_ptr and regular pointers instead of ↵Lioncash
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-13filesystem: Make CreateFactories() and InstallInterface() take a ↵Lioncash
VfsFilesystem instance by reference Neither of these functions alter the ownership of the provided pointer, so we can simply make the parameters a reference rather than a direct shared pointer alias. This way we also disallow passing incorrect memory values like nullptr.
2018-10-05romfs_factory: Extract packed update setter to new functionZach Hilman
2018-10-02services/fsp_srv: Amend service function tableLioncash
Adds new functions that have been given names to the table. Information is based off what is provided on Switchbrew.
2018-09-21filesystem: Add LayeredFS VFS directory getterZach Hilman
2018-09-19Fixed GetAccountId stub, Added error code for OpenDirectory and added ↵David Marcec
ActivateNpadWithRevision With these, `Nintendo Entertainment System - Nintendo Switch Online` loads
2018-09-10hle/service: Default constructors and destructors in the cpp file where ↵Lioncash
applicable When a destructor isn't defaulted into a cpp file, it can cause the use of forward declarations to seemingly fail to compile for non-obvious reasons. It also allows inlining of the construction/destruction logic all over the place where a constructor or destructor is invoked, which can lead to code bloat. This isn't so much a worry here, given the services won't be created and destroyed frequently. The cause of the above mentioned non-obvious errors can be demonstrated as follows: ------- Demonstrative example, if you know how the described error happens, skip forwards ------- Assume we have the following in the header, which we'll call "thing.h": \#include <memory> // Forward declaration. For example purposes, assume the definition // of Object is in some header named "object.h" class Object; class Thing { public: // assume no constructors or destructors are specified here, // or the constructors/destructors are defined as: // // Thing() = default; // ~Thing() = default; // // ... Some interface member functions would be defined here private: std::shared_ptr<Object> obj; }; If this header is included in a cpp file, (which we'll call "main.cpp"), this will result in a compilation error, because even though no destructor is specified, the destructor will still need to be generated by the compiler because std::shared_ptr's destructor is *not* trivial (in other words, it does something other than nothing), as std::shared_ptr's destructor needs to do two things: 1. Decrement the shared reference count of the object being pointed to, and if the reference count decrements to zero, 2. Free the Object instance's memory (aka deallocate the memory it's pointing to). And so the compiler generates the code for the destructor doing this inside main.cpp. Now, keep in mind, the Object forward declaration is not a complete type. All it does is tell the compiler "a type named Object exists" and allows us to use the name in certain situations to avoid a header dependency. So the compiler needs to generate destruction code for Object, but the compiler doesn't know *how* to destruct it. A forward declaration doesn't tell the compiler anything about Object's constructor or destructor. So, the compiler will issue an error in this case because it's undefined behavior to try and deallocate (or construct) an incomplete type and std::shared_ptr and std::unique_ptr make sure this isn't the case internally. Now, if we had defaulted the destructor in "thing.cpp", where we also include "object.h", this would never be an issue, as the destructor would only have its code generated in one place, and it would be in a place where the full class definition of Object would be visible to the compiler. ---------------------- End example ---------------------------- Given these service classes are more than certainly going to change in the future, this defaults the constructors and destructors into the relevant cpp files to make the construction and destruction of all of the services consistent and unlikely to run into cases where forward declarations are indirectly causing compilation errors. It also has the plus of avoiding the need to rebuild several services if destruction logic changes, since it would only be necessary to recompile the single cpp file.
2018-09-04bktr: Fix bucket overlap errorZach Hilman
2018-09-04registration: Add RegisteredCacheUnionZach Hilman
Aggregates multiple caches into one interface
2018-09-02Merge pull request #1213 from DarkLordZach/octopath-fsbunnei
filesystem/maxwell_3d: Various changes to boot Project Octopath Traveller
2018-09-02filesystem: Move dir retrieval after path checking in DeleteFile()Lioncash
We don't need to do the lookup if the path is considered empty currently.
2018-08-31filesystem: Implement OpenReadOnlySaveDataFilesystemZach Hilman
2018-08-31filesystem: Add OpenFileSystemWithPatchZach Hilman
2018-08-31core/core: Replace includes with forward declarations where applicableLioncash
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.
2018-08-25Merge pull request #1166 from lioncash/typoSebastian Valle
filesystem: Fix typo in log message
2018-08-23filesystem: Fix typo in log messageLioncash
2018-08-23filesystem: Add CreateFactories methods to fsZach Hilman
Allows frontend to create registration caches for use before a game has booted.
2018-08-23filesystem: Add logging to registration gettersZach Hilman
2018-08-21vfs: Replace mode.h include with forward declarations where applicableLioncash
Avoids the need to rebuild these source files if the mode header changes.
2018-08-20service/filesystem: Use forward declarations where applicableLioncash
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
2018-08-18filesystem: Add support for loading of system archivesZach Hilman
2018-08-11filesystem: Add Open and Register functions for BISFactoryZach Hilman
2018-08-09Merge pull request #990 from lioncash/entrybunnei
fsp_srv: Emplace entries first when building index instead of emplacing last
2018-08-08core: Port core to VfsFilesystem for file accessZach Hilman
2018-08-08filesystem: Remove unnecessary if conditionsZach Hilman
2018-08-08fsp_srv: Use std::string_view's copy() function instead of strncpy()Lioncash
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.
2018-08-08fsp_srv: Emplace entries first when building index instead of emplacing lastLioncash
The current way were doing it would require copying a 768 character buffer (part of the Entry struct) to the new element in the vector. Given it's a plain array, std::move won't eliminate that. Instead, we can emplace an instance directly into the destination buffer and then fill it out, avoiding the need to perform any unnecessary copies. Given this is done in a loop, we can request the destination to allocate all of the necessary memory ahead of time, avoiding the need to potentially keep reallocating over and over on every few insertions into the vector.
2018-08-04service: Remove redundant #pragma once directivesLioncash
These don't do anything within .cpp files (we don't include cpp files, so...)
2018-08-01service/filesystem: Add fsp:ldr and fsp:pr servicesLioncash
Adds the basic skeleton for the remaining fsp services based off information provided by Switch Brew.
2018-07-23VFS Regression and Accuracy Fixes (#776)Zach Hilman
* 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&
2018-07-22file_util, vfs: Use std::string_view where applicableLioncash
Avoids unnecessary construction of std::string instances where applicable.
2018-07-21file_util: Use an enum class for GetUserPath()Lioncash
Instead of using an unsigned int as a parameter and expecting a user to always pass in the correct values, we can just convert the enum into an enum class and use that type as the parameter type instead, which makes the interface more type safe. We also get rid of the bookkeeping "NUM_" element in the enum by just using an unordered map. This function is generally low-frequency in terms of calls (and I'd hope so, considering otherwise would mean we're slamming the disk with IO all the time) so I'd consider this acceptable in this case.
2018-07-19Merge pull request #720 from Subv/getentrytype_rootSebastian Valle
Filesystem: Return EntryType::Directory for the root directory.
2018-07-19Merge pull request #712 from lioncash/fspbunnei
fsp_srv: Misc individual changes
2018-07-19Filesystem: Return EntryType::Directory for the root directory.Subv
It is unknown if this is correct behavior, but it makes sense and fixes a regression with Stardew Valley.
2018-07-19fsp_srv: Remove unnecessary vector construction in IFile's Write() functionLioncash
We can avoid constructing a std::vector here by simply passing a pointer to the original data and the size of the copy we wish to perform to the backend's Write() function instead, avoiding copying the data where it's otherwise not needed.
2018-07-19fsp_srv: Remove unnecessary std::vector construction in IDirectory's Read() ↵Lioncash
function We were using a second std::vector as a buffer to convert another std::vector's data into a byte sequence, however we can just use pointers to the original data and use them directly with WriteBuffer, which avoids copying the data at all into a separate std::vector. We simply cast the pointers to u8* (which is allowed by the standard, given std::uint8_t is an alias for unsigned char on platforms that we support).