From 4ff2c831482e5d014182006bfb367f1f22dc534f Mon Sep 17 00:00:00 2001 From: GitHub Actions Date: Mon, 27 Dec 2021 22:46:54 +0000 Subject: [PATCH] Deploy exoticorn/microw8 to exoticorn/microw8:gh-pages --- 404.html | 3 + index.html | 341 +++++++++++++++++++++++++++++++++++++++++++ juice.css | 1 + normalize.css | 349 ++++++++++++++++++++++++++++++++++++++++++++ robots.txt | 3 + sitemap.xml | 6 + uw8/skipahead.uw8 | 3 + v0.1pre1/index.html | 1 + v0.1pre2/index.html | 1 + v0.1pre3/index.html | 1 + v0.1pre4/index.html | 1 + 11 files changed, 710 insertions(+) create mode 100644 404.html create mode 100644 index.html create mode 100644 juice.css create mode 100644 normalize.css create mode 100644 robots.txt create mode 100644 sitemap.xml create mode 100644 uw8/skipahead.uw8 create mode 100644 v0.1pre1/index.html create mode 100644 v0.1pre2/index.html create mode 100644 v0.1pre3/index.html create mode 100644 v0.1pre4/index.html diff --git a/404.html b/404.html new file mode 100644 index 0000000..f8414f0 --- /dev/null +++ b/404.html @@ -0,0 +1,3 @@ + +404 Not Found +

404 Not Found

diff --git a/index.html b/index.html new file mode 100644 index 0000000..132555c --- /dev/null +++ b/index.html @@ -0,0 +1,341 @@ + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + +
+ +
+ +
+
+

A WebAssembly based sizecoding platform

+
+ +
+
+
+ +
+ + + +
+ + + + + +
+
+ +
+ Versions +
+ + +
+ Spec +
+ + + + + + + + + + + + + + + + + +
+ Tooling +
+ + +
+ Examples +
+ + +
+
+ + + +
+ +
Overview
+

Versions

+ +

Spec

+

MicroW8 loads WebAssembly modules with a maximum size of 256kb. You module needs to export +a function fn upd() which will be called once per frame. +After calling upd MicroW8 will display the 320x240 8bpp framebuffer located +at offset 120 in memory with the 32bpp palette located at 0x13000.

+

The memory has to be imported as "env" "memory" and has a maximum size of 256kb (4 pages).

+

Other imports provided by the platform, also all in module env:

+
    +
  • +

    fn acos(f32) -> f32

    +
  • +
  • +

    fn asin(f32) -> f32

    +
  • +
  • +

    fn atan(f32) -> f32

    +
  • +
  • +

    fn atan2(f32, f32) -> f32

    +
  • +
  • +

    fn cos(f32) -> f32

    +
  • +
  • +

    fn exp(f32, f32) -> f32

    +
  • +
  • +

    fn log(f32) -> f32

    +
  • +
  • +

    fn sin(f32) -> f32

    +
  • +
  • +

    fn tan(f32) -> f32

    +
  • +
  • +

    fn pow(f32) -> f32

    +
  • +
  • +

    fn fmod(f32, f32) -> f32

    +
  • +
  • +

    fn random() -> i32

    +
  • +
  • +

    fn randomf() -> f32

    +
  • +
  • +

    fn randomSeed(i32)

    +
  • +
  • +

    fn cls(color: i32)

    +
  • +
  • +

    fn setPixel(x: i32, y: i32, color: i32)

    +
  • +
  • +

    fn getPixel(x: i32, y: i32) -> i32

    +
  • +
  • +

    fn hline(left: i32, right: i32, y: i32, color: i32)

    +
  • +
  • +

    fn rectangle(x1: f32, y1: f32, x2: f32, y2: f32, color: i32)

    +
  • +
  • +

    fn circle(cx: f32, cy: f32, radius: f32, color: i32)

    +
  • +
  • +

    fn line(x1: f32, y1: f32, x2: f32, y2: f32, color: i32)

    +
  • +
  • +

    fn time() -> f32

    +
  • +
  • +

    fn isButtonPressed(btn: i32) -> i32

    +
  • +
  • +

    fn isButtonTriggered(btn: i32) -> i32

    +
  • +
  • +

    fn printChar(char: i32)

    +
  • +
  • +

    fn printString(ptr: i32)

    +
  • +
  • +

    fn printInt(num: i32)

    +
  • +
  • +

    fn setTextColor(color: i32)

    +
  • +
  • +

    fn setBackgroundColor(color: i32)

    +
  • +
  • +

    fn setCursorPosition(x: i32, y: i32)

    +
  • +
+

Memory map

+
00000-00040: user memory
+00040-00044: time since module start in ms
+00044-0004c: gamepad state
+0004c-00078: reserved
+00078-12c78: frame buffer
+12c78-13000: reserved
+13000-13400: palette
+13400-13c00: font
+13c00-14000: reserved
+14000-40000: user memory
+
+

.uw8 format

+

The first byte of the file specifies the format version:

+

Format version 00:

+

This file is simply a standard WebAssembly module

+

Format version 01:

+

The rest of this file is the same as a WebAssembly +module with the 8 byte header removed. This module +can leave out sections which are then taken from +a base module provided by MicroW8.

+

You can generate this base module yourself using +uw8-tool. As a quick summary, it provides all function +types with up to 5 parameters (i32 or f32) where the +f32 parameters always preceed the i32 parameters. +Then it includes all imports that MicroW8 provides, +a function section with a single function of type +() -> void and an export section that exports +the first function in the file under the name upd.

+

Format version 02:

+

Same as version 01 except everything after the first byte is compressed +using a custom LZ compression scheme.

+

Tooling

+

The Web Assembly Binary Toolkit 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, a curly-braces infix +syntax for WebAssembly.

+

Once you have a size-efficient .wasm file, you can use 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.

+

Examples

+
    +
  • Skip Ahead (230 bytes): A port of my TIC-80 256byte game from LoveByte'21
  • +
  • OhNoAnotherTunnel (177 bytes): A port of my entry in the Outline'21 bytebattle final
  • +
  • Technotunnel (158 bytes): A port of my entry in the Outline'21 bytebattle quater final
  • +
  • Font & Palette: Just a simple viewer for the default font and palette.
  • +
  • Technotunnel B/W (199 bytes uncompressed): A port of my entry in the Outline'21 bytebattle quater final (older MicroW8 version with monochrome palette)
  • +
  • XorScroll (50 bytes uncompressed): A simple scrolling XOR pattern. Fun fact: This is the pre-loaded effect when entering a bytebattle.
  • +
  • CircleWorm (126 bytes uncompressed): Just a test for the circle fill function.
  • +
+ + +
+ + + +
+ + + + + + + diff --git a/juice.css b/juice.css new file mode 100644 index 0000000..768b427 --- /dev/null +++ b/juice.css @@ -0,0 +1 @@ +.text-center{text-align:center}.pos-absolute{right:0;left:0;position:absolute}.box-shadow{box-shadow:0 2px 10px 2px #ddd}.heading-text{font-family:"Fira Sans", sans-serif;font-size:32px;font-weight:600;padding:10px 0 25px 0;color:var(--primary-text-color)}h1,.title-text{font-family:"Fira Sans", sans-serif;font-size:25px;font-weight:500;color:var(--primary-text-color);border-left:var(--primary-color) 8px solid;padding-left:10px}h2,.subtitle-text{font-family:"Fira Sans", sans-serif;font-size:20px;font-weight:500;color:var(--primary-text-color)}.text{font-family:"Fira Sans", sans-serif;font-size:18px;font-weight:400;line-height:26px;letter-spacing:0.2px;color:var(--primary-text-color)}.subtext{font-family:"Fira Sans", sans-serif;font-size:16px;font-weight:400;letter-spacing:0.1px}.content{padding:0 40px;display:flex;flex-direction:column;overflow-x:auto}.content pre{overflow-x:auto;padding:1.25em 1.5em;white-space:pre;word-wrap:normal;background-color:white;color:#4a4a4a;font-size:.875em;font-family:monospace}.content code{background-color:white;color:#4a4a4a;font-size:.875em;font-weight:normal;padding:0.25em 0.5em;font-family:monospace}.content pre code{padding:0}.content a{color:var(--primary-link-color)}.content a:hover{text-decoration:underline}.content blockquote{border-left:#e2dede 8px solid;margin:0;background-color:#f2f1f0;padding:0 20px}body{padding:0;margin:0;box-sizing:border-box;background-color:var(--secondary-color);display:flex;flex-direction:column;min-height:100vh}a{text-decoration:none}ul{margin-top:0.5rem}ul>li{padding:0.3rem 0}p>img{width:100%;height:auto}header{background-color:var(--primary-color);color:black;padding:20px 50px;display:flex;align-items:center;justify-content:space-between}.logo{font-family:"Alfa Slab One", serif;font-size:32px;color:var(--primary-text-color);display:flex;align-items:center;margin:0 40px}.logo img{width:60px;margin:0 25px}.nav-item{margin:0 10px;text-decoration:none;font-size:18px;font-weight:bold}.nav-item:hover{color:#000;text-decoration:underline}.hero{display:flex;align-items:center;justify-content:space-evenly;height:100vh;background-color:var(--primary-color);overflow-x:hidden;padding:0 40px}.hero .explore-more{position:absolute;bottom:20px;cursor:pointer}main{display:flex;padding:50px 100px;flex-grow:1}main .toc{max-width:260px;min-width:240px}main .toc-item{padding:10px 20px;color:#424242}main .toc-item a,main .toc-item-child a{color:var(--secondary-text-color)}main .toc-item a:hover,main .toc-item-child a:hover{cursor:pointer;text-decoration:underline}main .toc-item a.active,main .toc-item-child a.active{color:var(--toc-highlight-text-color)}main .toc-item-child{padding:0 30px 5px;color:#424242}.toc-sticky{border-radius:3px;border-top:5px solid var(--primary-color);background-color:white;position:sticky;position:-webkit-sticky;position:-moz-sticky;position:-ms-sticky;position:-o-sticky;top:10px;padding:10px 0 20px;max-height:100vh;overflow:auto}footer{padding:50px;display:flex;flex-direction:column;justify-content:center;align-items:center;background-color:#202020;color:#fcfcfc}footer a{color:#fcfcfc;text-decoration:underline}@media screen and (min-width: 1280px){.content{max-width:60%;min-width:800px}}@media screen and (max-width: 768px){header{padding:10px 30px;flex-direction:column;align-items:center;justify-content:center}.logo{font-size:28px;margin:10px}.logo img{width:45px;margin:0 10px 0 0}.nav-item{margin:0 5px;font-size:14px}.hero{padding:40px 30px}main{padding:30px}.content{padding:0}.explore-more,.toc{display:none}} diff --git a/normalize.css b/normalize.css new file mode 100644 index 0000000..192eb9c --- /dev/null +++ b/normalize.css @@ -0,0 +1,349 @@ +/*! normalize.css v8.0.1 | MIT License | github.com/necolas/normalize.css */ + +/* Document + ========================================================================== */ + +/** + * 1. Correct the line height in all browsers. + * 2. Prevent adjustments of font size after orientation changes in iOS. + */ + +html { + line-height: 1.15; /* 1 */ + -webkit-text-size-adjust: 100%; /* 2 */ +} + +/* Sections + ========================================================================== */ + +/** + * Remove the margin in all browsers. + */ + +body { + margin: 0; +} + +/** + * Render the `main` element consistently in IE. + */ + +main { + display: block; +} + +/** + * Correct the font size and margin on `h1` elements within `section` and + * `article` contexts in Chrome, Firefox, and Safari. + */ + +h1 { + font-size: 2em; + margin: 0.67em 0; +} + +/* Grouping content + ========================================================================== */ + +/** + * 1. Add the correct box sizing in Firefox. + * 2. Show the overflow in Edge and IE. + */ + +hr { + box-sizing: content-box; /* 1 */ + height: 0; /* 1 */ + overflow: visible; /* 2 */ +} + +/** + * 1. Correct the inheritance and scaling of font size in all browsers. + * 2. Correct the odd `em` font sizing in all browsers. + */ + +pre { + font-family: monospace, monospace; /* 1 */ + font-size: 1em; /* 2 */ +} + +/* Text-level semantics + ========================================================================== */ + +/** + * Remove the gray background on active links in IE 10. + */ + +a { + background-color: transparent; +} + +/** + * 1. Remove the bottom border in Chrome 57- + * 2. Add the correct text decoration in Chrome, Edge, IE, Opera, and Safari. + */ + +abbr[title] { + border-bottom: none; /* 1 */ + text-decoration: underline; /* 2 */ + text-decoration: underline dotted; /* 2 */ +} + +/** + * Add the correct font weight in Chrome, Edge, and Safari. + */ + +b, +strong { + font-weight: bolder; +} + +/** + * 1. Correct the inheritance and scaling of font size in all browsers. + * 2. Correct the odd `em` font sizing in all browsers. + */ + +code, +kbd, +samp { + font-family: monospace, monospace; /* 1 */ + font-size: 1em; /* 2 */ +} + +/** + * Add the correct font size in all browsers. + */ + +small { + font-size: 80%; +} + +/** + * Prevent `sub` and `sup` elements from affecting the line height in + * all browsers. + */ + +sub, +sup { + font-size: 75%; + line-height: 0; + position: relative; + vertical-align: baseline; +} + +sub { + bottom: -0.25em; +} + +sup { + top: -0.5em; +} + +/* Embedded content + ========================================================================== */ + +/** + * Remove the border on images inside links in IE 10. + */ + +img { + border-style: none; +} + +/* Forms + ========================================================================== */ + +/** + * 1. Change the font styles in all browsers. + * 2. Remove the margin in Firefox and Safari. + */ + +button, +input, +optgroup, +select, +textarea { + font-family: inherit; /* 1 */ + font-size: 100%; /* 1 */ + line-height: 1.15; /* 1 */ + margin: 0; /* 2 */ +} + +/** + * Show the overflow in IE. + * 1. Show the overflow in Edge. + */ + +button, +input { /* 1 */ + overflow: visible; +} + +/** + * Remove the inheritance of text transform in Edge, Firefox, and IE. + * 1. Remove the inheritance of text transform in Firefox. + */ + +button, +select { /* 1 */ + text-transform: none; +} + +/** + * Correct the inability to style clickable types in iOS and Safari. + */ + +button, +[type="button"], +[type="reset"], +[type="submit"] { + -webkit-appearance: button; +} + +/** + * Remove the inner border and padding in Firefox. + */ + +button::-moz-focus-inner, +[type="button"]::-moz-focus-inner, +[type="reset"]::-moz-focus-inner, +[type="submit"]::-moz-focus-inner { + border-style: none; + padding: 0; +} + +/** + * Restore the focus styles unset by the previous rule. + */ + +button:-moz-focusring, +[type="button"]:-moz-focusring, +[type="reset"]:-moz-focusring, +[type="submit"]:-moz-focusring { + outline: 1px dotted ButtonText; +} + +/** + * Correct the padding in Firefox. + */ + +fieldset { + padding: 0.35em 0.75em 0.625em; +} + +/** + * 1. Correct the text wrapping in Edge and IE. + * 2. Correct the color inheritance from `fieldset` elements in IE. + * 3. Remove the padding so developers are not caught out when they zero out + * `fieldset` elements in all browsers. + */ + +legend { + box-sizing: border-box; /* 1 */ + color: inherit; /* 2 */ + display: table; /* 1 */ + max-width: 100%; /* 1 */ + padding: 0; /* 3 */ + white-space: normal; /* 1 */ +} + +/** + * Add the correct vertical alignment in Chrome, Firefox, and Opera. + */ + +progress { + vertical-align: baseline; +} + +/** + * Remove the default vertical scrollbar in IE 10+. + */ + +textarea { + overflow: auto; +} + +/** + * 1. Add the correct box sizing in IE 10. + * 2. Remove the padding in IE 10. + */ + +[type="checkbox"], +[type="radio"] { + box-sizing: border-box; /* 1 */ + padding: 0; /* 2 */ +} + +/** + * Correct the cursor style of increment and decrement buttons in Chrome. + */ + +[type="number"]::-webkit-inner-spin-button, +[type="number"]::-webkit-outer-spin-button { + height: auto; +} + +/** + * 1. Correct the odd appearance in Chrome and Safari. + * 2. Correct the outline style in Safari. + */ + +[type="search"] { + -webkit-appearance: textfield; /* 1 */ + outline-offset: -2px; /* 2 */ +} + +/** + * Remove the inner padding in Chrome and Safari on macOS. + */ + +[type="search"]::-webkit-search-decoration { + -webkit-appearance: none; +} + +/** + * 1. Correct the inability to style clickable types in iOS and Safari. + * 2. Change font properties to `inherit` in Safari. + */ + +::-webkit-file-upload-button { + -webkit-appearance: button; /* 1 */ + font: inherit; /* 2 */ +} + +/* Interactive + ========================================================================== */ + +/* + * Add the correct display in Edge, IE 10+, and Firefox. + */ + +details { + display: block; +} + +/* + * Add the correct display in all browsers. + */ + +summary { + display: list-item; +} + +/* Misc + ========================================================================== */ + +/** + * Add the correct display in IE 10+. + */ + +template { + display: none; +} + +/** + * Add the correct display in IE 10. + */ + +[hidden] { + display: none; +} diff --git a/robots.txt b/robots.txt new file mode 100644 index 0000000..92a2f7b --- /dev/null +++ b/robots.txt @@ -0,0 +1,3 @@ +User-agent: * +Allow: / +Sitemap: https://exoticorn.github.io/microw8/sitemap.xml diff --git a/sitemap.xml b/sitemap.xml new file mode 100644 index 0000000..03c0a90 --- /dev/null +++ b/sitemap.xml @@ -0,0 +1,6 @@ + + + + https://exoticorn.github.io/microw8/ + + diff --git a/uw8/skipahead.uw8 b/uw8/skipahead.uw8 new file mode 100644 index 0000000..fd9c2e0 --- /dev/null +++ b/uw8/skipahead.uw8 @@ -0,0 +1,3 @@ +#IޮaVpv[VLc^ȯCM[5$S.}a'cbV-=XLguu8 +9\ݯh<4?zk.8&/@6ֿ;8{.8_^t/kp|n,'>10^4=@ {NI +b_=U`Y=\O٦bxh&gtO; #@HzΖ+Xw \ No newline at end of file diff --git a/v0.1pre1/index.html b/v0.1pre1/index.html new file mode 100644 index 0000000..c8331a1 --- /dev/null +++ b/v0.1pre1/index.html @@ -0,0 +1 @@ +MicroW8
\ No newline at end of file diff --git a/v0.1pre2/index.html b/v0.1pre2/index.html new file mode 100644 index 0000000..75f5447 --- /dev/null +++ b/v0.1pre2/index.html @@ -0,0 +1 @@ +MicroW8
\ No newline at end of file diff --git a/v0.1pre3/index.html b/v0.1pre3/index.html new file mode 100644 index 0000000..7a6fdce --- /dev/null +++ b/v0.1pre3/index.html @@ -0,0 +1 @@ +MicroW8
\ No newline at end of file diff --git a/v0.1pre4/index.html b/v0.1pre4/index.html new file mode 100644 index 0000000..6e704bd --- /dev/null +++ b/v0.1pre4/index.html @@ -0,0 +1 @@ +MicroW8
\ No newline at end of file