What worries me is if future generations will be able to enjoy the games of today. Will it ever be feasible to emulate a PS3 to the level demanded here? Will my grandchildren in 50 years be able to play GTA 6 on a PS4 emulator? Processing power does not appear to scale to allow this, and there will barely by any of today's consoles still alive by then (also, I doubt 2060s television sets will have HDMI input).
Accuracy takes power: one man’s 3GHz quest to build a perfect SNES emulator
41–50 of 57 posts
Re: Accuracy takes power: one man’s 3GHz quest to build a perfect SNES emulator
#42What worries me is if future generations will be able to enjoy the games of today. Will it ever be feasible to emulate a PS3 to the level demanded here? Will my grandchildren in 50 years be able to play GTA 6 on a PS4 emulator? Processing power does not appear to scale to allow this, and there will barely by any of today's consoles still alive by then (also, I doubt 2060s television sets will have HDMI input).
The Dolphin Wii emulator isn't perfect - it has the obscure bugs mentioned in the article - but unlike SNES emulators, it doesn't have a lot of game-specific hacks.
Re: Accuracy takes power: one man’s 3GHz quest to build a perfect SNES emulator
#43Or consider Air Strike Patrol, where a shadow is drawn under your aircraft. This is done using mid-scanline raster effects, which are extraordinarily resource intensive to emulate. So what's really going on here is that the emulator must emulate not only the SNES hardware, but also the television . Video game emulators have had to deal with this for a long time, to varying and increasing levels of accuracy. Televisio…
That particular problem isn't a case of emulating the television, but rather accurately emulating the console's video hardware and its interactions with the rest of the system. If one were simply interested in emulating the television's behaviour then you could construct a frame buffer based on the visible sprites and postprocess that (possibly in conjunction with several preceding fields). If the console allowed sne…
This would be possible in most cases, but the SNES throws another problem at you: the video renderer can set flags that can affect the operation of the CPU. Range/tile over sprite flags, H/Vblank signals, etc.
In my model, I chose to forgo timestamps because they are very tricky to get right with subtle details. Instead, I render one pixel at a time, but I use a cooperative threading model. Whenever the CPU reads something from the PPU, it checks to see if the CPU is currently not caught up with the PPU. If so, it will switch and run the PPU. The PPU does the same with respect to the CPU.
Even with that, all the extra overhead of being -able- to process one pixel at a time knocks the framerate from ~240fps to ~100fps. And it fixes maybe a half-dozen minor issues in games for all that overhead.
This is because scanline-based renderers are notoriously good at working around these issues. There are lots of games that do a mid-scanline write in error, but only a few that do more than one on the same scanline. So all you have to do is make sure you render your line on the correct 'side' of the write. We actually took every game we could find with this issue, and averaged out the best possible position within a line to run the highest number of games correctly. Other emulators take that further and can make changes to that timing on a per-game basis to fix even more issues.
Air Strike Patrol's shadow is actually the only known effect where two writes occur on the same line, and there is no one point that would render the line correctly.
Re: Accuracy takes power: one man’s 3GHz quest to build a perfect SNES emulator
#44Perhaps we should start using CardBus and PCI-E based FPGA cards and go for hardware simulation rather than software emulation? Performance is far easier to achieve there. The devices aren't exactly expensive either.
Multi-core seems promising, but unfortunately even 4-8 threads aren't going to cut it here. Each emulated chip can have several logic units (eg a four-stage pipeline, an ALU, a DMA unit, etc.) And even then, CPUs aren't meant for this level of synchronization. You can only lock and unlock a mutex between two threads at about 100,000 times a second. And even if that were faster, what's going to be more a burden? Requiring a 3GHz single core CPU, or a 1GHz octa core CPU?
FPGAs are great for writing emulators (although I wouldn't say as easy), but the problem with this is even worse than the octa core CPU. Until more people have the hardware than a 3GHz single core CPU, it will continue to be a worse solution for the number of people your software can reach.
Re: Accuracy takes power: one man’s 3GHz quest to build a perfect SNES emulator
#45Earlier quoted context omitted.
The emulators on the wii virtual console are not accurate at all, not in the way that byuu is talking about. Also the games get heavily patched for that purpose, as well as the emulator being patched per-game.
I think I may have only bought the Donkey Kong Country series of games for the Wii VC. It worked well enough, but I imagine that there were indeed issues with the emulation on the Wii. I didn't do any research on it so I couldn't comment on that either. The one thing I realized after the last few years is that you can't count on game companies to do backwards compatibility forever. Microsoft (understandably) gave up…
Re: Accuracy takes power: one man’s 3GHz quest to build a perfect SNES emulator
#46Re: Accuracy takes power: one man’s 3GHz quest to build a perfect SNES emulator
#47What I find interesting is that most attention is being spent on BSNES when the subject of cycle accuracy and proper emulation of hardware comes up, like this is a new or novel discovery. BSNES is hardly the first to aim for this sort of goal, nor is its efforts as close to complete as the efforts spent by others. The NES scene in particular is now down to the level of breaking out scopes to measure response times on…
I never intended to convey that this is a new idea, sorry. I do believe my cooperative threading model is a new concept in emulation, but it's still a ridiculously old one in computer science.
> The NES scene in particular ...
... is not as rosy as it seems. Having recently written an NES emulator, I can tell you that they're far from completion. For just one example, all of those mapper chips are basically a big unknown. Those chips have ways of detecting scanline edges to simulate IRQs and split-screen effects. This is done by monitoring the bus for certain patterns from the cart-side. And the details of this stuff? Completely unknown. Not even Nestopia nor Nintendulator attempt to simulate this: they just have the PPU -tell- the mapper when a scanline edge is hit. I could be wrong, but I believe I'm the first to even attempt to have the mapper detect scanlines by monitoring the bus.
And we're talking chips that are dozens of times less complex in the worst case than some of the SNES coprocessors.
> It's no longer the 90s and people shouldn't even have to mention NESticle existed in an article unless they're that out of touch with trends of the last decade.
The important part of that article is that the SNES was (and largely still is) in the NESticle phase of development, which was the purpose of bsnes. Unfortunately, just as we go from NESticle (25-50MHz) to Nestopia (800MHz required); ZSNES (200MHz) to bsnes (2-3GHz) needs a huge jump. But this time, that jump is hitting the wall of where most computer users are at. While people didn't notice Nestopia because everyone has at least a 1GHz processor these days, bsnes was not so fortunate.
So the article was more about explaining what that level of overhead is required for.
Re: Accuracy takes power: one man’s 3GHz quest to build a perfect SNES emulator
#48Perhaps we should start using CardBus and PCI-E based FPGA cards and go for hardware simulation rather than software emulation? Performance is far easier to achieve there. The devices aren't exactly expensive either.
Yes, since the primary problem is trying to simulate dozens of unique processes that all run in parallel with a single CPU thread, modern processors are woefully inadequate for the task. Emulation is possible by way of sheer brute force, with processors being thousands of times faster than the original systems. Multi-core seems promising, but unfortunately even 4-8 threads aren't going to cut it here. Each emulated c…
It's great to see you on here. I've read a lot of the writeups on your site and they're very, very fascinating stuff. BSNES/Accuracy has become my favorite emulator as well, when I can spare the clock cycles.
So thanks for being awesome, and doubly thanks for your attention to detail when nobody else seems to think its important.
Re: Accuracy takes power: one man’s 3GHz quest to build a perfect SNES emulator
#49follow up to that story here: http://www.tested.com/news/44376-16_bit-time-capsule-how-emu...
Re: Accuracy takes power: one man’s 3GHz quest to build a perfect SNES emulator
#50Earlier quoted context omitted.
The SNES is now close to 25 years old, and the older the hardware gets, the more serious the issue of "bit rot" will become. Among NES collectors, it's not rare to find people lamenting not being able to play their original cartridges anymore. Those cartridges don't last forever. Thus, emulation serves an important archival purpose, and without it, those games may be lost forever.
Aren't there a bunch of knock-off systems coming out of Asia these days? I thought I saw a box that could be play NES, SNES and Genesis original cartridges down at my local games shop.