citra/src/core/file_sys
zhupengfei 890405bb7c
core/file_sys: LayeredFS implementation
This implementation is different from Luma3DS's which directly hooks the SDK functions. Instead, we read the RomFS's metadata and figure out the directory and file structure. Then, relocations (i.e. replacements/deletions/patches) are applied. Afterwards, we rebuild the metadata, and assign 'fake' data offsets to the files. When we want to read file data from this rebuilt RomFS, we use binary search to find the last data offset smaller or equal to the given offset and read from that file  (either from the original RomFS, or from replacement files, or from buffered data with patches applied) and any later files when length is not enough.

The code that rebuilds the metadata is pretty complex and uses quite a few variables to keep track of necessary information like metadata offsets. According to my tests, it is able to build RomFS-es identical to the original (but without trailing garbage data) when no relocations are applied.
2020-02-07 15:19:57 +08:00
..
archive_backend.cpp Prefix all size_t with std:: 2018-09-06 16:03:28 -04:00
archive_backend.h Address remaining review comments 2019-04-07 17:00:28 +02:00
archive_extsavedata.cpp archive_extsavedata: add correct FileOpen delays 2019-03-06 18:53:44 +01:00
archive_extsavedata.h FS: pass down program ID for archive operation 2019-02-02 20:44:13 -05:00
archive_ncch.cpp Remove unused stuff 2019-07-16 20:27:03 -04:00
archive_ncch.h Remove unused stuff 2019-07-16 20:27:03 -04:00
archive_other_savedata.cpp FS: pass down program ID for archive operation 2019-02-02 20:44:13 -05:00
archive_other_savedata.h FS: pass down program ID for archive operation 2019-02-02 20:44:13 -05:00
archive_savedata.cpp FS: pass down program ID for archive operation 2019-02-02 20:44:13 -05:00
archive_savedata.h FS: pass down program ID for archive operation 2019-02-02 20:44:13 -05:00
archive_sdmc.cpp fs_user: Add a delay for each file open 2019-03-06 16:09:24 +01:00
archive_sdmc.h fs_user: Add a delay for each file open 2019-03-06 16:09:24 +01:00
archive_sdmcwriteonly.cpp fs_user: Add a delay for each file open 2019-03-06 16:09:24 +01:00
archive_sdmcwriteonly.h fs_user: Add a delay for each file open 2019-03-06 16:09:24 +01:00
archive_selfncch.cpp FS: pass down program ID for archive operation 2019-02-02 20:44:13 -05:00
archive_selfncch.h FS: pass down program ID for archive operation 2019-02-02 20:44:13 -05:00
archive_source_sd_savedata.cpp Address review comments 2018-09-06 00:00:21 +02:00
archive_source_sd_savedata.h archive_source_sd_savedata: Add static method to get a specific save data path 2016-12-15 09:59:41 +00:00
archive_systemsavedata.cpp FS: pass down program ID for archive operation 2019-02-02 20:44:13 -05:00
archive_systemsavedata.h FS: pass down program ID for archive operation 2019-02-02 20:44:13 -05:00
cia_common.h FileSys::Ticket::Load: Return error if signature type does not match (#4339) 2018-10-15 11:26:35 -04:00
cia_container.cpp FileSys: Load the ticket when the CIAContainer is loaded 2019-04-28 21:21:28 +02:00
cia_container.h FileSys/cia: add ticket parsing 2018-09-23 13:05:55 -04:00
delay_generator.cpp fs_user: Add a delay for each file open 2019-03-06 16:09:24 +01:00
delay_generator.h fs_user: Add a delay for each file open 2019-03-06 16:09:24 +01:00
directory_backend.h Prefix all size_t with std:: 2018-09-06 16:03:28 -04:00
disk_archive.cpp Prefix all size_t with std:: 2018-09-06 16:03:28 -04:00
disk_archive.h Prefix all size_t with std:: 2018-09-06 16:03:28 -04:00
errors.h file_sys/errors: Add ERROR_INSUFFICIENT_SPACE 2017-11-05 13:26:29 -07:00
file_backend.h fs_user: Add a delay for each file open 2019-03-06 16:09:24 +01:00
ivfc_archive.cpp fs_user: Add a delay for each file open 2019-03-06 16:09:24 +01:00
ivfc_archive.h fs_user: Add a delay for each file open 2019-03-06 16:09:24 +01:00
layered_fs.cpp core/file_sys: LayeredFS implementation 2020-02-07 15:19:57 +08:00
layered_fs.h core/file_sys: LayeredFS implementation 2020-02-07 15:19:57 +08:00
ncch_container.cpp file_sys: Add support for BPS patches 2019-12-22 10:46:47 +01:00
ncch_container.h file_sys: Handle patch applying failures 2019-12-22 10:46:47 +01:00
patch.cpp file_sys: Add support for BPS patches 2019-12-22 10:46:47 +01:00
patch.h file_sys: Add support for BPS patches 2019-12-22 10:46:47 +01:00
path_parser.cpp FileSys: add PathParser 2016-11-19 17:17:19 +02:00
path_parser.h file_sys: Make a few single-argument constructors explicit 2016-12-07 17:26:56 -05:00
romfs_reader.cpp core/file_sys: Make RomFSReader an abstract interface 2020-02-07 15:19:53 +08:00
romfs_reader.h core/file_sys: Make RomFSReader an abstract interface 2020-02-07 15:19:53 +08:00
savedata_archive.cpp fs_user: Add a delay for each file open 2019-03-06 16:09:24 +01:00
savedata_archive.h file_sys: Make a few single-argument constructors explicit 2016-12-07 17:26:56 -05:00
seed_db.cpp SeedDB: replace seek(tell, set) with seek(cur) (#4344) 2018-10-25 21:39:26 -04:00
seed_db.h Implement SeedDB & Seed Crypto 2018-10-02 10:12:40 -05:00
ticket.cpp FileSys::Ticket::Load: Return error if signature type does not match (#4339) 2018-10-15 11:26:35 -04:00
ticket.h Replace boost::optional with std::optional where possible 2018-10-05 13:51:09 +02:00
title_metadata.cpp FileSys::Ticket::Load: Return error if signature type does not match (#4339) 2018-10-15 11:26:35 -04:00
title_metadata.h FileSys/cia: add ticket parsing 2018-09-23 13:05:55 -04:00