21 votes

How can it take 3GHz to emulate a Super Nintendo? One man’s quest to build a perfect SNES emulator. (2011)

18 comments

  1. [10]
    vivarium
    Link
    I've recently started setting up some emulators to play some older games. But, when trying to emulate N64 games, I ran into terrible performance issues with the highly recommended, highly accurate...

    I've recently started setting up some emulators to play some older games. But, when trying to emulate N64 games, I ran into terrible performance issues with the highly recommended, highly accurate emulators (e.g. simple64). I was very confused as to why I could play GameCube games on Dolphin just fine, but N64 games proved to be such a struggle, even after tweaking every setting I could. Even the WiiWare copies of games played better on Dolphin than the original roms did on simple64.

    This article I found by the late Near (r.i.p.) does a good job at explaining the tradeoffs between accuracy and performance in emulators, and why even older systems can be resource-intensive to emulate. Even though the article is about the SNES, it helped me to understand why the most accurate N64 emulator out there performed so poorly.

    I ended up switching to a different emulator (Project64) which is less accurate but has better performance, and the games I wanted to play ran just fine. I'm sure I'll run into some obscure bugs for some games, but my needs are pretty basic, so I'm sure I'll get by fine. But I thought I'd share the article, since I found the topic very interesting to read about.

    17 votes
    1. [4]
      Gummy
      (edited )
      Link Parent
      Be aware that project 64 is no longer recommended and newer versions have been reported as malware. Mupen64 or retroarch are much safer and more stable alternatives. Parallel launcher is also a...

      Be aware that project 64 is no longer recommended and newer versions have been reported as malware. Mupen64 or retroarch are much safer and more stable alternatives. Parallel launcher is also a good option despite being originally built for Mario 64 rom hacking, it's really just a nice front-end for the liberto cores.

      This wiki is a good source for emulation and explains better than me why project64 shouldn't be used compared to other newer projects.

      11 votes
      1. [3]
        thumbsupemoji
        Link Parent
        Came to say, /u/vivarium Mupen & m4xw are where you wanna be, that guy has done a lot for emulation.

        Came to say, /u/vivarium Mupen & m4xw are where you wanna be, that guy has done a lot for emulation.

        6 votes
        1. [2]
          vivarium
          (edited )
          Link Parent
          Thank you to you and @Gummy for the recommendations. I had initially started with the software Retrobat (which is just an opinionated EmulationStation-based frontend that auto-configures...

          Thank you to you and @Gummy for the recommendations. I had initially started with the software Retrobat (which is just an opinionated EmulationStation-based frontend that auto-configures emulators). Retrobat had downloaded Retroarch and configured it to use Mupen64Plus-Next with the Dynarec CPU core alongside ParaLLEl-RDP. I've tried other CPU cores and RDP plugins, but the performance issues still occurred.

          That's why I eventually switched to simple64 and finally Project64, the latter of which was the only one to play Kirby 64: The Crystal Shards without stuttering. All of the "accurate" emulators seem to work OK at first, but stutter as soon as 2+ enemies are on-screen, within seconds of starting the first stage.

          I would love to use the newer emulators, however I can't for the life of me figure out what magic combination of settings will make Kirby 64 run smoothly. My laptop is a 2017 Dell XPS 9560 with an NVIDIA GTX 1050 and an i7-7700K on Windows 11, which I assumed would be powerful enough, even if it is 7 years old now. Is there something I'm missing?

          EDIT: I just tried RMG (Rosalie's Mupen GUI) with its default configuration (Dynamic Recompiler + GLideN64) and it seems to work flawlessly. I'm not sure what Retroarch/simple64 are doing to make the default experience so abysmal, but I'm happy to have found something that works that isn't Project64.

          3 votes
          1. thumbsupemoji
            Link Parent
            Glad you got it going—disclaimer I am not a knowledgeable CS person lol, but i believe N64 carts often contained just bizarre one-off bits of hardware, in addition to weird optimizations &...

            Glad you got it going—disclaimer I am not a knowledgeable CS person lol, but i believe N64 carts often contained just bizarre one-off bits of hardware, in addition to weird optimizations & whatnot, that can make things tricky for specific games; I had a physical copy of Space Station Silicon Valley that would freeze at the same spot every playthrough, so when I saw it at a flea market I grabbed a second copy—same thing. Turns out if you have an expansion pack then your SSSV game will lock up at that exact spot, ever time lol. Pros and cons of physical media!

            1 vote
    2. [5]
      BeardyHat
      Link Parent
      I've been baffled by N64 emulation performance for some time now, so much so that I have no interest in exploring the catalogue. I had been trying to play Rogue Squadron and performance was awful,...

      I've been baffled by N64 emulation performance for some time now, so much so that I have no interest in exploring the catalogue. I had been trying to play Rogue Squadron and performance was awful, but FZero was great.

      I did come to the realization though that this is also just how it was and N64 games generally just run like shit, even on original hardware. I never had one as a kid, as I was already deep into PC gaming at the time, but lots of my friends did, so I thought I'd check it out, but the performance is just so off-putting.

      3 votes
      1. [4]
        Gummy
        Link Parent
        What emulator were you using and getting poor performance? N64 emulation has come a long way recently and Mupen has incredible performance even when scaled to 1440p and using HD textures. It's not...

        What emulator were you using and getting poor performance? N64 emulation has come a long way recently and Mupen has incredible performance even when scaled to 1440p and using HD textures. It's not always perfect, but it runs better than the original hardware at the very least.

        2 votes
        1. [3]
          BeardyHat
          Link Parent
          It's been a little while since I tried, but I had been running it through RetroArch with the Mupen64plus_next_gles3 core. Tried several different ones and that one seemed the best out of all of...

          It's been a little while since I tried, but I had been running it through RetroArch with the Mupen64plus_next_gles3 core. Tried several different ones and that one seemed the best out of all of them, yet still the performance is abysmal.

          Ok, that said. I started writing that comment and it occurred to me I should check it out again, as it's been a few months and I wanted to confirm the FPS and general stutter that I remembered. Which was happening, getting frame drops down to 25fps very frequently, then it occurred to me that RetroArch enables Rewind be default, so I disabled it and the performance issues appear to be resolved.

          Thanks for encouraging me to take another look. Actually helps me save a little money here, as I had been thinking about buying yet another retro handheld and this reinvigorates my satisfaction with the one I already have.

          2 votes
          1. [2]
            Gummy
            Link Parent
            I'm glad you got it figured out. Retroarch is really nice most of the time, but it could really use a UI overhaul and maybe not have so many weird features enabled by default. I just use Parallel...

            I'm glad you got it figured out. Retroarch is really nice most of the time, but it could really use a UI overhaul and maybe not have so many weird features enabled by default. I just use Parallel launcher for n64 games now since it's the same cores as what retroarch is using, but with a lot less fiddling in awkward menus.
            Though when it comes to handheld emulation I'm not sure what options there are outside of retroarch. Most of the emulating I do is streamed from my pc to my TV so I have avoided looking into much portable stuff.

            1 vote
            1. BeardyHat
              Link Parent
              Agreed with Retroarch. I have learned it, but still find it pretty fiddly in general and I do tend to prefer a standalone solution; that said, I've found Mupen to generally have fewer options with...

              Agreed with Retroarch. I have learned it, but still find it pretty fiddly in general and I do tend to prefer a standalone solution; that said, I've found Mupen to generally have fewer options with regards to emulation. Though I may now fiddle with it a bit more and see if I can get it as functional as RetroArch, as RA is now giving me issues coming out of suspend.

              Handheld options are pretty wide. In spite of being a PC Gamer for most of my life, I've never really fiddled with emulation on PC all that much, outside of messing about here and there. Right now I'm on Android, so I have most options available to me and am running several standalones already, such as NetherPSX2 (or whatever it's called now), Drastic and Citra.

              1 vote
  2. [5]
    JCPhoenix
    Link
    That's insane. Reading out code by looking at the physical structure of the chip.

    LLE is also a very expensive operation, monetarily speaking: to obtain the DSP program code requires melting the integrated circuit with nitric acid, scanning in the surface of a chip with an electron microscope, and then either staining and manually reading out or physically altering and monitoring the traces to extract the program and data ROMs. This kind of work can cost up to millions of dollars to have done professionally, depending upon the chip's complexity, due to the extremely specialized knowledge and equipment involved.

    That's insane. Reading out code by looking at the physical structure of the chip.

    15 votes
    1. [4]
      teaearlgraycold
      (edited )
      Link Parent
      I love the big middle finger to the people trying to protect their IP. All so that we can play some vidya. Reminds me of the 4K77 project. Star Wars nerds wanted the original version of A New Hope...

      I love the big middle finger to the people trying to protect their IP. All so that we can play some vidya.

      Reminds me of the 4K77 project. Star Wars nerds wanted the original version of A New Hope in 4K, but both Lucas & Disney refused. So they acquired (legally) original theatrical film rolls. They then captured each frame using a camera, aligning and cleaning each image. I believe a few different rolls were required to get each frame in high quality. They even remastered the color grading and performed digital noise reduction as might have been done with an official release. And now these nerds have the highest quality digital version of the unmodified Star Wars. It is of course distributed illegally even though the people that made it didn't break any laws in creating it.

      26 votes
      1. [3]
        NoblePath
        Link Parent
        Sidetracking a touch here, but is there a rationally defensible reason for lucas not releasing a 4k original? I mean what did he have to lose? What does Disney have to lose now? My only thought is...

        Sidetracking a touch here, but is there a rationally defensible reason for lucas not releasing a 4k original? I mean what did he have to lose? What does Disney have to lose now? My only thought is that it will cause like 0.003% drop in merchanides sales. Otherwise it just seems like "We don't want that just because we want to feel in control of it."

        3 votes
        1. teaearlgraycold
          Link Parent
          For Lucas it was a matter of pride I think. When he made A New Hope it wasn’t a massive franchise and there are lots of areas of the movie that lack polish. So he tried to retcon real life with...

          For Lucas it was a matter of pride I think. When he made A New Hope it wasn’t a massive franchise and there are lots of areas of the movie that lack polish. So he tried to retcon real life with his special edition edits to make it look how he wants it to look now.

          Maybe Disney has an agreement with him on this? I think they’d recoup their investment for the remaster many times over with a bluray and Disney Plus release. Not a huge line item but an easy win. It’ll probably happen eventually.

          8 votes
        2. Greg
          Link Parent
          There is a real cost involved in digitising films well; not an absurd cost, or even a particularly large one in the context of a company like Disney, but a cost nonetheless. The logical next step...

          There is a real cost involved in digitising films well; not an absurd cost, or even a particularly large one in the context of a company like Disney, but a cost nonetheless. The logical next step in my mind would be at least giving the nerds blessing to do it themselves, since they're clearly willing to provide most of the expensive time and expertise for free, but even that would come with a stack of lawyer time to get it signed off if it were officially sanctioned by the company.

          That might well not be the actual main cause here - I think you're likely right that Disney wants tight control of their IP, and I think @teaearlgraycold is likely right that Lucas personally didn't want to see the old versions released anyway - but even putting those aside it'd be an uphill battle trying to get them to spend anything at all without a clear expected return.

          All that said, I'd dearly love to live in a world where "the fans who made us what we are would enjoy it" would still be considered a good reason for a business to spend some infinitesimal-to-them amount of money on a project. Or even just refrain from aggressively suing people, in the context of Nintendo…

          3 votes
  3. unkz
    Link
    These were fun to play with back in the day. Interesting how emulation has to deal with not just the game system itself but also its ecosystem of peripherals, like how duck hunter also won’t work...

    This is done using mid-scanline raster effects, which are extraordinarily resource intensive to emulate.

    These were fun to play with back in the day. Interesting how emulation has to deal with not just the game system itself but also its ecosystem of peripherals, like how duck hunter also won’t work even if you have original hardware because of how non-CRT displays work.

    3 votes
  4. heraplem
    Link
    This is hard to come back to after what happened to Near, the author of bsnes.

    This is hard to come back to after what happened to Near, the author of bsnes.

    2 votes
  5. Sapholia
    Link
    Very interesting read, thank you. I remember using ZSNES back in the day, because it was familiar and also because it was the only SNES emulator I knew of with networking capabilities. I used it a...

    Very interesting read, thank you. I remember using ZSNES back in the day, because it was familiar and also because it was the only SNES emulator I knew of with networking capabilities. I used it a few times to play multiplayer games with online friends. But I do remember issues with it as well, most notably when playing Chrono Trigger. There's a portion of the game which places a semi-transparent cloud over the whole screen, which in the emulator was rendered fully opaque, meaning you couldn't even see to continue the game. (You could turn off individual graphics layers, fortunately, but obviously that's not the solution you want to use.) At the time, it felt wild to me how long that remained an issue, considering CT is one of the most popular games on the system.

    I did later use bsnes/higan a few times, but I'd largely stopped playing emulated games at that point. I can very much appreciate their attitude of respecting accuracy to the level they did, though.