From 179b3eaed11774bd84d77c734ddd764f3777576c Mon Sep 17 00:00:00 2001 From: Dennis Ranke Date: Wed, 12 Jan 2022 22:18:36 +0100 Subject: [PATCH] Finish docs, add hero screenshot --- site/content/_index.md | 19 --------------- site/content/docs.md | 39 ++++++++++++++++++++++++++++++- site/static/img/technotunnel.png | Bin 0 -> 10327 bytes site/static/uw8/skipahead.uw8 | Bin 230 -> 229 bytes site/templates/index.html | 2 +- 5 files changed, 39 insertions(+), 21 deletions(-) create mode 100644 site/static/img/technotunnel.png diff --git a/site/content/_index.md b/site/content/_index.md index 2f84c56..045c361 100644 --- a/site/content/_index.md +++ b/site/content/_index.md @@ -31,22 +31,3 @@ The initial motivation behind MicroW8 was to explore whether there was a way to * [v0.1pre3](v0.1pre3) * [v0.1pre4](v0.1pre4) * [v0.1pre5](v0.1pre5) - -## Tooling - -WARNING: severely out of date. The `uw8` binary includes a lot of the tool features below. - -The [Web Assembly Binary Toolkit](https://github.com/WebAssembly/wabt) includes -a few useful tools, eg. `wat2wasm` to compile the WebAssemby text format to binary -wasm and `wasm2wat` to disassemble wasm binaries. - -If you don't like the look of the `.wat` text format, you might want to take a -look at [CurlyWas](https://github.com/exoticorn/curlywas), a curly-braces infix -syntax for WebAssembly. - -Once you have a size-efficient `.wasm` file, you can use [uw8-tool](https://github.com/exoticorn/microw8/tree/master/uw8-tool) -(currently included in the MicroW8 repository) to strip off sections of the -WebAssembly module that are provided by the MicroW8 platform. - -Writing code for MicroW8 in C, Rust, AssemblyScript etc. should absolutely -possible but no examples are provided, yet. diff --git a/site/content/docs.md b/site/content/docs.md index 937f2b8..111a083 100644 --- a/site/content/docs.md +++ b/site/content/docs.md @@ -311,18 +311,55 @@ Usage: Reads a binary WebAssembly module, removes all exports not used by the MicroW8 platform + everything that is unreachable without those exports and writes the resulting module to `outfile`. -When compiling C code (or Rust, zig or others) to WebAssembly, you end up with a few exported global variables that are used for managing the heap and C stack, even if the code doesn't actually use those features. You can use this command to automatically remove those and gain a few bytes. See the C, Rust and zig examples in the MicroW8 repository. +When compiling C code (or Rust, zig or others) to WebAssembly, you end up with a few exported global variables that are used for managing the heap and C stack, even if the code doesn't actually use those features. You can use this command to automatically remove them and gain a few bytes. See the C, Rust and zig examples in the MicroW8 repository. + +# Other useful tools + +The [Web Assembly Binary Toolkit](https://github.com/WebAssembly/wabt) includes +a few useful tools, eg. `wat2wasm` to compile the WebAssemby text format to binary +wasm and `wasm2wat` to disassemble wasm binaries. + +[Binaryen](https://github.com/WebAssembly/binaryen) includes `wasm-opt` which enable additional optimizations over what LLVM (the backend that is used by most compilers that target WebAssembly) can do. # Distribution +The classical distribution option is just to put the `.uw8` cart into a zip file, let people run it themselves, either in the `uw8` tool or in the web runtime. + +If you want to go this way, you might consider including `microw8.html` in your download. It's specifically designed to be a small (~10KB at the moment), self-contained HTML file for just this reason. That way, anyone who has downloaded you production can run it, even when offline, provided they have a modern web browser at hand. Also, should future versions of MicroW8 ever introduce any kind of incompatibilities, they'd still have a compatible version right there without hunting arround for an old version. + ## Base64 encoded link +For small productions (<= 1024 bytes), when you load them in the web runtime, the URL is automatically updated to include the cart as base64 encoded data. You can just give that URL to others for them to run your prod. + ## url parameter +Another option is to put the cart on a webserver and add `#url=url/to/the/cart.uw8` to the end of the web runtime URL. ([Like this](../v0.1pre5#url=../uw8/skipahead.uw8)) + +If the cart and the web runtime are on different domains, you'll have to make sure that [CORS header](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS#the_http_response_headers) are enabled for the cart, otherwise the web runtime won't be able to load it. + +Feel free to put the web runtime on your own server if it makes sense to you, its [license](https://unlicense.org/) allows you to do anything you want with it. + ## `.html` + `.uw8` +At startup the web runtime will try to load a cart in the same directory as the `.html` file. If the URL of the web runtime ends in `.html` it will try to load a cart with the same name and the extension `.uw8`. If the URL of the web runtime ends in a `/` it will try to load a `cart.uw8` at that location. + +So, you could for example serve the web runtime as `https://example.org/mytunnel.html` and the cart as `https://example.org/mytunnel.uw8` and send people to the HTML page to run the cart. Or you could put them up as `https://example.org/mytunnel/index.html` and `https://example.org/mytunnel/cart.uw8` and send people to `https://example.org/mytunnel`. + +If a cart is found and loaded in this way, the load button is hidden. + ## Itch.io +The above `.html` + `.uw8` option works great on [Itch.io](https://itch.io) as well. Put these two files into a zip archive: + +* `index.html`: a copy of the web runtime (`microw8.html` in the MicroW8 download) +* `index.uw8`: Your game cart + +Upload the zip file to itch.io and make sure to set the embedded viewport size to exactly (!) 640x480 pixel. At that exact size the web runtime hides everything except for the MicroW8 screen. + +If instead you actually *want* to display the border around the screen and the byte size you can try a size of about 720x620. + +[See here for an example upload.](https://exoticorn.itch.io/skipahead) + # `.uw8` format The first byte of the file specifies the format version: diff --git a/site/static/img/technotunnel.png b/site/static/img/technotunnel.png new file mode 100644 index 0000000000000000000000000000000000000000..e9cf229d5efa80e4af12f6eb8426de781c585a31 GIT binary patch literal 10327 zcmW++bzGC*_rGI0NDpz85{i@{18F2wLJ-C%MQWggpa?pY6h?y*qvWF~ zU6MmoT80vn{O$Yu=XpKPz0W=O-g8gA&pnT=ER0#11egE-tfnSLR{?++(B3Hs2HNwE ze5)S-NMLG&vbq0aV^+KWOk*{`yjvtorokYcFeVs;fh!yyi;;TD$R_l~2@$$%FZfKJ zPs6t8Ivql+Vd_P62{SEfUbfMwB7E9ZW zIykB6Pld%aB&d}*{xgdrOP{`07uGfK{AJc(Ehvd!+J+E9N$#lwSMlgqblEIevD%%%Wh^xwa^B8}nZHUSKxLzPh}-AevE#-xZMs6}4^=tRc9TB_ zUI3+Rk)TerR;vJC%u2c*lrFS55_nvhcKwgn*Lw`{H+34}>9GrJ)Jqc2^06zsALy1L z=TGUcwPnB0cRs#Om1i#Gdh87OVzDH5_#0qUBYC=Ydh135FA3X_8+CA3-^l)na=5lQYhz#F1Xv2|X*@E@hm z$?omm+j31phm|n}JSg9TcaThSO~iiaMIsXkfw6@L!4K;S?Zlb8~ldQzd3^AN=&71$+nqob{_9r7d0wmt~q zh;g>X9+{Q0G+I@sNX}b=S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PhW8fY01bAPvXnZl_Z$`akpZBpH}2q{1kDx=KKs5oO&8Ty%Pbo9r3Z(rbdIV8bmil1solU#wn88)U;K3YF_j-Uj?7m!d!Llq5t^WRHa?&kpzu=pCd0*t&*z=&Avs%4nRn=ZQrs!!3 zNvOwL9MlY1G_$dz~pOzb||@Op(ilD5Uw}iO*w(= Yxbb^%E8JeB6$}E?OBP0zhM3s@0}R?q&j0`b literal 0 HcmV?d00001 diff --git a/site/static/uw8/skipahead.uw8 b/site/static/uw8/skipahead.uw8 index fd9c2e02a138bbabffc6f00de52cab3134aa00bd..b25250b2d2dedbb8fe8c3e345208fce1eed886bf 100644 GIT binary patch literal 229 zcmV^7j<5Q?!TFSkJPHrBuX`a3w)djT%KIA8O&UX%BbbT4age50ps50#`WC;L7d zF^w=@G(A8JhKYMlNeZxHn_m$rPlk{? g3Em@A WebAssembly based fantasy console -
+