summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
author Justin Kerk <dopefishjustin@gmail.com>2018-07-21 22:05:45 +0000
committer Justin Kerk <dopefishjustin@gmail.com>2018-07-21 22:05:45 +0000
commit7809e9005dff6769ad18cf924f285fd60519b044 (patch)
tree56426ac398a636abc42743d39eba41b808265c24
parent9ccca093f0bf097254e10e4d9e88702ab164b197 (diff)
Better Emscripten parameter handling, & update docs (nw)
-rw-r--r--docs/source/initialsetup/compilingmame.rst3
-rw-r--r--scripts/src/main.lua5
2 files changed, 4 insertions, 4 deletions
diff --git a/docs/source/initialsetup/compilingmame.rst b/docs/source/initialsetup/compilingmame.rst
index 36d2dc9e93d..847b66b7072 100644
--- a/docs/source/initialsetup/compilingmame.rst
+++ b/docs/source/initialsetup/compilingmame.rst
@@ -119,6 +119,8 @@ The SOURCES parameter should have the path to at least one driver .cpp file. The
The value of the SUBTARGET parameter serves only to differentiate multiple builds and need not be set to any specific value.
+Emscripten supports compiling to WebAssembly with a JavaScript loader instead of all-JavaScript, and in later versions this is actually the default. To force WebAssembly on or off, add WEBASSEMBLY=1 or WEBASSEMBLY=0 to the make command line.
+
Other make parameters can also be used, e.g. *-j* for multithreaded compilation as described earlier.
When the compilation reaches the emcc phase, you may see a number of *"unresolved symbol"* warnings. At the moment, this is expected for OpenGL-related functions such as glPointSize. Any others may indicate that an additional dependency file needs to be specified in the SOURCES list. Unfortunately this process is not automated and you will need to search the source tree to locate the files supplying the missing symbols. You may also be able to get away with ignoring the warnings if the code path referencing them is not used at run-time.
@@ -128,6 +130,7 @@ If all goes well, a .js file will be output to the current directory. This file
There are example .html files in that repository which can be edited to point to your newly compiled MAME js filename and pass in whatever parameters you desire. You will then need to place all of the following on a web server:
* The compiled MAME .js file
+* The compiled MAME .wasm file if using WebAssembly
* The .js files from the Emularity package (loader.js, browserfs.js, etc.)
* A .zip file with the ROMs for the MAME driver you would like to run (if any)
* Any software files you would like to run with the MAME driver
diff --git a/scripts/src/main.lua b/scripts/src/main.lua
index 5187ae5d042..65a80fb6c33 100644
--- a/scripts/src/main.lua
+++ b/scripts/src/main.lua
@@ -169,10 +169,7 @@ end
if _OPTIONS["WEBASSEMBLY"] then
emccopts = emccopts
- .. " -s WASM=1"
- else
- emccopts = emccopts
- .. " -s WASM=0"
+ .. " -s WASM=" .. _OPTIONS["WEBASSEMBLY"]
end
if _OPTIONS["ARCHOPTS"] then