aboutsummaryrefslogtreecommitdiff
path: root/src/core/loader
Commit message (Collapse)AuthorAgeFilesLines
* loader: find mixed-case loose RomFS directories consistentlysnowstormxd32 hours1-2/+20
| | | | | | Linux missed base version metadata for Base/RomFS while Windows included it. Use a case-insensitive fallback for the loose directory and check the version and resulting archive checksum. Assisted by Codex.
* loader: read the display version from GameDataList.Product.NNN tookraibse36 hours1-17/+30
| | | | | | | | | Donkey Kong Bananza names its resource size table without a version, so no version was found for a loose dump. Its GameData/GameDataList.Product .320.* files carry it (3.2.0), so read them as well and use the newest tag from either source. Assisted-by: Claude Sonnet 5.5 (wrote the GameDataList version lookup and its test)
* refactor: remove redundant EnsureRomFS call in ↵kraibse37 hours1-2/+0
| | | | AppLoader_DeconstructedRomDirectory
* Merge remote-tracking branch 'origin/nx2' into codex/upstream-loading-hotkeyskraibse37 hours6-31/+411
|\
| * Merge pull request #258 from Djihads80/nx2Assuka2 days4-2/+381
| |\ | | | | | | bring nx2-experimental up to date
| | * loader: add NUP (Unencrypted (Archival) Package) container supporta55uka2 days4-2/+381
| | |
| * | loader: build a loose RomFS once and only when it is readTakoroka3 days2-5/+34
| |/ | | | | | | | | | | | | | | | | | | | | Every loader of an extracted title built the whole RomFS from its romfs/ directory in its constructor, though most are made only for metadata (the game list, title lookups), and each build keeps an object per file: title 1's 206k files left four copies alive, ~0.6 GB of the heap. The RomFS is now built on first read, and loaders of the same directory share one build while any of them holds it. (cherry picked from commit be47212cac130e6a895423644751c0525dc6f169)
* / game_list: discover loose dumps without walking their RomFS payloadssnowstormxd2 days2-4/+40
|/ | | | | | Defer RomFS construction, reuse one discovery result, omit recursive folder sizing, and release rows discarded by cancellation. Add scan suspension and regression coverage for extracted layouts and Unicode paths. Assisted-by: Codex (implementation, selective integration and automated validation)
* game_list, loader: find loose ExeFS dumps and show their name and iconMeow4 days1-4/+14
|
* loader: read a loose dump's name and icon from game-folder sidecarsMeow4 days1-23/+56
| | | | | | look for icon and control.nacp sidecars in the ExeFS directory and the game folder above it (<game>/exefs/main and <game>/updates/<title id>/exefs/main layouts)
* loader: read a loose dump's display version from its own filesTakoroka4 days4-3/+93
| | | | | | | | | 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.
* Update deconstructed_rom_directory.cpplesmmwe5 days1-0/+14
|
* nx2: frame-locked input replay and quieter logsTakoroka7 days1-0/+1
| | | | | | | | | | | EDEN_NX2_KEY_RECORD records keyboard transitions as "f<frame>:code" against a global count of guest presents; EDEN_NX2_KEY_SCRIPT replays them on the same frames (or by seconds, as before), so a played session reproduces exactly. Debug aids: the PC/LR/SP of the first unmapped reads, NSO load addresses, EDEN_NX2_IPC_SUMMARY (request counts every 5 s), EDEN_NX2_FORCE_LOD0. Unmapped-access logging is rate limited and the per-draw/semaphore spam is demoted, so long sessions stay under the log size cap.
* loader: give loose ExeFS boots a RomFS and an fs registrationTakoroka7 days1-1/+41
| | | | | | | | | The ExeFS directory loader never set its romfs member and, when used on its own, never registered the process with the FileSystemController, so fsp-srv SetCurrentProcess failed with ResultTargetNotFound (2002-1002). Build the RomFS from a romfs/ directory next to exefs/ (or a .romfs file in exefs/), and register the process when the loader isn't wrapped by the NCA/NSP loaders.
* 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)PavelBARABANOV8 days3-9/+52
| | | | | | | | | | | | | | | | | | | | | | | | | - [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>
* [loader] add ZBIC (zstd variant) NSO decompression support for Switch 22.0+ ↵PavelBARABANOV2026-09-272-4/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (#4482) - [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. ------------------- A new NSO compression method was introduced in Switch 22.0.0. This is a customized variant of zstd and is used when NSO flags have bit 7 set. Key characteristics: - ZSTD_MAGICNUMBER is set to 0x4349425A (b'ZBIC') instead of 0xFD2FB528 - ZSTD_LEGACY_SUPPORT is set to 0 - ZSTD_TRACE is set to 1, zstd version used is 1.5.7 (10507) - FSE_readNCount is replaced with a BIC (Binary Interpolative Coding) version which improves compression of entropy tables significantly Source: https://switchbrew.org/wiki/22.0.0 Implementation: - Detect ZBIC segments via NSO flag bit 7 (NsoFlags_UseZbicCompression) and/or ZBIC magic scan in nso.cpp - Fall back to LZ4 when ZBIC is not detected or returns unexpected size - Handle segment 0 alternate offset (0x100 vs 0x108) for both ZBIC and LZ4 References: - Atmosphère loader/strat zstd-zbic integration: https://github.com/Atmosphere-NX/Atmosphere/commit/082115187a0509cb6b8a757de639a4e4741b8712 - nxdumptool ZBIC segment compression support: https://github.com/DarkMatterCore/nxdumptool/commit/441e5c0904f29427987433be4eb057a2843d222a - STORM_SWITCH ZBIC implementation: https://github.com/ReiKatari/STORM_SWITCH/commit/1e09eb82b760aaf340b810031400991c0740c091 Tested with firmware 23.0.0 and ZBIC-compressed NSOs. Co-authored-by: xbzk <xbzk@eden-emu.dev> Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/4482 Reviewed-by: CamilleLaVey <camillelavey99@gmail.com> Reviewed-by: lizzie <lizzie@eden-emu.dev> Reviewed-by: Maufeat <sahyno1996@gmail.com>
* [core, hle, video_core, memory] Improve multi-process, display layers, ↵Maufeat2026-08-295-9/+98
| | | | | | | | | | | | | | | | | | | | | 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>
* [fmt] use {#:x} instead of 0x{:#x} (#4170)lizzie2026-07-253-3/+3
| | | | | | | | | | continuation of #309 but applying to even more files than before :) also makes them lowercase because `0xfafafa` is better as `0XFAFAFA` Signed-off-by: lizzie <lizzie@eden-emu.dev> Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/4170 Reviewed-by: CamilleLaVey <camillelavey99@gmail.com> Reviewed-by: Maufeat <sahyno1996@gmail.com>
* [video_core, hle] remove redundant parent references in system structs (#3908)lizzie2026-06-234-15/+10
| | | | | | | | | | 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-125-18/+18
| | | | | | | | | | | | | | | 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-273-9/+6
| | | | | | | 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-313-3/+6
| | | | | | | | 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-124-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | 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-044-17/+125
| | | | | | | | | | | | | | | | | | | | 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>
* [core/loader] prevent program_image reallocations in NSO+KIP loading methods ↵lizzie2026-02-283-75/+47
| | | | | | | | | | | | | | | (#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>
* [crypto] Atomize all traces of MbedTLS, and require OpenSSL 3+ (#3606)lizzie2026-02-231-10/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Closes #3137 Closes #3465 - Replace all mbedtls usage with OpenSSL - require OpenSSL - Up OpenSSL version to 3, cuz that's what we actually need... CAVEATS: - httplib also now required - other ssl backends for svc are unused, maybe remove later * To be fair, our CI never used them anyways. And we never tested those TESTERS PLEASE TEST: - All games and applets boot - Boot, load, exit, etc. times Co-authored-by: crueter <crueter@eden-emu.dev> 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/3606 Reviewed-by: crueter <crueter@eden-emu.dev> Reviewed-by: MaranBr <maranbr@eden-emu.dev> Reviewed-by: DraVee <dravee@eden-emu.dev> Co-authored-by: lizzie <lizzie@eden-emu.dev> Co-committed-by: lizzie <lizzie@eden-emu.dev>
* [nce] add split patch mode to support modules bigger than 128MB (#3489)Maufeat2026-02-071-4/+32
| | | | | | | | | | nce patcher was extended to support modules larger than 128MB due to ARM64 branch limit. now added a pre-patch and (existing) post-patch module code. Allowwing MRS/MSR/SVC handler to remain within branch branch range Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/3489 Reviewed-by: MaranBr <maranbr@eden-emu.dev> Reviewed-by: CamilleLaVey <camillelavey99@gmail.com> Co-authored-by: Maufeat <sahyno1996@gmail.com> Co-committed-by: Maufeat <sahyno1996@gmail.com>
* [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>
* [core/loader] Implement a bit improper ASLR (#2945)lizzie2025-11-043-8/+27
| | | | | | | | | | | | | | 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>
* [meta] fix license headers (#2547)lizzie2025-09-211-0/+3
| | | | | | | Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/2547 Reviewed-by: MaranBr <maranbr@eden-emu.dev> Co-authored-by: lizzie <lizzie@eden-emu.dev> Co-committed-by: lizzie <lizzie@eden-emu.dev>
* [cmake, core] refactor: update mbedtls and make YUZU_USE_CPM better (#485)crueter2025-09-151-3/+3
| | | | | | | | | | | | | | | update mbedtls functors to support mbedtls3 signatures moved some vulkan stuff from externals to root, yuzu_use_cpm manages them now needs testing: - all key/derivation related things - nca verification - game loading/updates/stuff Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/485 Reviewed-by: MaranBr <maranbr@eden-emu.dev>
* [cmake] enable clang-cl and WoA builds (#348)lizzie2025-09-091-1/+1
| | | | | | | | | | | | | | Compilation and CMake fixes for both Windows on ARM and clang-cl, meaning Windows can now be built on both MSVC and clang on both amd64 and aarch64. Compiling on clang is *dramatically* faster so this should be useful for CI. Co-authored-by: crueter <crueter@eden-emu.dev> Co-authored-by: crueter <crueter@crueter.xyz> Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/348 Reviewed-by: CamilleLaVey <camillelavey99@gmail.com> Reviewed-by: crueter <crueter@eden-emu.dev> Co-authored-by: lizzie <lizzie@eden-emu.dev> Co-committed-by: lizzie <lizzie@eden-emu.dev>
* [fmt] use {:#X} for format instead of 0x{:X} (#309)lizzie2025-08-272-2/+8
| | | | | | | | Signed-off-by: lizzie <lizzie@eden-emu.dev> Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/309 Reviewed-by: crueter <crueter@eden-emu.dev> 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>
* [core, nce] module_id cache key handling (#195)wildcard2025-08-041-0/+3
| | | | | | | | | | Uses Module_id plus offset for cache key, Module_id is unique to each module. Also passes the module_id everytime new patcher is created in case the module is too big. Co-authored-by: crueter <crueter@eden-emu.dev> Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/195 Reviewed-by: crueter <crueter@eden-emu.dev> Co-authored-by: wildcard <nubieluv@gmail.com> Co-committed-by: wildcard <nubieluv@gmail.com>
* service: sm/kernel/loader: Implement QueryPointerBufferSize, automatic ↵JPikachu2025-04-301-2/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | pointer buffer sizing, and SM service improvements This commit introduces multiple improvements to IPC handling and system management services, enhancing game compatibility and emulator stability. --- 1. Fully Implemented QueryPointerBufferSize Service: - Exposes the per-process IPC pointer buffer size through `QueryPointerBufferSize` instead of returning stubbed values. - Added `m_pointer_buffer_size` field to `KProcess`, initialized with a safe default (0x8000). - Introduced getter and setter methods (`GetPointerBufferSize()` / `SetPointerBufferSize()`). - Registered new handler in `sm_controller` for handling QueryPointerBufferSize requests. - Ensures accurate buffer size reporting for games relying on this service. --- 2. Automatic Pointer Buffer Sizing Per-Game: - Automatically determines heap size by parsing `main.npdm` from the game’s ExeFS: - Heap size > 1 GiB → pointer buffer size set to `0x10000`. - Heap size > 512 MiB → pointer buffer size set to `0xC000`. - Otherwise, defaults to `0x8000`. - Gracefully handles missing or malformed `main.npdm` by falling back to default settings. - Automatically configures pointer buffer size during `AppLoader_NCA::Load`. - Added logging for heap size detection and buffer size configuration for easier debugging. --- 3. SM Service Improvements: - Added full implementation of `QueryPointerBufferSize` within the SM service framework. - Cleaned up stubbed methods and ensured correct domain handling. - Registered new service commands (e.g., `SetPointerBufferSize` and `QueryPointerBufferSize`) in `sm_controller`. - Improved session handling with proper conversion to domain objects where necessary. --- Benefits: - Greatly improves compatibility with games that require larger IPC pointer buffers - Eliminates the need for manual per-game pointer buffer overrides. - More accurate emulation of Switch system services, improving stability for both commercial titles and homebrew. - Provides cleaner logging for easier debugging and maintenance. - Future-proofs IPC handling for upcoming titles with higher memory demands. --- Additional Notes: - Default pointer buffer size remains 0x8000 for smaller titles or if heap size cannot be determined. - Falls back to safe defaults without affecting overall emulator performance. - All new service calls properly registered and integrated without breaking existing functionality.
* Port changes from Early Accessdarktux2025-04-041-8/+9
|
* scope_exit: Make constexprFearlessTobi2024-02-191-1/+3
| | | | | Allows the use of the macro in constexpr-contexts. Also avoids some potential problems when nesting braces inside it.
* vfs: Move vfs files to their own directoryFearlessTobi2024-01-252-2/+2
|
* loader: also register fs process for raw exefs partitionLiam2024-01-231-0/+8
|
* Merge pull request #12677 from GPUCode/whyy-moddersliamwhite2024-01-153-39/+80
|\ | | | | core: Support multiple modules per patcher
| * core: Support multiple modules per patcherGPUCode2024-01-153-39/+80
| |
* | loader: fix homebrew nro registrationLiam2024-01-131-6/+6
| |
* | fsp-srv: use program registry for SetCurrentProcessLiam2024-01-115-20/+12
|/
* kernel: restrict nce to applicationsLiam2023-12-221-3/+4
|
* file_sys: handle null romfsLiam2023-12-011-4/+2
|
* core: Rename patcher fileGPUCode2023-11-293-3/+3
|
* loader: fix gcc compileLiam2023-11-261-1/+1
|