diff options
author | Kartik Agaram <vc@akkartik.com> | 2020-11-16 20:44:02 -0800 |
---|---|---|
committer | Kartik Agaram <vc@akkartik.com> | 2020-11-16 20:44:02 -0800 |
commit | dd60a1d73c8017fd3d80ccf91e4549fc47a90760 (patch) | |
tree | 2b0e24d15102aa7dd53284511371c0f579c14bbe /html/apps/raytracing/2.mu.html | |
parent | 3d31467c0dae1d879111901635d257353aae27c9 (diff) | |
download | mu-dd60a1d73c8017fd3d80ccf91e4549fc47a90760.tar.gz |
7252
Diffstat (limited to 'html/apps/raytracing/2.mu.html')
-rw-r--r-- | html/apps/raytracing/2.mu.html | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/html/apps/raytracing/2.mu.html b/html/apps/raytracing/2.mu.html index 8e068b01..56563080 100644 --- a/html/apps/raytracing/2.mu.html +++ b/html/apps/raytracing/2.mu.html @@ -65,7 +65,7 @@ if ('onhashchange' in window) { <span id="L6" class="LineNr"> 6 </span><span class="muComment"># $ ./translate_mu apps/raytracing/2.mu</span> <span id="L7" class="LineNr"> 7 </span><span class="muComment"># $ ./a.elf > 2.ppm</span> <span id="L8" class="LineNr"> 8 </span> -<span id="L9" class="LineNr"> 9 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='2.mu.html#L9'>main</a></span><span class="PreProc"> -> </span>_/<span class="Constant">ebx</span>: int <span class="Delimiter">{</span> +<span id="L9" class="LineNr"> 9 </span><span class="PreProc">fn</span> <span class="muFunction">main</span><span class="PreProc"> -> </span>_/<span class="Constant">ebx</span>: int <span class="Delimiter">{</span> <span id="L10" class="LineNr">10 </span> <a href='../../405screen.mu.html#L169'>print-string</a> <span class="Constant">0</span>, <span class="Constant">"P3\n256 256\n255\n"</span> <span id="L11" class="LineNr">11 </span> <span class="PreProc">var</span> _four/<span class="Constant">edx</span>: int <span class="SpecialChar"><-</span> copy <span class="Constant">4</span> <span id="L12" class="LineNr">12 </span> <span class="PreProc">var</span> four/<span class="Constant">xmm1</span>: float <span class="SpecialChar"><-</span> convert _four @@ -80,7 +80,7 @@ if ('onhashchange' in window) { <span id="L21" class="LineNr">21 </span> <span class="Delimiter">{</span> <span id="L22" class="LineNr">22 </span> compare i, <span class="Constant">0xff</span> <span id="L23" class="LineNr">23 </span> <span class="PreProc">break-if-></span> -<span id="L24" class="LineNr">24 </span> <span class="PreProc">var</span> c: <a href='2.mu.html#L53'>rgb</a> +<span id="L24" class="LineNr">24 </span> <span class="PreProc">var</span> c: rgb <span id="L25" class="LineNr">25 </span> <span class="muComment"># compute r</span> <span id="L26" class="LineNr">26 </span> <span class="PreProc">var</span> tmp/<span class="Constant">xmm0</span>: float <span class="SpecialChar"><-</span> convert i <span id="L27" class="LineNr">27 </span> tmp <span class="SpecialChar"><-</span> divide image-size @@ -98,8 +98,8 @@ if ('onhashchange' in window) { <span id="L39" class="LineNr">39 </span> <span class="PreProc">var</span> b-addr/<span class="Constant">edx</span>: (addr float) <span class="SpecialChar"><-</span> <a href='../../131table.subx.html#L26'>get</a> c, b <span id="L40" class="LineNr">40 </span> copy-to *b-addr, one-fourth <span id="L41" class="LineNr">41 </span> <span class="muComment"># emit</span> -<span id="L42" class="LineNr">42 </span> <span class="PreProc">var</span> c-addr/<span class="Constant">edx</span>: (addr <a href='2.mu.html#L53'>rgb</a>) <span class="SpecialChar"><-</span> address c -<span id="L43" class="LineNr">43 </span> <a href='2.mu.html#L61'>print-rgb</a> <span class="Constant">0</span>, c-addr +<span id="L42" class="LineNr">42 </span> <span class="PreProc">var</span> c-addr/<span class="Constant">edx</span>: (addr rgb) <span class="SpecialChar"><-</span> address c +<span id="L43" class="LineNr">43 </span> print-rgb <span class="Constant">0</span>, c-addr <span id="L44" class="LineNr">44 </span> i <span class="SpecialChar"><-</span> increment <span id="L45" class="LineNr">45 </span> <span class="PreProc">loop</span> <span id="L46" class="LineNr">46 </span> <span class="Delimiter">}</span> @@ -109,7 +109,7 @@ if ('onhashchange' in window) { <span id="L50" class="LineNr">50 </span> <span class="PreProc">return</span> <span class="Constant">0</span> <span id="L51" class="LineNr">51 </span><span class="Delimiter">}</span> <span id="L52" class="LineNr">52 </span> -<span id="L53" class="LineNr">53 </span><span class="PreProc">type</span> <a href='2.mu.html#L53'>rgb</a> <span class="Delimiter">{</span> +<span id="L53" class="LineNr">53 </span><span class="PreProc">type</span> rgb <span class="Delimiter">{</span> <span id="L54" class="LineNr">54 </span> <span class="muComment"># components normalized to within [0.0, 1.0]</span> <span id="L55" class="LineNr">55 </span> r: float <span id="L56" class="LineNr">56 </span> g: float @@ -117,8 +117,8 @@ if ('onhashchange' in window) { <span id="L58" class="LineNr">58 </span><span class="Delimiter">}</span> <span id="L59" class="LineNr">59 </span> <span id="L60" class="LineNr">60 </span><span class="muComment"># print translating to [0, 256)</span> -<span id="L61" class="LineNr">61 </span><span class="PreProc">fn</span> <span class="muFunction"><a href='2.mu.html#L61'>print-rgb</a></span> <a href='../../405screen.mu.html#L9'>screen</a>: (addr <a href='../../405screen.mu.html#L9'>screen</a>), _c: (addr <a href='2.mu.html#L53'>rgb</a>) <span class="Delimiter">{</span> -<span id="L62" class="LineNr">62 </span> <span class="PreProc">var</span> c/<span class="Constant">esi</span>: (addr <a href='2.mu.html#L53'>rgb</a>) <span class="SpecialChar"><-</span> copy _c +<span id="L61" class="LineNr">61 </span><span class="PreProc">fn</span> <span class="muFunction">print-rgb</span> <a href='../../405screen.mu.html#L9'>screen</a>: (addr <a href='../../405screen.mu.html#L9'>screen</a>), _c: (addr rgb) <span class="Delimiter">{</span> +<span id="L62" class="LineNr">62 </span> <span class="PreProc">var</span> c/<span class="Constant">esi</span>: (addr rgb) <span class="SpecialChar"><-</span> copy _c <span id="L63" class="LineNr">63 </span> <span class="PreProc">var</span> n/<span class="Constant">ecx</span>: int <span class="SpecialChar"><-</span> copy <span class="Constant">0xff</span> <span class="muComment"># turns out 255 works just as well as 255.999, which is lucky because we don't have floating-point literals</span> <span id="L64" class="LineNr">64 </span> <span class="PreProc">var</span> xn/<span class="Constant">xmm1</span>: float <span class="SpecialChar"><-</span> convert n <span id="L65" class="LineNr">65 </span> <span class="muComment"># print 255 * c->r</span> |