Dolphin Progress Report: March 2017

In case you missed it, we had a special April Fools announcement on our Youtube Channel that blog writer JMC47 retired due to his failed bid to sing well in American Idol on Wii. If you want to catch up on the ridiculousness, the video is still up for all to gaze at in utter confusion.

April Fools 2017 - Retirement

With that out of the way, some delays to get everything ready have given us more time to tighten things up and bulk up what has been a relatively quiet month outside of a few mammoth changes. A group of Wii IOS changes were noteworthy enough to get their own article with the Wii Shop Channel finally getting compatibility in Dolphin. That's right, you can buy games from Nintendo within Dolphin, or, download titles you've purchased on your Wii in Dolphin, assuming you're using that Wii's NAND.

Other than that, the long awaited GPU Texture Decoders finally got merged for a broad performance increases and a new Bounding Box fallback path works on any machine that can run Dolphin. So we hope you can enjoy this breakdown of March's (and a little of April's) notable changes!

Notable Changes

Tons of IOS Fixes - Wii Shop Channel Support by leoetlino

A lot of people thought this was a joke when we announced it despite purposefully showing it weeks before April Fools. Through simple force of will from leoetlino and accurate emulation of the Wii's IOS, Dolphin can now connect to and use the Wii Shop Channel as if it were a real Wii.

System Menu Improvements Featuring Wii Shop Channel Support!

While we were primarily excited about being about being able to legitimately buy games directly in Dolphin, many users had the concern that this would cause issues for Nintendo. This is not true; The Wii Shop Channel requires a proper console ID and keys from a Wii; meaning that users without a Wii can't access the Wii Shop. And, when you do access the Wii Shop, Dolphin is acting as your Wii. Any games you purchased on that console will be available for download on your Wii, and if you make a purchase in Dolphin, it'll be available on your Wii. Dolphin will not aid you in accessing content you have not purchased.

To our surprise, it seems at least several users have been using this feature not only to retrieve games they bought years ago, but, also to buy games off the Wii Shop directly in the emulator. For this reason, Dolphin now has SSL verification enabled by default in recent development builds capable of connecting to the Wii Shop.

These changes also add additional functionality to other parts of the System Menu. Save exporting to SD card, Title Exporting to SD card, Title Installation, and other essential System Menu features will now work correctly from within emulation.

5.0-2964 - OGL: Implement Bounding Box on Systems Without SSBO by ligfx

Developers have made some unpopular decisions in the past regarding performance and compatibility in the name of progress. Whether it's asynchronous audio going the way of the dinosaurs, replacing floating point math with integer math, or even removing software bounding box, we have a penchant for taking away things in the name of progress and clean code.

The removal of software bounding box had some damaging repercussions however; Apple never ended up supporting OpenGL 4.3 and Shader Storage Buffer Object (SSBO) and thus any game that uses bounding box doesn't work on any Mac! This was not our intention at all, but, reimplementing the software backend would have meant losing the huge performance gains of the Vertex Loader JIT, or making the code much more complex.


Without bounding box, the game suffers from severe graphical glitches and crashes.


These complex effects are difficult to emulate efficiently.

ligfx is a macOS user that decided enough was enough and took matters into his own hands. If software bounding box wasn't coming back, he was going to find a way to emulate it with an older version of OpenGL. This ended up not being much of a challenge!

He used OpenGL's stencil buffer to get the pixel data and sent that to the CPU where it can easily calculate the Min/Max of the pixel data to do bounding box effects. BUT, any time you have CPU <-> GPU communication (such as, EFB Copies to RAM, Real XFB...) it slows things down tremendously. As such, this is considerably slower than hardware bounding box, and you're going to need a very powerful computer to maintain full speed at all times with this path. The only users likely to have a powerful computer without SSBO support, are our macOS users. Users on older graphics cards without SSBO support can use this too, but just expect some slowdowns during complex bounding box effects.

For an idea of what performance you'll get, we took a few performance snapshots of difference devices using the fallback path during a bounding box effect in Dolphin.

Note: This method of emulating bounding box should be considered just as accurate as the standard path. It does not contain any of the hacks needed for the old software bounding box implementation, and emulates all uses of bounding box correctly.

The reason why is that it uses the output from the GPU with the stencil buffer. Bounding box is really just the min/max of all rendered pixels. The old software bounding box path used video software to transform all vertices and calculate the min/max of all vertices. The second software bounding box method was closer, using the video software backend to rasterize the primitive, but still failed with alpha-test, ztest, and other cases.

If you're wondering why the Vertex Loader JIT necessitated the removal of software bounding box, it's because we no longer had the ability to send vertices to video software for bounding box.

5.0-3021 - Correct for Negative Viewport Dimensions by Armada651

Most games on the GameCube/Wii have a viewport that is a bit odd to emulate. They have a positive width alongside a negative height (E.G. 640x-480.) Because normal computers cannot handle negative viewport dimensions, we have to interpret it as a positive viewport. Jimmie Johnson's Anything with an Engine is then a special case within this odd case. Of the thousands of games tested on Dolphin, it is the only game to use a positive viewport (E.G. 640x480.) Because the viewport was already positive, Dolphin decided not to invert it and displayed the game as is... resulting in some very minor issues.

Outdated: Jimmie Johnson's Anything With an Engine Flipped

With this game as proof, we determined that if a game has a positive height, it inverts the whole viewport. Because we cannot handle negative viewports within standard graphics APIs, Dolphin now handles the inversion in the vertex shader. This new way of handling the GameCube/Wii's viewport dimensions covers all edgecases, making sure that there won't be any games inverting themselves from now on. Hopefully.

Jimmie Johnson's Anything with an Engine Working in Dolphin 5.0-3021

With all of these fixes in place, now everyone can finally enjoy this... very mediocre but enjoyable title. You're welcome!

5.0-3123 - libusb changes for Windows by leoetlino

When it comes to libusb on Windows, we're out of our area of expertise. On Linux, everything with USB Passthrough works perfectly, but on Windows we've run into a ton of issues that we don't know how to debug. The purpose of this change is to revert some additions that were a part of the USB Passthrough pull request. This will restore Bluetooth Passthrough functionality to where it was before, but, on Windows only there is still a risk of crashing when using USB Passthrough for Microphones and Wii Speak.

On Windows, libusb can sometimes cause Dolphin to crash simply by enumerating devices. Whenever libusb_unref_device is called, there is a tiny chance it will internally try to use a null pointer for no apparent reason, which promptly crashes Dolphin.

usbdk, which is the only libusb backend with partial support for isochronous transfers, also has its own issues. It doesn't work well with Bluetooth passthrough, because it doesn't redirect and hide the Bluetooth adapter from Windows properly, so users end up having to use both usbdk and Zadig. Isochronous transfers still don't fully work; large packets are completely broken so games like Your Shape do not work. Device enumeration can randomly fail, even after making sure only a single libusb context was used across Dolphin. And we have actually had to revert the context change to avoid bigger problems with Bluetooth Passthrough.

Those issues, mixed with other issues such as completely broken isochronous transfers in the WinUSB backend, have left us scratching our head. We have no idea why libusb on Windows is giving us so many headaches compared to Linux, which works flawlessly with no risk of crashing and supports more devices.

If there are any libusb masters out there that could give us a hand in figuring out what our problems are, it'd be much appreciated. As it is, we can again say Bluetooth Passthrough is safe to use, but, we recommend using Linux for USB Passthrough with USB Microphone titles until these issues are resolved. We are not removing the functionality from the Windows version because even this semi-broken functionality seems better than no functionality at all.

5.0-3220 - GPU Texture Decoding by stenzek

Weak CPUs are the bane of emulation, so any time you can take something strenuous off of the CPU, it's a win. While this change is beneficial to everyone, those on weaker CPUs are going to notice the biggest difference.

Unlike some other performance increases, the bulk of this change is actually going to affect stuttering on object/level load. While most of that stuttering can be attributed to shader generation, there is a very real amount that is texture decoding, especially in some troublesome games that like to decode textures at inopportune times. A lot of games will do this when loading new segments to levels or dynamically loading new areas, such as Metroid Prime.

The other main use case for this is decoding videos. One reason why the main menu to Mario Kart Wii is so difficult to run is because it is playing multiple video files at the same time, hitting the CPU emulation harder, while decoding the videos which adds to that difficulty. With GPU Texture Decoders, we can offload some of that stress to the GPU, greatly increasing performance, especially on weaker CPUs!

GPU Texture Decoding can be enabled in the Graphics Settings -> Hacks Tab under "GPU Texture Decoding." It should not cause any graphical glitches, but, performance may vary depending on your hardware.

5.0-3251 - Higher IR Vertex Offset Hack by iwubcode

Higher Internal Resolutions is a hack that break things. When users report bugs, such as "Silent Hill: Shattered Memories breaks at higher resolutions," it's one of those things that are low priority usually. Blog writer JMC47 has gone on the record in public saying that Shattered Memories would never be fixed at higher IRs.

iwubcode said to hell with that and dedicated a few months into figuring out a way to try and make Silent Hill: Shattered Memories work at higher resolutions. Within a few days, Silent Hill was working properly... albeit with a nasty hack. As exciting as that is, it's a slippery slope to start merging per-game hacks to fix higher resolutions; suddenly you have pages of hacks that users have to try and mix and match to get a game looking right, and it's just generally sloppy.

Over time, the hack was refined and moved to a place that made more sense and broke less games while fixing more. While we don't usually allow hacks for graphical issues, we decided to make an exception here.

What iwubcode is adjusting for is a pixel centering issue; something that we don't believe can work at higher resolutions regardless of accuracy. A hack to throw out the rounding is no worse than what Dolphin is currently doing at higher Internal Resolutions, and, it seems to help quite a few games in very positive ways. By keeping both methods, we don't stand to lose compatibility one way or another, and, the results are pretty staggering.


Many games suffer from annoying lines like this at higher resolutions.


With this hack, many of them are simply gone!


Oh noooo! Someone got light and color into Shadow the Hedgehog! How shall he brood?


Ahhhh, properly gloomy.


The light leaks out in spectacularly wrong ways at higher IRs in Silent Hill.


The new offset makes things work just as well as they do at 1x IR.

In the Graphics Settings -> Hacks screen, you can try "Vertex Offset" at higher internal resolutions to see if it bypasses problems in your favorite games.

Last Month's Contributors...

Special thanks to all of the contributors that incremented Dolphin from 5.0-2686 through to 5.0-3251!

Você pode continuar a discussão no tópico do fórum deste artigo.

Próximo post

Post anterior

Posts similares