Live data from Hacker News

Accuracy takes power: one man’s 3GHz quest to build a perfect SNES emulator

arstechnica.com

31–40 of 57 posts

Re: Accuracy takes power: one man’s 3GHz quest to build a perfect SNES emulator

#31
post #18

Earlier quoted context omitted.

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…

You're correct, this particular problem can be handled with sufficiently sophisticated frame buffer logic. I was generalizing from that to other concepts where emulating the television or its signal processing would be required. I'll give you another example. On the Atari 2600 game console, the vertical sync is software controlled . The software is responsible for enabling the vertical sync pulse. This can be done 60…

I recently bought 'Racing the beam' book which goes into Atari 2600 VCS details and programming - http://mitpress.mit.edu/catalog/item/default.asp?ttype=2&#38... I recommend this book to everyone interested in this topic.

Re: Accuracy takes power: one man’s 3GHz quest to build a perfect SNES emulator

#32
post #9

Earlier quoted context omitted.

It depends on the size. Big FPGA's are amongst the most expensive chips that you can buy ($10K and up), but small ones are affordable. The amount of logic in an 80's era game computer should be within the gate budget of a small to mid sized FPGA. See http://www.fpgaarcade.com/ for many examples of this.

Back in '01 (the good old days), we had volume prices of $40 for Xilinx parts which were big enough to get a PowerPC CPU in it.

What were you building?

Re: Accuracy takes power: one man’s 3GHz quest to build a perfect SNES emulator

#33
post #24
post #4

Perhaps 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.

I think the fact that the SNES hardware is proprietary would make it very tough to catch all the corner cases (since we'd be reduced to tons of test and check cycles or using SEMs to examine the chip). Plus, many cartridges has supplementary chips, so the fpga would also have to include all the different chips used, and all these are proprietary as well.

But all the hard work is done: bsnes emulates all of those chips. Sure, it's not trivial to convert bsnes to vhdl, but there's no need for further reverse-engineering unless you want to make pin-compatible replacements. The bsnes code and documentation contain all the information necessary to make an FPGA into a SNES-on-a-chip.

Re: Accuracy takes power: one man’s 3GHz quest to build a perfect SNES emulator

#34

Earlier quoted context omitted.

Also, the medium on which the software is delivered is not the problem either. It's just information after all. The problem is accurately emulating the software in software which is easier achieved by emulating the harware in hardware :)

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.

Re: Accuracy takes power: one man’s 3GHz quest to build a perfect SNES emulator

#35
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).

Re: Accuracy takes power: one man’s 3GHz quest to build a perfect SNES emulator

#36

Earlier quoted context omitted.

Also, the medium on which the software is delivered is not the problem either. It's just information after all. The problem is accurately emulating the software in software which is easier achieved by emulating the harware in hardware :)

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.

Nice perspective.

Conservators in museums face the same issues with video art and installation art. The video equipment becomes obsolete and breaks down. The light bulbs are no longer made (an art-prep person for a recent MOCA retrospective had to drive a van from LA to Arizona to lay hands on the last available batch of a certain type of florescent tube). With some minimalist installations, just changing the bulbs can make a huge difference.

Here's a little piece on conservation challenges with a piece by Nam June Paik, who pioneered wall-size video installations:

http://www.digitalartconservation.org/index.php/en/exhibitio...

"In the case of Internet Dream, the splitting system was the Achilles heel of the installation. The video splitter used since 1994 was produced by the South Korean manufacturer DASH. Since the manufacturer helped Paik with the technical realization of many of his works (including Megatron/Matrix in 1995), it is likely that this device was specially constructed for the installation. By 2008, the device’s shutdown function had become problematic, probably a sign of more serious loss of function to come."

You see the same dichotomy between fine-art creators versus conservators, as you see between video game artists and emulator designers: "whatever works in the moment" freedom versus obsessive attention to detail.

Re: Accuracy takes power: one man’s 3GHz quest to build a perfect SNES emulator

#37
post #35

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).

Not to mention DRM.. it's a serious problem.

Re: Accuracy takes power: one man’s 3GHz quest to build a perfect SNES emulator

#38
post #3

Or 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…

Is anyone else reminded of the "copper" effect people would do back in the day where they would cycle the colors of a screen in sync with the horizontal refresh of the monitor to create bars of color the oscillate up and down in really cool patterns?

I made copper bars once, just for having done them. I guess by the time I got into democoding (96/97 or so), they didn't impress as much anymore. It was cool that they were technically full-colour in a 256c screenmode, but apart from that they were just horizontal coloured bars to me :)

However there was another very useful trick to changing colours wrt sync. Basically you wanted to have all the gfx drawing done before the vertical retrace (which is quite a bit longer than the horizontal one), then flip the buffer (during) so you'd get a flickerless display at full framerate. Now if you'd change palette colour 0 (background, including screen edges) to red right after the flip, and then back to black again after your drawing routines are done and you begin waiting for the vsync again, you got to see the top of your screen's background red, up until some percentage of the screen height.

This was basically your performance meter. Code more complex routines and the red area becomes bigger. Add even more calculations, it gets to the bottom of the screen, and when it gets too far you won't be done calculating before the next vsync and your framerate drops to half.

Some times I even micro-optimized bits of assembly code by marking the position with pencil on a post-it on the side of the monitor to see if switching around some instructions would make it go up or down a few millimeters :) It really was that stable (given you did exactly the same calculations every frame--which is often the case for demos, but probably not for games). That is, until Windows came along: multitasking meant you were going to miss that vsync every once in a while and the red bar jumping up and down like crazy.

Re: Accuracy takes power: one man’s 3GHz quest to build a perfect SNES emulator

#39

Earlier quoted context omitted.

Back in '01 (the good old days), we had volume prices of $40 for Xilinx parts which were big enough to get a PowerPC CPU in it.

What were you building?

Surface to air missiles!
Post reply on HN