aboutsummaryrefslogtreecommitdiff
path: root/src/core/loader/loader.cpp
Commit message (Collapse)AuthorAgeFilesLines
* loader: read a loose dump's display version from its own filesTakoroka4 days1-0/+10
| | | | | | | | | Mario Kart World 1.8.0 reported 1.0.0: GetDisplayVersion only knew installed titles' metadata, and a loose ExeFS/RomFS dump has none. The dump's version now comes from its control.nacp (in ExeFS, or up to three directories above it), else from RomFS System/Resource/ResourceSizeTable.Product.NNN (Mario Kart World has no NACP; Product.180 is 1.8.0). Folder names are never parsed.
* loader: load a loose ExeFS when given its mainTakoroka8 days1-0/+7
| | | | | | | 'main' is also a valid NSO, so IdentifyFile picked the single-NSO loader, which skips main.npdm, rtld and the sdk modules and then crashes writing into an uninitialised process. Prefer the ExeFS directory loader when the file is named main and sits in an ExeFS.
* [core] Support block-compressed NSZ and XCZ (#4552)PavelBARABANOV9 days1-9/+39
| | | | | | | | | | | | | | | | | | | | | | | | | - [x] I have read and followed the [Contribution Guidelines](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/CONTRIBUTING.md#code-contributions). - [x] I have read and followed the [AI Policy](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/policies/AI.md). - [x] I have read and followed the [Coding Guidelines](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/policies/Coding.md) to the best of my ability. ------------------- - Add NCZBLOCK (nsz -B / .xcz) reader: each read decodes only the covered blocks and re-encrypts CTR sections, no disk output. - Allow installing solid .nsz to NAND via DecompressNCZForInstall (lazy, incremental decode with frontier, O(n) instead of O(n^2)). - Accept BKTR updates with thousands of sections (MaxSectionCount = 0x10000). - Wire .nsz/.xcz into loader, registered cache, scanner, and NAND install (content_manager.h), and reject solid NCZ from the game list. - Bump the pinned zstd to 33618c8 in cpmfile.json, which includes the upstream AArch64 revert ([33618c89](https://github.com/facebook/zstd/commit/33618c89e511637f8a6ef955b3501766d71feb53)) for a ZSTD_decodeSequence branch optimization that could corrupt data on ARM64; without it, solid NCZ decoding on Android fails with "Data corruption detected". NCZ format and CTR counter semantics follow the reference nsz tool and its Rust port: - https://github.com/nicoboss/nsz (Decompressor.py, BlockDecompressorReader.py) - https://docs.rs/nsz-rs/0.3.0/src/nsz_rs/decompress.rs.html The last-block edge case (decompressed size is an exact multiple of block size) is handled as described in https://github.com/nicoboss/nsz/issues/210 Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/4552 Reviewed-by: CamilleLaVey <camillelavey99@gmail.com> Reviewed-by: Shinmegumi <shinmegumi@eden-emu.dev>
* [core, hle, video_core, memory] Improve multi-process, display layers, ↵Maufeat2026-08-291-0/+39
| | | | | | | | | | | | | | | | | | | | | dynamic shader cache and rework overlay (#4238) - [x] I have read and followed the [Contribution Guidelines](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/CONTRIBUTING.md#code-contributions). - [x] I have read and followed the [AI Policy](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/policies/AI.md) - [x] I have read and followed the [Coding Guidelines](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/policies/Coding.md) to the best of my ability. ------------------- - Dynamic shader cache reloading capability for qlaunch - Multi-process improvements (thanks to @frank1734), instead of just using the main application we now respect caller process (also did it for HID devices while I was at it) - Layer stack masks & shared buffer screenshot for video core, added different masks (screenshot, recording, etc.) this was discovered as an issue due to how in qlaunch the transition was not right between applications. May not be perfect but also fixes screenshots while using qlaunch - Reworked overlay display management (input and visibility) - instead of random numbers as I've previously did, I decided to add an AppletZIndex enum for better readability. Also split capability of input by touch and gamepad. - etc. Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/4238 Reviewed-by: Samuel <lizzie@eden-emu.dev> Reviewed-by: CamilleLaVey <camillelavey99@gmail.com> Reviewed-by: MaranBr <maranbr@eden-emu.dev>
* [common/logging] Simplify logging logic and fix issues when logging before ↵lizzie2026-03-121-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | system is created (#3688) - our logging code was bigger than spdlog itself, why???? just keep it simple - fix issues when logging before logging system is even started - removes the "initialized logging twice" issue - removes uneeded indirection in file logging - uses direct formatting instead of jumping hoopla-around the fmt::format() ressult - code duplication and dead code removal as usual I did explore dup2() but I think it's not worth the hassle I did try `fwopen()` but it's better if things are just kept as-is. there is a lot of noise because I removed a bunch of redundant files on logging and just put everything in one file now normally this wouldn't be a good idea, however consider: the complexity of logging; it's less than 500 lines... does it really need a whole subsystem?!?!?! ITS JUST LOGGING Signed-off-by: lizzie <lizzie@eden-emu.dev> Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/3688 Reviewed-by: crueter <crueter@eden-emu.dev> Reviewed-by: DraVee <chimera@dravee.dev> Reviewed-by: CamilleLaVey <camillelavey99@gmail.com> Co-authored-by: lizzie <lizzie@eden-emu.dev> Co-committed-by: lizzie <lizzie@eden-emu.dev>
* [android/fs] external content loader + nca/xci patches (#3596)xbzk2026-03-041-1/+69
| | | | | | | | | | | | | | | | | | | | Foreword: WHY DON'T EVERYBODY USE ONE FOLDER FOR EACH GAME+CONTENTS? AIN'T THIS THE FORMAT GAMES COME WHEN YOU BUE THEM? DO YOU LIVE WITH ALL YOUR FRIENDS AND HAVE A 2ND HOUSE FOR ALL THE CHILDREN? Nice, i feel better now. This feat extends Maufeat's work on external content loading. It harmonically additions: "...also, if in each game folder X, you find a folder Y, and in this folder Y you detect ONLY a single game, then mount all external content for that game found in that folder Y and its subfolders." Permanent (not toggleable). External Content folders are supported equally. Also: -Reworked several routines for preserving single source of truth between android and other systems; -Fixed the annoying unknown format error for content files, by providing proper format detection. Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/3596 Reviewed-by: MaranBr <maranbr@eden-emu.dev> Reviewed-by: Lizzie <lizzie@eden-emu.dev> Co-authored-by: xbzk <xbzk@eden-emu.dev> Co-committed-by: xbzk <xbzk@eden-emu.dev>
* [common] replace Common::(DerivedFrom, IsArithmetic, Size, ConvertibleTo, ↵lizzie2025-11-071-1/+2
| | | | | | | | | | | IsIntegral) with libstdc++ equivalents (#290) Signed-off-by: lizzie <lizzie@eden-emu.dev> Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/290 Reviewed-by: crueter <crueter@eden-emu.dev> Reviewed-by: Caio Oliveira <caiooliveirafarias0@gmail.com> Co-authored-by: lizzie <lizzie@eden-emu.dev> Co-committed-by: lizzie <lizzie@eden-emu.dev>
* [common, fs] Use std::string_view instead of std::string&; inline functions ↵lizzie2025-08-271-9/+10
| | | | | | | | | | | that are used rarely (#330) Signed-off-by: lizzie <lizzie@eden-emu.dev> Co-authored-by: crueter <crueter@eden-emu.dev> Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/330 Reviewed-by: crueter <crueter@eden-emu.dev> Co-authored-by: lizzie <lizzie@eden-emu.dev> Co-committed-by: lizzie <lizzie@eden-emu.dev>
* Port changes from Early Accessdarktux2025-04-041-8/+9
|
* core: implement basic integrity verificationLiam2023-09-061-1/+3
|
* vfs: expand support for NCA readingLiam2023-08-151-2/+2
|
* core/loader: Return nullptr if file is nullptrMerry2022-09-251-0/+4
|
* core/loader: remove ELF loaderLiam2022-08-011-11/+0
|
* general: Convert source file copyright comments over to SPDXMorph2022-04-231-3/+2
| | | | | 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.
* loader: log the type of mismatching file-extensionBytesGalore2022-03-031-1/+2
|
* file_sys: Support load game collection (#6582)Feng Chen2021-07-201-5/+8
| | | Adds support for loading games with multiple programs embedded within such as the Dragon Quest 1+2+3 Collection
* common: fs: Rework the Common Filesystem interface to make use of ↵Morph2021-05-251-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | std::filesystem (#6270) * 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
* core: Make variable shadowing a compile-time errorLioncash2021-05-161-1/+1
| | | | | | 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.
* hle: kernel: Rename Process to KProcess.bunnei2021-05-051-1/+1
|
* main: Resolve error string not displayingLioncash2021-01-031-0/+4
| | | | | | | | | During the transition to make the error dialog translatable, I accidentally got rid of the conversion to ResultStatus, which prevented operator<< from being invoked during formatting. This adds a function to directly retrieve the result status string instead so that it displays again.
* core: loader: Implement support for loading indexed programs.bunnei2020-11-241-5/+7
|
* patch_manager: Remove usages of the global system instanceLioncash2020-11-181-12/+15
| | | | | | | With this, only 19 usages of the global system instance remain within the core library. We're almost there.
* common/fileutil: Convert namespace to Common::FSLioncash2020-08-161-1/+1
| | | | | | | | | | | | 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.
* common/concepts: Rename IsBaseOf to DerivedFromLioncash2020-08-071-1/+1
| | | | | | | | This makes it more inline with its currently unavailable standardized analogue std::derived_from. While we're at it, we can also make the template match the requirements of the standardized variant as well.
* Place in anonymous namespaceDavid Marcec2020-08-031-0/+4
|
* loader: Make IdentifyFile typesafeDavid Marcec2020-08-031-20/+32
| | | | Relies on #4465 for concept.h Common::IsBaseOf
* loader: Add recognition for KIP file typeZach Hilman2019-06-051-0/+10
|
* loader: Add KIP and INI file parser-specific errorsZach Hilman2019-06-051-1/+5
|
* kernel/process: Hook up the process capability parser to the process itselfLioncash2018-12-211-1/+3
| | | | | While we're at it, we can also toss out the leftover capability parsing from Citra.
* nso: Return an optional address from LoadModuleLioncash2018-10-151-1/+2
| | | | | If a malformed NSO is attempted to be loaded, we shouldn't continue onwards. We should be reporting an error and bailing out.
* loader: Add getter for packed updateZach Hilman2018-10-051-1/+2
| | | | Reads the update included with the game if it has one and adds the new ErrorNoPackedUpdate status.
* Port #4182 from Citra: "Prefix all size_t with std::"fearlessTobi2018-09-151-1/+1
|
* bktr: Fix bucket overlap errorZach Hilman2018-09-041-2/+2
|
* loader: Add BKTR-specific error messages and codesZach Hilman2018-09-041-1/+10
|
* loader: Add NSP file type and NSP-specific errorsZach Hilman2018-09-041-2/+12
|
* vfs_real: Forward declare IOFileLioncash2018-09-021-1/+4
| | | | | | 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.
* loader: Add new NAX-specific errors and messagesZach Hilman2018-08-231-1/+14
|
* nax: Add AppLoader_NAX and update loader to support itZach Hilman2018-08-231-2/+12
|
* Merge pull request #1005 from DarkLordZach/registered-fmtbunnei2018-08-151-0/+2
|\ | | | | file_sys: Add support for registration format
| * loader: Recognize filename '00' as NCAZach Hilman2018-08-111-0/+2
| | | | | | | | Needed to avoid mismatch filetype warnings on split NAND NCAs
* | loader: Make ResultStatus directly compatible with fmtLioncash2018-08-151-8/+4
| | | | | | | | | | | | | | | | | | 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.
* | loader: Remove address mapping remnants from citraLioncash2018-08-141-6/+0
| | | | | | | | These mappings are leftovers from citra and don't apply to the Switch.
* | Fixed invalid cast in loaderDavid Marcec2018-08-121-1/+1
|/ | | | GetMessageForResultStatus takes a u16, not a size_t.
* loader: Add more descriptive errorsZach Hilman2018-08-091-0/+49
| | | Full list of new errors and descriptions in core/loader/loader.h
* loader: Remove unused IdentifyFile overloadZach Hilman2018-08-081-4/+0
|
* Avoid parsing RomFS to directory in NCAZach Hilman2018-08-061-1/+1
|
* Remove files that are not usedZach Hilman2018-08-011-0/+9
|
* loader: Remove unnecessary constructor call in IdentifyFile()Lioncash2018-07-231-1/+1
| | | | | | RealVfsFile inherits from VfsFile, the instance from std::make_shared is already compatible with the function argument type, making the copy constructor call unnecessary.
* file_util, vfs: Use std::string_view where applicableLioncash2018-07-221-1/+2
| | | | | Avoids unnecessary construction of std::string instances where applicable.
* loader: Amend Doxygen commentsLioncash2018-07-191-2/+2
| | | | These weren't adjusted when VFS was introduced