Settings

Theme

Ryujinx (Switch Emulator) Update

blog.ryujinx.org

94 points by benaadams 3 years ago · 26 comments

Reader

hedgehog 3 years ago

I hadn't seen this before and I was curious what approach Ryujinx and Yuzu (mentioned here) take to emulate the GPU. Both appear to emulate the actual hardware rather than patch the guest to intercept graphics calls in some way. This includes recompiling Maxwell shader machine code into host-compatible shaders (GLSL or whatever). Impressive.

  1. https://github.com/Ryujinx/Ryujinx/blob/master/Ryujinx.Graphics.Shader/Decoders
  2. https://github.com/yuzu-emu/yuzu/tree/master/src/shader_recompiler
  • AlexAltea 3 years ago

    This is fairly common in many console emulators, see:

    - PS3 (Nvidia RSX): https://github.com/RPCS3/rpcs3/blob/master/rpcs3/Emu/RSX/rsx...

    - PS4 (AMD GCN): https://github.com/AlexAltea/orbital-qemu/blob/master/hw/ps4...

    The hardware is known ahead of time, so console platforms take advantage of that: GPU drivers allocate a context and hand it over to userspace which can do nearly anything it wants with it (abstraction layers are quite thin), and graphics APIs are essentially a 1:1 mapping of the hardware.

    Because of that there's little difference between emulating the API or emulating the GPU (the subset of the GPU accessible through the API).

    The only major difference I'd say is emulating the entire GPU (including VM, GART/IOMMU, display controller, multi-contexts, etc.) vs just emulating a single GPU context (which feels quite similar to implementing a graphics API).

    • hedgehog 3 years ago

      Fascinating, and still an impressive technical lift especially for hobby projects without full time funding.

      • mrguyorama 3 years ago

        If you want to visit crazy-land, check out Dolphin's UberShaders; the gamecube had a mostly fixed function but super configurable graphics pipeline that can't really be translated well to modern hardware, and this caused lots of stutters and annoyances, so eventually some mad lad decided to write a GPU shader that just simulated the entire pipeline flow, no more translation or anything. Won't work on your laptop very well, but if you have an 8 year old dedicated GPU or newer, fixes the problem outright.

        A similar thing was actually done in n64 world for RSP emulation, another proto-gpu device with it's own highly configurable microcode. First it was emulated in CPU with AngryLion, and someone else I think made it all run in compute shaders on the GPU, meaning you can FINALLY play nearly every n64 game accurately rendered, upscaled rendering if you want, and no slowdowns or bugs or glitches from more rare techniques, like the spy gadget in perfect dark.

Gigachad 3 years ago

I’ve used yuzu a bit before but not Ryujinx. Does anyone know what the main differences between them are? Looks like both still require owning a hacked switch which is quite a barrier to entry.

  • USA-RedDragon 3 years ago

    From the end-user perspective: I see Yuzu and Ryujinx differences as mostly about game compatibility (I keep both around). I personally don't know any feature one has over the other that might drive people to a specific one.

    As far as the requirement to own a Switch, it mostly has to do with being able to decrypt games to play them and system OS apps for services they provide to games. If they were to ship these keys or firmware blobs, they'd be at risk of litigation from Nintendo versus providing documentation on how to obtain the keys and firmware legally. Some of the firmware files might be able to be reimplemented in the future depending on patents and the like.

    As a side note, the files required to play _can_ be found online, probably by searching the firmware version plus the filename from Yuzu/Ryujinx docs. (The keys are firmware version specific, and I think tools like RyuSAK let you get both keys and firmware, but this definitely isn't the legal way to go about it )

  • Snuupy 3 years ago

    > both still require owning a hacked switch which is quite a barrier to entry

    This has not been necessarily the case for years.

    • azalemeth 3 years ago

      By which you mean that if you have a fusee-glecee (sic) compatible switch, no hardware mods are necessary beyond turning it on holding a usually inaccessible button combination, right? After that, everything is perfectly legal backup and format shifting.

    • Gigachad 3 years ago

      Looking at the websites, both emulators claim you have to dump the system keys for them to work.

      • dmonitor 3 years ago

        just like how they require you to dump ROMs from your legitimately owned game copies, presumably.

    • eatonphil 3 years ago

      What are the conditions under which do you still need a hacked switch?

  • causi 3 years ago

    There's enough difference in performance and stability it's worth using both if you're into Switch emulation. They can have different performance and bugs for different games. For example, on my hardware Yuzu has a difficult time maintaining a good framerate on Mario Odyssey and it also has an almost half-second input lag with that game. Ryujinx has neither of those problems.

  • pjmlp 3 years ago

    Ryujinx is using C#, which is kind of neat, given that on computing it seems one needs to prove a point to make it clear for others.

peter-m80 3 years ago

Why do this kind of software use .Net? Shouldn't this be implemented with portability in mind?

  • dagmx 3 years ago

    .NET is pretty portable. It can run on most popular platforms.

    Where would you be running this where you’re also blocked by net support?

  • sirwhinesalot 3 years ago

    It runs on Windows, macOS and Linux, how much more portable do you want it to be?

    • rowanG077 3 years ago

      Android, iOS, Fuchsia

      • sirwhinesalot 3 years ago

        .NET also runs on Android and iOS so Ryujinx could support them in the future. Most emulators written in C/C++ don't run on all of those platforms either.

        • rowanG077 3 years ago

          Don't run, right now. But with some effort they could be ported by someone who wants. With .NET you are just shit out of luck.

  • kelnos 3 years ago

    They appear to distribute Windows, Linux, and macOS builds. I'm not plugged into the .NET/Mono scene, but the download (the Linux one at least) appears to be an AOT-compiled ELF file, with no dynamic dependencies (well, aside from possibly dlopen()ing things at runtime) on .NET/Mono components. I was able to run it without installing the Mono runtime or any libraries.

  • Kuinox 3 years ago

    .NET is portable, .NET Framework isn't.

Keyboard Shortcuts

j
Next item
k
Previous item
o / Enter
Open selected item
?
Show this help
Esc
Close modal / clear selection