- [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 [Coding Guidelines](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/policies/Coding.md) to the best of my ability.
-------------------
This is intended to be a proper fix for the Ender Magnolia Shackled Beast's vaper NCE only crash.
Description of the issue: An NCE memory fault can occur while the GPU still has newer writes pending for that memory. The handler now checks for those writes before invalidating the CPU mapping. If any remain, it handles the guest instruction through the existing interpreter; otherwise, it invalidates the mapping and retries.
Also, the buffer cache tracks changes by page, while GPU writes may cover only part of a page. The change keeps tracking a page while GPU-written bytes remain and prevents fallback CPU uploads from overwriting those bytes.
I've tried to fix this via buffer readbacks upon NCE invalidation twice before, but that way we had always regressions in other games.
Now this is a proper handling which should low to no performance impact.
Tests:
-Endermag/Android: Stay on any save respite with Shackled Beast in party. That would usually crash the game;
-DKCR/Android: Stage 1 was being perf impacted on previous attempts. Now this approach should be ok.
-Overall performance checks.
Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/4604
Reviewed-by: lizzie <lizzie@eden-emu.dev>
Reviewed-by: crueter <crueter@eden-emu.dev>
Replaces nlohmann_json with the much faster and much less bloated [jacinth](https://github.com/crueter/jacinth), a JSON library I'm working on that essentially aims to be a lightweight wrapper around `yyjson` with extra C++23 sauce. It's not as fast as yyjson or glaze, but has a very nice API that allows for compile-time struct serialization *and* traditional nlohmann-like OOPery (plus to_json and from_json). Jacinth also exclusively exposes itself as a C++20 module, so consider that migration started
httplib has been replaced with the **much** smaller [Hydrocarbon](https://github.com/crueter/hydrocarbon) (which is <1500 LoC compared to 24k). It's a much cleaner API than httplib and doesn't depend on curl or anything else (besides openSSL). Insert joke about me NIHing everything here.
Auto updater has been reworked. Windows setup executables will have a system.txt that indicates this is a system install; that will just execute the exe directly (same as .dmg on macOS)
Zip files will instead:
- Ask the user if they want to keep the old one around in a different directory.
- Extracts the zip into a staging directory
- Close while detach-launching a thin helper shim executable that:
- Removes or renames the old application directory in accordance with the user's choice
- Renames the staging directory to the current directory name
- Launches and detaches the *new* eden.exe in the background.
So to the user it looks like: download, extract, new Eden launches, yay.
Alongside all of these changes, I had to make a bunch of CMake changes to bring this project up to be modules-compatible. Consider it a bonus.
Assisted-by: Local Ornith-1.5-35B (fixing a few nonsensical build errors)
Signed-off-by: crueter <crueter@eden-emu.dev>
- [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.
-------------------
Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/4412
Reviewed-by: lizzie <lizzie@eden-emu.dev>
I wanted to debug an ARM32 guest application using gdb-stub, which did not work: After using watchpoints, or software breakpoints the program cannot be resumed.
The following PR fixes those issues seen so I can properly use gdb. I used two separate commits, but can squash them if you like.
**Elision of in-block register saving**
Contrary to [the A64 path](https://git.eden-emu.dev/eden-emu/eden/src/commit/7a6d055094846b7787f9b8c0f238c0c68709f632/src/dynarmic/src/dynarmic/ir/opt_passes.cpp#L1468), for A32 guests, `conf.check_halt_on_memory_access` is not considered when deciding to use `GetSetElimination`. This destroys the register state when using watchpoints (which utilizes dynarmics `MemoryAbort`).
A test is added to verify correct behavior.
**Improper invalidation of Eden's internal caching**
Eden's internal caching of single guest code pages does not properly invalidate the CodePage when `InvalidateCacheRange` is called. This issue is present in both, A32 and A64 variants. Thus, when gdb modifies the guest code back to contain the original instruction after hitting a breakpoint this code is not retranslated and we can not continue from the breakpoint.
Unfortunately adding a test for this is harder as it depends on the interaction: write memory -> `InvalidateCacheRange` -> assert next `MemoryReadCode` returns new bytes. Which I think can't be constructed without a real process + memory subsystem.
The two changes for this issue are quite minimal, that is why I hope to get by without a test. I added an equivalent A32/test_invalidation.cpp, which did not exist compared to A64, but this does not cover Edens caching mechanic.
Assisted-by: kiro-cli (no specific model/auto mode used) (issue analysis, writing the tests)
- [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 [Coding Guidelines](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/policies/Coding.md) to the best of my ability.
- [x] I have read and followed the [website policy](https://git.eden-emu.dev/eden-emu/site-policy).
- [x] I affirm that the content of this pull request body was written and submitted entirely by me, in my own words, and not by an AI agent or LLM.
- [ ] I affirm that I did not read any of this, and understand that my pull request will be closed if I check this box.
- [x] I affirm that, by submitting this pull request, I am responsible for all of the changes contained within these commits.
-------------------
Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/4620
Reviewed-by: crueter <crueter@eden-emu.dev>
- [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 [Coding Guidelines](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/policies/Coding.md) to the best of my ability.
- [x] I have read and followed the [website policy](https://git.eden-emu.dev/eden-emu/site-policy).
- [ ] I affirm that the content of this pull request body was written and submitted entirely by me, in my own words, and not by an AI agent or LLM.
- [ ] I affirm that I did not read any of this, and understand that my pull request will be closed if I check this box.
- [x] I affirm that, by submitting this pull request, I am responsible for all of the changes contained within these commits.
-------------------
Seven dynarmic fixes, one commit each with a test that fails without it, after a first commit that makes `dynarmic_tests` build again:
- Tests don't build on master: #4513's SM3/SM4 tests call `SM4E` with three operands and `SM3PARTW1/W2` with four (they take two and three), which oaknut 2.0.3 rejects. Only the calls change; the expected values were already right (checked against the Arm pseudocode).
- A32 SHA-1 (`SHA1C/P/M/H/SU0/SU1`) was never translated.
- `CLZ` (16-bit lanes) on AVX-512 got lanes 4-7 wrong.
- 32-bit `SDIV` by zero on x64 returned the dividend instead of 0.
- `FRINT` through the soft-float fallback read the rounding mode and exactness one byte off.
- `SQSHLU` on x64 didn't saturate 8/16-bit lanes and cut 64-bit lanes to 32 bits.
- `SM4E`/`SM4EKEY` on x64: `lea` with the S-box's absolute address throws in Xbyak in a PIE build, so #4513's `A64: SM4` aborts.
- `FCVTZS`/`FCVTZU` (vector) `#64` without SSE4.1 called a null thunk. To reach it on a modern CPU, `DYNARMIC_HOST_FEATURE_OVERRIDE` (CMake option, off by default) lets `DYNARMIC_HOST_FEATURES=<hex mask>` hide host features in test builds, and ctest also runs the suite as SSE2-only.
Tested on Linux x86_64 (AVX-512), each case alone on master (7a6d055094) with these tests, then this PR:
| | master + these tests | this PR |
|---|---|---|
| A32 SHA-1 (2 cases), `A64: SM4` | abort | pass |
| SDIV/UDIV by zero (A32, A64), VRINTX/VRINTA, FRINT, SQSHLU, `A64: CLZ` | fail | pass |
| FCVTZS/FCVTZU `#64` | passes (SSE4.1 path) | passes |
| whole suite | | 141 pass, 1 skipped (needs its variable); as SSE2-only, all 142 pass |
Assisted-by: Claude Opus 5.5 (Aogo) (wrote the patches and tests, rebased them, ran the checks above and wrote this description)
Co-authored-by: AO55 <AO55@reden-emu.dev>
Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/4598
Reviewed-by: lizzie <lizzie@eden-emu.dev>
- [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 [Coding Guidelines](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/policies/Coding.md) to the best of my ability.
- [X] I have read and followed the [website policy](https://git.eden-emu.dev/eden-emu/site-policy).
- [X] I affirm that the content of this pull request body was written and submitted entirely by me, in my own words, and not by an AI agent or LLM.
- [ ] I affirm that I did not read any of this, and understand that my pull request will be closed if I check this box.
- [X] I affirm that, by submitting this pull request, I am responsible for all of the changes contained within these commits.
-------------------
The NCE interpreter code was incorrectly handling register 31 Zero Register commands (SetReg(ZR) and GetReg(ZR)) as stack pointers, which was causing a freeze in XBC1:DE with NCE and PR !4604 because it runs GPU pages through the interpreter, when before they were being invalidated and this issue would not appear.
The fix changes the behavior of the NCE interpreter to ignore SetReg(ZR) and return 0 for GetReg(ZR), which corrects this behavior, while leaving the SP behavior is unchanged.
Tested on Linux (Radeon 6900 XT, Garuda Linux) built from latest master branch with !4604 and this fix applied on top, and an AYN Thor Pro 12GB with the same build configuration.
Xenoblade Chronicles: DE ran as expected and no longer froze, crashed or broke the textures/lighting when closing out of the equipment menu. Reactive flushing causes a slowdown in the menu after exiting the equipment menu, but also fixes the issue with the save file thumbnail when using NCE. Performance also appeared unaffected when running without reactive flushing enabled.
Patch files attached for testing.
Assisted-by: Claude Opus 5.5 (diagnosis, implementation)
Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/4631
Reviewed-by: crueter <crueter@eden-emu.dev>
- [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 [Coding Guidelines](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/policies/Coding.md) to the best of my ability.
- [x] I have read and followed the [website policy](https://git.eden-emu.dev/eden-emu/site-policy).
- [x] I affirm that the content of this pull request body was written and submitted entirely by me, in my own words, and not by an AI agent or LLM.
- [ ] I affirm that I did not read any of this, and understand that my pull request will be closed if I check this box.
- [x] I affirm that, by submitting this pull request, I am responsible for all of the changes contained within these commits.
-------------------
**Problem**:
Games with very large guest basic blocks (>30,000 instructions, e.g., NBA 2K26) caused out-of-line conditional branches (deferred_emits via B.cond/CBZ) to exceed the ±1 MiB limit, triggering oaknut::OaknutException("out of range") and an abort trap. Additionally, SIGN_BIT in page_table.h was set to 57 instead of 55 (44 + 12 - 1), causing a mismatch with ATTRIBUTE_MASK.
**Solution**:
• Added periodic FlushDeferredEmits (64 KB threshold) behind unconditional jumps to ensure out-of-line branches always remain within a valid range.
• Added a handled CodeBufferExhausted exception that triggers a cache flush (ClearCache()) and transparent IR re-emission in address_space.cpp.
• Aligned SIGN_BIT to 55 in page_table.h.
Assisted-by: Claude Opus/Fable
### 🔗 Related Changes
* Co-developed with !4660
Co-authored-by: Nicola <nicola@local>
Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/4659
Reviewed-by: lizzie <lizzie@eden-emu.dev>
## Summary
Automatic controller assignment for Eden, aimed at couch co-op and handheld PCs (Steam Deck,
Legion Go, ROG Ally, AYN Odin), plus a set of fixes for running Eden in Steam's Game Mode
(gamescope) and under Steam Input.
## Controller Assignment Handler
Settings > Controls gains a **Controllers** tab. The handler is a segmented choice:
| Handler | Behaviour |
|---|---|
| **Modern Console** | Automatic: each controller that connects becomes the next player (up to 8). |
| **Manual** (default) | Players are set in each player's tab, as before. Its Controller Applet choice: **Disabled**, **Custom Frontend** or **Real Hardware** (the console's own applet, LLE). |
Under Modern Console, **Portable Handheld Gaming Device with Built-in Controller** (on/off)
makes external controllers take the players first, with the handheld's own controls used only
when none is connected.
In the automatic modes:
- Players follow their controllers across reconnects: a controller that leaves keeps its player
for 45 seconds and takes it back when it returns. Each controller keeps its own mappings when
it changes player, for the session.
- At most eight players; a ninth controller waits until a player is free.
- The user's saved controller setup is never rewritten; remaps made in the Controls tab last for
the session, and input profiles are what persist.
- Input profiles can be picked or removed per player, from the Controllers tab or each player tab.
- A controller whose player has no controller mappings (a fresh setup) gets its default mapping.
A DSU (cemuhook) motion binding from the manual setup is kept, for handhelds whose own gyro
needs it.
## Gameplay options
- **Pause When a Controller Disconnects** (on by default): the game pauses when a player's
controller is turned off, or has been gone for 3 seconds, and resumes when a controller takes
that player again. Pressing + on another controller goes on without it.
- **Use Any Controller as Joy-Cons**: a game that only takes Joy-Cons gets them automatically
(dual, or a single sideways one with the buttons arranged to fit).
- **Button Layout**: By Position or By Label, for Xbox and PlayStation style controllers.
- **Player Lights**: controllers that have them show their player number.
## Controllers tab and player tabs
- Connected Players: each player with its controller and battery, profile picker, Swap, Config,
Turn Off (Bluetooth), reorder arrows, drag to swap, and click to rumble. Controllers can be
given a name for the session.
- Assign Handheld Controller: auto-detect, or pick/Identify the handheld's own pad.
- P1-P8 tabs show each player's battery and can be dragged or moved with arrows to change the
player order.
- In Modern Console the Controllers and player tabs use a modern card layout that follows the
light and dark themes, including the system's dark mode (macOS).
## On-screen display
- **Controller Overlay** (View menu, Ctrl+Shift+V): players, their controllers and batteries,
and each player's recent buttons, including stick moves (LS/RS) and clicks (L3/R3). How many
inputs are kept and for how long can be set.
- **Controller Hints**: names a controller in the bottom-left corner when it joins or leaves
a player, and says when the game pauses for a disconnected one. Works without the overlay.
Both are drawn into the presented frame as crisp overlay panels (not scaled with the game, not
in screenshots), so they show inside gamescope.
## Steam Input and gamescope fixes
- **Native gyro under Steam Input.** Steam's virtual pads carry no motion sensors. Eden now opens
the real motion-capable controller behind each virtual pad for its sensors only (Steam Deck,
Steam Controller incl. the 2026 model, Sony, Nintendo), and turns on the Deck's IMU, which
Steam keeps off unless the layout uses the gyro. No DSU server or Steam layout change needed.
- **Bypass Steam Input** (Controllers tab, shown when launched through Steam): Eden opens the
real controllers itself instead of Steam's virtual pads.
- **Controller identity under Steam.** All virtual pads share one GUID and Steam moves physical
controllers between them; controllers are tracked by their Steam handle and slot instead.
- **Handheld detection under Steam.** The Deck's own controls are recognised behind Steam Input
without mistaking standalone controllers (e.g. the Steam Controller) for them.
- **Windows no longer rescale on hover in Game Mode.** gamescope scales a window to fit the
screen together with any tooltip reaching past it, so the main window and Settings grew and
shrank on hover. Under gamescope they now fill the screen.
- **VSync modes in Game Mode.** gamescope offers only some present modes, so Immediate and FIFO
Relaxed vanished silently. They are now listed greyed out with a tooltip pointing to Steam's
Disable Frame Limit and Allow Tearing settings.
- **Stick range testers on small screens.** The controller drawing scales down to fit on
800-pixel screens instead of cutting off the stick range circles.
- **Midnight Blue themes.** A hovered menu-bar item is readable again, and hovered tabs no longer
change size (which made the Settings tabs shake).
## Fixes
- Crash when HID received a controller update before NPad's applet resource was set up.
## Testing
Tested on a Steam Deck (Desktop and Game Mode, direct and Steam launches) with Xbox
controllers, plus a stress test with up to 10 virtual controllers connecting, disconnecting and
pressing at random in both automatic modes (no assignment errors, never more than 8 players,
disconnect pauses resume as expected).
## AI disclosure
Developed with Claude Opus 5.5 (implementation and debugging). I reviewed, tested and can
explain every change.
- [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.
---
Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/4583
Reviewed-by: CamilleLaVey <camillelavey99@gmail.com>
- [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 [Coding Guidelines](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/policies/Coding.md) to the best of my ability.
- [x] I have read and followed the [website policy](https://git.eden-emu.dev/eden-emu/site-policy).
- [ ] I affirm that the content of this pull request body was written and submitted entirely by me, in my own words, and not by an AI agent or LLM.
- [ ] I affirm that I did not read any of this, and understand that my pull request will be closed if I check this box.
- [x] I affirm that, by submitting this pull request, I am responsible for all of the changes contained within these commits.
-------------------
Problem
When opening a file in a BCAT directory, Eden validated the file name using the directory validation rules. As a result, valid file names containing '.' (e.g. "VSSetting_0.byaml") were incorrectly rejected.
Fix
Use VerifyNameValidFile instead of the directory validation routine when validating file names.
Test
Verified with Splatoon 2. Files such as "VSSetting_0.byaml" could not be opened before the change and now open successfully.
Co-authored-by: Dmr77680 <dmr77680@noreply.git.eden-emu.dev>
Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/4625
Reviewed-by: crueter <crueter@eden-emu.dev>
Reviewed-by: lizzie <lizzie@eden-emu.dev>
Nitter has been taken down, Link has been reverted to X.
Updated driver recommended to T30 for Adreno 711- 899 and T29 for 700 - 710.
Fixed Build guide for android via terminal, Due to new android SDK suffox.
- [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 [Coding Guidelines](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/policies/Coding.md) to the best of my ability.
- [X] I have read and followed the [website policy](https://git.eden-emu.dev/eden-emu/site-policy).
- [X] I affirm that the content of this pull request body was written and submitted entirely by me, in my own words, and not by an AI agent or LLM.
- [ ] I affirm that I did not read any of this, and understand that my pull request will be closed if I check this box.
- [X] I affirm that, by submitting this pull request, I am responsible for all of the changes contained within these commits.
-------------------
Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/4617
Reviewed-by: crueter <crueter@eden-emu.dev>
thanks to @chrelliott978 for the initial impl, basically clang will yell at you if you dare use wstring_codecvt<> and some other shit, and to be fair one day it will be removed because it's deprecated (but it's c++, we know it will NEVER be deprecated)
either way this makes clang shut up
untested at all
Signed-off-by: lizzie <lizzie@eden-emu.dev>
Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/3773
Reviewed-by: crueter <crueter@eden-emu.dev>
main idea is basically to manually manage the file backed storage ourselves
basically the libc will use pooled workes who will read off sync data and may or may not use mmap, this detail can vary between libcs, so id rather have one unified concept of "paged file" as opposed to relying on the libc doing what it should
the main benefit is that one doesnt need to call fwrite/fread or whatever, they can just do normal paged file ops and such
this pr has seen changes from mapped flags as well, as some OSes; particularly android, do not enjoy being told to make hugepages that are 1GB in size, especially for lower end devices.
Signed-off-by: lizzie <lizzie@eden-emu.dev>
Co-authored-by: Caio Oliveira <caiooliveirafarias0@gmail.com>
Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/3151
Reviewed-by: MaranBr <maranbr@eden-emu.dev>
Reviewed-by: crueter <crueter@eden-emu.dev>