About XRoar Online

XRoar Online is a Dragon emulator in your browser. It emulates all of the Dragon 32, Dragon 64, Tandy Colour Computers 1, 2 and 3 (and some similar machines), and the Tandy MC-10. It supports dynamically fetching cassette, floppy disk, and even hard disk images from the web into your computer's RAM to be used with the emulated machine, as well as "uploading" local files.

Credits

All of this is possible thanks to Emscripten, a toolchain that allows you to compile regular C code into WebAssembly. WebAssembly is supported in all modern browsers. XRoar certainly required some extra code, but Emscripten's environment makes these requirements refreshingly minimal.

Caveats

XRoar as a normal desktop application tries to be user-friendly and search a list of filenames that may contain the firmware ROM images for a particular machine or cartridge. It also checks for extensions in a variety of cases, and even searches for old .dgn files, as used by PC-Dragon and (I think?) T3. This is fine locally, but trying a web download for each potential name in turn would be very inefficient. The previous requirement for ROM stub files to be created has been lifted, but instead only the first file found in a romlist (with a ".rom" file extension) will be considered, so use the canonical filenames.

The way the HTML/JavaScript interface is defined seems a bit klunky, and it would be nice to make XRoar Online more easily embeddable. Web Components sound like they might simplify this, with their "shadow DOM"s and what-not, but I'm not sure yet whether I can embed Emscripten's output in one.

You can now save out changed disk image files, but XRoar Online is still never going to provide what people really want - to be able to work on local files transparently - because it runs in a sandbox, and all the files it accesses are held ephemerally in memory.

Building

XRoar Online is built from the same source tree as regular XRoar. Download it from the XRoar homepage, or clone the XRoar git repository. A snapshot of the exact tree used to build the current version should be available as xroar-snap.tar.gz.

As usual, if you cloned the git repository, you'll first have to run ./autogen.sh to generate the configure script. Ensure you have the emscripten environment set up, and run emconfigure ./configure --enable-wasm. Then build with emmake make. I also strongly recommend adding CFLAGS="-O3 -flto" LDFLAGS="-O3 -flto" to the configure line to get a link-time-optimised build.

HTML/JavaScript support files are in the wasm/ subdirectory of the distribution. The supplied index.shtml depends on the server supporting SSI (as xroar-wasm.html contains only the basics), but you can combine them into a flat file quite simply.

It's worth noting that the supporting JavaScript changes quite a bit, so if you update the wasm file, be sure to update the HTML/JS support too.

Updated 23 Nov 2024