summaryrefslogtreecommitdiffstats
path: root/src/core/hle/service/filesystem (unfollow)
Commit message (Collapse)AuthorFilesLines
2023-08-24filesystem: Return correct error for RenameFile when dest_path already existsFearlessTobi1-1/+10
Allows Grid Autosport to boot. Fixes https://github.com/yuzu-emu/yuzu/issues/8287.
2023-08-15fssystem: rework for yuzu styleLiam1-2/+2
2023-08-15vfs: expand support for NCA readingLiam3-3/+12
2023-08-08fs: return result on null outputsLiam1-4/+24
2023-08-08general: fix incorrect conversionsLiam1-1/+1
2023-08-08core: remove ResultVal typeLiam3-104/+140
2023-06-03fsp-srv: avoid patching romfs multiple timesLiam1-8/+12
2023-05-11fs: adjust future save pathLiam1-2/+2
2023-05-11fs: stub cache storage and fix params alignmentLiam2-5/+17
2023-03-01service: move hle_ipc from kernelLiam2-68/+67
2023-02-21service: refactor server architectureLiam3-13/+14
Converts services to have their own processes
2023-02-14remove static from pointer sized or smaller types for aesthetics, change constexpr static to static constexpr for consistencyarades791-1/+1
Signed-off-by: arades79 <scravers@protonmail.com>
2023-02-14add static lifetime to constexpr values to force compile time evaluation where possiblearades791-1/+1
Signed-off-by: arades79 <scravers@protonmail.com>
2023-02-14general: rename CurrentProcess to ApplicationProcessLiam2-4/+5
2023-02-03fsp_srv: Copy HLE Read Buffer for OutputAccessLogToSdCardameerj1-1/+1
2023-02-03Revert "Merge pull request #9718 from yuzu-emu/revert-9508-hle-ipc-buffer-span"ameerj1-6/+3
This reverts commit 25fc5c0e1158cb8e81cbc769b24ad84032a1fbfd, reversing changes made to af20e25081f97d55b451606c87922e2b49f0d363.
2023-02-02Revert "hle_ipc: Use std::span to avoid heap allocations/copies when calling ReadBuffer"liamwhite1-3/+6
2022-12-29hle_ipc: Rename ReadBufferSpan to ReadBufferameerj1-14/+14
2022-12-25fsp_srv: Use ReadBufferSpanameerj1-17/+14
2022-11-23service: Make use of buffer element count helpersLioncash1-2/+2
2022-10-08fsp_srv: stub GetCacheStorageSizeLiam2-1/+14
2022-08-23core:filesystem: speed up IDirectory servicevonchenplus1-1/+2
2022-06-27core: Replace all instances of ResultCode with Resultgerman772-28/+27
2022-06-14common: Change semantics of UNREACHABLE to unconditionally crashLiam1-1/+1
2022-04-23general: Convert source file copyright comments over to SPDXMorph8-24/+16
This formats all copyright comments according to SPDX formatting guidelines. Additionally, this resolves the remaining GPLv2 only licensed files by relicensing them to GPLv2.0-or-later.
2022-04-02fix: typosAndrea Pappacoda1-1/+1
2022-04-02hle: service: filesystem: Create a service thread where appropriate.bunnei1-5/+8
2022-01-21service/filsystem: Update fsp-srv function tableLioncash1-0/+3
2021-11-04general: Get the current process program id directly from the systemMorph2-7/+4
This allows us to avoid including KProcess' header file in files that only need to get the current process' program id.
2021-11-04general: Rename GetTitleID to GetProgramIDMorph2-4/+5
2021-11-04core: Remove unused includesameerj1-1/+0
2021-11-02general: Remove MakeResult helpersMorph1-11/+10
This is made obsolete by the presence of implicit constructors.
2021-10-07service: Reduce header include overheadMorph2-2/+0
2021-09-14vfs: Partially implement GetFileTimeStampRawMorph3-1/+37
Gets rid of homebrew warnings using this func
2021-09-12FS: Mark recursive CreateDirectory as inaccurate and temporaryMorph1-0/+5
2021-09-08Addressed issuesChloe1-1/+1
Co-authored-by: Mai M. <mathew1800@gmail.com>
2021-09-06FS: Recursively create directories for CreateDirectoryChloe Marcec1-8/+13
Originally we only created the parent directory, this caused issues for creating directories which also contained subdirectories, eg `/Folder1/Folder2` This allows the ultimate mod manager homebrew to at least boot
2021-06-28filesystem: Open a read-only directory for SDMC modsMorph1-5/+9
This prevents mod files from being locked due to the read-only share flag in Windows.
2021-06-28core: Simplify SDMC mod loadinglat9nq1-1/+2
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>
2021-06-28core: Support LayeredFS mod from SDMC directorylat9nq2-0/+10
Enables loading a mod directly from `[yuzu data directory]/sdmc/atmosphere/contents/[title_id]`. For use with some homebrew mod managers.
2021-06-16fsp_srv: Fix filesystem access loggingMorph2-12/+15
This introduces a new setting Enable FS Access Log which saves the filesystem access log to sdmc:/FsAccessLog.txt If this setting is not enabled, this will indicate to FS to not call OutputAccessLogToSdCard. Fixes softlocks during loading in Xenoblade Chronicles 2 when certain DLC is enabled.
2021-06-03fsp-srv: Replace one last instance of RESULT_SUCCESSMorph1-1/+1
2021-06-03fspsrv: Implement DisableAutoSaveDataCreation (#6355)Chloe4-1/+17
- Used by Mii Edit
2021-06-02general: Replace RESULT_UNKNOWN with ResultUnknownMorph2-19/+19
Transition to PascalCase for result names.
2021-06-02general: Replace RESULT_SUCCESS with ResultSuccessMorph2-50/+50
Transition to PascalCase for result names.
2021-05-26common: fs: Rework the Common Filesystem interface to make use of std::filesystem (#6270)Morph1-9/+12
* 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
2021-05-06hle: kernel: Rename Process to KProcess.bunnei2-2/+2
2021-05-01service: filesystem: Return proper error codes for CreateFileMorph1-2/+7
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
2021-04-26service: Eliminate cases of member shadowingLioncash1-10/+11
Resolves a few localized instances of member variable shadowing. Brings us a little closer to turning shadowing warnings into errors.
2021-04-15common: Move settings to common from core.bunnei1-1/+1
- Removes a dependency on core and input_common from common.
2021-04-07IFile: Update to 12.xMorph1-3/+7
2021-04-07fsp-srv: Update to 12.xMorph2-3/+8
2020-12-08fsp_srv: Implement OpenDataStorageWithProgramIndexMorph4-1/+57
- Used by RollerCoaster Tycoon 3: Complete Edition
2020-12-08core: Remove unnecessary enum casts in log callsLioncash2-24/+21
Follows the video core PR. fmt doesn't require casts for enum classes anymore, so we can remove quite a few casts.
2020-11-27savedata_factory: Eliminate usage of the global system instanceLioncash1-1/+2
Now there's only two meaningful instances left in core.
2020-11-27service: Eliminate usages of the global system instanceLioncash7-37/+47
Completely removes all usages of the global system instance within the services code by passing in the using system instance to the services.
2020-11-18patch_manager: Remove usages of the global system instanceLioncash3-7/+15
With this, only 19 usages of the global system instance remain within the core library. We're almost there.
2020-10-21Revert "core: Fix clang build"bunnei1-5/+3
2020-10-18core: Fix clang buildLioncash1-3/+5
Recent changes to the build system that made more warnings be flagged as errors caused building via clang to break. Fixes #4795
2020-10-13filesystem: Fix CreateDirectory and DeleteFileMorph1-2/+3
Add a check if dir is nullptr (does not exist) Fixes save game creation in Hades
2020-09-17file_sys/bis_factory: Eliminate usage of the global system accessorLioncash1-1/+1
2020-08-23fsp_srv: Resolve -Wunused-but-set-variable warningLioncash1-1/+8
We can just log out the parameters in the meantime.
2020-08-23fsp_srv: Resolve -Wmaybe_uninitialized warning in OpenSaveDataFileSystem()Lioncash1-2/+5
Initialize id to a deterministic value and also mark the unreachable cases in the switch with UNREACHABLE().
2020-08-16common/fileutil: Convert namespace to Common::FSLioncash1-40/+40
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.
2020-07-31minor nitsMorph1-1/+3
2020-07-30fsp-srv: Stub Read/WriteSaveDataFileSystemExtraDataWithMaskBySaveDataAttributeMorph2-23/+56
Stub these 2 service commands required for Animal Crossing: New Horizons Update 1.4.0
2020-07-30fs: Rename SaveDataDescriptor to SaveDataAttributeMorph2-7/+7
2020-07-16Add comment to clarify the nullptr checkMorph1-0/+1
2020-07-16filesystem: Create subdirectories prior to creating a fileMorph1-0/+3
If subdirectories exist in the given path parameter and don't exist in the real filesystem create them prior to creating the files within. This fixes the softlocks upon save creation in The Legend of Zelda: Breath of the Wild
2020-05-11service: fsp_srv: Stub implementation of OpenMultiCommitManager.bunnei2-1/+38
2020-04-30fs-srv: GetFreeSpaceSize & GetTotalSpaceSizeDavid Marcec1-2/+2
Closes #3533 Turns out the functions were already implemented but just never added
2020-04-20service: Update function tablesLioncash1-0/+4
Keeps the service function tables up to date. Updated based off information on SwitchBrew.
2020-04-16CMakeLists: Specify -Wextra on linux buildsLioncash2-1/+5
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.
2020-02-08hle: services: Use std::shared_ptr instead of copy by value.bunnei1-7/+9
2019-11-27file_sys/directory: Make EntryType an enum classLioncash1-2/+2
This can trivially be an enum class rather than a regular enum, making it more strongly typed.
2019-11-27core: Prepare various classes for memory read/write migrationLioncash1-5/+2
Amends a few interfaces to be able to handle the migration over to the new Memory class by passing the class by reference as a function parameter where necessary. Notably, within the filesystem services, this eliminates two ReadBlock() calls by using the helper functions of HLERequestContext to do that for us.
2019-11-12service: Update function tablesLioncash1-0/+6
Keeps the function tables up to date. Updated based off information from Switchbrew.
2019-11-12service: Resolve sign conversion errorsLioncash2-16/+16
These are fairly trivial to resolve and most of the changes entail using RESULT_UNKNOWN over ResultCode(-1).
2019-10-06hle/service: Replace global system instance calls with instance-based onesLioncash2-11/+17
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.
2019-10-05service/filesystem: Silence -Wunused-variableReinUsesLisp1-1/+1
2019-10-01bcat: Add FSC accessors for BCAT dataZach Hilman2-1/+3
Ports BCAT to use FSC interface
2019-09-30filesystem: Add getter for BCAT temporary directoryZach Hilman1-0/+9
2019-09-22configure_debug: Move reporting option to loggingZach Hilman4-6/+6
2019-09-21filesystem: Add const qualification to various accessorsZach Hilman3-68/+76
2019-09-21yuzu: Port old usages of Filesystem namespace to FilesystemControllerZach Hilman3-14/+37
2019-09-21filesystem: Pass Size Getter functions to IFileSystem for sizesZach Hilman3-20/+31
2019-09-21filesystem: Add FileSystemController to deglobalize FS servicesZach Hilman2-58/+359
2019-06-29fsp-srv: Implement GetAccessLogVersionInfoZach Hilman2-3/+14
Returns some misc. data about logging to help the game determine if it should log.
2019-06-29fsp-srv: Implement OutputAccessLogToSdCardZach Hilman4-21/+58
Allows games to log data to the SD.
2019-04-11service: Update service function tablesLioncash1-0/+7
Updates function tables based off information from SwitchBrew.
2019-04-10fsp_srv: Remove unnecessary parameter popping in IDirectory's Read()Lioncash1-4/+1
IDirectory's Read() function doesn't take any input parameters. It only uses the output parameters that we already provide.
2019-04-10fsp_srv: Log out option values in IFile's Read and Write functionsLioncash1-4/+6
These indicate options that alter how a read/write is performed. Currently we don't need to handle these, as the only one that seems to be used is for writes, but all the custom options ever seem to do is immediate flushing, which we already do by default.
2019-04-05service/fsp_srv: Don't pass SaveDataDescriptor instances by value.Lioncash2-4/+4
Passing around a 64 byte data struct by value is kind of wasteful, instead pass a reference to the struct.
2019-04-05service/fsp_srv: Remove unnecessary unknown member in OpenSaveDataFileSystemLioncash1-7/+8
The unknown member here is actually padding due to being passed as a struct. We can do the same, and remove the need to pop a padding word.
2019-04-05service/fsp_srv: Update SaveDataInfo and SaveDataDescriptor structsLioncash1-1/+3
I realized that I updated the documentation on SwitchBrew a while ago, but never actually updated the structs within yuzu.
2019-04-05filesystem: Use a std::string_view in OpenFile()Lioncash1-5/+8
Rather than make a full copy of the path, we can just use a string view and truncate the viewed portion of the string instead of creating a totally new truncated string.
2019-04-04hle/service: Resolve unused variable warningsLioncash1-41/+29
In several places, we have request parsers where there's nothing to really parse, simply because the HLE function in question operates on buffers. In these cases we can just remove these instances altogether. In the other cases, we can retrieve the relevant members from the parser and at least log them out, giving them some use.
2019-03-27core: Port current uses of RegisteredCache to ContentProviderZach Hilman2-7/+6
2019-03-18fsp_srv: Unstub SetCurrentProcessLioncash2-1/+5
This just acts as a basic setter for a given PID value and performs no further checking, so we can just store the passed in value.
2019-01-30service/fsp-srv: Update function tablesLioncash2-17/+25
Updates function tables based off information provided by SwitchBrew.
2018-12-27filesystem: Populate save data sizes from control dataZach Hilman2-0/+53
2018-12-10fsp_srv: Implement IStorage::GetSizeZach Hilman1-2/+15
Takes no input and returns the size as a u64. Needed by Katamari Damacy Reroll to boot.
2018-12-10service/fsp_srv: Correct returned value in GetGlobalAccessLogMode()Lioncash1-1/+10
Based off RE, the backing code only ever seems to use 0-2 as the range of values 1 being a generic log enable, with 2 indicating logging should go to the SD card. These are used as a set of flags internally. Given we only care about receiving the log in general, we can just always signify that we want logging in general.
2018-12-02filesystem: De-globalize registered_cache_unionLioncash2-17/+4
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.
2018-12-01service/fsp_srv: Implement CleanDirectoryRecursivelyLioncash3-1/+35
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/
2018-11-27Reworked svcs slightly, improved error messages in AM and fsp_srvDavid Marcec1-6/+6
2018-11-26Changed logging to be "Log before execution", Added more error logging, all services should now log on some levelDavid Marcec1-1/+14
2018-11-19filesystem: Clear registered union paths on factory creationZach Hilman2-0/+6
2018-11-16file_sys/errors: Extract FS-related error codes to file_sys/errors.hLioncash2-11/+11
Keeps filesystem-related error codes in one spot.
2018-11-16fsp_srv: Add support for using open source archive if not found in NANDZach Hilman1-0/+10
2018-11-02filesystem: Cache RegisteredCacheUnion instead of constructing on demandZach Hilman2-4/+11
Prevents unnecessary re-reads of the metadata and unnecessary temporary objects.
2018-10-29ns: Implement command 400: GetApplicationControlDataZach Hilman1-14/+10
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 Hilman2-4/+22
Equates to yuzu_dir/dump/<title id>/
2018-10-29fsp_srv: Implement ISaveDataInfoReaderZach Hilman1-0/+144
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 Hilman2-1/+13
Needed by Checkpoint. Returns an object that can iterate through all savedata on the system.
2018-10-29savedata_factory: Expose accessors for SaveDataSpaceZach Hilman2-0/+11
2018-10-27service/filesystem: Add DirectoryDelete & DirectoryDeleteRecursivelyDeeJayBro1-2/+26
2018-10-17fsp_srv: Apply patches to Data storage in OpenDataStorageByDataIdZach Hilman1-1/+5
2018-10-16file_sys/registered_cache: Use unique_ptr and regular pointers instead of shared_ptrs where applicableLioncash2-11/+10
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 VfsFilesystem instance by referenceLioncash2-10/+10
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 Hilman2-0/+10
2018-10-03services/fsp_srv: Amend service function tableLioncash1-0/+2
Adds new functions that have been given names to the table. Information is based off what is provided on Switchbrew.
2018-09-22filesystem: Add LayeredFS VFS directory getterZach Hilman2-1/+14
2018-09-19Fixed GetAccountId stub, Added error code for OpenDirectory and added ActivateNpadWithRevisionDavid Marcec1-1/+1
With these, `Nintendo Entertainment System - Nintendo Switch Online` loads
2018-09-11hle/service: Default constructors and destructors in the cpp file where applicableLioncash8-1/+12
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 Hilman1-1/+1
2018-09-04registration: Add RegisteredCacheUnionZach Hilman2-0/+10
Aggregates multiple caches into one interface
2018-09-02filesystem: Move dir retrieval after path checking in DeleteFile()Lioncash1-2/+5
We don't need to do the lookup if the path is considered empty currently.
2018-09-01filesystem: Implement OpenReadOnlySaveDataFilesystemZach Hilman2-1/+7
2018-09-01filesystem: Add OpenFileSystemWithPatchZach Hilman2-1/+23
2018-08-31core/core: Replace includes with forward declarations where applicableLioncash1-0/+1
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-24filesystem: Fix typo in log messageLioncash1-1/+1
2018-08-23filesystem: Add CreateFactories methods to fsZach Hilman2-8/+11
Allows frontend to create registration caches for use before a game has booted.
2018-08-23filesystem: Add logging to registration gettersZach Hilman1-4/+25
2018-08-21vfs: Replace mode.h include with forward declarations where applicableLioncash3-2/+3
Avoids the need to rebuild these source files if the mode header changes.
2018-08-21service/filesystem: Use forward declarations where applicableLioncash3-5/+19
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-19filesystem: Add support for loading of system archivesZach Hilman4-16/+50
2018-08-12filesystem: Add Open and Register functions for BISFactoryZach Hilman2-4/+23
2018-08-09core: Port core to VfsFilesystem for file accessZach Hilman2-8/+8
2018-08-09filesystem: Remove unnecessary if conditionsZach Hilman1-1/+1
2018-08-09fsp_srv: Use std::string_view's copy() function instead of strncpy()Lioncash1-5/+1
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-09fsp_srv: Emplace entries first when building index instead of emplacing lastLioncash1-2/+3
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 directivesLioncash2-4/+0
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 servicesLioncash5-0/+85
Adds the basic skeleton for the remaining fsp services based off information provided by Switch Brew.
2018-07-24VFS Regression and Accuracy Fixes (#776)Zach Hilman1-16/+29
* 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 applicableLioncash1-1/+1
Avoids unnecessary construction of std::string instances where applicable.
2018-07-21file_util: Use an enum class for GetUserPath()Lioncash1-2/+2
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-19Filesystem: Return EntryType::Directory for the root directory.Subv1-0/+4
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() functionLioncash1-2/+3
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() functionLioncash1-10/+8
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).
2018-07-19filesystem: std::move VirtualDir instance in VfsDirectoryServiceWrapper's constructorLioncash1-1/+3
Avoids unnecessary atomic reference count incrementing and decrementing
2018-07-19filesystem: Use std::string's empty() function instead of comparing against a literalLioncash1-1/+1
This is simply a basic value check as opposed to potentially doing string based operations (unlikely, but still, avoiding it is free).
2018-07-19filesystem: Remove pragma disabling global optimizationsLioncash1-2/+0
This was just an artifact missed during PR review.
2018-07-19fsp_srv: Make IStorage constructor explicitLioncash1-1/+1
Prevents implicit conversions.
2018-07-19fsp_srv: Add missing includesLioncash1-0/+5
Gets rid of relying on indirect inclusions.
2018-07-19fsp_srv: Resolve sign-mismatch warnings in assertion comparisonsLioncash1-3/+3
2018-07-19fsp_srv: Respect write length in Write()Lioncash1-4/+5
Previously we were just copying the data whole-sale, even if the length was less than the total data size. This effectively makes the actual_data vector useless, which is likely not intended. Instead, amend this to only copy the given length amount of data. At the same time, we can avoid zeroing out the data before using it by passing iterators to the constructor instead of a size.
2018-07-19Virtual Filesystem 2: Electric Boogaloo (#676)Zach Hilman4-115/+383
* Virtual Filesystem * Fix delete bug and documentate * Review fixes + other stuff * Fix puyo regression
2018-07-18hle/filesystem: Amend trace log in OpenSaveData() to compile in debug modeLioncash1-1/+1
Previously this wouldn't compile, since no such function named SaveStructDebugInfo() exists.
2018-07-17General Filesystem and Save Data Fixes (#670)Zach Hilman4-87/+125
2018-07-08Revert "Virtual Filesystem (#597)"bunnei4-404/+70
This reverts commit 77c684c1140f6bf3fb7d4560d06d2efb1a2ee5e2.
2018-07-06Virtual Filesystem (#597)Zach Hilman4-70/+404
* 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
2018-07-03Update clang formatJames Rowe1-2/+2
2018-07-03Rename logging macro back to LOG_*James Rowe2-28/+28
2018-06-19Services/FS: Return the correct error code when trying to mount a nonexistent savedata.Subv1-2/+11
2018-06-07Common/string_util: add StringFromBuffer functionmailwl1-22/+9
convert input buffer (std::vector<u8>) to string, stripping zero chars
2018-05-02general: Make formatting of logged hex values more straightforwardLioncash2-6/+6
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).
2018-04-24filesystem: Move logging macros over to new fmt-compatible onesLioncash2-30/+29
2018-04-24Service/FS: implement IFileSystem::RenameFilemailwl1-1/+21
2018-04-20service: Use nested namespace specifiers where applicableLioncash3-12/+6
Tidies up namespace declarations
2018-04-15fsp_srv: Implement DeleteFile.bunnei1-1/+15
- Used by Binding of Isaac.
2018-04-15fsp_srv: Implement IFile::Flush.bunnei1-1/+9
2018-04-11Various fixes and clangHexagon121-12/+5
2018-04-10Updated fsp-srv with more service names.Hexagon121-4/+102
2018-04-07Fix spelling of InitializeJames Rowe2-3/+3
2018-04-01hle_ipc, fsp_srv: Cleanup logging.bunnei1-2/+2
2018-03-31fsp_srv: Implement GetSize and SetSize.bunnei1-2/+21
2018-03-21FS: Implemented IFileSystem::CreateDirectory.Subv1-0/+15
2018-03-20FS: Implemented IFileSystem's OpenDirectory function.Subv1-0/+28
Note that the filter parameter is not yet implemented.
2018-03-20FS: Added the IDirectory IPC interface and implemented its two functions.Subv1-0/+51
2018-03-20FS: Implement MountSdCard.Subv1-2/+6
2018-03-20FS: Added an SDMC archive factory and registered it to the SDMC archive on startup.Subv2-0/+6
2018-03-19oopsN00byKing1-3/+3
2018-03-19Clean Warnings (?)N00byKing1-3/+3
2018-03-04FS: Stubbed CreateSaveData. It currently does nothing.Subv2-0/+15
2018-03-04FS: Make EnsureSaveData create the savedata folder when called for the first time.Subv2-0/+20
2018-03-02FS: Implement MountSaveData and some of the IFile interface.Subv2-0/+189
2018-03-02Filesystem: Added a SaveData Factory and associated Disk_FileSystem.Subv2-2/+10
2018-02-14service: Remove remaining uses of BufferDescriptor*.bunnei1-3/+1
2018-02-10fsp_srv: Stub MountSdCard.bunnei2-0/+9
2018-02-07Service: stub some functions in am, audio, time, vi servicesmailwl1-0/+1
2018-01-25hle: Rename RequestBuilder to ResponseBuilder.bunnei1-9/+9
2018-01-25service: Fix all incorrect IPC response headers.bunnei1-2/+2
2018-01-21fsp_srv: Various improvements to IStorage:Read implementation.bunnei3-48/+72
2018-01-21filesystem: Implement basic IStorage functionality.David Marcec4-0/+252