top | item 22748135

How SNES emulators got a few pixels from complete perfection

543 points| turbohz | 6 years ago |arstechnica.com | reply

158 comments

order
[+] byuu|6 years ago|reply
Hi all, thank you for sharing this article here! It is technically a "laymen's" version of https://byuu.org/articles/edge-of-emulation (submitted here earlier), meant for a wider audience, but it does elaborate on some new discoveries such as the digital video output testing mode.

In the off chance anyone is able to help with this, I've set up a Discord channel (#ars) for coordination here: https://discord.gg/Fx7TfKh

Every member of the bsnes-emu project is on said server.

Thanks so much!

[+] greggh|6 years ago|reply
I'm sure the answer is no, but I emailed a few people at NERD (Nintendo European Research & Development). Asked the obvious question about the documentation even existing anymore, and if there were any possibilities of it ever being made public.

You've probably done that already, but I figured it was worth a shot. I'll update if I actually get a response.

[+] armitron|6 years ago|reply
Please don't use discord if you can avoid it, it's spyware.
[+] FillardMillmore|6 years ago|reply
Interesting tangent from the article:

>Today, SNES emulation is in a very good place. Barring unusual peripherals that are resistant to emulation (such as a light-sensor based golf club, an exercise bike, or a dial-up modem used to place real-money bets on live horse races in Japan), every officially licensed SNES title is fully playable

I had to look up the 'dial-up modem' reference - apparently it's a Japan-only peripheral called the "Famicom Network System" that did in fact have software available that allowed for bets to be placed on live horse races.

https://en.wikipedia.org/wiki/Family_Computer_Network_System

http://niwanetwork.org/wiki/JRA-PAT

[+] Kaze404|6 years ago|reply
If this is interesting to you, I recommend this (1) documentary on XBAND, a peripheral used to access an Xbox Live-like service for the Super Nintendo. It's a fascinating piece of engineering for the time.

(1) - https://youtu.be/k_5M-z_RUKA

[+] Zenbit_UX|6 years ago|reply
Nintendo had dial up modems and their own intranet in 37% of Japanese households in the mid 80s? How did I not know this was a thing.
[+] GuiA|6 years ago|reply
I imagine that these could still be emulatable in software, right? I.e. you could simulate whatever data the golf club was generating and pipe it into the emulator, such that you could play that golf game with a Wiimote or some other peripheral.

Similarly you could have some shim code for the online games like the horse race one that talks to some community run server, re-enabling a new kind of net experience.

[+] geofft|6 years ago|reply
The linked story about Higan's NEC uPD772x emulation being used by Stephen Hawking is pretty amazing, both as a story in its own right and as a parable about the value of open source and code getting used in wildly different contexts from what it was originally designed for: https://www.sfchronicle.com/bayarea/article/The-Silicon-Vall...
[+] nullc|6 years ago|reply
It's sad that Nintendo doesn't seem to see this as an opportunity to earn free press and goodwill by simply releasing all the design documents, mask images, etc.

The community is going to get there eventually without their help, but they could probably make it much faster and cheaper to get there.

Doubly so because they sell products which almost certainly benefit from these open source emulation efforts.

[+] kingbirdy|6 years ago|reply
Nintendo is still actively selling SNES games via Nintendo Switch Online, and as far as I know rolls their own emulator(s) for this rather than using existing open source ones as Sony did for the PS Classic, so I doubt this will happen any time soon.
[+] overcast|6 years ago|reply
What's sad is they don't just release the entire SNES/NES library for people who buy into their Nintendo online service. It's shameful how they've treated people who have bought and rebought into previous iterations only to have their libraries wiped out with new hardware generations. I'm looking at you virtual console.
[+] userbinator|6 years ago|reply
And so the final, most extreme approach, would be to expand upon our decapping efforts. We have 20x die scans, but the resolution is not enough to make out and reconstruct individual logic circuits from them, such as was done with the Visual 6502 project.

That was done with the NES too:

https://github.com/SourMesen/VisualNes

[+] Cyberdog|6 years ago|reply
> It combines both simulators into a single simulation and allows the simulation to run NES roms (albeit at roughly 1/1000th of the speed of a real NES)

What is this emulator doing that causes it to emulate so slowly? Even if it's doing perfect emulation, are modern processors still so slow that they can't emulate a couple 35-year-old processors at something closer to real time?

[+] dehrmann|6 years ago|reply
Would using die scans start to run into copyright issues?
[+] lukevp|6 years ago|reply
I haven’t heard about this, thank you for the link!
[+] kingbirdy|6 years ago|reply
If you found this interesting, the author's website has a number of informative, in-depth articles about emulator development & console architectures: https://byuu.net/
[+] Razengan|6 years ago|reply
I just want to say that some of the most fun I’ve ever had on the PC has been in a SNES emulator. The sheer variety, depth, hours of content, ease of accessibility, and great music has been nearly unmatched on most other platforms.

I highly recommend anyone with an interest in games to grab a bunch of ROM packs (including Japanese exclusive games and fan translation hacks) and spend some of your quarantine on the SNES.

[+] scandinavegan|6 years ago|reply
SNES graphics has aged really well! I introduced my kids to NES and SNES through emulators, and while they played Super Mario Bros on NES, they really liked Super Mario World, Super Tennis, and Clay Fighter on SNES.

I'd like to get them to play A Link to the Past and Chrono Trigger, but I don't think that they're patient enough. Still, beautiful games with great soundtracks.

[+] smabie|6 years ago|reply
Especially Chrono Trigger! That game is amazing!
[+] ilaksh|6 years ago|reply
On the last extreme idea, it seems one thing to do for starters is to get the 100x magnification of the PPUs from someone and put it in the GitHub repo.

Then anyone who has the ability to start converting that to VHDL or any sort of identification of components can start on part of it and contribute to the repo.

With some started, it may be possible for less expert people who have a little bit of VHDL or whatever to contribute to some degree with expert supervision.

[+] terrycody|6 years ago|reply
Admiration to those people like byuu write emulators with their devotion, if without them, we have no today's splendid retro culture.
[+] jancsika|6 years ago|reply
Is there any SNES emulator that runs on arm?

I've got retroarch v1.3.6 on Stretch on aarch64. It has crashed with a "file not found" and "bus error" for bsnes. Higan segfaults when I try to run it.

[+] rm445|6 years ago|reply
Not helpful to you except as an existence proof, but you can install Retropie on a Raspberry Pi and it will play SNES ROMs fine. I believe the emulator is a variant of SNES9x.
[+] nmz|6 years ago|reply
retropie runs fine on some arm platforms. you can also use lakka. However the latest retroarch is 1.8.5, while the 1.3.6 version is from 2016, I would imagine nothing would work on Stretch, so I recommend an upgrade or any OS that isn't debian. If in doubt, gentoo always works, though its source based.

https://retropie.org.uk/ http://www.lakka.tv/

[+] th0ma5|6 years ago|reply
I've been running it on a Fire stick 4k but in 32 bit mode
[+] knorker|6 years ago|reply
Error in the article: 32x32bit multiply (i.e. 2^64 bits) is not a "heat death of the universe" thing.

It's a lot, yes. Not practical for these purposes. But there's a reason we don't use 64bit encryption.

64bit encryption is easily brute forced.

If you want to keep it in a table, sure that's 18 exabytes (multiplied by element size in bytes), but that's before compression. I imagine multiply output compresses very well. And that's a lot of RAM. But not anywhere near "heat death of the universe" amounts.

I bet FAANG easily have that much RAM. Each of them.

[+] nullc|6 years ago|reply
Performing those 2^64 operations on the original SNES hardware as would be required to profile its unknown behavior, on the other hand...
[+] smprather|6 years ago|reply
Has Nintendo released officially, or leaked, the RTL for any of the processors in the SNES? If someone could get their hands on that, then the emulation authors should be able to achieve perfection.
[+] NobodyNada|6 years ago|reply
AFAIK chips from this era were designed and layed out by hand, rather than with an HDL.
[+] intellix|6 years ago|reply
I'm sure that I was playing Zelda Link to the Past and Super Metroid without any problems about 20 years ago. What's changed since then? I thought this was already solved :) apologies for my ignorance
[+] TAForObvReasons|6 years ago|reply
Nintendo Switch Online subscription includes an "official" SNES emulator. How does it compare to BSNES, and would a decompilation of the emulator help with resolving the PPU issues?
[+] delroth|6 years ago|reply
Nintendo's emulators are usually equivalent to what the state of the art was 15-20 years ago. They have plenty of bugs, usually fixed with duct tape and game specific hacks. They are designed to run the set of games they sell and nothing else -- once you get out of what the QA team has explicitly tested, it's not uncommon to find unemulated or badly emulated hardware features.
[+] xwdv|6 years ago|reply
Can original SNES hardware play ROMs somehow?
[+] montecarl|6 years ago|reply
Yes! These are called flash carts (short for cartridge). Here is a popular one for SNES: https://www.amazon.com/dp/B0052URJKM

Many people who stream older console games on twitch seem to use them as well as people who like to play romhacks.

[+] lidHanteyk|6 years ago|reply
It is interesting to me how some systems are easier to emulate than others, and the ease of emulation seems to correlate somewhat with ease of programming model. The infamous example which comes to mind even far beyond the SNES is of course the Sega Saturn, while on the other end of the spectrum, Dolphin has support for multiple consoles at once.
[+] delroth|6 years ago|reply
Counting the GameCube and the Wii as two consoles is kind of cheating, the Wii is barely more than an overclocked GameCube with an irrelevant OS running on the side exposing some I/O through a fairly well defined I/O interface. The hardest part of emulating a Wii is emulating a GameCube.

Dolphin is also nowhere close to the accuracy of emulators like bsnes. There are many games that plain don't boot, mysterious bugs that have resisted debugging for years and years (some game breaking, e.g. if you have too many characters unlocked you cannot finish Fire Emblem Radiant Dawn on Dolphin), etc.

[+] sprayk|6 years ago|reply
Dolphin has support for two consoles: Gamecube and Wii. It supports both of them because the architectures are extremely similar. I don't get what you mean by "ease of programming model". Saturn/Playstation/N64 were the first to have games programmed primarily in C with libraries provided by the system developers. This generation is harder to emulate simply because the system architectures contain more chips connected with wider buses running at much higher clock speeds. All of those factors make low level analysis, like with a logic analyzer, impractical. Another factor is the popularity of the system and level of interest in emulation of the system. The original XBox is a good example of this. Gamecube and PS2 have much more polished emulators because they have more titles that interest people, while little effort is spent on emulating the original Xbox (despite being essentially a PC) arguably due to the lack of exclusive titles to make it worth it.
[+] aidenn0|6 years ago|reply
I played SNES games emulated on a 66MHz 486/DX2 using an emulator named "esnes". No sound[1] and translucency was more miss than hit, but good enough to play through the entirety of ChronoTrigger. It was pretty cool to play a current (if aging) system emulated on a PC.

1: Sound was eventually implemented, I don't remember if it was before or after I upgraded to a Pentium though.