Commit graph

10595 commits

Author SHA1 Message Date
b5bec371ae Add toggle for LRU 2025-04-30 04:05:45 -03: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
Pavel Barabanov
56e619c872 Remove the stub for GetCradleFwVersion 2025-04-30 02:52:04 +03:00
449a2497ea Initial MMO implementation
MMO (Multithreaded Memory Operations)
2025-04-28 16:44:35 -03:00
4e7f6ef694 Better FastMemcpy and FastMemset
Use 16-byte copy paths
2025-04-28 16:44:21 -03:00
476e0fe432 Use 4MB cache size instead of 1MB 2025-04-28 16:38:44 -03:00
abc7e71ecd Replace std::memcpy/memset with intrinsics on known sizes 2025-04-28 16:27:30 -03:00
52a692b73a Merge branch 'purple' of https://git.eden-emu.dev/MrPurple666/eden into purple 2025-04-19 19:27:01 -03:00
7a62776d11 fix duplicated on merge 2025-04-19 19:26:04 -03:00
f65c3042c4 Merge branch 'master' into purple 2025-04-19 21:54:56 +00:00
6ac5eaea11 Merge https://git.eden-emu.dev/eden-emu/eden into purple 2025-04-19 18:53:45 -03:00
f2db4dd3a1 Fix CI Building For Windows, Android & Linux 2025-04-19 14:46:06 -07:00
EmulationEnjoyer
a5a7cb8a24 chore(HLE): Update HLE API version constants
- Updated Horizon OS version to 19.0.1 and NintendoSDK version to 1.0. Adjusted `VERSION_HASH`, `DISPLAY_VERSION`, and `DISPLAY_TITLE` to match the new firmware versions.

ref: fcb6444037
2025-04-19 17:56:48 -03:00
EmulationEnjoyer
e6d0c5ea42 arm: Skip duplicate consecutive addresses in backtrace output
ref: aa56430f2a
2025-04-19 17:56:48 -03:00
Zephyron
cf1bcb02c5 service/vi: Improve OpenDisplay validation
Updates the OpenDisplay function in IApplicationDisplayService to properly
validate display names. Instead of only accepting "Default", now validates
against all known valid display names: "Default", "External", "Edid",
"Internal", and "Null".

- Changes log level from WARNING to DEBUG since this is no longer stubbed
- Adds proper validation for all valid display names
- Returns ResultOperationFailed for invalid display names
- Improves logging by including the requested display name
2025-04-19 17:19:38 -03:00
c8a4cf715f windows actions (again) (#39)
Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/39
Co-authored-by: swurl <swurl@swurl.xyz>
Co-committed-by: swurl <swurl@swurl.xyz>
2025-04-17 04:50:25 +00:00
Pavel Barabanov
ee03ac227d Fixes the launch of some games on firmware versions 18 and above. 2025-04-15 05:59:18 +03:00
Pavel Barabanov
b66ebe638b Qlauncher firmware 19 2025-04-14 14:18:13 -04:00
JPikachu
d6eff706f2 Service: am: enhance UnpopInData, GetHdcpAuthenticationState and GetHdcpAuthenticationStateChangeEvent
Thanks to Sudachi and Torzu for some help and referance.
2025-04-14 14:18:13 -04:00
909a94783c fixes out_audio_controller build error 2025-04-14 12:23:30 -03:00
Zephyron
cae9d9b9e8 service/audio: implement Unknown5000 and add debug commands
- Add Unknown5000 implementation to create duplicate controller interface
- Add new debug-related command handlers:
  * OverrideDefaultTargetForDebug (50001)
  * SetForceOverrideExternalDeviceNameForDebug (50003)
  * ClearForceOverrideExternalDeviceNameForDebug (50004)
- Add proper debug logging for interface creation
- Update header with new function declaration
- Fix missing commas in function registration array

These changes improve the audio controller implementation by
adding support for interface duplication and debug override
functionality. The implementation maintains proper interface
lifetime management using SharedFrom.
2025-04-14 12:15:52 -03:00
Pavel Barabanov
1bd86b08f2 Qlauncher firmware 19 2025-04-14 12:10:33 -03:00
JPikachu
d87ba21d05 Service: am: enhance UnpopInData, GetHdcpAuthenticationState and GetHdcpAuthenticationStateChangeEvent
Thanks to Sudachi and Torzu for some help and referance.
2025-04-14 12:10:06 -03:00
darktux
eb536ef8a8 Return correct amount of values from IFriendService::GetReceivedFriendRequestCount 2025-04-13 15:39:17 -03:00
darktux
26eece092f Fix NROs crashing and loading infinitely (#3)
Commit from Suyu, looks like Yuzu devs forgot to initialize memory here.

Comment from darktux: I've changed the use of memset to std::fill.

Co-authored-by: Belal Ashraf <nullequal@noreply.localhost>
Reviewed-on: http://y2nlvhmmk5jnsvechppxnbyzmmv3vbl7dvzn6ltwcdbpgxixp3clkgqd.onion/darktux/torzu/pulls/3
Co-authored-by: darktux <darktux@y2nlvhmmk5jnsvechppxnbyzmmv3vbl7dvzn6ltwcdbpgxixp3clkgqd.onion>
Co-committed-by: darktux <darktux@y2nlvhmmk5jnsvechppxnbyzmmv3vbl7dvzn6ltwcdbpgxixp3clkgqd.onion>
2025-04-13 15:39:03 -03:00
JPikachu
bc86307ad6 Service: Add AliasRegionExtraSize
Thanks to Briar for finding and testing the Service
Credit: Antique - [Sudachi] Dev (https://sudachi.emuplace.app/)
2025-04-12 22:54:32 -03:00
be4bc3b477 WIP: DO-NOT-MERGE: NCE experiments: Better Pre-Fetch implementation
should make it more performatic as in use with new lru cache implmentation
2025-04-12 22:54:32 -03:00
739e5c47ea WIP: DO-NOT-MERGE: NCE experiments: Better LRU cache implementation
It uses a better lru implementation, since initial as basic functions to LRU, use a modern system to it to make performance better
2025-04-12 22:54:32 -03:00
Pavel Barabanov
70c2439d8c Add sync core speed 2025-04-12 22:54:32 -03:00
f9f311c014 Revert "Merge branch 'pr-12'"
This reverts commit dfe104bbb96b52f47943462c296ecbcb046dffdf, reversing
changes made to 45683a4034.
2025-04-12 22:54:32 -03:00
JPikachu
e0795f2b40 Service: Add AliasRegionExtraSize
Thanks to Briar for finding and testing the Service
Credit: Antique - [Sudachi] Dev (https://sudachi.emuplace.app/)
2025-04-12 16:23:47 +01:00
JPikachu
a6c9177ad1 Implement additions to nvdr services
Fixes log error: "[  41.472933] Debug <Critical> core/hle/service/nvdrv/devices/nvhost_ctrl_gpu.cpp:operator():81: Assertion Failed! Unimplemented ioctl=C0084713"

Credit: Antique - Sudachi dev, for the base Implementation and Citron for slight additions.
2025-04-11 17:48:09 -03:00
3d43fecece WIP: DO-NOT-MERGE: NCE experiments: Initial LRU 2025-04-11 17:05:06 -03:00
27ceda2c6c WIP: DO-NOT-MERGE: NCE experiments: Fix build errors 2025-04-11 17:04:55 -03:00
777b674edf WIP: DO-NOT-MERGE: NCE experiments: Some optimizations on pre-fetch and cache 2025-04-11 17:04:45 -03:00
d36031849e WIP: DO-NOT-MERGE: NCE experiments: Ensure guest context reflects thread state during unlock 2025-04-11 17:04:34 -03:00
d621707001 WIP: DO-NOT-MERGE: NCE experiments
botw boots but with poor performance
2025-04-11 17:04:24 -03:00
JPikachu
4957950b55 revert 789bbd7ab5
This needs to be put aside for now, but may be implemented again later
2025-04-10 03:45:51 +00:00
9cef9f5dce Update fmt to allow for v11
Signed-off-by: swurl <swurl@swurl.xyz>
2025-04-10 01:11:22 +02:00
Briar
216ded6997 android: Improve network gateway handling 2025-04-10 00:40:07 +02:00
Briar
077592903e core: Add support for game settings overrides (#6)
* core: Add support for game settings overrides
---------

Co-authored-by: Gamer64 <76565986+Gamer64ytb@users.noreply.github.com>
Co-authored-by: zhang wei <zwdreams@gmail.com>
2025-04-09 23:44:33 +02:00
90bda9fee5 Use u32 instead of int
fix windows build error
2025-04-04 03:40:50 +02:00
2d2e9208d2 Unified torzu and sudachi friend.cpp + fix android build on dma_pusher 2025-04-04 03:40:49 +02:00
Pavel Barabanov
409946d1e6 Added the GetKeyCodeMapByPort service, thanks JPikachu for the tip. 2025-04-04 03:40:49 +02:00
JPikachu
7c4fdaf528 Update freind, nifm and nim stubs
Credit: Antique - [Sudachi] Dev (https://sudachi.emuplace.app/)
2025-04-04 03:40:49 +02:00
EmulationEnjoyer
d5bb26bf3e Implement HID function stub "SetGestureOutputRanges" (#105)
Add function stub for "SetGestureOutputRanges" in HID service

Fixes userspace panic when booting Donkey Kong Country Returns HD:

> Debug <Critical> core\hle\service\service.cpp:operator ():78: Assertion Failed!
Unknown / unimplemented function '92(<unknown>)': port='hid' cmd_buf={[0]=0x6, [1]=0x8000000C, [2]=0x1, [3]=0x0, [4]=0x4F434653, [5]=0x0, [6]=0x0, [7]=0x0, [8]=0x49434653}
> Service.AM <Info> core\hle\service\am\service\application_functions.cpp:SetTerminateResult:187: (STUBBED) called, result=0x1a80a (2010-0212)
> Debug.Emulated <Critical> core\hle\kernel\svc\svc_exception.cpp:Break:52: Userspace PANIC! info1=0x0000001086D02C4C, info2=0x0000000000000004
> Debug.Emulated <Critical> core\hle\kernel\svc\svc_exception.cpp:operator ():33: debug_buffer_err_code=1A80A
> Debug.Emulated <Critical> core\hle\kernel\svc\svc_exception.cpp:Break:102: Emulated program broke execution! reason=0x0000000000000000, info1=0x0000001086D02C4C, info2=0x0000000000000004

ref: 132077e18f

![](https://i.imgur.com/hbBnlYs.png)

Reviewed-on: http://vub63vv26q6v27xzv2dtcd25xumubshogm67yrpaz2rculqxs7jlfqad.onion/torzu-emu/torzu/pulls/105
Co-authored-by: EmulationEnjoyer <emulationenjoyer@noreply.localhost>
Co-committed-by: EmulationEnjoyer <emulationenjoyer@noreply.localhost>
2025-04-04 03:40:49 +02:00
Zephyron
789bbd7ab5 kernel: Implement SystemResourceSize info type for VAMM initialization
Adds support for InfoType::SystemResourceSize (0x1C) which is required for
proper initialization of the Virtual Address Memory Manager (VAMM). This
implementation:

1. Adds SystemResourceSize to the InfoType enum in svc_types.h
2. Implements the GetInfo handler for SystemResourceSize in svc_info.cpp
3. Returns 512MB (0x20000000 bytes) as the system resource size
4. Adds debug logging for the SVC call

The 512MB value is chosen based on typical system resource allocations
needed for VAMM initialization on the Nintendo Switch.

This fixes crashes in games that rely on VAMM functionality, particularly
during nn::os::detail::VammManager::InitializeIfEnabled().
2025-04-04 03:40:49 +02:00
MrPurple666
c6f2a85142 Add the rest of the necessary code for ssl:s
Credit: Antique - (Sudachi) Dev [https://sudachi.emuplace.app/]

Signed-off-by: MrPurple666 <antoniosacramento666@gmail.com>
2025-04-04 03:40:49 +02:00
JPikachu
6581fc5b98 Update ssl stubs
Updated the ssl stubs to implement ssl:s for Firmware 19
This should make Xenoblade X: Definitive Edition bootable
Credit: Antique - (Sudachi) Dev [https://sudachi.emuplace.app/]
2025-04-04 03:40:48 +02:00
JPikachu
6abd4d2f2b Rewrote mm:u to follow switchbrew.org documentation and update them
Credit: Antique - [Sudachi Dev] (https://sudachi.emuplace.app/)
2025-04-04 03:40:48 +02:00