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 and disk images from the web into your computer's RAM to be used with the emulated machine, as well as "uploading" local files.


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.


WAV files are not supported for cassette images. While it's possible to make this happen, I wonder what the utility is: files used by XRoar Online are all stored in a memory-based filesystem on the user's machine, and WAV files tend to be rather large. If enough people tell me this isn't a problem on modern machines, I'll think about it!

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. Right now XRoar Online requires a list of stub files to create as a hint about what is actually available. See the romstubs variable definition in wasm/software.js. I think in future, I may just be more prescriptive about filenames, probably simply adopting those expected by MAME.

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.

The ability to save out changed disk images would be useful. It's never going to be what people really want - to be able to work on local files transparently - because XRoar Online runs in a sandbox and all the files it accesses are held ephemerally in memory. But there's nothing stopping there being a bit of extra UI to save out disk or tape images, in the same way as "Save snapshot..." does for for snapshots.


XRoar Online is built from the same source tree as regular XRoar. Download it from the XRoar homepage, or clone the XRoar git repository.

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.

Updated 29 Jul 2023