mu/409float.mu
Kartik Agaram 5c105a7aca 6949 - snapshot of next raytracing milestone
Not yet right, but worth a snapshot just because it gives a cool result.
Here, try it out:
  $ ./translate_mu_debug apps/raytracing/3.mu
  $ ./a.elf > x.ppm
Now view x.ppm as an image.

In general, this was quite tedious to write. And a still-open question
is how to emit the progress bar to stderr. My options are to either duplicate
all my print-* functions (already proliferating) or add global variables
to Mu.
2020-10-04 21:15:28 -07:00

17 lines
457 B
Forth

# Some quick-n-dirty ways to create floats.
fn fill-in-rational _out: (addr float), nr: int, dr: int {
var out/edi: (addr float) <- copy _out
var result/xmm0: float <- convert nr
var divisor/xmm1: float <- convert dr
result <- divide divisor
copy-to *out, result
}
fn fill-in-sqrt _out: (addr float), n: int {
var out/edi: (addr float) <- copy _out
var result/xmm0: float <- convert n
result <- square-root result
copy-to *out, result
}