By Craig Buckler

JSNES: a NES Emulator Written in JavaScript

By Craig Buckler

JSNESToday’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.

Visit the JSNES page…

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

  • Jason Garrison

    I believe the answer is, “because he can”. Very, very cool!

  • WWW

    Why? Why not?

  • “My only question is … why?!!”

    Simple.. It’s nostalgic. I grew up on that stuff. Brings back good memories. :)

  • Maybe Craig is too old to understand why ;)

    Anyone that can hum the music to the original super mario brothers (and occasionally does out of the blue) understands “why”.

  • HereAndNow

    I tried the Javascript NES emulator, with Chrome 4 on Ubuntu, and it works great!

    Anyone interested in checking out HTML5 sites & demos can try some of these:

    I’m not sure, if the people who installed Google Chrome Frame need to prefix the URLs with “cf:” or not.

    This stuff is really cool!

  • Nostalgia plus technical challenge, i guess.

    Now we have a new JavaScript and Canvas performance benchmark. :D

  • kurole

    Thats cool.
    Gchrome beating even firefox

  • Very cool.

    I can’t figure out what to do in Mario Bros! Once he gets to the top, what’s he supposed to do? There seems to be nothing to do except avoid the tortoises!

  • r4ccoon

    maybe he get bored with c++, or csharp, or java
    maybe he loves javascript
    maybe he hates IE!!

  • Am I missing something? What are the controls

  • Anonymous

    I can’t seem to play it. The controls aren’t doing anything in google chrome (or firefox for that matter). It’s like the game is in demo mode (like the computers playing).

  • chaoszvvz

    Cool, it runs perfect.

  • Ivan

    Good work!

  • Aikeru

    Am I the only one thinking we need a “Doom” port to test browser performance? :D

  • I can now help answer “why” Ben wrote it…
    SitePoint’s Exclusive Interview With Ben Firshman, Creator of JSNES

Get the latest in JavaScript, once a week, for free.