Commit Graph

460 Commits

Author SHA1 Message Date
lizzie 45a2008aa6
[common] replace Common::(DerivedFrom, IsArithmetic, Size, ConvertibleTo, 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>
2025-11-07 17:03:01 +01:00
lizzie 504df4856d
[core/loader] Implement a bit improper ASLR (#2945)
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>
2025-11-04 22:35:34 +01:00
lizzie 191e4c75a1
[meta] fix license headers (#2547)
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>
2025-09-21 21:58:59 +02:00
crueter d207df959a
[cmake, core] refactor: update mbedtls and make YUZU_USE_CPM better (#485)
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>
2025-09-15 04:22:15 +02:00
lizzie 9d2681ecc9
[cmake] enable clang-cl and WoA builds (#348)
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>
2025-09-09 20:47:49 +02:00
lizzie 9d53933a95
[fmt] use {:#X} for format instead of 0x{:X} (#309)
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>
2025-08-27 22:39:11 +02:00
lizzie 09e77fa146
[common, fs] Use std::string_view instead of std::string&; inline functions 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>
2025-08-27 22:21:04 +02:00
wildcard 41ffa5a342
[core, nce] module_id cache key handling (#195)
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>
2025-08-04 18:41:28 +02:00
JPikachu 8599c47fe0 service: sm/kernel/loader: Implement QueryPointerBufferSize, automatic 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.
2025-04-30 06:35:22 +00:00
darktux 616619c8f7 Port changes from Early Access 2025-04-04 03:40:46 +02:00
FearlessTobi 4d55e58ee4 scope_exit: Make constexpr
Allows the use of the macro in constexpr-contexts.
Also avoids some potential problems when nesting braces inside it.
2024-02-19 16:00:46 +01:00
FearlessTobi 24f979a4b8 vfs: Move vfs files to their own directory 2024-01-25 16:40:42 -05:00
Liam 9528c40b1e loader: also register fs process for raw exefs partition 2024-01-23 00:01:38 -05:00
liamwhite f05d1c60be Merge pull request #12677 from GPUCode/whyy-modders
core: Support multiple modules per patcher
2024-01-15 13:52:38 -05:00
GPUCode 26a25d2280 core: Support multiple modules per patcher 2024-01-15 00:46:05 +02:00
Liam 36739873d2 loader: fix homebrew nro registration 2024-01-13 13:48:56 -05:00
Liam 2397093e4f fsp-srv: use program registry for SetCurrentProcess 2024-01-11 11:28:52 -05:00
Liam a7ff872a4c kernel: restrict nce to applications 2023-12-22 21:52:49 -05:00
Liam 4321fc6154 file_sys: handle null romfs 2023-12-01 23:39:48 -05:00
GPUCode e6e15d2d10 core: Rename patcher file 2023-11-29 23:49:16 +02:00
Liam d7db22185a loader: fix gcc compile 2023-11-26 19:34:07 -05:00
Liam 982183d4c6 loader: apply nso patch to offset program image 2023-11-25 00:47:36 -05:00
GPUCode 3930e3d7fd core: Define HAS_NCE macro 2023-11-25 00:47:36 -05:00
GPUCode 3814ca9d84 Address some review comments 2023-11-25 00:47:35 -05:00
GPUCode 3764cc4be2 android: Add cpu bakend gui toggle 2023-11-25 00:47:28 -05:00
Liam 19619b1b14 arm: Implement native code execution backend 2023-11-25 00:46:47 -05:00
Liam 3a5992f2ef kernel: Manually specify aslr region start 2023-11-25 00:46:15 -05:00
Liam bb4e14e7ac loader: don't reassign program ID on npdm reparse 2023-09-30 11:35:42 -04:00
Liam efef3d8487 core: improve debug workflow 2023-09-14 16:44:15 -04:00
Liam 76671fdede core: implement basic integrity verification 2023-09-06 16:49:27 -04:00
liamwhite aa16fd2422 kernel: offset code entry point for 39-bit address space type (#11326) 2023-08-25 23:59:32 +02:00
Liam 5e3139e7c6 vfs: expand support for NCA reading 2023-08-15 17:47:25 -04:00
Liam 6b6f0b21b9 k_process: PageTable -> GetPageTable 2023-07-14 21:43:15 -04:00
Tobias 16590ff2d0 file_sys/content_archive: Detect compressed NCAs (#11047) 2023-07-12 23:17:18 +02:00
Charles Lombardo b1b9075f2d android: Add proper homebrew check 2023-06-09 20:17:51 -04:00
Liam 156516e399 kernel: use KTypedAddress for addresses 2023-03-22 09:35:16 -04:00
Liam c68577384a general: rename CurrentProcess to ApplicationProcess 2023-02-13 19:03:12 -05:00
Merry 62b91b0094 core/loader: Return nullptr if file is nullptr 2022-09-25 19:31:35 +01:00
Kyle Kienapfel ea00332a67 code: dodge PAGE_SIZE #define
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
2022-08-19 16:08:40 -07:00
Liam 9080ea9ab1 core/loader: remove ELF loader 2022-08-01 17:19:23 -04:00
Liam 79bf4bc3ff general: fix compilation on MinGW GCC 12 2022-06-13 20:09:32 -04:00
Liam 8f979d453d common: consolidate ELF structure definitions 2022-06-05 09:42:05 -04:00
Andrea Pappacoda b2eb103829 chore: add missing SPDX tags
Follow-up to 2b87305d31
2022-04-28 18:24:11 +02:00
Morph 2b87305d31 general: Convert source file copyright comments over to SPDX
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-23 05:55:32 -04:00
BytesGalore 8f530cbb09 loader: log the type of mismatching file-extension 2022-03-03 06:45:13 +01:00
Lioncash 8a509e5a2c general: Replace NonCopyable struct with equivalents 2022-02-02 13:17:12 -05:00
bunnei acd1fff964 core: loader: kip: Minimal changes to fix KIP loading.
- Allows us to boot KIP (kernal apps), useful for testing the kernel.
2021-12-17 23:08:51 -08:00
jam1garner 9ea4d9cb8c loader: Support loading subsdk{8,9} 2021-12-05 23:07:50 -05:00
ameerj d27abf5546 core: Remove unused includes 2021-11-03 21:42:57 -04:00
Feng Chen 77f209e391 file_sys: Support load game collection (#6582)
Adds support for loading games with multiple programs embedded within such as the Dragon Quest 1+2+3 Collection
2021-07-20 01:10:05 -04:00