Update README.md with Emscripten instructions
Emscripten is pretty low on our priority list at the moment, but we'd love to get a web UI back some time in the future.
In the mean time you can enjoy sharing your games via the web thanks to
@@ -167,6 +167,32 @@ And then `make` as normal.
The result of your build will be a `.bin`, `.hex`, `.elf` and DfuSe-compatible `.dfu` file.
+### Building & Running For Web (Emscripten)
+
+Building in Emscripten - asm.js/WebAssembly - works on Linux and WSL.
+
+You will need to install the emscripten compiler. See https://emscripten.org/docs/getting_started/downloads.html for complete instructions, but generally you should just browse to your desired directory and:
+
+```
+git clone https://github.com/emscripten-core/emsdk.git
+cd emsdk
+./emsdk install latest
+./emsdk activate latest
+source ./emsdk_env.sh
+```
+
+You should now have commands like `emcc` in your path, and an `EMSDK` environment variable set ready to build your project.
+
+In your project directory:
+
+``` shell
+mkdir build.em
+cmake .. -DCMAKE_TOOLCHAIN_FILE=$EMSDK/upstream/emscripten/cmake/Modules/Platform/Emscripten.cmake -G "Unix Makefiles"
+make
+python3 -m http.server
+```
+Finally, open the URL given by Python's HTTP server in your browser and open your project's .html file.
+
### Video Capture
`32blit-sdl` supports optional FFMPEG video capture, which you can enable by grabbing a FFMPEG snapshot, building it, and turning on `ENABLE_FFMPEG` when building your project.
