Commit graph

25303 commits

Author SHA1 Message Date
lizzie
7ea05d0f86 scheduler takes kernel ptr 2026-06-15 18:22:29 +00:00
lizzie
1e138178c3 special touchups, more kernel cascade calls :) 2026-06-15 18:22:29 +00:00
lizzie
7792f38289 remove parent refs pt 1/2 2026-06-15 18:21:35 +00:00
lizzie
92a904d37f fixups 2026-06-15 18:21:35 +00:00
lizzie
c6acc261e5 license + fix stuffs 2026-06-15 18:21:35 +00:00
lizzie
2140ff5734 remove m_kernel reference from global scheduler 2026-06-15 18:21:35 +00:00
lizzie
c74423465b fixups 2026-06-15 18:21:35 +00:00
lizzie
3485425208 fix license 2026-06-15 18:21:35 +00:00
lizzie
7c05a4ede8 case stupidity in windows 2026-06-15 18:21:35 +00:00
lizzie
1fdabb7c66 correct defines for d3d9 2026-06-15 18:21:35 +00:00
lizzie
f9a101a4ac fs 2026-06-15 18:21:35 +00:00
lizzie
99a7305834 fix msvc 2026-06-15 18:21:35 +00:00
lizzie
edad1eacda public 2026-06-15 18:21:35 +00:00
lizzie
189d823bca better inlining 2026-06-15 18:21:35 +00:00
lizzie
878573f0c5 maxwell macros 2026-06-15 18:21:35 +00:00
lizzie
68a8cc536b remove implicit system saved in struct, pass as first param 2026-06-15 18:21:35 +00:00
lizzie
3f542f3fd4 ffs 2026-06-15 18:21:35 +00:00
lizzie
0ddb0998e7 extra 2026-06-15 18:21:35 +00:00
lizzie
dd97689fe5 extra fixups 2026-06-15 18:21:35 +00:00
lizzie
9c9291fd31 less load, fix nv01 timer being kepler 2026-06-15 18:21:35 +00:00
lizzie
3b23200e14 fx 2026-06-15 18:21:35 +00:00
lizzie
aab2d4cfaf [video_core] Remove redundant references in GPU engine structs
Signed-off-by: lizzie <lizzie@eden-emu.dev>
2026-06-15 18:21:35 +00:00
maufeat
37e934c6b2 [kernel, hle] Initial 22.0.0 kernel changes and cmd stubs (#3761)
- KProcess::Run() and CreateThread() SVC now write the current thread handle to TLS+0x110
- KPageTableBase::LockForMapDeviceAddressSpace now checks for a new KPageTableBase boolean, m_allowed_exec_device_mapping
- Stub `am` + `acc` + `settings` cmd module that needs to work for qlaunch

Thanks to: @alula and @yellows8
Source for changes: https://github.com/Atmosphere-NX/Atmosphere/pull/2744, https://switchbrew.org/, https://yls8.mtheall.com/

Co-authored-by: PavelBARABANOV <pavelbarabanov94@gmail.com>
Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/3761
Reviewed-by: CamilleLaVey <camillelavey99@gmail.com>
2026-06-15 18:21:35 +00:00
lizzie
8c7faebcfb llicense fix 2026-06-15 18:21:35 +00:00
lizzie
baf5113783 fx 2026-06-15 18:21:35 +00:00
lizzie
d7bfc7e900 [audio_core, hle/services, video_core/compute] Inline std::unique_ptr<> allocs into std::optional<>
Signed-off-by: lizzie <lizzie@eden-emu.dev>
2026-06-15 18:21:35 +00:00
BoiledElectricity
5ebb5b8772
[opengl] query GL_MAX_CLIP_DISTANCES instead of hardcoding 8 (#4095)
Some checks are pending
tx-src / sources (push) Waiting to run
Check Strings / check-strings (push) Waiting to run
The GL shader profile hardcoded max_user_clip_distances to 8. Query the
device limit like the Vulkan path already does (it reads
maxClipDistances), so we use what the host actually reports.

Clamp to Maxwell's NumClipDistances (8) since the guest never produces
more than that and the SPIR-V output array is sized for at most 8. So a
host reporting fewer than 8 is respected, and one reporting more can't
overrun anything.

Fixes #3910
https://git.eden-emu.dev/eden-emu/eden/issues/3910

Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/4095
Reviewed-by: MaranBr <maranbr@eden-emu.dev>
Reviewed-by: Lizzie <lizzie@eden-emu.dev>
2026-06-15 04:30:40 +02:00
xbzk
73918d23d5
[video_core, maxwell] fixes for homebrew games that use MESA compiler (#4012)
two main issues:

shader_environment.cpp

Support Mesa nv50_ir-compiled homebrew fragment shaders
Mesa nv50_ir (used by NZP-Switch via libdrm_nouveau) emits Maxwell SASS that differs from NVN in two ways our shader pipeline didn't account for, causing "infinite" loops during shader scanning.

How?  TryFindSize() previously detected end-of-shader only via NVN's "BRA $-1" self-branch trailer (SELF_BRANCH_A/B). Mesa-compiled shaders end with an unconditional @PT EXIT and emit no trailer, so scanning ran past the shader and looped to MAXIMUM_SIZE.

Fix: Added a secondary match against @PT EXIT T (opcode 0xE30, predicate PT, flow T) as a fallback terminator. The mask is estrictive enough to reject predicated EXITs, conditional-flow EXITs, and sched control words, so well-formed NVN shaders see no ehavior change (their single @PT EXIT immediately precedes BRA $-1, and both detections return the same size).

load_store_attribute.cpp + attribute.h

IPA's is_perspective check only applied the ×position_w correction for IR::IsGeneric() attributes, and used a per-component SPH lookup. Two failure modes followed:

1. Mesa fragment shaders read varyings via legacy attribute slots
(ColorFrontDiffuse, FixedFncTexture, FogCoordinate) which are
remapped to generic varyings later by ConvertLegacyToGeneric. At
IPA-translation time they're still legacy, so IsGeneric() was
false and the inject was skipped — but the resulting GLSL/SPIR-V
varying was Smooth (perspective-correct), and the SASS still
issued its manual perspective dance via MUFU.RCP(ATTR_W)+FMUL,
compounding an extra ×clip_w factor. NZP fog (eye_z distance
varying) ended up as eye_z⁴×density² instead of eye_z²×density²,
saturating fog to white everywhere.

2. Even for legacy attrs that should inject, Mesa stores them in two formats selected by the IPA's interpolation_mode field:
Pass/Multiply/Constant → attr/w (perspective); inject ×position_w
Sc (ScreenLinear)      → raw attr; do NOT inject
Unconditionally injecting for Sc dims vertex colors by 1/clip_w because there's no SASS multiplier to round-trip it back.

Fix: extend the IPA correction path to also fire on IsLegacyAttribute(), gated on interpolation_mode != Sc. While here, the generic-path check is widened from per-component to vector-level (first non-Unused PixelImap, with all-Unused fallthrough treated as Perspective) so it matches the GLSL interpolation qualifier picked by CollectInterpolationInfo — this fixes the same all-zeroed-imap case Mesa exposes for explicit generics. IsLegacyAttribute moved from translate_program.cpp's anonymous namespace into attribute.h next to IsGeneric so IPA can reach it.

Tested on NaziZombies:Portable (Switch homebrew): fog now matches real
hardware, vertex-colored geometry (hand, gun, decals) renders correctly.

Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/4012
Reviewed-by: Lizzie <lizzie@eden-emu.dev>
Reviewed-by: MaranBr <maranbr@eden-emu.dev>
2026-06-15 03:05:11 +02:00
BoiledElectricity
ef4113aeaa
[video_core] fix TOCTOU in Vulkan instance extension enumeration (#4072)
So CreateInstance was enumerating instance extensions twice, and that could race if the driver returned a different list the second time. On some AMD iGPU drivers, we could enable an extension from the first list, then fail the second check with VK_ERROR_EXTENSION_NOT_PRESENT.

Fix this by enumerating once and passing that same snapshot into RequiredExtensions.

Fixes: https://github.com/eden-emulator/Issue-Reports/issues/414
Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/4072
Reviewed-by: Lizzie <lizzie@eden-emu.dev>
Reviewed-by: MaranBr <maranbr@eden-emu.dev>
2026-06-15 03:02:53 +02:00
xbzk
78a1cd0533
[hle] support passing arguments to homebrew applications (#4013)
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>
2026-06-15 03:02:33 +02:00
xbzk
026974211e
[vk, homebrew] ETC2 format list added (#4061)
Liz' command. ETC2 format list added. Used mainly in homebrew, NZ:P for example.

Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/4061
Reviewed-by: Lizzie <lizzie@eden-emu.dev>
Reviewed-by: MaranBr <maranbr@eden-emu.dev>
2026-06-15 03:00:58 +02:00
BoiledElectricity
d698c3b601
[hle/fs] fix handle Temporary/ProperSystem/SafeMode save spaces instead of ASSERT(false) (#4069)
OpenSaveDataFileSystem was missing a few SaveDataSpaceId mappings, so it would hit ASSERT(false). This broke games that open cache storage, with TOTK being the obvious one, because save enumeration could assert before the game even finished loading.

Fixed this by mapping Temporary to user nand, and ProperSystem/SafeMode to system nand. These only get used for the free-space check here, so they just need to point somewhere sane.

Fixes: https://github.com/eden-emulator/Issue-Reports/issues/368
Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/4069
Reviewed-by: Lizzie <lizzie@eden-emu.dev>
Reviewed-by: MaranBr <maranbr@eden-emu.dev>
2026-06-15 03:00:21 +02:00
lizzie
60e1032771
[qt] fix various crashes due to invalid/corrupted/outdated settings (#4070)
lots of "out of index" errors :)

Signed-off-by: lizzie <lizzie@eden-emu.dev>

Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/4070
Reviewed-by: crueter <crueter@eden-emu.dev>
Reviewed-by: MaranBr <maranbr@eden-emu.dev>
2026-06-14 20:48:24 +02:00
Eden CI
1071353291
[dist, android] Update translations from Transifex for Jun 13 (#4091)
Some checks failed
tx-src / sources (push) Has been cancelled
Check Strings / check-strings (push) Has been cancelled
Automatic translation update for Jun 13

Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/4091
Reviewed-by: Lizzie <lizzie@eden-emu.dev>
Reviewed-by: MaranBr <maranbr@eden-emu.dev>
2026-06-13 18:35:50 +02:00
MaranBr
eb8086a011
[buffer_cache] Fix Xenoblade Chronicles series (#4066)
Some checks are pending
tx-src / sources (push) Waiting to run
Check Strings / check-strings (push) Waiting to run
This fixes a bug introduced in the Xenoblade Chronicles series where some small elements would occasionally flicker on the screen.

Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/4066
Reviewed-by: crueter <crueter@eden-emu.dev>
Reviewed-by: Lizzie <lizzie@eden-emu.dev>
2026-06-13 01:06:57 +02:00
lizzie
4edb1ac6c5
[common/fs] create XDG_DATA_{HOME,CACHE,CONFIG}_HOME if we are the first application to ever be ran or they dont exist for a reason (#4087)
samu will be happy

basically this handles the edge case where either:
a) eden is the first application ever ran (i.e no config dirs made yet)
b) user didnt have them
c) user is trying to run on a sandbox appimage or whatever bs

Signed-off-by: lizzie <lizzie@eden-emu.dev>

Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/4087
Reviewed-by: crueter <crueter@eden-emu.dev>
Reviewed-by: MaranBr <maranbr@eden-emu.dev>
2026-06-12 23:55:09 +02:00
lizzie
3875093c70
[hle] Fixes for nxident, nxmp and nxplay, remove hbl.nsp workarounds (#3996)
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>
2026-06-12 23:48:24 +02:00
Eden CI
eaad33adcd
[dist, android] Update translations from Transifex for Jun 09 (#4073)
Some checks are pending
tx-src / sources (push) Waiting to run
Check Strings / check-strings (push) Waiting to run
Automatic translation update for Jun 09

Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/4073
2026-06-09 23:32:44 +02:00
crueter
3e31831cb0
[externals] UCRT64 support (#4035)
Testing which deps can't cross MSVCRT/UCRT barriers

- openssl
- Qt

FFmpeg and Sirit are fine--likely don't use the C99 APIs that MSVCRT is missing?

Closes #4022

Signed-off-by: crueter <crueter@eden-emu.dev>
Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/4035
2026-06-09 21:41:50 +02:00
lizzie
5ba3ae32dc
[hle/sockets] fix crash when socket() isn't initialized but send()/recv() are called (#3729)
Some checks failed
tx-src / sources (push) Has been cancelled
Check Strings / check-strings (push) Has been cancelled
the correct behaviour would be for the hle service NOT to crash

Signed-off-by: lizzie <lizzie@eden-emu.dev>

Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/3729
Reviewed-by: Maufeat <sahyno1996@gmail.com>
Reviewed-by: MaranBr <maranbr@eden-emu.dev>
2026-06-06 03:54:55 +02:00
BoiledElectricity
470d43df6d
[hid_core] fix bounds-check aruid index in GetControllerFromNpadIdType (#4064)
Some checks are pending
tx-src / sources (push) Waiting to run
Check Strings / check-strings (push) Waiting to run
GetIndexFromAruid returns AruidIndexMax as the “not found” value, but both
GetControllerFromNpadIdType overloads were using that value to index
controller_data without checking it first.

when a game routes through DisconnectNpad before its applet resource is
registered, we can end up indexing past the end of controller_data. That seems
to be what was crashing some games on launch, especially on macOS and Android,
where the out-of-bounds read is less likely to just slide by unnoticed.

So yeah, AruidIndexMax is a sentinel, not a real controller_data index, so we
should not treat it like one.

  Fixes: https://github.com/eden-emulator/Issue-Reports/issues/438
  Fixes: https://github.com/eden-emulator/Issue-Reports/issues/439

Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/4064
Reviewed-by: Lizzie <lizzie@eden-emu.dev>
Reviewed-by: MaranBr <maranbr@eden-emu.dev>
2026-06-05 19:26:21 +02:00
bdm110
fb6330645a
[file_sys] Avoid crash on empty NACP language entries (#4062)
This fixes an Android game library scan crash when reading XCI title metadata with empty or incomplete NACP language entries.

Previously, NACP::GetLanguageEntry() could fall back to:

language_entries.at(static_cast<u8>(Language::AmericanEnglish))

When language_entries was empty, this threw std::out_of_range and aborted the Android scan thread.

The new fallback preserves the existing lookup order:
1. preferred language entry with non-empty application name
2. any entry with non-empty application name
3. first available entry
4. static empty LanguageEntry if no entries exist

Tested locally with a Mainline RelWithDebInfo APK on Odin3 Android 15 using a large external TF-card ROM directory. The previous build crashed during fresh ROM scan; the patched build completes scanning normally.

Related my issue:
https://github.com/eden-emulator/Issue-Reports/issues/500

Co-authored-by: bdm110 <bdm110@prontmail.com>
Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/4062
Reviewed-by: Lizzie <lizzie@eden-emu.dev>
Reviewed-by: MaranBr <maranbr@eden-emu.dev>
Reviewed-by: crueter <crueter@eden-emu.dev>
2026-06-05 17:20:24 +02:00
Yang Liu
48219f348c
[dynarmic, loongarch64] Add minimal toy implementation enough to execute LSLS (#4054)
Some checks are pending
tx-src / sources (push) Waiting to run
Check Strings / check-strings (push) Waiting to run
Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/4054
Reviewed-by: Lizzie <lizzie@eden-emu.dev>
Reviewed-by: crueter <crueter@eden-emu.dev>
2026-06-05 02:32:06 +02:00
crueter
661346503b
[net] Add support for future macOS PGO shenanigans (#4050)
Rudimentary tests showed that using PGO on macOS *does* have an
appreciable impact on performance. So we're probably going to introduce
it soon.

Signed-off-by: crueter <crueter@eden-emu.dev>
Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/4050
Reviewed-by: Lizzie <lizzie@eden-emu.dev>
2026-06-05 02:24:26 +02:00
lizzie
ce9c7c196d
[cmake] fix OpenSSL not using <openssl/cert.h> when applicable because it tries to use the system one instead of being explicitly linked (#4053)
should fix hiccups with self-built OpenSSL

Signed-off-by: lizzie <lizzie@eden-emu.dev>

Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/4053
Reviewed-by: crueter <crueter@eden-emu.dev>
Reviewed-by: MaranBr <maranbr@eden-emu.dev>
2026-06-04 19:39:09 +02:00
crueter
efc7472330
[cmake] Bump minimum version to 3.31 (#4055)
Ubuntu 24.04 can't hurt us anymore.

Some other deps may have their versions raised, but there's not much of
an incentive so we'll keep it as is for now.

Signed-off-by: crueter <crueter@eden-emu.dev>
Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/4055
Reviewed-by: Lizzie <lizzie@eden-emu.dev>
Reviewed-by: MaranBr <maranbr@eden-emu.dev>
2026-06-04 15:28:39 +02:00
Duncan Ogilvie
aadcc24aac
[core/debugger] Protocol-compliant vCont support (#3896)
Some checks are pending
tx-src / sources (push) Waiting to run
Check Strings / check-strings (push) Waiting to run
(gdb) set scheduler-locking on
(gdb) continue

As discussed in #3848, follow-up to implement vCont support according to spec.

Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/3896
Reviewed-by: Lizzie <lizzie@eden-emu.dev>
Reviewed-by: crueter <crueter@eden-emu.dev>
2026-06-04 05:49:23 +02:00
lizzie
89199f4d27
[*] basic in-house cpp linting (#4039)
- add `#pragma once` to remainder files
- "correcter" defines (ANDROID), see https://groups.google.com/g/android-ndk/c/cf9_f1SLXls
- extra miscelly fixups

Signed-off-by: lizzie <lizzie@eden-emu.dev>

Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/4039
Reviewed-by: MaranBr <maranbr@eden-emu.dev>
Reviewed-by: crueter <crueter@eden-emu.dev>
2026-06-04 05:49:07 +02:00
lizzie
978d9d935d
[vk/vma] force ANV to have HOST_CACHED stream buffers (#3792)
Signed-off-by: lizzie <lizzie@eden-emu.dev>
Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/3792
Reviewed-by: MaranBr <maranbr@eden-emu.dev>
Reviewed-by: crueter <crueter@eden-emu.dev>
2026-06-04 05:48:41 +02:00
lizzie
ad9af25027
[dynarmic] fix pre-SSE4.1 having errors on CMHI/CMLO, fix extra nuisances and add INTERP testcase (#4025)
does a bit of code dedup
fixes pre-SSE4.1 having horrific CMHI/CMLO

Signed-off-by: lizzie <lizzie@eden-emu.dev>

Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/4025
Reviewed-by: crueter <crueter@eden-emu.dev>
Reviewed-by: MaranBr <maranbr@eden-emu.dev>
2026-06-03 22:53:21 +02:00