You can change that. Goto Systems Preferences | Keyboard and then select the Shortcuts pane. Click Mission Control and then un-click the checkbox that binds F12 to Dashboard (which you probably do not use).
Being an American, I was never exposed to the BBC machines. I tried running the emulator and entering a small program; alas, I can't figure out how to enter the "=" key, so I had to give up. I couldn't find "+" either.
I found the hardest part of writing my own microcomputer emulator in javascript was keyboard mapping. Each browser does things in a somewhat different way, and then there is the inherent tradeoff between emulating the original keyboard layout faithfully vs using a logical layout (where pressing "=" on the PC keyboard results in a "=" event in the emulator).
As for the CPU emulation speed, indeed chrome doesn't optimize switch statements greater than 128 entries. I got around this by coding it as "if (opcode < 0x80) switch (opcode) { first 128 cases } else switch (opcode) { other 128 cases }
I had tried using a 256-way opcode dispatch table, which was great for chrome, but it hurt firefox performance (which is blazing with the 256-way switch). Having two 128-way switches was pretty good for both browsers.
I'd love to see a messaging system set up to treat any of these JS Beebs currently running in any browser worldwide as though they're all on a single Econet.
Great stuff. I used a BBC Master up until 1999 as a serial terminal for a Sun machine. The thing was an electronics and experimenters dream: well documented, built in decent BASIC and assembler and ports galore plus if you blew it up, £5 was about all it cost to fix it (I.e. just get another one off eBay). Think they go for a lot more than that now.
This is really interesting to me. I actually started writing my own about three years ago, also called 'jsbeeb', in CoffeeScript. I didn't get around to finishing it, but the 6502 emulation worked, and it has just enough peripheral support to boot through enough of the OS to display the familiar banner: http://i.imgur.com/HjxV3ks.png
I remember seeing in documentation somewhere that switch statements with more than 128 cases are not optimised in V8, that might be what OP is referring to; however, I've never seen a 128-case switch statement in production, nor have I seen a developer use that many cases in development, refactoring tends to happen earlier in my experience.
> switch statements with more than 128 cases are not optimised in V8
I recently saw this in Petka Antonov's "Optimization Killers"[1], though I've definitely seen it somewhere else as well, because I recall hearing that variables mixed with literals in a switch could trip up the optimizer.
The error came from the profiler in v8: the main function was tagged as "Could not JIT - too many cases in switch statement" (or similar). I think it's a fair limitation; as you say, more than a few dozen is rare in "real" code - although one might argue this is a pretty common idiom for handling emulation of bytecodes.
An exceptional game in 32kb. Would be interesting to see if they get as far as running Elite.