aboutsummaryrefslogtreecommitdiff
path: root/src/core/loader/nro.cpp
Commit message (Collapse)AuthorAgeFilesLines
* [video_core, hle] remove redundant parent references in system structs (#3908)lizzie2026-06-231-11/+6
| | | | | | | | | | reworked a bit to remove references of parent objects and instead pass as arguments to methods to prevent useless reloads Signed-off-by: lizzie <lizzie@eden-emu.dev> Co-authored-by: maufeat <sahyno1996@gmail.com> Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/3908 Reviewed-by: Maufeat <sahyno1996@gmail.com> Reviewed-by: crueter <crueter@eden-emu.dev>
* [hle] support passing arguments to homebrew applications (#4013)xbzk2026-06-151-14/+78
| | | | | | | | | | | | | | | | | | | Homebrew (.NRO) program args support Adds a 'program_args' setting and delivers it to NRO homebrews via libnx's homebrew ABI. NROs previously had no way to receive CLI flags (e.g. NZ:P's -noglsl). Setting: program_args, Category::System, startup-only. Surfaced in Qt + Android Debug sections. NRO loader: builds a 4-entry 'ConfigEntry' table + argv at the data segment tail; prepends 'homebrew ' so user args land at argv[1]; scans for 'svc #7' to use as LR. Drops the stale NSO-style argdata append. KProcess: stores loader-provided guest addresses; 'Run' switches to the homebrew entry (x0=config_ptr, x1=-1, lr=svc7) and patches the real MainThreadHandle into the ConfigEntry slot. Legacy NSO path unchanged. Tested on NZP — args reach 'argv' correctly. Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/4013 Reviewed-by: Lizzie <lizzie@eden-emu.dev> Reviewed-by: MaranBr <maranbr@eden-emu.dev>
* [hle] Fixes for nxident, nxmp and nxplay, remove hbl.nsp workarounds (#3996)lizzie2026-06-121-1/+1
| | | | | | | | | | | | | | | adds `gpio` and `i2c` services implements `IApplicationFunctions::SetMediaPlaybackStateForApplicatio` stubs `IBtmSystemCore::GetDiscoveredAudioDevice` implements `nvhost_ctrl_gpu::PmuGetGpuLoad` IOCTL (0x20) implements `PSM::GetBatteryAgePercentage`, `PSM::GetBatteryVoltageState` and `PSM::GetBatteryChargeInfoFields` implements `ISystemSettingsServer::GetConsoleInformationUploadFlag`, `ISystemSettingsServer::SetConsoleInformationUploadFlag`, `ISystemSettingsServer::GetAutomaticApplicationDownloadFlag`, `ISystemSettingsServer::SetAutomaticApplicationDownloadFlag`, `&ISystemSettingsServer::GetUsb30EnableFlag`, `ISystemSettingsServer::SetUsb30EnableFlag` removes `hbl.nsp` specific workarounds Signed-off-by: lizzie <lizzie@eden-emu.dev> Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/3996 Reviewed-by: MaranBr <maranbr@eden-emu.dev> Reviewed-by: crueter <crueter@eden-emu.dev>
* [loader] change ASLR algo to be more uniform (#3869)lizzie2026-04-271-3/+2
| | | | | | | Signed-off-by: lizzie <lizzie@eden-emu.dev> Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/3869 Reviewed-by: crueter <crueter@eden-emu.dev> Reviewed-by: MaranBr <maranbr@eden-emu.dev>
* [common] unify std::random_device (#3801)lizzie2026-03-311-1/+2
| | | | | | | | Signed-off-by: lizzie <lizzie@eden-emu.dev> Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/3801 Reviewed-by: CamilleLaVey <camillelavey99@gmail.com> Co-authored-by: lizzie <lizzie@eden-emu.dev> Co-committed-by: lizzie <lizzie@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>
* [core/loader] prevent program_image reallocations in NSO+KIP loading methods ↵lizzie2026-02-281-2/+2
| | | | | | | | | | | | | | | (#3639) also changes some methods to std::span<> as well, but mainly std::vector<> in the NSO/KIP loading stuff is not needed to be memcpy'ed and memmove'd around this should save a marginal amount of loading time (RDR1) Signed-off-by: lizzie <lizzie@eden-emu.dev> Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/3639 Reviewed-by: DraVee <dravee@eden-emu.dev> Reviewed-by: Maufeat <sahyno1996@gmail.com> Co-authored-by: lizzie <lizzie@eden-emu.dev> Co-committed-by: lizzie <lizzie@eden-emu.dev>
* [core/loader] Implement a bit improper ASLR (#2945)lizzie2025-11-041-2/+9
| | | | | | | | | | | | | | A bit improper of an ASLR - it does something but something good? Who knows... All I know is that there is a non-uniform distrobution for rand() and that rng_seed is likely a better solution? I don't know Signed-off-by: lizzie lizzie@eden-emu.dev Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/2945 Reviewed-by: Maufeat <sahyno1996@gmail.com> Reviewed-by: MaranBr <maranbr@eden-emu.dev> Co-authored-by: lizzie <lizzie@eden-emu.dev> Co-committed-by: lizzie <lizzie@eden-emu.dev>
* vfs: Move vfs files to their own directoryFearlessTobi2024-01-251-1/+1
|
* loader: fix homebrew nro registrationLiam2024-01-131-6/+6
|
* fsp-srv: use program registry for SetCurrentProcessLiam2024-01-111-2/+4
|
* core: Rename patcher fileGPUCode2023-11-291-1/+1
|
* core: Define HAS_NCE macroGPUCode2023-11-251-3/+3
|
* Address some review commentsGPUCode2023-11-251-3/+3
|
* android: Add cpu bakend gui toggleGPUCode2023-11-251-1/+1
|
* arm: Implement native code execution backendLiam2023-11-251-5/+57
|
* kernel: Manually specify aslr region startLiam2023-11-251-1/+2
|
* core: improve debug workflowLiam2023-09-141-1/+2
|
* kernel: offset code entry point for 39-bit address space type (#11326)liamwhite2023-08-251-1/+1
|
* k_process: PageTable -> GetPageTableLiam2023-07-141-1/+1
|
* android: Add proper homebrew checkCharles Lombardo2023-06-091-1/+12
|
* code: dodge PAGE_SIZE #defineKyle Kienapfel2022-08-191-1/+1
| | | | | | | | | | | | | | | | | | | | | Some header files, specifically for OSX and Musl libc define PAGE_SIZE to be a number This is great except in yuzu we're using PAGE_SIZE as a variable Specific example `static constexpr u64 PAGE_SIZE = u64(1) << PAGE_BITS;` PAGE_SIZE PAGE_BITS PAGE_MASK are all similar variables. Simply deleted the underscores, and then added YUZU_ prefix Might be worth noting that there are multiple uses in different classes/namespaces This list may not be exhaustive Core::Memory 12 bits (4096) QueryCacheBase 12 bits ShaderCache 14 bits (16384) TextureCache 20 bits (1048576, or 1MB) Fixes #8779
* 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.
* general: Make most settings a BasicSettinglat9nq2021-06-281-2/+2
| | | | | | | | | | | Creates a new BasicSettings class in common/settings, and forces setting a default and label for each setting that uses it in common/settings. Moves defaults and labels from both frontends into common settings. Creates a helper function in each frontend to facillitate reading the settings now with the new default and label properties. Settings::Setting is also now a subclass of Settings::BasicSetting. Also adds documentation for both Setting and BasicSetting.
* common: fs: Rework the Common Filesystem interface to make use of ↵Morph2021-05-251-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* hle: kernel: Rename Process to KProcess.bunnei2021-05-051-4/+4
|
* loader: Resolve instances of variable shadowingLioncash2021-04-271-7/+6
| | | | | Eliminates variable shadowing cases across all the loaders to bring us closer to enabling variable shadowing as an error in core.
* common: Move settings to common from core.bunnei2021-04-141-1/+1
| | | | - Removes a dependency on core and input_common from common.
* hle: kernel: Migrate PageHeap/PageTable to KPageHeap/KPageTable.bunnei2021-02-181-1/+1
|
* hle: kernel: KThread: Reorganize thread priority defaults.bunnei2021-01-281-2/+2
|
* core: hle: kernel: Rename Thread to KThread.bunnei2021-01-281-1/+1
|
* core: Eliminate remaining usages of the global system instanceLioncash2020-11-271-5/+1
| | | | | | Removes all remaining usages of the global system instance. After this, migration can begin to migrate to being constructed and managed entirely by the various frontends.
* core/CMakeLists: Make some warnings errorsLioncash2020-10-131-1/+1
| | | | | | | | | 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/romfs_factory: Eliminate usage of the global system accessorLioncash2020-09-161-2/+2
|
* core/loader: Remove dependencies on the global system instanceLioncash2020-09-161-2/+2
| | | | | | | | | Now all that remains is: 18 instances in file_sys code 14 instances in GDB stub code (this can be tossed wholesale) 4 instances in HLE code 2 instances in settings code.
* loader: nro: Fix process initialization using ProgramMetadata default.bunnei2020-04-201-10/+13
|
* loader: elf/kip/nro: Updates for new VMM.bunnei2020-04-171-2/+2
|
* core: memory: Move to Core::Memory namespace.bunnei2020-04-171-2/+2
| | | | - helpful to disambiguate Kernel::Memory namespace.
* yuzu: Port old usages of Filesystem namespace to FilesystemControllerZach Hilman2019-09-211-1/+3
|
* nro: Implement ReadControlDataNick Renieris2019-09-081-0/+9
| | | | | | With this, the "Developer" field in the Properties for homebrew is now populated. Signed-off-by: Nick Renieris <velocityra@gmail.com>
* VM_Manager: Align allocated memory to 256bytesFernando Sahmkow2019-07-191-1/+1
| | | | | | This commit ensures that all backing memory allocated for the Guest CPU is aligned to 256 bytes. This due to how gpu memory works and the heavy constraints it has in the alignment of physical memory.
* core/core: Move process execution start to System's Load()Lioncash2019-04-111-7/+7
| | | | | | | | | This gives us significantly more control over where in the initialization process we start execution of the main process. Previously we were running the main process before the CPU or GPU threads were initialized (not good). This amends execution to start after all of our threads are properly set up.
* kernel/codeset: Make CodeSet's memory data member a regular std::vectorLioncash2019-03-221-1/+1
| | | | | | | | | | | The use of a shared_ptr is an implementation detail of the VMManager itself when mapping memory. Because of that, we shouldn't require all users of the CodeSet to have to allocate the shared_ptr ahead of time. It's intended that CodeSet simply pass in the required direct data, and that the memory manager takes care of it from that point on. This means we just do the shared pointer allocation in a single place, when loading modules, as opposed to in each loader.
* kernel: Move CodeSet structure to its own source filesLioncash2019-03-201-0/+1
| | | | | | | | Given this is utilized by the loaders, this allows avoiding inclusion of the kernel process definitions where avoidable. This also keeps the loading format for all executable data separate from the kernel objects.
* loader/nro: Make the static LoadNro function internally linkedLioncash2018-12-021-4/+5
| | | | | This simply acts as a forwarding function for the Load() function, so this doesn't need to be directly exposed.
* loader/nro: Remove dependency on the System classLioncash2018-12-021-8/+6
| | | | | | Load() is already given the process instance as a parameter, so instead of coupling the class to the System class, we can just forward that parameter to LoadNro()
* process: Make MirrorMemory take state to map new memory asZach Hilman2018-11-151-2/+5
| | | | Credits to Subv
* loader/nro: Call RegisterRomFS from LoadZach Hilman2018-10-291-0/+5
| | | | Allows NRO homebrew to use the RomFS in the ASET section.
* nro: Make LoadNro method accessible outside of apploader code.bunnei2018-10-251-6/+15
|
* nro: Make LoadNro take a VfsFile by const referenceLioncash2018-10-141-5/+5
| | | | | | This function doesn't need to care about ownership semantics, so we can just pass it a reference to the file itself, rather than a std::shared_ptr alias.