JSNES: a NES Emulator Written in JavaScript
Today’s award for the most unlikely, probably pointless, but simply stunning use of JavaScript goes to Ben Firshman and his Nintendo Entertainment System emulator, JSNES.
The emulator is port of the Java-based vNES project. It uses the HTML canvas
element for screen rendering (sorry Internet Explorer users) although sound is not supported yet.
There are 17 working games to try. Most will run in Firefox 3.5 or Safari 4, but neither browser offers a playable gaming experience. You’ll be lucky to achieve 10 frames per second on the highest-specification liquid-nitrogen-cooled ninja PC.
The real revelation, however, is Google Chrome — it runs the emulator at full speed (50-60 fps) on a modest PC. Google’s canvas
performance optimization appears to be out-pacing the competition by a considerable margin. Both Mozilla and WebKit have raised bugs to investigate why there is such a noticeable speed difference.
Although JSNES is little more than an interesting experiment, it illustrates what can be achieved with modern JavaScript engines, some ingenuity, and lots of caffeine. Ben Firshman — you are a genius. My only question is … why?!!
See also: SitePoint’s Exclusive Interview With Ben Firshman, Creator of JSNES