about summary refs log tree commit diff stats
path: root/html/apps/life.mu.html
diff options
context:
space:
mode:
authorKartik Agaram <vc@akkartik.com>2021-08-15 23:44:43 -0700
committerKartik Agaram <vc@akkartik.com>2021-08-15 23:44:43 -0700
commit52e3ea8a4bec791e4c2d64fb8aca9e26cdf60f25 (patch)
tree331a98b558b8d638348b3e93ce4ef036ae70130c /html/apps/life.mu.html
parent8765064d6910c65ea5ed5526b27e9752df000c3d (diff)
downloadmu-52e3ea8a4bec791e4c2d64fb8aca9e26cdf60f25.tar.gz
.
Diffstat (limited to 'html/apps/life.mu.html')
-rw-r--r--html/apps/life.mu.html89
1 files changed, 51 insertions, 38 deletions
diff --git a/html/apps/life.mu.html b/html/apps/life.mu.html
index cc262c2d..af4a479a 100644
--- a/html/apps/life.mu.html
+++ b/html/apps/life.mu.html
@@ -1,36 +1,36 @@
-<!DOCTYPE html>
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
 <html>
 <head>
-<meta charset="UTF-8">
+<meta http-equiv="content-type" content="text/html; charset=UTF-8">
 <title>Mu - apps/life.mu</title>
-<meta name="Generator" content="Vim/8.2">
-<meta name="plugin-version" content="vim8.1_v2">
+<meta name="Generator" content="Vim/8.1">
+<meta name="plugin-version" content="vim8.1_v1">
 <meta name="syntax" content="none">
-<meta name="settings" content="number_lines,use_css,pre_wrap,no_foldcolumn,expand_tabs,line_ids,prevent_copy=,use_input_for_pc=fallback">
+<meta name="settings" content="number_lines,use_css,pre_wrap,no_foldcolumn,expand_tabs,line_ids,prevent_copy=">
 <meta name="colorscheme" content="minimal-light">
-<style>
+<style type="text/css">
 <!--
 pre { white-space: pre-wrap; font-family: monospace; color: #000000; background-color: #ffffd7; }
 body { font-size:12pt; font-family: monospace; color: #000000; background-color: #ffffd7; }
 a { color:inherit; }
 * { font-size:12pt; font-size: 1em; }
 .PreProc { color: #c000c0; }
-.muRegEbx { color: #5f00ff; }
-.muRegEcx { color: #870000; }
 .muRegEdx { color: #af5f00; }
+.Special { color: #ff6060; }
 .LineNr { }
 .muRegEsi { color: #005faf; }
-.muRegEdi { color: #00af00; }
+.muRegEbx { color: #5f00ff; }
 .Constant { color: #008787; }
+.muRegEdi { color: #00af00; }
+.muRegEcx { color: #870000; }
+.Delimiter { color: #c000c0; }
 .muFunction { color: #af5f00; text-decoration: underline; }
 .CommentedCode { color: #8a8a8a; }
-.Delimiter { color: #c000c0; }
 .muComment { color: #005faf; }
-.Special { color: #ff6060; }
 -->
 </style>
 
-<script>
+<script type='text/javascript'>
 <!--
 
 /* function to open any folds containing a jumped-to line before jumping to it */
@@ -81,18 +81,18 @@ if ('onhashchange' in window) {
 <span id="L17" class="LineNr"> 17 </span>    <span class="PreProc">break-if-&gt;=</span>
 <span id="L18" class="LineNr"> 18 </span>    <span class="PreProc">return</span> <span class="Constant">0</span>/false
 <span id="L19" class="LineNr"> 19 </span>  <span class="Delimiter">}</span>
-<span id="L20" class="LineNr"> 20 </span>  compare x, <span class="Constant">0x100</span>/width
+<span id="L20" class="LineNr"> 20 </span>  compare x, <span class="Constant">0x80</span>/width
 <span id="L21" class="LineNr"> 21 </span>  <span class="Delimiter">{</span>
 <span id="L22" class="LineNr"> 22 </span>    <span class="PreProc">break-if-&lt;</span>
 <span id="L23" class="LineNr"> 23 </span>    <span class="PreProc">return</span> <span class="Constant">0</span>/false
 <span id="L24" class="LineNr"> 24 </span>  <span class="Delimiter">}</span>
-<span id="L25" class="LineNr"> 25 </span>  compare y, <span class="Constant">0xc0</span>/height
+<span id="L25" class="LineNr"> 25 </span>  compare y, <span class="Constant">0x60</span>/height
 <span id="L26" class="LineNr"> 26 </span>  <span class="Delimiter">{</span>
 <span id="L27" class="LineNr"> 27 </span>    <span class="PreProc">break-if-&lt;</span>
 <span id="L28" class="LineNr"> 28 </span>    <span class="PreProc">return</span> <span class="Constant">0</span>/false
 <span id="L29" class="LineNr"> 29 </span>  <span class="Delimiter">}</span>
 <span id="L30" class="LineNr"> 30 </span>  <span class="PreProc">var</span> idx/eax: int <span class="Special">&lt;-</span> copy y
-<span id="L31" class="LineNr"> 31 </span>  idx <span class="Special">&lt;-</span> shift-left <span class="Constant">8</span>/log2width
+<span id="L31" class="LineNr"> 31 </span>  idx <span class="Special">&lt;-</span> shift-left <span class="Constant">7</span>/log2width
 <span id="L32" class="LineNr"> 32 </span>  idx <span class="Special">&lt;-</span> add x
 <span id="L33" class="LineNr"> 33 </span>  <span class="PreProc">var</span> grid/<span class="muRegEsi">esi</span>: (addr array boolean) <span class="Special">&lt;-</span> copy _grid
 <span id="L34" class="LineNr"> 34 </span>  <span class="PreProc">var</span> result/eax: (addr boolean) <span class="Special">&lt;-</span> index grid, idx
@@ -102,7 +102,7 @@ if ('onhashchange' in window) {
 <span id="L38" class="LineNr"> 38 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='life.mu.html#L38'>set-state</a></span> _grid: (addr array boolean), x: int, y: int, val: boolean <span class="Delimiter">{</span>
 <span id="L39" class="LineNr"> 39 </span>  <span class="muComment"># don't bother checking bounds</span>
 <span id="L40" class="LineNr"> 40 </span>  <span class="PreProc">var</span> idx/eax: int <span class="Special">&lt;-</span> copy y
-<span id="L41" class="LineNr"> 41 </span>  idx <span class="Special">&lt;-</span> shift-left <span class="Constant">8</span>/log2width
+<span id="L41" class="LineNr"> 41 </span>  idx <span class="Special">&lt;-</span> shift-left <span class="Constant">7</span>/log2width
 <span id="L42" class="LineNr"> 42 </span>  idx <span class="Special">&lt;-</span> add x
 <span id="L43" class="LineNr"> 43 </span>  <span class="PreProc">var</span> grid/<span class="muRegEsi">esi</span>: (addr array boolean) <span class="Special">&lt;-</span> copy _grid
 <span id="L44" class="LineNr"> 44 </span>  <span class="PreProc">var</span> result/eax: (addr boolean) <span class="Special">&lt;-</span> index grid, idx
@@ -178,11 +178,11 @@ if ('onhashchange' in window) {
 <span id="L114" class="LineNr">114 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='life.mu.html#L114'>step</a></span> old-grid: (addr array boolean), new-grid: (addr array boolean) <span class="Delimiter">{</span>
 <span id="L115" class="LineNr">115 </span>  <span class="PreProc">var</span> y/<span class="muRegEcx">ecx</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">0</span>
 <span id="L116" class="LineNr">116 </span>  <span class="Delimiter">{</span>
-<span id="L117" class="LineNr">117 </span>    compare y, <span class="Constant">0xc0</span>/height
+<span id="L117" class="LineNr">117 </span>    compare y, <span class="Constant">0x60</span>/height
 <span id="L118" class="LineNr">118 </span>    <span class="PreProc">break-if-&gt;=</span>
 <span id="L119" class="LineNr">119 </span>    <span class="PreProc">var</span> x/<span class="muRegEdx">edx</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">0</span>
 <span id="L120" class="LineNr">120 </span>    <span class="Delimiter">{</span>
-<span id="L121" class="LineNr">121 </span>      compare x, <span class="Constant">0x100</span>/width
+<span id="L121" class="LineNr">121 </span>      compare x, <span class="Constant">0x80</span>/width
 <span id="L122" class="LineNr">122 </span>      <span class="PreProc">break-if-&gt;=</span>
 <span id="L123" class="LineNr">123 </span>      <span class="PreProc">var</span> n/eax: int <span class="Special">&lt;-</span> <a href='life.mu.html#L49'>num-live-neighbors</a> old-grid, x, y
 <span id="L124" class="LineNr">124 </span>      <span class="muComment"># if neighbors &lt; 2, die of loneliness</span>
@@ -221,9 +221,9 @@ if ('onhashchange' in window) {
 <span id="L157" class="LineNr">157 </span><span class="muComment"># color a square of size 'side' starting at x*side, y*side</span>
 <span id="L158" class="LineNr">158 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='life.mu.html#L158'>render-square</a></span> _x: int, _y: int, color: int <span class="Delimiter">{</span>
 <span id="L159" class="LineNr">159 </span>  <span class="PreProc">var</span> y/<span class="muRegEdx">edx</span>: int <span class="Special">&lt;-</span> copy _y
-<span id="L160" class="LineNr">160 </span>  y <span class="Special">&lt;-</span> shift-left <span class="Constant">2</span>/log2side
+<span id="L160" class="LineNr">160 </span>  y <span class="Special">&lt;-</span> shift-left <span class="Constant">3</span>/log2side
 <span id="L161" class="LineNr">161 </span>  <span class="PreProc">var</span> side/<span class="muRegEbx">ebx</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">1</span>
-<span id="L162" class="LineNr">162 </span>  side <span class="Special">&lt;-</span> shift-left <span class="Constant">2</span>/log2side
+<span id="L162" class="LineNr">162 </span>  side <span class="Special">&lt;-</span> shift-left <span class="Constant">3</span>/log2side
 <span id="L163" class="LineNr">163 </span>  <span class="PreProc">var</span> ymax/<span class="muRegEcx">ecx</span>: int <span class="Special">&lt;-</span> copy y
 <span id="L164" class="LineNr">164 </span>  ymax <span class="Special">&lt;-</span> add side
 <span id="L165" class="LineNr">165 </span>  <span class="Delimiter">{</span>
@@ -231,7 +231,7 @@ if ('onhashchange' in window) {
 <span id="L167" class="LineNr">167 </span>    <span class="PreProc">break-if-&gt;=</span>
 <span id="L168" class="LineNr">168 </span>    <span class="Delimiter">{</span>
 <span id="L169" class="LineNr">169 </span>      <span class="PreProc">var</span> x/eax: int <span class="Special">&lt;-</span> copy _x
-<span id="L170" class="LineNr">170 </span>      x <span class="Special">&lt;-</span> shift-left <span class="Constant">2</span>/log2side
+<span id="L170" class="LineNr">170 </span>      x <span class="Special">&lt;-</span> shift-left <span class="Constant">3</span>/log2side
 <span id="L171" class="LineNr">171 </span>      <span class="PreProc">var</span> xmax/<span class="muRegEcx">ecx</span>: int <span class="Special">&lt;-</span> copy x
 <span id="L172" class="LineNr">172 </span>      xmax <span class="Special">&lt;-</span> add side
 <span id="L173" class="LineNr">173 </span>      <span class="Delimiter">{</span>
@@ -260,12 +260,12 @@ if ('onhashchange' in window) {
 <span id="L196" class="LineNr">196 </span>      compare <a href='life.mu.html#L8'>state</a>, <span class="Constant">0</span>/false
 <span id="L197" class="LineNr">197 </span>      <span class="Delimiter">{</span>
 <span id="L198" class="LineNr">198 </span>        <span class="PreProc">break-if-=</span>
-<span id="L199" class="LineNr">199 </span>        <a href='life.mu.html#L158'>render-square</a> x, y, <span class="Constant">3</span>/cyan
+<span id="L199" class="LineNr">199 </span>        <a href='life.mu.html#L158'>render-square</a> x, y, <span class="Constant">0</span>/black
 <span id="L200" class="LineNr">200 </span>      <span class="Delimiter">}</span>
 <span id="L201" class="LineNr">201 </span>      compare <a href='life.mu.html#L8'>state</a>, <span class="Constant">0</span>/false
 <span id="L202" class="LineNr">202 </span>      <span class="Delimiter">{</span>
 <span id="L203" class="LineNr">203 </span>        <span class="PreProc">break-if-!=</span>
-<span id="L204" class="LineNr">204 </span>        <a href='life.mu.html#L158'>render-square</a> x, y, <span class="Constant">0</span>/black
+<span id="L204" class="LineNr">204 </span>        <a href='life.mu.html#L158'>render-square</a> x, y, <span class="Constant">3</span>/cyan
 <span id="L205" class="LineNr">205 </span>      <span class="Delimiter">}</span>
 <span id="L206" class="LineNr">206 </span>      x <span class="Special">&lt;-</span> increment
 <span id="L207" class="LineNr">207 </span>      <span class="PreProc">loop</span>
@@ -284,20 +284,20 @@ if ('onhashchange' in window) {
 <span id="L220" class="LineNr">220 </span>  <span class="muComment"># allocate on the heap</span>
 <span id="L221" class="LineNr">221 </span>  <span class="PreProc">var</span> grid1-storage: (handle array boolean)
 <span id="L222" class="LineNr">222 </span>  <span class="PreProc">var</span> grid1-ah/eax: (addr handle array boolean) <span class="Special">&lt;-</span> address grid1-storage
-<span id="L223" class="LineNr">223 </span>  populate grid1-ah, <span class="Constant">0xc000</span>  <span class="muComment"># width * height</span>
-<span id="L224" class="LineNr">224 </span>  <span class="PreProc">var</span> _grid1/eax: (addr array boolean) <span class="Special">&lt;-</span> <a href='../120allocate.subx.html#L223'>lookup</a> *grid1-ah
+<span id="L223" class="LineNr">223 </span>  populate grid1-ah, <span class="Constant">0x3000</span>  <span class="muComment"># width * height</span>
+<span id="L224" class="LineNr">224 </span>  <span class="PreProc">var</span> _grid1/eax: (addr array boolean) <span class="Special">&lt;-</span> <a href='../120allocate.subx.html#L235'>lookup</a> *grid1-ah
 <span id="L225" class="LineNr">225 </span>  <span class="PreProc">var</span> grid1/<span class="muRegEsi">esi</span>: (addr array boolean) <span class="Special">&lt;-</span> copy _grid1
 <span id="L226" class="LineNr">226 </span>  <span class="PreProc">var</span> grid2-storage: (handle array boolean)
 <span id="L227" class="LineNr">227 </span>  <span class="PreProc">var</span> grid2-ah/eax: (addr handle array boolean) <span class="Special">&lt;-</span> address grid2-storage
-<span id="L228" class="LineNr">228 </span>  populate grid2-ah, <span class="Constant">0xc000</span>  <span class="muComment"># width * height</span>
-<span id="L229" class="LineNr">229 </span>  <span class="PreProc">var</span> _grid2/eax: (addr array boolean) <span class="Special">&lt;-</span> <a href='../120allocate.subx.html#L223'>lookup</a> *grid2-ah
+<span id="L228" class="LineNr">228 </span>  populate grid2-ah, <span class="Constant">0x3000</span>  <span class="muComment"># width * height</span>
+<span id="L229" class="LineNr">229 </span>  <span class="PreProc">var</span> _grid2/eax: (addr array boolean) <span class="Special">&lt;-</span> <a href='../120allocate.subx.html#L235'>lookup</a> *grid2-ah
 <span id="L230" class="LineNr">230 </span>  <span class="PreProc">var</span> grid2/<span class="muRegEdi">edi</span>: (addr array boolean) <span class="Special">&lt;-</span> copy _grid2
 <span id="L231" class="LineNr">231 </span>  <span class="muComment"># initialize grid1</span>
-<span id="L232" class="LineNr">232 </span>  <a href='life.mu.html#L38'>set-state</a> grid1, <span class="Constant">0x80</span>, <span class="Constant">0x5f</span>, <span class="Constant">1</span>/live
-<span id="L233" class="LineNr">233 </span>  <a href='life.mu.html#L38'>set-state</a> grid1, <span class="Constant">0x81</span>, <span class="Constant">0x5f</span>, <span class="Constant">1</span>/live
-<span id="L234" class="LineNr">234 </span>  <a href='life.mu.html#L38'>set-state</a> grid1, <span class="Constant">0x7f</span>, <span class="Constant">0x60</span>, <span class="Constant">1</span>/live
-<span id="L235" class="LineNr">235 </span>  <a href='life.mu.html#L38'>set-state</a> grid1, <span class="Constant">0x80</span>, <span class="Constant">0x60</span>, <span class="Constant">1</span>/live
-<span id="L236" class="LineNr">236 </span>  <a href='life.mu.html#L38'>set-state</a> grid1, <span class="Constant">0x80</span>, <span class="Constant">0x61</span>, <span class="Constant">1</span>/live
+<span id="L232" class="LineNr">232 </span>  <a href='life.mu.html#L38'>set-state</a> grid1, <span class="Constant">0x40</span>, <span class="Constant">0x2f</span>, <span class="Constant">1</span>/live
+<span id="L233" class="LineNr">233 </span>  <a href='life.mu.html#L38'>set-state</a> grid1, <span class="Constant">0x41</span>, <span class="Constant">0x2f</span>, <span class="Constant">1</span>/live
+<span id="L234" class="LineNr">234 </span>  <a href='life.mu.html#L38'>set-state</a> grid1, <span class="Constant">0x3f</span>, <span class="Constant">0x30</span>, <span class="Constant">1</span>/live
+<span id="L235" class="LineNr">235 </span>  <a href='life.mu.html#L38'>set-state</a> grid1, <span class="Constant">0x40</span>, <span class="Constant">0x30</span>, <span class="Constant">1</span>/live
+<span id="L236" class="LineNr">236 </span>  <a href='life.mu.html#L38'>set-state</a> grid1, <span class="Constant">0x40</span>, <span class="Constant">0x31</span>, <span class="Constant">1</span>/live
 <span id="L237" class="LineNr">237 </span>  <span class="muComment"># render grid1</span>
 <span id="L238" class="LineNr">238 </span>  <a href='life.mu.html#L186'>render</a> grid1
 <span id="L239" class="LineNr">239 </span>  <span class="Delimiter">{</span>
@@ -308,12 +308,25 @@ if ('onhashchange' in window) {
 <span id="L244" class="LineNr">244 </span>    <span class="muComment"># iter: grid1 -&gt; grid2</span>
 <span id="L245" class="LineNr">245 </span>    <a href='life.mu.html#L114'>step</a> grid1, grid2
 <span id="L246" class="LineNr">246 </span>    <a href='life.mu.html#L186'>render</a> grid2
-<span id="L247" class="LineNr">247 </span>    <span class="muComment"># iter: grid2 -&gt; grid1</span>
-<span id="L248" class="LineNr">248 </span>    <a href='life.mu.html#L114'>step</a> grid2, grid1
-<span id="L249" class="LineNr">249 </span>    <a href='life.mu.html#L186'>render</a> grid1
-<span id="L250" class="LineNr">250 </span>    <span class="PreProc">loop</span>
-<span id="L251" class="LineNr">251 </span>  <span class="Delimiter">}</span>
-<span id="L252" class="LineNr">252 </span><span class="Delimiter">}</span>
+<span id="L247" class="LineNr">247 </span><span class="CommentedCode">#?     linger</span>
+<span id="L248" class="LineNr">248 </span>    <span class="muComment"># iter: grid2 -&gt; grid1</span>
+<span id="L249" class="LineNr">249 </span>    <a href='life.mu.html#L114'>step</a> grid2, grid1
+<span id="L250" class="LineNr">250 </span>    <a href='life.mu.html#L186'>render</a> grid1
+<span id="L251" class="LineNr">251 </span><span class="CommentedCode">#?     linger</span>
+<span id="L252" class="LineNr">252 </span>    <span class="PreProc">loop</span>
+<span id="L253" class="LineNr">253 </span>  <span class="Delimiter">}</span>
+<span id="L254" class="LineNr">254 </span><span class="Delimiter">}</span>
+<span id="L255" class="LineNr">255 </span>
+<span id="L256" class="LineNr">256 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='life.mu.html#L256'>linger</a></span> <span class="Delimiter">{</span>
+<span id="L257" class="LineNr">257 </span>  <span class="PreProc">var</span> i/<span class="muRegEcx">ecx</span>: int <span class="Special">&lt;-</span> copy <span class="Constant">0</span>
+<span id="L258" class="LineNr">258 </span>  <span class="Delimiter">{</span>
+<span id="L259" class="LineNr">259 </span>    compare i, <span class="Constant">0x10000000</span>  <span class="muComment"># Kartik's Linux with -accel kvm</span>
+<span id="L260" class="LineNr">260 </span><span class="CommentedCode">#?     compare i, 0x8000000  # Kartik's Mac with -accel tcg</span>
+<span id="L261" class="LineNr">261 </span>    <span class="PreProc">break-if-&gt;=</span>
+<span id="L262" class="LineNr">262 </span>    i <span class="Special">&lt;-</span> increment
+<span id="L263" class="LineNr">263 </span>    <span class="PreProc">loop</span>
+<span id="L264" class="LineNr">264 </span>  <span class="Delimiter">}</span>
+<span id="L265" class="LineNr">265 </span><span class="Delimiter">}</span>
 </pre>
 </body>
 </html>