laitimes

Switch emulator Ryujinx progress report 2023-September

author:YUZU

Switch emulator Ryujinx progress report 2023-September

Switch emulator Ryujinx progress report 2023-September

September was an unusually quiet month for our friends who released games, with the only notable games being the rather bland Baten Kaitos Decepticon remake, and the dubious Mortal Kombat 1. At least the latter managed to bring some joy to its otherwise haunting visuals.

In addition to these, we have content from the entire project, including LDN, Mac improvements, and a lot of service work.

Our first stop is Puerto Delphino, where the sparkle lag is the name of the game. The title art of Super Mario Sunshine (part of the 3D All-Star series) puts a lot of pressure on several of our buffer transition shaders, especially those that convert pace; Stride is actually a gap between elements of the same "type" in a vertex specification or other dataset. If you make a shopping list, for example: tomatoes, 1, bread, 1, apples, 6, the "stride" between your items is 1, or in the computer, no matter how much memory each item occupies!

Either way, in order not to bore everyone with the theory, we need to convert some of the buffer formats used by SMS to a format that is more reasonable for real GPUs through compute shaders. Nvidia doesn't need these conversions and works fine without them, but AMD (and when it comes to forcing Nvidia to use them) struggles greatly.

Video loading...

This is what writing 230MB in the calculation looks like every time the buffer needs to be converted!

To reduce this crazy effect, we can instead device map converted vertex buffers (since they are only accessible from the GPU) and also allow the transform shader itself to scale the workgroup size. This is ideal for most dedicated GPUs with more cores. Even together, the problem is not completely eliminated, but the difference is still noticeable.

Video loading...

Mortal Kombat 1 was an unexpected stab in early September on the topic of poor performance, as even users of our highest-end systems struggled to reach the native frame cap of 60FPS.

Further inspection and analysis revealed that MK1 was creating more than 100 buffer textures that overlapped simultaneously. MK1 exposes an edge case in buffer cache implementations where many buffer textures can be created as views of other overlapping buffer ranges. If all of this is jargon, the basic result is that the scenario that the buffer cache is checking is basically impossible, so it's just a waste of time and your time.

Once this is corrected, a 46% improvement can be seen. The game also seems to have a maximum frame rate cap, so the value here could be higher!

Switch emulator Ryujinx progress report 2023-September
Switch emulator Ryujinx progress report 2023-September

Not content to affect just one game, the second issue was adjusting the size of the texture lookup array every time the lookup returned, which yielded some nice gains in some UE4 games with limited FIFO and coincidentally improved the frame-time stability of Mortal Kombat 11.

THE REAL WINNER, THOUGH, WAS THE R-TYPE FINAL 2 ALIEN FIGHTER: FINAL 2, WHICH IMPROVED THE HOOD BY AN ASTONISHING 700% FROM 8FPS All the Way to 60FPS. If side-scrolling space shooters are exactly what you aspire to play, now is the time.

Switch emulator Ryujinx progress report 2023-September

September also marks the arrival of the Baten Kaitos I&II Decepticon I.・II remaster, and if you're interested in trivia, the first of them holds the world record for the longest 100% speed run, clocking in in fourteen days in the real world.

Obviously, it brings a whole new category of services: "NGC". It's a bit mysterious these days because no one can really know what it does. BKI & II appears to have signed up for the service, but has never actually made any calls. However, upon further checking, it seems that in firmware 16.0.0, Nintendo has moved its profanity and general input filtering checks to its own service.

NGC, "no good content", seems to have taken over the role provided in the past by the generic firmware word blacklist, which has been in use since the 3DS/Wii U era and is close to 5,000 lines for us.

This new service has four parts:

  1. GetContentVersion - Just get the version of the dictionary of bad words to use from the firmware file "Version .dat.
  2. Check - These methods actually heuristics any text to determine which word or string to tokenize. There is a generic dictionary of terms to always mark, followed by a dictionary specific to each region that checks for specific strings that have problems in certain areas.
  3. Mask - This method replaces any bad words in the string with an asterisk (*) up to the first 512 characters; Beyond this range, the string will not be processed. In addition to this, there's a rather crude email address check, and a new feature to "normalize" text and convert strings to "canonical" format according to the Unicode standard.
  4. Reload - what does it say on tin. Unmount and remount the system archive. Unknown use, may just be a fail-safe.

Overall, basic word checking is quite a lot. For obvious reasons, we can't display the list of generated terms and substrings in various dictionaries, but some of them are... Imaginative!

Switch emulator Ryujinx progress report 2023-September

Two services we have implemented: "lbl" (prior to firmware 10.0.0) to control backlight and screen services, and "WLAN" to manage general LAN services, have been moved to our New Vision project. We emphasized this when we first added it, but the core premise was that there were a number of key flaws in the way we handled many service implementations in the first place. However, because we have implemented a lot of services over the past 5 years, these services are migrating gradually as they migrate over time. For more information on this specific change, please refer to this year's first progress report.

Alas, we clearly cannot continue without answering this question. Can it run Crysis?!

Before September, the answer was a resounding no! Luckily, this isn't some GPU madness, nor is it a one-time custom CPU instruction, just some network checks... Honestly, it's very disappointing considering the legacy of the game. By removing the remaining unsupported BSD socket options, everyone's cult classic PC killer can actually get back to business.

Switch emulator Ryujinx progress report 2023-September

We've hadn't had to touch audio services for a while, but September bless we released Isu X Northern Adventure, which amplifies some of the issues with implementing a compressor effect in the audio renderer. There's a whole little list of inaccuracies being cleaned up, which allows the game to find its sound.

Switch emulator Ryujinx progress report 2023-September

Super Bomberman R 2 is the final game of the month, which pokes holes in our fake software Switch using a brand new service of the "friends" class. Since almost all of these types of services are useless without a connection with Nintendo, they are easily stubbed and allow the game to be fully playable! It's a bit fuzzy though.

If any of you are working on a game, get people to disable the anti-aliasing filter!

Switch emulator Ryujinx progress report 2023-September

Back in 2021, when everyone was stuck inside and begging for some multiplayer, we released a preview version of a feature more commonly known as LDN. In reality, this is just the name of the service that deals with the local wireless capabilities of the switch and needs to be reverse-engineered and implemented like any other service.

The initial preview was very popular and "good enough" for most people who wanted a multiplayer game, but wasn't really clean or accurate enough for us to incorporate it into the main codebase. We never really intended to be years away, but things happened and priorities changed.

Now at the end of 2023, there is renewed focus on getting all of this organized. The initial implementation of ldn:u, INetworkClient interface, and DisabledLdnClient has been completed, which is a huge challenge, even if they do not yet provide any framework for actually using native wireless capabilities. Stay tuned for follow-up work that will enable actual bridging of these "local" connections on more useful goals... For example, the Internet.

For our macOS users, especially those with M1/M2 chipsets, there are many games that can easily get stuck at startup, loading screen, or almost anywhere else in the game. The issue is isolated to a few skipped VCPU interrupts, which now have their own dedicated VTimer to periodically interrupt execution if a full call is missed. This allows games like Persona 5, Brave Default, and Life Strange: True Colors to be played outside of a short two-minute session.

Switch emulator Ryujinx progress report 2023-September
Switch emulator Ryujinx progress report 2023-September
Switch emulator Ryujinx progress report 2023-September

To end the month, let's skip some quick changes to the analog miscellaneous side.

The use of the async keyword was refactored around the Avalonia project to remove the dependency on "asynchronous invalid" in favor of "asynchronous tasks". This also allows the list of games to be loaded without blocking the program from launching again.

The macOS version now includes a headless workflow for those who prefer to run the emulator from the command line or launcher. These can be found on our Github release page.

Additional settings have been implemented for the aforementioned headless build, such as zoom filter selection, anti-aliasing options, and the option to use SDL's exclusive full-screen mode, providing the lowest possible latency for users who do not require a GUI.

September has passed, and I hope everyone has a wonderful autumn. We ourselves are dealing with many different tasks, and some of them have finally caught up with us! Our resident LDN demons are mired in the weeds that end up collecting all the multiplayer pieces, while those with Steam Decks are pulling their hair to try to resolve whatever altercation Avalonia and Gamescope are arguing.

As usual, we would like to thank all our supporters, no matter what form it takes. If you want to get involved in any way you can, we always welcome contributing code on GitHub, donating to our Patreon, and helping other users through our Discord. Until our next meeting!