Experimental Nintendo Switch Emulator written in C#
Go to file
Mary 6cb22c9d38
Miria: The Death of OpenTK 3 (#2194)
* openal: Update to OpenTK 4

* Ryujinx.Graphics.OpenGL: Update to OpenTK 4

* Entirely removed OpenTK 3, still wip

* Use SPB for context creation and handling

Still need to test on GLX and readd input support

* Start implementing a new input system

So far only gamepad are supported, no configuration possible via UI but detected via hotplug/removal

Button mapping backend is implemented

TODO: front end, configuration handling and configuration migration
TODO: keyboard support

* Enforce RGB only framebuffer on the GLWidget

Fix possible transparent window

* Implement UI gamepad frontend

Also fix bad mapping of minus button and ensure gamepad config is updated in real time

* Handle controller being disconnected and reconnected again

* Revert "Enforce RGB only framebuffer on the GLWidget"

This reverts commit 0949715d1a03ec793e35e37f7b610cbff2d63965.

* Fix first color clear

* Filter SDL2 events a bit

* Start working on the keyboard detail

- Rework configuration classes a bit to be more clean.
- Integrate fully the keyboard configuration to the front end (TODO: assigner)
- Start skeleton for the GTK3 keyboard driver

* Add KeyboardStateSnapshot and its integration

* Implement keyboard assigner and GTK3 key mapping

TODO: controller configuration mapping and IGamepad implementation for keyboard

* Add missing SR and SL definitions

* Fix copy pasta mistake on config for previous commit

* Implement IGamepad interface for GTK3 keyboard

* Fix some implementation still being commented in the controller ui for keyboard

* Port screen handle code

* Remove all configuration management code and move HidNew to Hid

* Rename InputConfigNew to InputConfig

* Add a version field to the input config

* Prepare serialization and deserialization of new input config and migrate profile loading and saving

* Support input configuration saving to config and bump config version to 23.

* Clean up in ConfigurationState

* Reference SPB via a nuget package

* Move new input system to Ryujinx.Input project and SDL2 detail to Ryujinx.Input.SDL2

* move GTK3 input to the right directory

* Fix triggers on SDL2

* Update to SDL2 2.0.14 via our own fork

* Update buttons definition for SDL2 2.0.14 and report gamepad features

* Implement motion support again with SDL2

TODO: cemu hooks integration

* Switch to latest of nightly SDL2

* SDL2: Fix bugs in gamepad id matching allowing different gamepad to match on the same device index

* Ensure values are set in UI when the gamepad get hot plugged

* Avoid trying to add controllers in the Update method and don't open SDL2 gamepad instance before checking ids

This fixes permanent rumble of pro controller in some hotplug scenario

* Fix more UI bugs

* Move legcay motion code around before reintegration

* gamecontroller UI tweaks here and there

* Hide Motion on non motion configurations

* Update the TODO grave

Some TODO were fixed long time ago or are quite oudated...

* Integrate cemu hooks motion configuration

* Integrate cemu hooks configuration options to the UI again

* cemuhooks => cemuhooks

* Add cemu hook support again

* Fix regression on normal motion and fix some very nasty bugs around

* Fix for XCB multithreads issue on Linux

* Enable motion by default

* Block inputs in the main view when in the controller configuration window

* Some fixes for the controller ui again

* Add joycon support and fixes other hints

* Bug fixes and clean up

- Invert default mapping if not a Nintendo controller
- Keep alive the controller being selected on the controller window (allow to avoid big delay for controller needing time to init when doing button assignment)
- Clean up hints in use
- Remove debug logs around
- Fixes potential double free with SDL2Gamepad

* Move the button assigner and motion logic to the Ryujinx.Input project

* Reimplement raw keyboard hle input

Also move out the logic of the hotkeys

* Move all remaining Input manager stuffs to the Ryujinx.Input project

* Increment configuration version yet again because of master changes

* Ensure input config isn't null when not present

* Fixes for VS not being nice

* Fix broken gamepad caching logic causing crashes on ui

* Ensure the background context is destroyed

* Update dependencies

* Readd retrocompat with old format of the config to avoid parsing and crashes on those versions

Also updated the debug Config.json

* Document new input APIs

* Isolate SDL2Driver to the project and remove external export of it

* Add support for external gamepad db mappings on SDL2

* Last clean up before PR

* Addresses first part of comments

* Address gdkchan's comments

* Do not use JsonException

* Last comment fixes
2021-04-14 12:28:43 +02:00
.github CI: Add option to manually trigger github actions 2021-04-07 21:20:15 +02:00
ARMeilleure PPTC vs. giant ExeFS. (#2168) 2021-04-13 03:24:36 +02:00
Ryujinx Miria: The Death of OpenTK 3 (#2194) 2021-04-14 12:28:43 +02:00
Ryujinx.Audio Report active audio device as TV, rather than internal speakers. (#2103) 2021-03-14 21:31:36 +11:00
Ryujinx.Audio.Backends Haydn: Part 1 (#2007) 2021-02-26 01:11:56 +01:00
Ryujinx.Audio.Backends.OpenAL Miria: The Death of OpenTK 3 (#2194) 2021-04-14 12:28:43 +02:00
Ryujinx.Audio.Backends.SoundIo Haydn: Make SoundIO session implementation lock-free (#2068) 2021-02-28 17:20:34 +01:00
Ryujinx.Common Miria: The Death of OpenTK 3 (#2194) 2021-04-14 12:28:43 +02:00
Ryujinx.Cpu Remove unused physical region tracking (#2085) 2021-03-06 20:21:53 -03:00
Ryujinx.Graphics.Device infra: Migrate to .NET 5 (#1694) 2020-11-15 19:27:15 +01:00
Ryujinx.Graphics.GAL Texture Cache: "Texture Groups" and "Texture Dependencies" (#2001) 2021-03-02 19:30:54 -03:00
Ryujinx.Graphics.Gpu Hold reference for render targets in use (#2156) 2021-04-02 16:33:39 +02:00
Ryujinx.Graphics.Host1x infra: Migrate to .NET 5 (#1694) 2020-11-15 19:27:15 +01:00
Ryujinx.Graphics.Nvdec infra: Migrate to .NET 5 (#1694) 2020-11-15 19:27:15 +01:00
Ryujinx.Graphics.Nvdec.H264 infra: Migrate to .NET 5 (#1694) 2020-11-15 19:27:15 +01:00
Ryujinx.Graphics.Nvdec.Vp9 Enable multithreaded VP9 decoding (#2009) 2021-02-11 01:54:42 +01:00
Ryujinx.Graphics.OpenGL Miria: The Death of OpenTK 3 (#2194) 2021-04-14 12:28:43 +02:00
Ryujinx.Graphics.Shader Implement shader HelperThreadNV (#2163) 2021-04-02 21:50:35 +11:00
Ryujinx.Graphics.Texture Fix lineSize for LinearStrided -> Linear conversion (#2091) 2021-03-10 01:24:46 +01:00
Ryujinx.Graphics.Vic infra: Migrate to .NET 5 (#1694) 2020-11-15 19:27:15 +01:00
Ryujinx.Graphics.Video infra: Migrate to .NET 5 (#1694) 2020-11-15 19:27:15 +01:00
Ryujinx.HLE [ImgBot] Optimize images (#2205) 2021-04-14 01:20:30 +02:00
Ryujinx.Input Miria: The Death of OpenTK 3 (#2194) 2021-04-14 12:28:43 +02:00
Ryujinx.Input.SDL2 Miria: The Death of OpenTK 3 (#2194) 2021-04-14 12:28:43 +02:00
Ryujinx.Memory Remove unused physical region tracking (#2085) 2021-03-06 20:21:53 -03:00
Ryujinx.Memory.Tests Test: Fixes github action warning (#2100) 2021-03-13 04:12:36 +01:00
Ryujinx.ShaderTools infra: Migrate to .NET 5 (#1694) 2020-11-15 19:27:15 +01:00
Ryujinx.Tests Add Sqdmulh_Ve & Sqrdmulh_Ve Inst.s with Tests. (#2139) 2021-03-25 23:33:32 +01:00
Ryujinx.Tests.Unicorn infra: Migrate to .NET 5 (#1694) 2020-11-15 19:27:15 +01:00
.editorconfig Adding .editorconfig so code style can be consistent and localized (#1131) 2020-05-03 00:58:58 +02:00
.gitattributes aloha 2018-02-04 20:08:20 -03:00
.gitignore Implement ContentManager and related services (#438) 2018-11-18 17:37:41 -02:00
appveyor.yml infra: Migrate to .NET 5 (#1694) 2020-11-15 19:27:15 +01:00
global.json Edit the global.json to allow use of dotnet sdk 5.0.XXX (#2008) 2021-02-10 09:37:19 +01:00
LICENSE.txt Update license (#788) 2019-10-12 23:48:31 -03:00
README.md Update README.MD to reflect new OpenGL requirements, gamedb statistics, mods support (#2167) 2021-04-02 19:45:01 +02:00
Ryujinx.sln Miria: The Death of OpenTK 3 (#2194) 2021-04-14 12:28:43 +02:00
Ryujinx.sln.DotSettings Add features to GUI (#757) 2019-11-29 15:32:51 +11:00

Ryujinx

An experimental Switch emulator written in C#

As of March 2021, Ryujinx has been tested on over 3,200 titles: ~2,700 boot past menus and into gameplay, with approximately 1,900 of those being considered playable. See the compatibility list here.

Usage

To run this emulator, we recommend that your PC have at least 8GB of RAM; less than this amount can result in unpredictable behavior and may cause crashes or unacceptable performance.

See our Setup & Configuration Guide on how to set up the emulator.

Latest build

These builds are compiled automatically for each commit on the master branch. While we strive to ensure optimal stability and performance prior to pushing an update, our automated builds may be unstable or completely broken.

The latest automatic build for Windows, macOS, and Linux can be found on the Official Website.

Building

If you wish to build the emulator yourself you will need to:

Step one: Install the X64 version of .NET 5.0 (or higher) SDK.

Step two (choose one):
(Variant one)

After the installation of the .NET SDK is done; go ahead and copy the Clone link from GitHub from here (via Clone or Download --> Copy HTTPS Link. You can Git Clone the repo by using Git Bash or Git CMD.

(Variant two):

Download the ZIP Tarball. Then extract it to a directory of your choice.

Step three:

Build the App using a Command prompt in the project directory. You can quickly access it by holding shift in explorer (in the Ryujinx directory) then right clicking, and typing the following command:
Run dotnet build -c Release inside the Ryujinx project folder to build Ryujinx binaries.

Ryujinx system files are stored in the Ryujinx folder. This folder is located in the user folder, which can be accessed by clicking Open Ryujinx Folder under the File menu in the GUI.

Features

  • Audio

    Audio output is entirely supported, audio input (microphone) isn't supported. We use C# wrappers for OpenAL, and libsoundio as the fallback.

  • CPU

    The CPU emulator, ARMeilleure, emulates an ARMv8 CPU and currently has support for most 64-bit ARMv8 and some of the ARMv7 (and older) instructions, including partial 32-bit support. It translates the ARM code to a custom IR, performs a few optimizations, and turns that into x86 code.
    Ryujinx also features an optional Profiled Persistent Translation Cache, which essentially caches translated functions so that they do not need to be translated every time the game loads. The net result is a significant reduction in load times (the amount of time between launching a game and arriving at the title screen) for nearly every game. NOTE: this feature is now enabled by default in the Options menu > System tab. You must launch the game at least twice to the title screen or beyond before performance improvements are unlocked on the third launch! These improvements are permanent and do not require any extra launches going forward.

  • GPU

    The GPU emulator emulates the Switch's Maxwell GPU using the OpenGL API (version 4.5 minimum) through a custom build of OpenTK. There are currently four graphics enhancements available to the end user in Ryujinx: disk shader caching, resolution scaling, aspect ratio adjustment and anisotropic filtering. These enhancements can be adjusted or toggled as desired in the GUI.

  • Input

    We currently have support for keyboard, mouse, touch input, JoyCon input support emulated through the keyboard, and most controllers. Controller support varies by operating system, as outlined below.
    Windows: Xinput-compatible controllers are supported natively; other controllers can be supported with the help of Xinput wrappers such as x360ce.
    Linux: most modern controllers are supported.
    In either case, you can set up everything inside the input configuration menu.

  • DLC & Modifications

    Ryujinx is able to manage add-on content/downloadable content through the GUI. Mods (romfs, exefs, and runtime mods such as cheats) are also supported; the GUI contains a shortcut to open the respective mods folder for a particular game.

  • Configuration

    The emulator has settings for enabling or disabling some logging, remapping controllers, and more. You can configure all of them through the graphical interface or manually through the config file, Config.json, found in the user folder which can be accessed by clicking Open Ryujinx Folder under the File menu in the GUI.

Compatibility

You can check out the compatibility list here.

Don't hesitate to open a new issue if a game isn't already on there!

Help

If you are having problems launching homebrew or a particular game marked status-playable or status-ingame in our compatibility list, you can contact us through our Discord server. We'll take note of whatever is causing the app/game to not work, put it on the watch list and fix it at a later date.

If you need help with setting up Ryujinx, you can ask questions in the #support channel of our Discord server.

Contact

If you have contributions, need support, have suggestions, or just want to get in touch with the team, join our Discord server!

If you'd like to donate, please take a look at our Patreon.

License

This software is licensed under the terms of the MIT license. The Ryujinx.Audio project is licensed under the terms of the LGPLv3 license. This project makes use of code authored by the libvpx project, licensed under BSD and the ffmpeg project, licensed under LGPLv3. See LICENSE.txt and THIRDPARTY.md for more details.

Credits