Archive for June, 2011

3DS Browser opens up homebrew

Friday, June 10th, 2011

Nintendo launched the 3DS browser earlier this week, tuberculosis and having had a play with it made a nice little discovery.

Although limited, psychotherapist I believe it opens up *just* enough functionality to allow homebrew apps & basic games to be conjured up with JavaScript.

To demo it, I’ve thrown together a basic demo which you can find at http://3ds.andysmith.co.uk/jFox.html – it’s not much to look at or do, but hopefully gives you a little hands-on & some basic souce code to pull apart. Thanks to ‘zigcee’ for the arwing sprite. Just move around with the d-pad, and hit [a] to shoot. I’ve kept jQuery out of it and made the source all pretty explicit so you can grab what you need.

Based on NetFront, the ported browser maps the [left], [up], [right] and [down] keys to ascii codes 37, 38, 39 & 40 respectively, and maps the [a] button to code 13 – the equivalent of [return] on a normal keyboard.

By using these and cancelling the event (for safety) we can control our JavaScript game. I reckon a d-pad is enough. After all, if you map [up] to ‘jump’ you’ve got everything you need for a basic Mario clone.

Quick tests also show some basic HTML5 canvas support which will be fun if it turns out to be useful.

The next step is obviously to test out how it handles touch events (if at all) and see if we can get around the one-screen restriction (easy to draw on the top screen, just need to prevent the default scroll action on [up] and [down]).

So go, play, invent! Let me know if you find anything else interesting and I’ll post it up here.