Join 3,417 readers in helping fund MetaFilter (Hide)


JNES
September 18, 2009 6:40 AM   Subscribe

JNES is a Javascript Nintendo Emulator. It works shockingly well.
posted by chunking express (46 comments total) 16 users marked this as a favorite

 
Awesome. Bubble Bobble is a lot easier at 2.6 FPS. Wait, not easier...the other thing.
posted by DU at 6:44 AM on September 18, 2009 [1 favorite]


I'm getting 60 FPS. I'm running the emulator in Chrome, as they recommend.
posted by chunking express at 6:46 AM on September 18, 2009


And thus I began another game of Dragon Warrior.
posted by Lemurrhea at 6:58 AM on September 18, 2009 [3 favorites]


Maybe I won't write that paper comparing market and administrative responses to potentially cataclysmic systemic risks.
posted by anotherpanacea at 7:01 AM on September 18, 2009 [5 favorites]


Yeah, this is awesome. Although not to sound ungrateful, but there's no sound.. <canvas> with Chrome's fast javascript engine is reasonable for graphics, but are there any sound solutions that'd work that don't involve flash?
posted by Nelson at 7:07 AM on September 18, 2009


Oh crap. This is going to be like Cyclomaniacs all over again. My productivity is again shot.
posted by glaucon at 7:11 AM on September 18, 2009


The one fiddly bit was working around the places where the Fuse code used low-level C constructs to its advantage: using unions to chop and change between individual registers and 16-bit register pairs, and relying on limited-size C data types (often in pretty subtle ways) to truncate 8-bit and 16-bit values at the right time, whereas Javascript only has integers.

Wow developing games for the NES must have been a maddening experience.
posted by geoff. at 7:17 AM on September 18, 2009 [1 favorite]


Firefox not only dragged arse, it also gets confused if you have quick find on. Now I get to try Chrome for the first time.

...and it's full speed. Nice. But is there a way to expand the screen?
posted by Hardcore Poser at 7:24 AM on September 18, 2009


Wow developing games for the NES must have been a maddening experience.

I'm pretty sure NES game developers used real programmers, not JavaScript code monkeys.
posted by effbot at 7:27 AM on September 18, 2009 [1 favorite]


Although not to sound ungrateful, but there's no sound..

In my best Gob Bluth voice: "...TYPICAL."
posted by jake at 7:40 AM on September 18, 2009


Java applets are dead by now, but now a volcano has destroyed the cemetery.
posted by RobotVoodooPower at 7:42 AM on September 18, 2009 [2 favorites]


I get about 12 fps in Safari and 7 in Firefox on Snow Leopard. Chrome for Mac isn't available yet so, eh.
posted by jedicus at 7:44 AM on September 18, 2009


I get about 12 fps in Safari and 7 in Firefox on Snow Leopard. Chrome for Mac isn't available yet so, eh.

This.
posted by schyler523 at 7:46 AM on September 18, 2009


This has to be one of the best non-flash flash Friday posts ever. Childhood being relived. I remember when my brother, my family/friends and I would have Dr Mario championships. My brother was so good at that game he would setup the moves that dumped more pieces on you. He would continuously dump them too. It got so bad that you would not be able to do anything but sit there and get rained on by random pieces. One time my dad got so mad at my brother that he ground him until my brother was 18. It didn't stick but thinking back it was funny to see a grown man (my dad who looks like Randy Marsh btw) yelling "Your grounded until your 18 old man!" to my brother. Good times.
posted by Mastercheddaar at 7:52 AM on September 18, 2009


Once again, Flash is way ahead of the game.

ActionScript is effectively JavaScript -- but Flash has always (well, for the last eight years) compiled it from Bytecode. It never felt like Java however because they actually never got it into their heads it was OK to hit 100% CPU for 3 seconds. Can't ship an ad that way.

JS is just recapitulating Flash's evolution.
posted by effugas at 7:52 AM on September 18, 2009


Hmm.. a game like Dragon Warrior would actually still be playable at <10 fps. Just saying. I probably won't find any use for this, though. I slack off at work plenty, but playing NES games would cross over into "just don't give a fuck" territory.
posted by naju at 7:58 AM on September 18, 2009 [3 favorites]


I get about 12 fps in Safari and 7 in Firefox on Snow Leopard. Chrome for Mac isn't available yet so, eh.

Proving once again that Macs are terrible for gaming. Zing! Although actually Chrome is available for the Mac as a developer release. My Mac friends say it works pretty well.
posted by Nelson at 8:10 AM on September 18, 2009 [1 favorite]


JS is just recapitulating Flash's evolution.

Yes, except that this time, it doesn't suck massive donkey balls*.





Okay, fine, it easily can. But my point is this: Almost everything running in flash I've ever seen is a massive brain-popping processor hog. This includes "simple" things. Most of the JS I've seen is not. I have to use a firefox extension to kill off all flash in order to keep my system from getting turned into a crawling mess every time a page decides to use Flash ads; I've never felt a desire to turn off Javascript.

*not donkey-ball-sucking-ist.
posted by Tomorrowful at 8:14 AM on September 18, 2009


Sorry, forgot to add this:

It never felt like Java however because they actually never got it into their heads it was OK to hit 100% CPU for 3 seconds. Can't ship an ad that way.

Dude. Dude. Have you ever seen an actual, real-world Flash ad? Like half the fucking internet is coated in them, and I regularly saw spikes up to 100% on my processor monitor before I got FlashBlock. I'm told it's slightly less awful on Windows, but I think we're well past the point where a Mac user is some kind of pathetic freak who can be safely ignored by a major developer. Especially when that same major developer is (now) fucking Adobe, whose flagship products have just a tiny bit of association with the Mac.

As far as my own experiences go, Flash=Ass Slow.
posted by Tomorrowful at 8:18 AM on September 18, 2009 [1 favorite]


Tomorrowful--

You underestimate the degree to which Flash -- once Futuresplash -- has been mismanaged by everyone who's bought the technology since.

I can't remember the last web page I saw that spiked CPU to 100% consistently. Literally, unable to remember. Since I don't doubt your experience, that can only mean the Mac port of Flash is really, really bad.

Seriously. Flash as a technology is just compiled ECMAscript, with a really well done vector drawing layer. It's a little sad seeing browsers struggle to do today what Flash has been doing for almost a decade.
posted by effugas at 8:24 AM on September 18, 2009


playing NES games would cross over into "just don't give a fuck" territory

Come on over. There's a free buffet and half-priced drinks from noon til 4.
posted by uncleozzy at 8:25 AM on September 18, 2009 [4 favorites]


Works fine (60FPS) in the dev preview of Chrome on macs. Pretty awesome.
posted by neustile at 8:29 AM on September 18, 2009


I regularly saw spikes up to 100% on my processor monitor before I got FlashBlock.

The answer to this is to stop obsessing over your processor monitor. All but the most trivial tasks should produce spikes to 100%, because that means is your OS's scheduler is using your computer's spare resources to their full extent to get tasks done as quickly as possible. I've never understood how people who want or expect their CPU meter to stay below 100% think CPU scheduling works.

(FWIW I'm a full time Mac user who's never had any desire to install ad-blocking or flash-blocking software)
posted by cillit bang at 8:43 AM on September 18, 2009 [1 favorite]


The NES ran at 1.8MHz on an 8bit cpu, and this "javascript" emulator relies heavily on the canvas element, which is just a wrapper for a bunch of C++ code, and only runs well in a specific browser. Just saying.
posted by ecurtz at 8:45 AM on September 18, 2009 [1 favorite]


Yeah, on my Mac I run the ClickToFlash plugin in Safari/WebKit because Flash can veer from glacial to galactically slow, and last week the NYT website bombed Safari repeatedly, and the last straw, etc. Now I get to quarantine Flash and enable it selectively, and surprisingly, among all of my websites, I don't miss anything really important that's Flash-only.

Picked up the dev preview of Chrome (15 MB) and, indeed, 60 fps on my Mac Mini.

In Chrome, using command-plus to increase zoom enlarged the game window, but slowed down the FPS. I next tried Universal Access in Mac OS X, and that did the trick. Made the game window as wide as my screen (turned smoothing off) and FPS remained constant. Bliss!

Impressive.
posted by Jubal Kessler at 8:51 AM on September 18, 2009


Doesn't run in Lynx. EPIC FAIL TO THE MAX!
posted by blue_beetle at 9:13 AM on September 18, 2009


I also use ClickToFlash in Safari, but am tempted to try life without it again -- happily, Snow Leopard Safari runs Flash in a separate process, so if Flash Player crashes, you just reload your page, not reopen your whole browser. I think it's my favorite of all Snow Leopard features/refinements.

Anyway, back on topic: I thought Safari had met and exceeded JavaScript performance on Chrome... apparently Chrome has pulled ahead again? Or perhaps I was just misinformed. If V8 continues to be faster than SquirrelFish Extreme (think I've got those names right...), I wonder what the implications would be if Apple decided to dump theirs and switch to V8.

So, yeah, I'm really loving the new browser wars. (Me of 7 or 8 years ago would have been shocked to hear Now Me being happy about browser wars.)
posted by BaxterG4 at 9:13 AM on September 18, 2009


happily, Snow Leopard Safari runs Flash in a separate process, so if Flash Player crashes, you just reload your page, not reopen your whole browser.

Unfortunately, I'm running SL and Safari in 64-bit mode, and still got the unrelenting hypnowheel of death. Had to force quit, hence ClickToFlash.

...apparently Chrome has pulled ahead again?

I think this particular boost is due to a robust canvas implementation and a specific JS engine optimization. I suspect both Chrome and WebKit are close to each other for general purpose JS. Here's an Ars article from August 18 on the matter.
posted by Jubal Kessler at 9:41 AM on September 18, 2009


Me of 7 or 8 years ago would have been shocked to hear Now Me being happy about browser wars.
I know, it's crazy, isn't it? The difference is that the old browser wars were tearing apart the web--all that "Works best in IE"--while now the vendors are falling over themselves to see who can implement the standards the best. Except Microsoft. Who are still trying to live in the old paradigm.
posted by bitslayer at 10:15 AM on September 18, 2009


Except Microsoft. Who are still trying to live in the old paradigm.

When you're installed as the default browser on nearly every computer that is shipped, you merely have to make a product good enough so the majority of people don't make a switch. The good enough bar is remarkably low for most users.
posted by geoff. at 10:29 AM on September 18, 2009


I have never, ever been disappointed with the speed of Flash on any platform; Windows, Linux, or Mac. I've never been bothered to install NoScript or FlashBlock; using them just makes using the web annoying. I do run AdBlock, though, as it doesn't get in my way and simply cuts out the crap.
posted by zsazsa at 10:33 AM on September 18, 2009


Happily, Microsoft seems to be making the first few rumblings toward some HTML5 participation. I wonder how much the IE folks talk to the Silverlight folks.

Thanks for the link, Jubal. Also: I hadn't considered that there might be substantial differences in the <canvas> implementation; in fact, I guess I'd just assumed that Google's Chrome changes were going right back into the main WebKit branch. Are they off on their own branch?
posted by BaxterG4 at 11:02 AM on September 18, 2009


See also: JavaScript Spectrum emulator
posted by malevolent at 11:14 AM on September 18, 2009


Chrome and Safari both have different javascript engines. I think one of them is called SquirelFish, and the other is called V8. They both use WebKit for rendering HTML pages.
posted by chunking express at 11:40 AM on September 18, 2009


but are there any sound solutions that'd work that don't involve flash?

Yes, theoretically, assuming data URLs. You'd create a series of elements that are supported by the browser for sound, build the data URL for the src with the audio in it, and then trigger them by the game. Some of the timing related issues could be tricky and possibly glitchy and I'm sure there's a performance catch here unless you wanted to use a note-data format like MIDI rather than an audio format, in which case you'd be giving up the NES synth sounds, though you'd still have the tunes.

I'm pretty sure NES game developers used real programmers, not JavaScript code monkeys.

I don't think you can describe the person who put this together as a code monkey. They clearly understand C, Javascript, and probably the NES architecture well enough to pull this off.

The majority of Javascript users may be people who are still cutting and pasting old scripts from Danny Goodman's book and/or using Dreamweaver, but the language itself is pretty awesome and there are some very smart programmers doing cool things with it, in and outside of the browser.

Once again, Flash is way ahead of the game.

ActionScript is effectively JavaScript -- but Flash has always (well, for the last eight years) compiled it from Bytecode.

JS is just recapitulating Flash's evolution.


It's doing a lot more than that. If we're invoking evolutionary metaphors, I think it's a lot more apt to say JavaScript has been filling an entirely different niche, but is now adapting to fill more niches than it used to including a niche Flash has had few competitors for. The compilation to bytecode has always been necessary for Flash to actually do its job, which it has done pretty well over the last 12-13 years, largely beating out Java applets, some half-hearted Quicktime efforts, and probably some MS dreck and other competitors I'm not remembering at the moment. Meanwhile, JavaScript has until recently largely been a tool for manipulation of HTML documents and reprogramming of responses to events in a browser, which it has also done pretty well, particularly once we got past DOM level 2. But in the last 5 years, people have figured out it could do a lot more, and it's coming for some of Flash's territory. I'm sure Flash will continue to compete, but it will also lose some ground.
posted by weston at 12:17 PM on September 18, 2009 [1 favorite]


Sounds like we need a … <soundcanvas>.
posted by BaxterG4 at 12:29 PM on September 18, 2009


nthing Chrome on the Mac working really well.

It's better than Safari, tbh, and I haven't had any problems with it crashing.
posted by empath at 1:46 PM on September 18, 2009


So, someone found a use for Chrome. Huh.
posted by regicide is good for you at 2:02 PM on September 18, 2009 [1 favorite]


Great, but can it play Doom?

Oh, wait...
posted by bpm140 at 2:18 PM on September 18, 2009


weston--

Fundamentally, JS has been manipulating an HTML DOM, while Flash/Actionscript have been mucking with a vector canvas. Turns out the former is much, much better for documents, and the latter is vastly superior for games. The underlying technology is *really* similar, especially now with JIT'ing.

The primary advantage of Flash is that there's just one implementation, so the appcompat hell that is web design just doesn't exist for Flash.

--Dan
posted by effugas at 2:36 PM on September 18, 2009


I dunno if this is helpful considering the Java/Flash rivalry that's sprung up in this thread, but I've always just played NES games off of this site. It has a better selection than JNES, runs faster, and uses a bigger playing screen.
posted by greenland at 3:57 PM on September 18, 2009


(FWIW I'm a full time Mac user who's never had any desire to install ad-blocking or flash-blocking software)

I think this is one of those things where you'll never notice using them until one day you stop.
posted by Sparx at 4:05 PM on September 18, 2009


Contra doesn't work at all...
posted by joe defroster at 4:31 PM on September 18, 2009


I don't think you can describe the person who put this together as a code monkey.

I don't think that's what I did.
posted by effbot at 5:45 PM on September 18, 2009


what's wrong with nescafe?
posted by djduckie at 9:45 PM on September 18, 2009


Gotta give the dude who put this together props -- it's a pretty impressive display of both his skill and the relative strength of the chrome js implementation.
posted by ph00dz at 9:48 PM on September 18, 2009


« Older Doing Business in China...  |  How my factual error found its... Newer »


This thread has been archived and is closed to new comments