# ScummVM (WebAssembly build): corresponding source `scummvm.js` and `scummvm.wasm` in this directory are a WebAssembly build of **ScummVM 2.9.1**, licensed under the GNU General Public License, version 3 or later (see `COPYING`; other licences for bundled code are in `licenses/`). This file is our written offer of the complete corresponding source. ## Upstream source - Repository: https://github.com/scummvm/scummvm - Tag: `v2.9.1` - Commit: `9d9b9e93108a276c551aeffa390169ccc5148e15` - Source tarball for that tag: https://github.com/scummvm/scummvm/archive/refs/tags/v2.9.1.tar.gz ## Our changes One patch, `source/0001-emscripten-pre-js-keep-page-arguments.patch`, applied to `dists/emscripten/custom_shell-pre.js` (code that is compiled into `scummvm.js` through `--pre-js`). Upstream discards any command-line arguments set by the embedding page. The patch keeps them, so the page can pick a game target from its query string. No C/C++ source was changed. The page around the engine (`index.html`, `harness.js`, `harness.css`, `scummvm.ini`) is our own and is shipped here as readable source. It does not use upstream's `custom_shell.html` (which loads BrowserFS from a CDN). Saves and settings go to IndexedDB through Emscripten's IDBFS instead. `scummvm_fs.js` is upstream's `dists/emscripten/assets/scummvm_fs.js`, unchanged. ## Third-party libraries linked in - Emscripten ports (fetched by emcc 3.1.51): SDL2, libogg, libvorbis, libpng, zlib - libmad 0.15.1b (GPL-2.0-or-later), from https://deb.debian.org/debian/pool/main/libm/libmad/libmad_0.15.1b.orig.tar.gz (sha256 `bbfac3ed6bfbc2823d3775ebb931087371e142bb0e9bb1bee51a76a6e0078690`; this is the upstream `libmad-0.15.1b.tar.gz`) ## Build The toolchain is the Docker image `emscripten/emsdk:3.1.51` (`sha256:fde95518821ccc1b629ee674a7a068a809fda47ea16814b0ed53bd646555147b`). That is the emsdk version pinned by upstream's `dists/emscripten/build.sh`. ```sh git clone --depth 1 --branch v2.9.1 https://github.com/scummvm/scummvm.git src (cd src && git apply ../source/0001-emscripten-pre-js-keep-page-arguments.patch) mkdir -p libs && cp libmad-0.15.1b.tar.gz libs/ docker run --rm --network host -u "$(id -u):$(id -g)" -e HOME=/work/home \ -v "$PWD:/work" emscripten/emsdk:3.1.51 bash -c 'mkdir -p /work/home; /work/build-in-docker.sh' ``` `source/build-in-docker.sh` builds libmad, then runs the configure and make below. The output lands in `src/build-emscripten/`. ```sh LDFLAGS="-lidbfs.js" emconfigure ./configure \ --host=wasm32-unknown-emscripten --build=wasm32-unknown-emscripten \ --disable-debug --enable-release \ --disable-all-engines --enable-engine=sky,queen,lure,drascula --disable-detection-full \ --enable-vorbis --enable-ogg --enable-zlib --enable-png --enable-mad --with-mad-prefix=$LIBS/build \ --disable-flac --disable-tremor --disable-jpeg --disable-gif --disable-theoradec --disable-vpx --disable-faad \ --disable-mpeg2 --disable-a52 --disable-mikmod --disable-openmpt --disable-mpcdec --disable-fluidsynth --disable-fluidlite \ --disable-freetype2 --disable-fribidi --disable-opengl-game --disable-lua --disable-mt32emu --disable-bink \ --disable-cloud --disable-libcurl --disable-sdlnet --disable-enet --disable-tts --disable-translation \ --disable-eventrecorder --disable-hq-scalers --disable-discord --disable-seq-midi --disable-timidity \ --disable-tinygl --disable-sonivox --disable-imgui emmake make -j 20 emmake make dist-emscripten ``` `source/stage.sh` then assembles this directory: - engine files from `src/build-emscripten/` - the four engine data files, the three GUI themes, and the four games' launcher icons - the game archives, unpacked - `index.json` listings, written by `source/make_http_index.py` (a Python port of upstream's `build-make_http_index.js`) Build output checksums: - `scummvm.wasm` sha256 `0bba6d31374b7feb6d4bfdce4703f4059ec71b56da21d1805d1445fe09e94a9c` - `scummvm.js` sha256 `66a82171fb0634664f34d3fc0316e9d87db37fb0d3d38e96bd5a207e053affb9`