Skip to content

Instantly share code, notes, and snippets.

@JimmyDansbo
Created December 18, 2025 08:36
Show Gist options
  • Select an option

  • Save JimmyDansbo/d67210650ed254cf6118a0c1ed39497e to your computer and use it in GitHub Desktop.

Select an option

Save JimmyDansbo/d67210650ed254cf6118a0c1ed39497e to your computer and use it in GitHub Desktop.
# Build X16 emulator webassembly:
# Install emscripten:
# https://emscripten.org/docs/getting_started/downloads.html
git clone https://github.com/emscripten-core/emsdk.git
cd emsdk
# Fetch the latest version of the emsdk (not needed the first time you clone)
git pull
# Download and install the latest SDK tools.
./emsdk install latest
# Make the "latest" SDK "active" for the current user. (writes .emscripten file)
./emsdk activate latest
# Activate PATH and other environment variables in the current terminal
source ./emsdk_env.sh
# Get emulator
git clone https://github.com/x16community/x16-emulator.git
# Get latest ROM build (can also be downloaded directly from github actions if logged in)
gh run download -R https://github.com/x16community/x16-rom -n "ROM Image" --dir latest_rom
# Copy ROM symbols (seems to not be needed?)
cp latest_rom/*.h x16-emulator/src/.
# Build emulator
mkdir x16-emulator/build
cp latest_rom/rom.bin x16-emulator/build
cd x16-emulator/build
emcmake cmake .. -DENABLE_FLUIDSYNTH=OFF -DENABLE_TRACE=OFF
emmake make
# Package emulator
cd ..
mkdir emu_binaries
cp build/x16emu.data build/x16emu.html build/x16emu.js build/x16emu.wasm emu_binaries/
mkdir emu_binaries/webassembly
cp webassembly/styles.css webassembly/main.js webassembly/jszip.min.js emu_binaries/webassembly/
file emu_binaries/*
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment