#!/bin/bash # Build MAME 0.285's vectrex driver as WebAssembly from emu/mame, with emu/patches applied. # Output: emu/mame/vectrexweb.js and .wasm set -e HERE=$(cd "$(dirname "$0")" && pwd) cd "$HERE/mame" git checkout -q -- . for p in "$HERE"/patches/*.patch; do [ -e "$p" ] && git apply "$p" done . ~/emsdk/emsdk_env.sh >/dev/null 2>&1 emmake make -j"${JOBS:-10}" \ SUBTARGET=vectrexweb SOURCES=src/mame/miltonbradley/vectrex.cpp \ WEBASSEMBLY=1 NOWERROR=1 TOOLS=0 \ NO_USE_PIPEWIRE=1 NO_USE_PULSEAUDIO=1 NO_USE_PORTAUDIO=1 NO_USE_MIDI=1 \ OPTIMIZE=3 "$@" ls -la "$HERE"/mame/vectrexweb.js "$HERE"/mame/vectrexweb.wasm