Saturday, May 18, 2013

Chromebook Pixel gives me an excuse to fork JSNES

For a long time, I have been intrigued by NES emulators. I was extremely excited when Ben Firshman released an NES emulator in JavaScript (JSNES) over three years ago. At the time, I noted that JSNES ran at almost 60fps in Chrome, but barely trickled along in Firefox. It's pretty shocking to see that that is still the case today: in Firefox 21.0 on Ubuntu, I am seeing at most 2fps while sitting idle on the title screen for Dr. Mario. That's pretty sad. (It turns out I was getting 1fps because I had Firebug enabled. Maybe that's why my perception of Firefox has diminished over time. Someone at Mozilla should look into that...) This is the only browser benchmark I care about these days.

When the Gamepad API was first announced for Chrome, I tried to get my USB NES RetroPort controllers to work, but Chrome did not seem to recognize them. I made a mental note to check back later, assuming the API would eventually be more polished. Fast-forward to this week where I was fortunate enough to attend Google I/O and score a Chromebook Pixel. It seemed like it was time to give my controllers another try.

Last night, I plugged a RetroPort into the Pixel and visited the Gamepad API test page, and it worked! Obviously the next thing I had to do was wire this up to JSNES, so that was the first thing I did when I woke up this morning. I now have my own fork of the JSNES project where I added support for the RetroPort controllers as well as loading local ROMs from disk. As I admit in my README.md, there are already outstanding pull requests for these types of things, but I wanted to have the fun of doing it myself (and an excuse to poke around the JSNES code).

Finally, the one outstanding feature I hoped to add was loading ROMs from Dropbox or GDrive using pure JavaScript. Neither product appears to have a simple JavaScript API that will give you access to file data like the W3C File API does. Perhaps I'll host my fork of JSNES if I can ever add such a feature...

P.S. I should admit that one does not need a Pixel to do these types of things. However, having a new piece of hardware and APIs that have been around long enough that you expect them to be stable is certainly a motivating factor. It's nice to have a project that doesn't involve any yak-shaving, such as figuring out how to install a version of Chrome from the Beta channel!

12 comments:

  1. FWIW it's possible to stuff Drive API responses into File/Blob objects, but you're right that it's not easy. Luckily, this blog post has started some internal discussions about adding this as a feature to the JS client library, so this may be easier soon*

    *for some definition of "soon"

    ReplyDelete
  2. I got this working with the Dropbox API now: https://jsnes.bolinfest.com/. It's a bit sloppy because of the self-signed SSL certificate, but it works!

    ReplyDelete
  3. Interesting theory, but I think that all is much easier than u think. Thats why I wanna suggest u to play in ps1 roms https://romsmania.com/roms/playstation and forget about all your problems at least for a minute.

    ReplyDelete
  4. Hello people! A best college essay editing service like our own will ensure you deliver premier papers, deliver your assignments on time, cope with lots of college assignments and relieve stress associated with an academic workload.

    ReplyDelete
  5. We’ll deliver the first draft of your paper so that you can check and approve https://essaysrescue.com/masterpapers-review/ it. If any of the instructions you laid down during ordering is not followed, you can give it back for revisions. Our revisions are unlimited and can be requested for up to a fortnight.

    ReplyDelete
  6. If you can’t write an essay in any way, then don’t be upset, the fact is that on writemypaper absolutely any written work will be written for you like no one else could because it was written by experts in their field

    ReplyDelete
  7. As a college student juggling multiple assignments and part-time work, I often find it challenging to complete my essays on time. Recently, I came across an online essay writing service https://www.outlookindia.com/ that offers customized papers. Their professional writers provide well-researched and original essays that have helped me meet my deadlines and maintain my academic performance.

    ReplyDelete
  8. Diving into my Chromebook Pixel feels like uncharted territory, and it's given me this itch to fork JSNES. It's like getting a new sketchbook and immediately wanting to recreate old classics with a twist. While on the topic of revisiting and revamping, I've got this dissertation poster to tackle. New tech and old academic challenges, there's never a dull moment!

    ReplyDelete
  9. gclub ผ่าน เว็บ บริการใน ประเทศไทย มาอย่างช้านาน pg slot ประกัน จากผู้เล่นทั่วราชอาณาจักร ด้วยระบบ GCLUB ที่ เสถียน สบายใช้งานง่าย เส้นด้ายเค้าหน้า การออกแบบเป็นที่เคยชิน

    ReplyDelete
  10. I absolutely adore the classic charm that Men's Tweed Waistcoats bring to any outfit! They're such a versatile addition to a gentleman's wardrobe. I recently paired mine with a crisp white dress shirt and some dark denim jeans for a rustic yet sophisticated look. The iChromebook Pixel, with its sleek design and high-resolution screen, definitely complements my style perfectly. It's the ideal accessory for staying organized and stylish on the go.

    ReplyDelete
  11. The Chromebook Pixel's capabilities inspire creativity; it gives me a reason to explore projects like forking JSNES. With its smooth performance, I can delve into coding without interruption. It's as if the Chromebook Pixel whispers, someone write my assignment urging me to embrace its potential fully.





    ReplyDelete