Commit Graph
3900 Commits
Author SHA1 Message Date
KeatonTheBot 58f9b6106f Upgrade Android Gradle Plugin to 9.3.1, Gradle to 9.6.1, update dependencies 2026-08-12 21:47:51 -05:00
KeatonTheBot 5422aa35b9 Fix errors in 88cef7e8: misc: chore: Use explicit types & fix object creation 2026-08-12 15:45:13 -05:00
gdkchan 8ccf83d9a3 Prevent waits with zero timeout on Turnip 2026-08-12 14:00:36 -05:00
avan 2eecc18dc7 Reject texture descriptors with unmapped addresses
Fix an "Invalid texture format 0x25A5A (sRGB: True)" error that occurs when running OCTOPATH TRAVELER 0.

The game may leave texture descriptor heap entries filled with 0x5A. Interpreting such uninitialized entries as valid texture descriptors produces an invalid format and causes texture creation to proceed with garbage descriptor data.

Validate the texture address before decoding the descriptor. Descriptors with a zero or unmapped address are marked as invalid and skipped. The invalid state is cleared when the corresponding texture pool entry is modified, allowing the descriptor to be evaluated again.
2026-08-12 13:57:34 -05:00
avan 3ceca9c381 Fix shadow state handling for blend enable updates
Incorrect rendering was observed during loading transitions in Trails in the Sky 1st Chapter. Testing showed that routing the first render target's RT0 BlendEnable transition from disabled to enabled through the normal register write path prevented the issue.

Further investigation found that the normal register write was restoring Shadow RAM behavior that was missing from UpdateBlendEnable.

UpdateBlendEnable uses a fast bulk update path instead of issuing a normal register write for each render target. As a result, it bypasses the Shadow RAM handling provided by DeviceStateWithShadow.WriteWithRedundancyCheck.

A normal register write updates both State and ShadowState in MethodTrack and MethodTrackWithFilter modes. In MethodReplay mode, it ignores the incoming value and restores the value previously stored in ShadowState to State.

UpdateBlendEnable must reproduce the same behavior while retaining its bulk comparison and copy path. In track modes, copy the incoming enable values to shadowState. In replay mode, copy shadowState to the incoming enable span, then let the existing comparison and copy logic update state and mark BlendState dirty when necessary.

The original implementation incorrectly used state for both track and replay handling. This prevented Shadow RAM from correctly recording or replaying BlendEnable values, which could cause rendering state synchronization errors.

Correct the bulk update path to use ShadowState for tracking and replay. This preserves the optimized bulk operation while addressing the underlying issue without requiring an RT0-specific compatibility workaround.

(cherry picked from commit 733bd0951b)
2026-08-12 13:57:34 -05:00
avan a4412346a7 Add raw copy dependencies for incompatible textures
Trails in the Sky 1st uses texture descriptors with different formats and dimensions that map to the same region of guest GPU memory. For example, the game interprets the same underlying data as both an R32Uint 2x1 texture and an R32G32Float 1x1 texture. Both textures have an 8-byte logical payload, but their texel formats and dimensions are different.

Ryubing cannot represent these two descriptors as normally compatible texture views, so it creates separate host texture objects for them. Since these host textures represent the same guest memory, a modification made to one of them should become visible to the other before the other texture is read. However, the existing synchronization mechanism does not fully handle this situation.

The game uses this pattern for its exposure or brightness history. A compute shader first writes the updated exposure data to the R32G32Float 1x1 host texture. A later operation then reads the raw bits of the same data through the R32Uint 2x1 host texture. The original Ryubing implementation did not synchronize the contents of these two separate host textures. As a result, the reading texture received stale zero values, which caused the shader to calculate an incorrectly low exposure value and made the rendered image appear too dark.

TextureGroup already has a guest-memory synchronization mechanism for incompatible overlaps. When _flushIncompatibleOverlaps is enabled, the most recent texture contents are written back to guest memory, after which the other texture reloads the data. However, this mechanism was primarily enabled through IsFormatHostIncompatible, which checks whether an individual texture format can be correctly supported by the host GPU.

In this case, both R32Uint and R32G32Float are individually supported by the host GPU. Therefore, IsFormatHostIncompatible does not enable this synchronization path. The issue is not that either format is unsupported. The issue is that two individually supported aliases, represented by separate host textures, do not maintain coherent contents.

In theory, the latest contents could be flushed to guest memory immediately after every GPU write to a host texture, allowing other textures that map to the same guest memory to reload the updated data. However, doing so could frequently trigger expensive operations such as GPU waits, data readbacks, guest texture layout conversions, and memory-tracking updates. This would be particularly costly for textures that are updated every frame or during every compute dispatch.

For this reason, the fix does not require an immediate flush after every write. Instead, it extends Ryubing's existing TextureDependency and TextureGroupHandle mechanisms. When two fully incompatible textures map to exactly the same guest memory and satisfy a strict set of raw-copy requirements, the program creates a raw-copy dependency between them.

When the source texture is modified, the target texture is only marked as requiring a raw copy. The latest logical raw bytes are copied from the source only when the target texture is actually about to be used. This keeps the contents of the separate host texture aliases coherent while avoiding unnecessary round trips through guest memory.
2026-08-12 13:57:33 -05:00
KeatonTheBot b0eb271b5b SDL: Update game controller database on launch
- Downloads updated gamecontrollerdb.txt file on launch, only updates when a new file is available. This keeps the database updated between SDL releases.

(cherry picked from commit 0657b00622)
2026-08-12 13:57:33 -05:00
KeatonTheBot 88cef7e853 misc: chore: Use explicit types & fix object creation 2026-08-12 13:57:33 -05:00
Renovate Bot 69c088004a Update dependency Ryujinx.SDL3-CS to 2026.707.0 (#16)
This PR contains the following updates:

| Package | Change | [Age](https://docs.renovatebot.com/merge-confidence/) | [Confidence](https://docs.renovatebot.com/merge-confidence/) |
|---|---|---|---|
| [Ryujinx.SDL3-CS](https://github.com/Kenji-NX/SDL3-CS) | `2026.501.0` → `2026.707.0` | ![age](https://developer.mend.io/api/mc/badges/age/nuget/Ryujinx.SDL3-CS/2026.707.0?slim=true) | ![confidence](https://developer.mend.io/api/mc/badges/confidence/nuget/Ryujinx.SDL3-CS/2026.501.0/2026.707.0?slim=true) |

---

### Release Notes

<details>
<summary>Kenji-NX/SDL3-CS (Ryujinx.SDL3-CS)</summary>

### [`v2026.707.0`](https://github.com/Kenji-NX/SDL3-CS/compare/2026.501.0...2026.707.0)

[Compare Source](https://github.com/Kenji-NX/SDL3-CS/compare/2026.501.0...2026.707.0)

</details>

---

### Configuration

📅 **Schedule**: (UTC)

- Branch creation
  - At any time (no schedule defined)
- Automerge
  - At any time (no schedule defined)

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box

---

This PR has been generated by [Mend Renovate](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0My4yNDkuNSIsInVwZGF0ZWRJblZlciI6IjQzLjI0OS41IiwidGFyZ2V0QnJhbmNoIjoibWFzdGVyIiwibGFiZWxzIjpbXX0=-->

Reviewed-on: https://git.ryujinx.app/projects/Kenji-NX/pulls/16
2026-08-12 13:53:19 -05:00
KeatonTheBot d3bd888885 Fix MemoryMap/MemoryUnmap/MemoryProtect in UnicornAArch32 and UnicornAArch64
(cherry picked from commit b362f837c5)
2026-08-12 13:52:41 -05:00
LotP b615f50701 fix-tests
- downgrade unicorn to last working version
- update to new cp reg struct system
- remove nonexistent register (used to silently continue)
- fix partial unmap tests
    - InitializeSignalHandler() was moved out of the translator (almost 2.5 years ago), but the test code was never updated to manually call the function as it was changed to do in the real cpu context, so the tests just started failing.
    - by manually initializing the handler we no longer cause tests to fail.
2026-08-12 13:52:41 -05:00
Renovate Bot d5524be27a Update dependency Ryujinx.Audio.OpenAL to 1.25.2 (#8)
This PR contains the following updates:

| Package | Change | [Age](https://docs.renovatebot.com/merge-confidence/) | [Confidence](https://docs.renovatebot.com/merge-confidence/) |
|---|---|---|---|
| Ryujinx.Audio.OpenAL | `1.25.1` → `1.25.2` | ![age](https://developer.mend.io/api/mc/badges/age/nuget/Ryujinx.Audio.OpenAL/1.25.2?slim=true) | ![confidence](https://developer.mend.io/api/mc/badges/confidence/nuget/Ryujinx.Audio.OpenAL/1.25.1/1.25.2?slim=true) |

---

### Configuration

📅 **Schedule**: (UTC)

- Branch creation
  - At any time (no schedule defined)
- Automerge
  - At any time (no schedule defined)

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box

---

This PR has been generated by [Mend Renovate](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0My4xNzguMCIsInVwZGF0ZWRJblZlciI6IjQzLjE3OC4wIiwidGFyZ2V0QnJhbmNoIjoibWFzdGVyIiwibGFiZWxzIjpbXX0=-->

Reviewed-on: https://git.ryujinx.app/projects/Kenji-NX/pulls/8
2026-07-15 11:27:21 -05:00
LotPandLotP1 43b4f3bf12 check for HandleDesc
HandleDesc can be null, make sure to check for that.

Co-authored-by: LotP1 <68976644+LotP1@users.noreply.github.com>
2026-07-15 11:27:06 -05:00
Xam 8d7d8f344c HLE: Applets: Software keyboard: update cursor position on SetInputText
fixes cursor being at 0 position even when text is present, especially annoying for handheld devices with kde virtual keyboard, which is pretty bad, with no way to move the cursor or delete text backward
2026-05-27 18:18:42 -05:00
Babib3l 047dbf3db7 River : HLE: Make process identity explicit for service metadata resolution
This PR is the first in a batch of structural changes to Ryujinx.

**Changes**

- Added `ProcessIdentity` and `ProcessKind` to describe loaded programs by:
  - PID, program ID, application ID, program index, display version, process kind
- Stored identity metadata on `ProcessResult`.
- Added PID-based process lookup helpers to `ProcessLoader`.
- Updated HLE services to resolve application metadata through the caller PID instead of `Processes.ActiveApplication`.
- Added PTC/JIT disk cache initialization logging with PID, title ID, display version, selector, and enabled state.
- Added `ClientProcessId` property to ServiceCtx (/src/Ryujinx.HLE/HOS/ServiceCtx.cs) that uses the handle descriptor PId when available, falling back to `Process.Pid`.
- Updated 15 HLE service files to use `context.ClientProcessId` instead of `context.Process.Pid` for client process access, ensuring services correctly identify the calling process even when invoked via IPC with handle descriptors.

These changes make service metadata resolution more explicit and prepare the emulator for other structural changes later on.
2026-05-27 18:18:36 -05:00
Mabel d0f0007421 Fix Clipboard Copy Operation Crash
Fixes a COM exception crash related to clipboard copy events from changes in Avalonia 11.3

Solves [Ryubing/Issues#294](https://github.com/Ryubing/Issues/issues/294) caused by Avalonia 11.3's changes, see [AvaloniaUI/Avalonia#20007](https://github.com/AvaloniaUI/Avalonia/issues/20007) for more information

I've only tested this on Windows, no idea if this has issues in MacOS or Linux, or if it's even a problem there at all.
2026-05-27 18:18:28 -05:00
LotP 60e553bffa remap joy-cons 2026-05-27 18:18:20 -05:00
KeatonTheBot a8a23b6b2c Revert fix buffer destroy before submit changes (VertexBufferState.cs & VertexBufferUpdater.cs) from 'Fix Vulkan validation errors' 2026-05-17 00:30:34 -05:00
AsperTheDogandAsperTheDog e0f6e207e8 Fix Vulkan validation errors
This PR fixes several validation errors caused by invalid Vulkan usage. These validation errors often end up invoking Undefined Behavior on the driver side, which can lead to artifacts or crashes which are driver specific and otherwise incredibly hard to track. I don't think it should have any impact on performance, but it would be good to test it with as many games as possible (maybe a bug in a game was fixed?).

Each commit fixes an error. I added to each a description with the validation error that was fixed and a small explanation on what was causing it and how I fixed it.

Co-authored-by: AsperTheDog <guillerman0000@gmail.com>
2026-05-16 23:37:11 -05:00
KeatonTheBot 30ab86cb72 Upgrade Android Gradle Plugin to 9.2.1, Gradle to 9.5.1, update dependencies 2026-05-16 23:15:51 -05:00
AsperTheDogandAsperTheDog 2901f9b795 Change non-uniform shader extension to be more conservative
The previous fix for Tomodachi Life (#91) included the extension to all shaders, independently on if it was needed or not. This PR fixes that by lazily adding the extension only when it is actually needed.

This change should not be noticed by anyone, but it avoids having to modify shaders that do not perform any type of dynamic indexing, which apparently is something some modders care about.

Co-authored-by: AsperTheDog <guillerman0000@gmail.com>
2026-05-16 23:11:55 -05:00
Max b08b9eabe6 [HLE] Stub ILibrarySelfAccessor:ExitAndReturn (10) 2026-05-16 23:11:55 -05:00
AsperTheDogandAsperTheDog 83c65c2c06 Add shader non-uniform indexing support
This PR marks ALL texture indexes as nonuniform to fix an issue with the paths in Tomodachi Life: Living the Dream on AMD cards. It should have a negligible impact on performance (and it should not have an impact at all on NVIDIA cards!)

It's caused by what is called 'implicit non-uniform sampler array indexing'. The idea is basically that some GPUs optimize texture lookups from indexed texture arrays, by assuming that you are never going to index different textures within a single workgroup. What this causes is that visual glitch where a subgroup is tasked with rendering a block of the screen, and in the boundaries some cores are indexing the wrong texture.

Co-authored-by: AsperTheDog <guillerman0000@gmail.com>
2026-05-16 23:11:55 -05:00
cookieso 3a6ce7cd1e Input: Implement HD Rumble for compatible Nin devices
This PR addresses [this issue](https://github.com/Ryubing/Issues/issues/231) and implements HD Rumble for compatible Nin devices.
## New Features
- Add the option for Gamepads to implement HD Rumble
- Add the HD rumble capability to SDL3Gamepad and SDL3JoyCon when they meet certain requirements
2026-05-16 23:11:55 -05:00
Max 94cfe6930c Check if the Device is rendering before waiting on it
Fixes an issue where there were missed references and an ``OperationCancelled`` exception when exiting an application.
2026-05-16 23:11:55 -05:00
yell0wsuitandyell0wsuit 9a4bf8f94d [HLE] Match hardware screenshot buffer size behavior for captures
## Description

~~Fixes a fatal CLR crash when `caps` screenshot saving receives an input buffer larger than `0x384000`.~~

~~Resolves a crash in Tomodachi Life: Living the Dream where saving the pictures to the system's album crashes with 0x80131506.~~

Follow up to #18. This PR adjusts the validation and copy behavior to better match real hardware, and adds logging to make invalid screenshot buffer cases easier to diagnose.

Real hardware accepts screenshot buffers with a size greater than or equal to `0x384000`, but only `0x384000` bytes are needed for the 1280x720 RGBA image.

This changes screenshot saving to:

- reject buffers smaller than `0x384000`
- accept buffers equal to or larger than `0x384000`
- copy only the first `0x384000` bytes into the 1280x720 bitmap

## Testing

Tested with a real Switch NRO using `capssuSaveScreenShotEx0`, `capssuSaveScreenShotEx1`, and `capssuSaveScreenShotEx2`.

Observed hardware behavior:

```text
0x384000     => OK
0x384000 - 1 => NullInputBuffer
0x384000 + 1 => OK
0x3C0000     => OK // Tomo life picture size
```

Co-authored-by: yell0wsuit <5692900+yell0wsuit@users.noreply.github.com>
2026-05-16 23:11:55 -05:00
yell0wsuitandyell0wsuit d69d9c3b31 [HLE] Fix StoreData layout and implement IDatabaseService.Append
- Fixes `StoreData` layout/update handling so `UpdateLatest` returns the stored Mii data correctly.

- Implements `IDatabaseService.Append` (https://switchbrew.org/wiki/Shared_Database_services#IDatabaseService)

Also adds regression tests for `UpdateLatest` and `Append`.

(Might) fix Mario Kart 8 Deluxe crashing on first boot due to failed Mii verification check (due to custom Mii from emulator), and potentially Tomodachi Life: Living the Dream for the "Import Mii from system" option.

Co-authored-by: yell0wsuit <5692900+yell0wsuit@users.noreply.github.com>
2026-05-16 23:11:55 -05:00
Frosch d9da38c10b fix: gamepads have the same name
When connecting multiple controllers of the same model, the first device's name ends with (0), the second with (1), the third with (1), the fourth with (1), and so on. To ensure these names are truly unique, GetUniqueGamepadName is now called recursively.
2026-05-16 23:11:54 -05:00
Max ac699e430b [HLE] Implemented ILibraryAppletSelfAccessor:1
Needed for Tomodachi Life: Living the Dream (?)

based on [this](https://www.reddit.com/r/Ryubing/comments/1t4lfc9/comment/ok4e7tu/)
2026-05-16 23:11:54 -05:00
KeatonTheBot 89d7a5c45e UI: RPC: Asset images 2026-05-16 23:11:54 -05:00
Max 93d1eea58d UI: LoadGuestApplication asynchronous cancellation
Fixed LoadGuestApplication hanging when cancelled.
Since startup procedure has technically changed, we should consider testing this with a variety of game formats to ensure regressions do not occur.
2026-05-16 19:45:45 -05:00
KeatonTheBot ad8ab179d2 Update Ryujinx.SDL3-CS to 2026.501.0
- Fixes upstream SDL issue: Crash on Windows when a controller is connected
2026-05-16 19:45:15 -05:00
KeatonTheBot 18c6ec439b misc: Replace IntPtr/UIntPtr with nint/nuint 2026-05-16 18:42:48 -05:00
Xam f2ac50360e HLE: CaptureManager: SaveScreenShot: properly handle screenshot image data
no way this was working before, and if it did, just pure luck, unsafe blind copy of bytes as is and zero checks.

i only tested tomodachi, but should fix all games that were crashing on saving screenshots

the crash was happening because the screenshot buffer was bigger than the bitmap buffer, so marshall.copy() was raising an unhandhled expection crashing the emu.

on top of this, because the data was just copied as is, the result image was garbled.
2026-05-16 18:42:31 -05:00
LotP 8c42f306dd Fix Dual Joy-Con driver and InputView 2026-05-16 18:42:27 -05:00
KeatonTheBot d765d6daa6 Downgrade FluentAvalonia to 2.4.1 2026-05-16 18:41:56 -05:00
KeatonTheBotandMaki e7c720fd2c Update SDL2 to SDL3
- Fix: Crash when connecting a JoyCon

- Fix: Make controller GUIDs match old SDL2 GUIDs

- Fix: Detect face button layout for gamepads

Co-authored-by: Maki <77-maki@users.noreply.git.ryujinx.app>
2026-05-16 18:25:16 -05:00
KeatonTheBot f3a87af51d Use Forgejo badges 2026-05-16 17:27:40 -05:00
KeatonTheBot 1b9615983f Update GitLab references to Forgejo 2026-05-16 17:27:39 -05:00
sh0inx d040492b7a Update BiquadFilterEffectParameterTests.cs 2026-05-16 17:24:52 -05:00
LotP 05f7878699 Accurate Service Names
- Services now use their actual names when creating processes instead of the generic "Service".

- Services now use their names encapsulated in curly brackets for threads, e.g. {HID}, instead of the default "HLE.OsThread", making it easier to see what is actually happening behind the scenes. Client threads should use <> and host threads should use {}.

- Fixed a bug where initiating services would create extra unneeded servers.

This is part 1 of a series of service and Horizon changes i'm working on. More will follow at a later date.
2026-05-16 17:24:42 -05:00
KeatonTheBot 0d8bd2653b Vulkan: Enable VK_EXT_memory_priority for Pageable Memory to work properly 2026-04-01 09:10:46 -05:00
KeatonTheBot b7ffcb3be8 Update NuGet packages
* Avalonia to 11.3.13

* Svg.Controls.Avalonia group to 11.3.9.5

* FluentAvalonia to 2.5.0

* DynamicData to 9.4.31

* Gommon to 2.8.1.1

* Humanizer to 3.0.10

* Microsoft.NET.Test.Sdk to 18.3.0

* NUnit to 4.5.1

* NUnit3TestAdapter to 6.2.0

* Rxmxnx.PInvoke.Extensions to 2.9.0
2026-04-01 09:09:28 -05:00
KeatonTheBot 46c55ee79d UI: Restore FluentAvaloniaUI package, disable animations on app initialization
* Avalonia's built-in color picker is now used when selecting a firmware avatar
2026-04-01 08:58:49 -05:00
KeatonTheBot 6c1c05dc5d Android: Update to 2.1.0-pr.2 2026-03-27 13:21:36 -05:00
KeatonTheBot 637c8130a3 Optimize AutoDeleteCache code 2026-03-27 13:06:59 -05:00
KeatonTheBot 7781911baa Vulkan: Fix Adreno compatibility 2026-03-27 13:06:59 -05:00
KeatonTheBot bd3d4d0566 Add build variants/flavors 2026-03-27 13:06:59 -05:00
KeatonTheBot 63c7d2a0ee Tweak feedback loop restriction logic 2026-03-19 10:49:39 -05:00
Coxxs 5f40a22b0d HLE: Implement CreateContextForSystem
Implement nn::ssl::sf::ISslServiceForSystem -> CreateContextForSystem (100)

Ryujinx implements both ISslService and ISslServiceForSystem in one class so we can just return new ISslContext.

Also fixed the incorrect parameter reading order. (CreateContextForSystem basically has same params as CreateContext)
2026-03-14 23:00:03 -05:00