Hacker News new | past | comments | ask | show | jobs | submit login
Dolphin Emulator - Dolphin MEGA Progress Report: April and May 2021 (dolphin-emu.org)
250 points by Parseus on June 6, 2021 | hide | past | favorite | 67 comments



Not only am I always impressed by Dolphin, but by how interesting and detailed their blog posts are! If only other software projects could do the same. I don't even really play games much anymore, especially Nintendo games, but somehow I always come away with delight when I read the Dolphin progress updates and so on.


I agree.

When I read of Dolphin or MAME updates I feel like the world is a better place.

Why is this?

It seems bigger than just the joy of knowing old games will be preserved forever.


I recently wanted to play the original Paper Mario, but sadly it's not available on Switch, only Wii U. So I decided to go the emulator route. Dolphin is so good that Paper Mario runs better as a Wii U Virtual Console ROM under Dolphin than it does as an N64 ROM under Project 64.


Project 64 is pretty dated, though. Surprisingly, it looks like it's now open source, but I'm pretty sure that wasn't always the case, and it sat unimproved for several years. Someone can correct me on this, but that's my understanding. (that isn't to say there wasn't a time where PJ64 was hands down the best N64 emulator)

Mupen64plus, in my experience, has been far superior to PJ64 for a long time. These days the emulators have come along enough that the differences can be somewhat trivial, but a decade ago Mupen64plus ran better for me on lower-end hardware and had way fewer idiosyncrasies than PJ64.

Comparison:

https://youtu.be/W5alOzrL_Hw?t=556

Nevertheless, it wouldn't surprise me if Paper Mario ran better through Wii U Virtual Console on Dolphin than through Mupen64plus! ;)


I feel like that makes a lot of sense. You're getting the N64 emulation for free from Nintendo there. Of course, Dolphin has to be good enough to emulate the emulator correctly, but somehow seems easier than emulating a complex native GC/Wii game.


Dolphin isn't a Wii U emulator, are you confusing it with the Wii?


Dolphin can't play Wii U games, but it can play games released on Wii U's Virtual Console platform, which is the case here


Are those games distributed as Wii titles rather than Wii U?

I'd imagine that you can't actually play anything exclusive to the Wii U virtual console.


I'm not sure how it works technically under the hood. I got Paper Mario as a ".wad" file instead of the normal .iso that you see for GC/Wii/WiiU games, and Dolphin was able to load the .wad file.


Shall I assume you didn't copy it from your Wii U console? if you downloaded it from somewhere, it probably was the original Wii version.


Ah, you are probably right, my mistake. Unfortunately I can't edit my original comment now. I was under the impression it was a Wii U file since I downloaded it from a reddit link I found that said it was a Wii U Virtual Console title. But, doing some research it was also released for the original Wii VC at some point, so it's likely that's where the file came from.


My understanding is that `wad`s are specifically for the Wii (and Google seems to back me up on that), so regardless of where they got it from the fact that it was a `wad` means they were playing the Wii version. If it was an actual Wii U version it would be some other format.


I never knew that! This project is just so well done. Always amazing to find out new features.


Actually I may have been mistaken. Paper Mario was also released for Wii Virtual Console (not exclusively Wii U) so I may have downloaded that one.


The Wii U Virtual Console games only run on the Wii U.


> 5.0-14120 - Fix Out of Bounds Texture Coordinate Behavior

> More surprisingly, the originally intended effect is never shown on console either! Players have instead been seeing a different kind of blur effect created by this undefined behavior. In all likelihood, this bug went unnoticed by developers because the effect they achieved looked pretty good and they simply didn't realize that anything was wrong. While implementing the undefined behavior in Dolphin, pokechu22 also fixed Nintendo's bug so that we could see what could have been.

Nah, it looks wrong with the original "bug" fixed—it's supposed to look like a painting! The developers may or may not have known what happened, but I bet if not for the quirk they would have gone with something else entirely.


I don’t really understand how they consider an effect to be ‘undefined’; did Nintendo ever release documentation for this hardware?


There is (was) extensive developer documentation. I don’t know if it’s ever been made openly public.


And it's fraught with problems if the Dolphin team were to use any of the information from those Nintendo links that they can't prove they determined/discovered/developed independently. Most emulator developers are avoiding those even if there might be useful documentation in there. These blogposts are informative as hell but they also do the job of covering their asses by showing their original work.


>This was thankfully a lot less strict than on iOS devices, which strictly forbid mapping memory as executable whatsoever and made iOS untenable for us to officially support. Apple even provides documentation for helping developers port JITs to macOS on ARM. Skyler used a method described in the documentation that would change the mapped memory between Writeable when emitting code to Executable when executing code. Since Dolphin wasn't designed for this, there were a few hiccups along the way, but eventually everything was massaged into working with the new restrictions.

How expensive is changing memory mapping modes? Does it involve a system call? Does it need to happen often?


No / yes / only once.

It's just an mprotect(2) call to change the page from R+W to R+X. It needs to happen between the JIT being done creating a hunk of code and the first execution. Basically: allocate a page, write generated machine code to the page, change page to executable, patch page in (so the code gets invoked instead of either interpretation or a baseline compiler).

I'm sure you can be smarter about it and involve locks such that you track how full "code pages" are and switch non-full pages back to writeable in order to update their content.


On m1 switch RX to RW and back does not require a syscall

The mprotect call will fail as that isn’t a valid mechanism to toggle rw/rx


Can you give a citation that mprotect will fail? Yes there's the new, faster mechanism, but I'm surprised that they broke mprotect.


it's possible the old mprotect call will work if you use the appropriate initial mmap flag to get a jit region, but I would be surprised. The rules for rwx regions are already very restrictive compared to mmap/mprotect/etc APIs on other platforms.

I don't have an M1 Mac to test myself, but the "faster" mechanism doesn't involve anything in the pagetables, so I think toggling pagetable walks into the existing restrictions on RWX allocations.


It certainly looks like mprotect is still supported (if occasionally broken) as of 11.2 on apple silicon. Qemu and v8 both seem to rely on it.

https://developer.apple.com/forums/thread/672804


I haven’t tested on a Mac recently, but I’m pretty sure that mprotect will change the base page permissions but SPRR will continue to apply (and you’ll need to call pthread_jit_write_protect_np).


Reusing pages is usually how most emulators work, as doing what you describe is essentially a memory leak.


Apple doesn't acknowledge emulators as valid software and would prefer the world not have access to them.


Rosetta is an emulator, though.


Changing memory modes on osx/m1 is cheap, it doesn’t involve a syscall, and it has to happen any time you want to make a change to generated code (unless you do code on a separate thread from execution)


Where is that quote from? I'm not seeing it on the linked page.


It’s from this page (which was linked in the opening sentence of the April & May 2021 progress report):

https://dolphin-emu.org/blog/2021/05/24/temptation-of-the-ap...


Kudos to the team working on Dolphin. This stuff seems like witchcraft to me and their dedication to hunt down tiny bugs is amazing!


Yeah, they are wizards. I love reading emulator source code. It's helped me have a better understanding of electronics. I still don't know anywhere near enough though...


Such passion and joy in these release notes!


How well does dolphin run on Rpi 4 now?


Look for a second hand Wii U. Plays GC wii and Wii U games with hdmi!


Does it upscale GameCube games? If not do the still look ok? Dreamcast VGA 480p still looks great.


Wii U keeps the original Wii/Gamecube GPU. It has another chip behind it that scales it to HDMI. This is also why Wii 240p doesn't work on the Wii U. Instead old VC games will be a slightly blurry 480p at best.

If you want the clearest 480p, the original Wii will do. With component cables and a compatible TV, it should be just as clear as DreamCast VGA.


Yes, Gamecube (and Wii) games are upscaled right up to 4K and they look great. Many games work in 16:9 widescreen also (Gamecube was originally 4:3).

For many games there are even community high-def texture packs that you can add to make them look even better.

[Edit: Sorry, was talking about Dolphin here, not Wii U!]


[Edit: seems like you're talking about Dolphin. flatiron upthread mentioned a Wii U so that's what the question you replied to is about.]

Wii U's max HDMI output is 1080p. Also I have not seen any information that it does upscaling at all, so if you have a source for that, I'd like to know it.


Yes, the GP misspoke. However, I'd expect any half-decent TV to have no trouble upscaling the Wii U's 1080p signal → 4K.


> Many games work in 16:9 widescreen also (Gamecube was originally 4:3).

There are a handful of GameCube titles that were 16:9 native widescreen on the original console. The one that comes to mind for me is Serious Sam: The Next Encounter


F-Zero GX has a widescreen option as well. It's probably one of the better looking games when you can pump it at 1080p or higher, but I don't think a Pi is quite ready for that level of abuse yet. Maybe another 2-3 generations of new Pi hardware.


Not well. If you don't have a PC you'd be better off running it on your phone with HDMI out to a monitor.


Is there a listing of which hardware can run games at full speed at native/upscaled resolution?


Not as such, but there are a lot of YouTube videos where people test a series of games on a particular phone. There are some general rules though. Snapdragon always outperforms other platforms of a particular generation due to driver issues. More popular games like Mario and Zelda will run better because they get more developer attention. There are multiple forks with different goals, eg, Dolphin MMJR has much higher performance than official Dolphin at the cost of stability and accuracy.

Snapdragon 845 is the entry level where you can play maybe 50 percent of games at full speed, and a few at full speed and higher than native resolution. If you want to run at double or triple native gamecube resolution I'd recommend at least an 865.

Also keep in mind some phones like Pixels disable video out. Get an HDMI+PD adapter to keep your phone charged while outputting to a TV. If your phone's USB port is limited to USB 2.0 speeds you'll have to get a DisplayLink adapter.


If you have specific games in mind you can often find comparable test results for similar hardware on the game's wiki page. https://wiki.dolphin-emu.org/index.php?title=The_Legend_of_Z... (you can click "expand" to get a ton more results but they may be on very old versions and not representative of current performance).


Raspberry Pi hardware is way, way too weak.


The Raspberry Pi 4 is on the order of 10 - 20X more powerful than the Gamecube's 20 year old, single core ~400 Mhz 32-bit CPU. The GPU is a bit more difficult to compare, but I'd guess a well optimised emulator with JIT/code translation ought to run very well on Pi 4 hardware.

[1] https://en.wikipedia.org/wiki/Gekko_(microprocessor)


It actually struggles to hit 30 FPS in most GC titles still. Accurate emulation between vastly different platform stacks generally does not care about the raw performance ratio rather how "lucky" some of the hardware functionality can be efficiently mapped.


Yes, in terms of Dolphin's performance today, I don't doubt it. There are probably many more optimisations that can be made: Dolphin's AArch64 JIT is still pretty incomplete and inefficient compared to the x86-64 JIT, for example.

My point is in theory, given enough time and effort, the Pi 4 should have more than enough power to emulate a 20-year old device. I'd argue that it's certainly not "way way too weak" as the reply above suggested.


The RPi4 GPU is very weak for the tricks that Dolphin does. Good luck to get Ubershaders running on that for example.

The CPU isn't much of an issue.

Emulating a platform at such a low level in real-time is very heavy resource-wise, by design.


To elaborate a bit more on the GPU peak FP32 perf:

> VideoCore VI @ 500MHz: 500 [MHz] x 2 [slice] x 4 [qpu/slice] x 4 [processor] x 2 [op/clock] = 32 Gflop/s

which is the RPi4 config.

compared to a Snapdragon 800: 147.9Gflops FP32, and that's still a very old part.

And about the Wii itself:

> With the Wii, Nintendo opted to go with an innovative control scheme, rather than to focus on processing power. It offered 12 gigaflops, which represents a 1.27x improvement over its GameCube predecessor

The margins are way too slim when counting emulation overhead.


Ok, sounds like the Pi’s VideoCore VI is a lot less performant than I thought. I’d imagined it’d be closer to other mobile GPUs.


My understanding is that the VideoCore architecture was initially designed as more of a "media codec coprocessor", and was incidentally able to grow enough matrix math throughput to be pressed into service as a GPU.


It was probably a sane technical choice for them. RPi4 is made on the same node as the Snapdragon 800 (28nm), but with a much more recent (and bigger) CPU complex, using the Cortex-A72.

As a bunch of RPis are headless anyway...


The differences aren't just raw CPU and GPU power though. The GC, Wii, and Wii U had a couple different high bandwidth and low latency RAM[0] types in the GPU. The low latency and speed likely led to access patterns that are harder to emulate with a Pi's unified and relatively slow DRAM.

[0] https://en.m.wikipedia.org/wiki/1T-SRAM


There is a 2019 video where there is some "mixed" success with gamecube on Rpi 4 https://www.youtube.com/watch?v=l4TyYU9Xhcs

I figured with Rpi improvements (kernel/settings) and dolphin improvements, it was time to ask if it's going better now. Everyone seems negative (without data) here though.


How has Dolphin avoided getting sued by Nintendo? They seem very uptight about controlling their IPs


It might be instructive to flip the question around: what would Nintendo sue for? For which works of authorship is Dolphin infringing the copyrights? Which Nintendo patents or trademarks does Dolphin infringe? If the angle is contributory infringement based on users running illegally copied games, how does Dolphin fail to pass the "substantial non-infringing uses" test?

The only emulator project I know of that was apparently successfully stopped by Nintendo wasn't an emulator of a Nintendo system at all. It was actually a Neo Geo Pocket emulator that had "Pokemon" in its name (for stupid reasons that are not relevant to this discussion) and was threatened for trademark infringement on that basis.


And yet, so many amazing emulator projects have been sued out of existence. Remember Bleem, the Windows program that played contemporary Playstation games? Bleem actually won the court case, but the legal costs forced them out of business.

And then there was the time Sony sued Connectix for their emulator. Sony got an injuction, and while Connectix won in appeal, they also ran out of money and closed.

Nintendo, on the other hand, focuses less on suing emualator developers and more on suing distributors of ROMS for old, unavailable titles, like LoveROM.


I'm not convinced that many emulators have been sued out of existence; do you have more examples? Over the past quarter-century, there have been countless emulators released, at least a couple dozen of which achieved considerable fame. Of the examples mentioned so far, only one (Connectix) actually hinged on an issue that was substantially related to emulation (copies of the PS1 firmware used for reverse engineering during development). The bleem! case was primarily about commercial use of screenshots, and the NGP emulator matter was about the emulator's name containing an unrelated trademark (and, to my knowledge, never actually went to court).


No. Two amazing emulators got sued out of existence - and paved the way for legal existence of hundreds of emulators since.

In no way are emulators a target these days. The ROMs are. By your own admission - the emulator war was won.


After this sony hired the emulator devs to work for sony for their own emulator (which consists of bleem code). Money wins :)


IIRC, Nintendo hasn't sued anyone since their lost against GameGenie.

edit:

https://enwp.org?curid=60789181


They’re careful to not make downloads of roms, isos, or boot roms.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: