54ea2285f0
* Refactoring of KMemoryManager class * Replace some trivial uses of DRAM address with VA * Get rid of GetDramAddressFromVa * Abstracting more operations on derived page table class * Run auto-format on KPageTableBase * Managed to make TryConvertVaToPa private, few uses remains now * Implement guest physical pages ref counting, remove manual freeing * Make DoMmuOperation private and call new abstract methods only from the base class * Pass pages count rather than size on Map/UnmapMemory * Change memory managers to take host pointers * Fix a guest memory leak and simplify KPageTable * Expose new methods for host range query and mapping * Some refactoring of MapPagesFromClientProcess to allow proper page ref counting and mapping without KPageLists * Remove more uses of AddVaRangeToPageList, now only one remains (shared memory page checking) * Add a SharedMemoryStorage class, will be useful for host mapping * Sayonara AddVaRangeToPageList, you served us well * Start to implement host memory mapping (WIP) * Support memory tracking through host exception handling * Fix some access violations from HLE service guest memory access and CPU * Fix memory tracking * Fix mapping list bugs, including a race and a error adding mapping ranges * Simple page table for memory tracking * Simple "volatile" region handle mode * Update UBOs directly (experimental, rough) * Fix the overlap check * Only set non-modified buffers as volatile * Fix some memory tracking issues * Fix possible race in MapBufferFromClientProcess (block list updates were not locked) * Write uniform update to memory immediately, only defer the buffer set. * Fix some memory tracking issues * Pass correct pages count on shared memory unmap * Armeilleure Signal Handler v1 + Unix changes Unix currently behaves like windows, rather than remapping physical * Actually check if the host platform is unix * Fix decommit on linux. * Implement windows 10 placeholder shared memory, fix a buffer issue. * Make PTC version something that will never match with master * Remove testing variable for block count * Add reference count for memory manager, fix dispose Can still deadlock with OpenAL * Add address validation, use page table for mapped check, add docs Might clean up the page table traversing routines. * Implement batched mapping/tracking. * Move documentation, fix tests. * Cleanup uniform buffer update stuff. * Remove unnecessary assignment. * Add unsafe host mapped memory switch On by default. Would be good to turn this off for untrusted code (homebrew, exefs mods) and give the user the option to turn it on manually, though that requires some UI work. * Remove C# exception handlers They have issues due to current .NET limitations, so the meilleure one fully replaces them for now. * Fix MapPhysicalMemory on the software MemoryManager. * Null check for GetHostAddress, docs * Add configuration for setting memory manager mode (not in UI yet) * Add config to UI * Fix type mismatch on Unix signal handler code emit * Fix 6GB DRAM mode. The size can be greater than `uint.MaxValue` when the DRAM is >4GB. * Address some feedback. * More detailed error if backing memory cannot be mapped. * SetLastError on all OS functions for consistency * Force pages dirty with UBO update instead of setting them directly. Seems to be much faster across a few games. Need retesting. * Rebase, configuration rework, fix mem tracking regression * Fix race in FreePages * Set memory managers null after decrementing ref count * Remove readonly keyword, as this is now modified. * Use a local variable for the signal handler rather than a register. * Fix bug with buffer resize, and index/uniform buffer binding. Should fix flickering in games. * Add InvalidAccessHandler to MemoryTracking Doesn't do anything yet * Call invalid access handler on unmapped read/write. Same rules as the regular memory manager. * Make unsafe mapped memory its own MemoryManagerType * Move FlushUboDirty into UpdateState. * Buffer dirty cache, rather than ubo cache Much cleaner, may be reusable for Inline2Memory updates. * This doesn't return anything anymore. * Add sigaction remove methods, correct a few function signatures. * Return empty list of physical regions for size 0. * Also on AddressSpaceManager Co-authored-by: gdkchan <gab.dark.100@gmail.com> |
||
---|---|---|
.github | ||
ARMeilleure | ||
Ryujinx | ||
Ryujinx.Audio | ||
Ryujinx.Audio.Backends | ||
Ryujinx.Audio.Backends.OpenAL | ||
Ryujinx.Audio.Backends.SDL2 | ||
Ryujinx.Audio.Backends.SoundIo | ||
Ryujinx.Common | ||
Ryujinx.Cpu | ||
Ryujinx.Graphics.Device | ||
Ryujinx.Graphics.GAL | ||
Ryujinx.Graphics.Gpu | ||
Ryujinx.Graphics.Host1x | ||
Ryujinx.Graphics.Nvdec | ||
Ryujinx.Graphics.Nvdec.H264 | ||
Ryujinx.Graphics.Nvdec.Vp9 | ||
Ryujinx.Graphics.OpenGL | ||
Ryujinx.Graphics.Shader | ||
Ryujinx.Graphics.Texture | ||
Ryujinx.Graphics.Vic | ||
Ryujinx.Graphics.Video | ||
Ryujinx.HLE | ||
Ryujinx.Input | ||
Ryujinx.Input.SDL2 | ||
Ryujinx.Memory | ||
Ryujinx.Memory.Tests | ||
Ryujinx.SDL2.Common | ||
Ryujinx.ShaderTools | ||
Ryujinx.Tests | ||
Ryujinx.Tests.Unicorn | ||
.editorconfig | ||
.gitattributes | ||
.gitignore | ||
appveyor.yml | ||
global.json | ||
LICENSE.txt | ||
README.md | ||
Ryujinx.sln | ||
Ryujinx.sln.DotSettings |
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 clickingOpen 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
- AmiiboAPI is used in our Amiibo emulation.