OXYGENHUB
◆ main enhanced-x16-emulator / webassembly / WebAssembly.md
1.6 KiB · Markdown · last changed chore(): initial commit 25 days ago renderedsource blame history raw
9120e874 Andy McCall 1
## WebAssembly/HTML5 Support
2
The Commander X16 emulator supports a HTML/WebAssembly build target using the [Emscripten compiler]https://emscripten.org/.
3
4
## Demo
5
[HTML X16 Emulator Demo]https://sebastianvog.github.io/x16-emulator/x16emu.html
6
## Installation
7
Follow installation steps from [here]https://emscripten.org/docs/getting_started/downloads.html#
8
9
## Build
10
11
    make wasm
12
13
This outputs the following artifacts in the build directory, which can be uploaded to any web server.
14
15
	ex16mu.data x16emu.html x16emu.js x16mu.wasm webassembly/styles.css webassembly/main.js
16
17
You will also need the system ROM (rom.bin) which you can build from the [X16 ROM source]https://github.com/X16Community/x16-rom or take from the latest [binary release]https://github.com/xylothan/x16-emulator/releases.
18
(It is not always guaranteed though that the latest binary release is compatible with the current state of the emulator source.)
19
20
### Testing
21
To run a test webserver:
22
23
    python -m SimpleHTTPServer 8080
24
25
And start [http://localhost:8080/x16emu.html]http://localhost:8080/x16emu.html
26
27
Note: You will get the error `wasm streaming compile failed: TypeError: Failed to execute 'compile' on 'WebAssembly'...`
28
This is because SimpleHTTPServer does not serve .wasm files with the correct mime type. don't worry, everything will still work fine though.
29
30
### Supported Browsers
31
Working Browsers are Chrome, Safari, FireFox, Opera and Microsoft Edge (Beta)
32
33
### Known Issues
34
* Speed of the webassembly emulation is lacking, compared to the native version
35
* No support to load PRGs (yet)
36
* Doesn't display particularly well in portrait mode on mobile