9 ms·
Nintendo Switch Emulator: Progress Report December 2023
- nazgulsenpai 3y ago> Fashion Designer, a game which we’re sure will be topping Game of the Year charts across the globe, was exhibiting a particularly strange glitch. The tone in which this blog post is written is very entertaining while being informative. Thank you to the Ryujinx team, and all emulation projects for that matter, for their work in game preservation!
- ddnb 3y agoI have absolutely no idea how emulator development is but I always wondered how specific bugs like these are fixed; is it just adding an if statement specific to this game or are these just general bugs that get fixed and could just as well also fix something undiscovered in other games as well?
- marksomnian 3y agoThis is (I believe) the PR that fixed this specific issue: https://github.com/Ryujinx/Ryujinx/pull/5933 https://github.com/Ryujinx/Ryujinx/pull/5933 In short, no - from my understanding, it does actually fix the underlying issue, rather than special-casing the game. I wouldn't be surprised if there are a few edge cases like that which are special-cased, particularly for older games (when "abuse" of CPU/GPU quirks was more common to eke out extra performance).
- enjoytheview 3y agoThe answer is both. Devs will first try to fix it by correctly emulating the system behavior because like you said, that can also fix other games and because that is the right thing to do. There are occasions where doing that can result in a huge performance penalty or some other underised behavior so they just resort to hacks in the emulator or straight up patching the game.
- HideousKojima 3y agoAlso, at least in the Dolphin emulator for the Gamecube/Wii, they only use game-specific hacks as a last resort. They learned from a lot of older emulator projects that game-specific hacks pile up on each other and eventually make the code an unmaintainable mess.
- rolltrunhert 3y ago> They learned from a lot of older emulator projects They learned from themselves after doing just that for many years. Lately they have been working hard to get rid of game specific overrides. They still have a gazillion tho, see here: https://github.com/dolphin-emu/dolphin/tree/master/Data/Sys/GameSettings https://github.com/dolphin-emu/dolphin/tree/master/Data/Sys/...
- JoshTriplett 3y agoThis is one of the differences between the bsnes/higan family of SNES emulators and the previous generation (ZSNES/snes9x/etc). bsnes/higan and emulators derived from them managed to emulate the SNES more accurately (which required more processing power), and this allowed having fewer game-specific hacks. Emulation benefits hugely from increases to processing power over time.
- narnarpapadaddy 3y agoBoth, depending on the specific issue and the emulation technique. There’s a slew of different approaches to emulation, such as bytecode interpretation (you read the ROM on the fly and try to “do the intended thing” using platform native APIs), bytecode translation (you convert the ROM into platform native code), hardware emulation (you simulate the original chips directly, and the ROMs “just work”), and more. In many cases all those techniques are used together for different parts of the system (such as emulating a CPU vs a GPU). Depending on what the issue is, how well the hardware is documented (you may even hit an undocumented hardware bug!), and how difficult it is to create a general-purpose fix for your particular approach to emulation, or how computational expensive it is to emulate correct behavior, you may choose to add a workaround. Some emulation projects put more emphasis on 100% correct emulation than others. Console emulators tend to be biased towards performance.
- cogman10 3y ago> Depending on what the issue is, how well the hardware is documented (you may even hit an undocumented hardware bug!) What's fun is, particularly with older games and hardware, it wasn't uncommon for devs to use hardware bugs to their advantage. DK64 is notoriously hard to emulate because of that.
- zwirbl 3y agoCan you elaborate on DK64? AFAIK it shipped with a memory leak that was known to the deva but could not be fixed in time for Christmas season 199x. This bug lead to a OOM crash in less than two hours or something so it was decided to require and ship it with the Expansion Pack with 8MB (?) RAM instead of the default jumper pack with half as much. I
- dallen33 3y agoThat turned out to not be true, FYI: https://www.reddit.com/r/n64/comments/t2owki/psa_dk64s_expansion_pak_usage_was_not_to_fix_a_bug/ https://www.reddit.com/r/n64/comments/t2owki/psa_dk64s_expan...
- smith7018 3y agoAs a long term emulator aficionado, I'm really proud of Ryujinx. Initially, Yuzu was much further ahead but Ryujinx really stuck with it and I'd say they're both solid now. I switched to Ryujinx full time last year on my Steam Deck and love it! Thanks Ryujinx team!
- echelon 3y ago> I switched to Ryujinx full time last year on my Steam Deck and love it! To play retail games you purchased, right? ;) Honestly, I don't know how Nintendo survives as an independent console maker in the years to come. They ceded the traditional home console, and now everyone is making portables. Valve's portable can play the entire retail Nintendo line for "free". Valve gets the benefit of piracy to help lift sales of their system, too.
- manuelabeledo 3y ago> Honestly, I don't know how Nintendo survives as an independent console maker in the years to come. They ceded the traditional home console, and now everyone is making portables. Valve's portable can play the entire retail Nintendo line for "free". I think you overestimate the willing of most people to play on emulators.
- jsheard 3y agoOr to pirate games in general. 99% of the Steam library is trivial to pirate but that's doing just fine. The Switch is on its last legs anyway, and the successor will reset jailbreaking/emulation progress back to zero.
- asimovfan 3y agothe hits that were released for the previous one however will still be pirated.
- mschuster91 3y ago> The Switch is on its last legs anyway, and the successor will reset jailbreaking/emulation progress back to zero. Jailbreaking yes, but emulation? I wouldn't be so certain, it's still the fundamentally same, mainstream CPU/GPU family just with more beef. The most pressing challenge is getting game cartridges to a point where they can be decrypted.
- 1-6 3y agoMy feelings are mixed. Hacking and emulating has been part of the gaming community for decades but isn’t this illegal?
- lbourdages 3y agoIt is 100% legal if you obtain your ROMs legally (i.e. own the game and somehow dump it).
- slau 3y ago100% legal everywhere in the world, under all circumstances? That’s a very, very bold claim.
- minimaul 3y agoAnd not true - for example, format shifting in the UK is illegal. You can't legally rip a CD, DVD or Bluray here, let alone a console game.
- gmac 3y agoWould be interesting to see a reference for that. I’ve never heard of anyone being pursued for ripping or format-shifting.
- minimaul 3y agohttps://www.theguardian.com/uk-news/2015/jul/17/high-court-quashes-regulations-copy-cds-musicians https://www.theguardian.com/uk-news/2015/jul/17/high-court-q... Prosecutions are basically unheard of, but it’s not legal nonetheless.
- toolz 3y agoI have a friend that just purchases the game and then pirates the dump (as it's much easier that way to obtain the dump). That's maybe technically illegal (IANAL), but I don't think anyone should be worrying about violating the letter of a law so long as the spirit of the law isn't being violated.
- feverzsj 3y agoChecking their repo, it's almost fully written in c#. .Net can be this performant now?
- rvanlaar 3y agoIf it can be performant depends on the tasks it need to full fill. The Switch uses the X1. A chip from 2015. The CPU has a clock rate of 1GZ, the GPU 307-768 MHz. [1] [1] https://en.wikipedia.org/wiki/Nintendo_Switch#Technical_specifications https://en.wikipedia.org/wiki/Nintendo_Switch#Technical_spec...
- whizzter 3y agoIt really always was, the runtime system within .NET always had the capability to run C/C++ code but to get C++ code to talk to C#/VB code with GC-heap objects you had to use language extensions and I think that limited the appeal by a fair bit (Especially as iirc they actually made 2 different extensions), on top of this the C# language has also always had and continually gets new extensions to do non-heap tasks (Compared to Java that has focused on the a clean Java world where everything was on the heap).
- rolltrunhert 3y agoTheir C# JIT [1] generates x86_64 or ARM native code. This is why it's fast. 1: https://github.com/Ryujinx/Ryujinx/tree/master/src/ARMeilleure https://github.com/Ryujinx/Ryujinx/tree/master/src/ARMeilleu...
- stusmall 3y agoCheck the end of the article for frame rates for different titles.
- m3kw9 3y agodidn't Yuzu copy Ryujinx open source code, and now Ryujinx close sourced some of its code?
- knodi 3y agoI love Switch Emulator on SteamDeck! Thank you Ryujinx and Yuzu.
- marksomnian 3y agoInteresting that Ryujinx is written in C# - I'm not sure why, but at first thought I'd have expected something like a console emulator (where one would have to do "unusual" memory / GPU operations to fully match the quirks of the platform) to be written in C or C++, like Dolphin or PCSX2 (Wii / PS2 emulators) are. Though clearly they can make C# work well for it, and the benefits of working in a managed language are probably worth it.
- jsheard 3y agoIt originally had a very unique approach, it would JIT the emulated instructions into .NET bytecode and then let the .NET runtime JIT that into native code. At some point they switched over to their own bespoke JIT-to-native engine for more control though.
- whizzter 3y agoI'm also using the dynamic code-loading to get free JIT in other projects and quite a few features of .NET relies on that, there are limitations (and for something as dynamic as an emulator I'm not at all surprised that they hit a brick wall at some point). Another benefit of C# is that they continually add features to make the language less susceptible to GC stalls. Compared to Java you have Value types, real generics, ref and out arguments, Span<T> types, stackalloc allocations, unsafe blocks and so on. You can get quite far without allocating anything on the heap and the ergonomics won't be that much worse than even C++ when doing so.
- aftbit 3y agoC# has an unsafe mode if you need it. I've written some low level hardware twiddling code in C# before. It can also be very fast. https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/unsafe-code https://learn.microsoft.com/en-us/dotnet/csharp/language-ref...
- kminehart 3y agoIt's probably not super important with the switch like it would be with the nintendo 64 or something because it's an ARM cpu.
- whatsthatabout 3y agoIt’s truly amazing what the team has done with ryujinx. It’s such a masterpiece of software and I‘m excited to see what’s coming
- RGamma 3y agoPreserving gaming history where Nintendon't. All kudos to you!
- yellow_lead 3y agoAs someone who doesn't own a switch, why does the emulator require switch keys to work? Edit: after searching google I've found there are many sources for such keys.