BeebEm now in WebAssembly (in-browser)

want to talk about MESS/model b/beebem/b-em/electrem/elkulator? do it here!
Post Reply
arj
Posts: 4
Joined: Mon Sep 20, 2010 10:43 am
Contact:

BeebEm now in WebAssembly (in-browser)

Post by arj » Sun Jun 10, 2018 2:22 pm

Working on WebAssembly quite a bit here and thought that a BeebEm port would make a good project to show what's possible in recent browsers.

I've taken the 0.0.13 version of BeebEm for Unix, updated it to use SDL2 rather than SDL1.2 and built a WebAssembly binary with the Emscripten tools. The process was reasonably straightforward - the main addition was adding a way to pull in disc images from the web (currently using a ?disc1=http://some/disc/image.ssd query string in the url when loading).

Testing seems to be not too bad - sound is a bit glitchy, but I get a solid 50fps at 1x speed. Memory usage is around 130 MB in Chrome.

The source is here : https://github.com/rhys101/beebem-wasm

and you can try it out here : https://beeb.webassembly.link/

Same keyboard layout as beebem - F12 for the menu (fn-F12 on a Mac). Needs a bit more work, but it's a start.

--Rhys

User avatar
Matt Godbolt
Posts: 181
Joined: Mon Jul 31, 2006 10:02 am
Location: Chicago
Contact:

Re: BeebEm now in WebAssembly (in-browser)

Post by Matt Godbolt » Sun Jun 10, 2018 2:29 pm

Wow! Super cool! How does one configure the keyboard - I couldn't work out how to get BREAK to work?

arj
Posts: 4
Joined: Mon Sep 20, 2010 10:43 am
Contact:

Re: BeebEm now in WebAssembly (in-browser)

Post by arj » Sun Jun 10, 2018 2:38 pm

BREAK is mapped to the Break key currently - I'll need to update to use a friendlier layout! Will see if I can get the standard right-cmd+F12 keys etc to work.

arj
Posts: 4
Joined: Mon Sep 20, 2010 10:43 am
Contact:

Re: BeebEm now in WebAssembly (in-browser)

Post by arj » Sun Jun 10, 2018 3:06 pm

I've just updated the map so that the Delete key also maps to BREAK.

So on a Mac the combination fn-Backspace will BREAK and shift-fn-Backspace will !BOOT

User avatar
richmond62
Posts: 209
Joined: Sun Apr 16, 2017 3:15 pm
Contact:

Re: BeebEm now in WebAssembly (in-browser)

Post by richmond62 » Sun Jun 10, 2018 5:48 pm

I have about 12 Macintosh keyboards of various vintages to hand and I cannot work
out what you mean by "fn".

I normally use a 2001 iMac keyboard that has 15 F keys, and sometimes I use
a 2010 keyboard that has 16 F keys.

Neither of these has anything marked "fn".

arj
Posts: 4
Joined: Mon Sep 20, 2010 10:43 am
Contact:

Re: BeebEm now in WebAssembly (in-browser)

Post by arj » Sun Jun 10, 2018 6:16 pm

Drats - it was based on a quick re-map I did on a macbook air that I have here - sorry about that. I have a Mac desktop keyboard at work, so will be able to check and update later tomorrow.

Normally for the Mac laptop-based keyboards, fn is the bottom left key where present - on the desktop keyboards some models have it in the navigation cluster above the arrows (under the f13 I think). For these desktop keyboards however, the Delete key should work directly as Break, so worth giving that a go.

User avatar
richmond62
Posts: 209
Joined: Sun Apr 16, 2017 3:15 pm
Contact:

Re: BeebEm now in WebAssembly (in-browser)

Post by richmond62 » Sun Jun 10, 2018 6:18 pm

My wife's MacBook Air laptop has an fn key . . . but that is not every Macintosh.

User avatar
Elminster
Posts: 2005
Joined: Wed Jun 20, 2012 8:09 am
Location: Essex, UK
Contact:

Re: BeebEm now in WebAssembly (in-browser)

Post by Elminster » Sun Jun 10, 2018 7:10 pm

richmond62 wrote:
Sun Jun 10, 2018 6:18 pm
My wife's MacBook Air laptop has an fn key . . . but that is not every Macintosh.
It is the usual thing. iMac keyboards have had the ‘fn’ for a decade, but yours are a little older. :lol:

Edit: checked and manufacture date of keyboard was 2007.
Attachments
11B0E811-270F-4230-85BF-358919B60FE4.jpeg

User avatar
richmond62
Posts: 209
Joined: Sun Apr 16, 2017 3:15 pm
Contact:

Re: BeebEm now in WebAssembly (in-browser)

Post by richmond62 » Mon Jun 11, 2018 6:36 pm

OK: I went to the System Prefs. thingy in Mac OS 10.7.5 and turned off all the F-keys mods.

Now I'm up queer street as the '=' (among others) key does not line up with the '=' on the Macintosh keyboard.

User avatar
Elminster
Posts: 2005
Joined: Wed Jun 20, 2012 8:09 am
Location: Essex, UK
Contact:

Re: BeebEm now in WebAssembly (in-browser)

Post by Elminster » Mon Jun 11, 2018 7:38 pm

I do remember years ago remapped all the F key due to Acorn Emulators on Mac. I think it was mainly mission control stuff I moved.

I also use Flour utility to auto switch fn mode.

Post Reply