5c105a7aca
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.
17 lines
457 B
Forth
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
|
|
}
|