From 132d72d28a63e58ec7f5e6fc955be140ee5844b0 Mon Sep 17 00:00:00 2001 From: Kartik Agaram Date: Mon, 11 Oct 2021 21:35:16 -0700 Subject: . --- html/apps/ex11.mu.html | 44 ++++++++++++++++++++++---------------------- 1 file changed, 22 insertions(+), 22 deletions(-) (limited to 'html/apps/ex11.mu.html') diff --git a/html/apps/ex11.mu.html b/html/apps/ex11.mu.html index cc71489a..2362a8ad 100644 --- a/html/apps/ex11.mu.html +++ b/html/apps/ex11.mu.html @@ -72,12 +72,12 @@ if ('onhashchange' in window) { 9 # between control points, and arrow keys to move the control point at the 10 # cursor. 11 - 12 fn main screen: (addr screen), keyboard: (addr keyboard), data-disk: (addr disk) { + 12 fn main screen: (addr screen), keyboard: (addr keyboard), data-disk: (addr disk) { 13 var env-storage: environment 14 var env/esi: (addr environment) <- address env-storage 15 initialize-environment env, 0x200 0x20, 0x180 0x90, 0x180 0x160 16 { - 17 render screen, env + 17 render screen, env 18 edit keyboard, env 19 loop 20 } @@ -95,8 +95,8 @@ if ('onhashchange' in window) { 32 y: int 33 } 34 - 35 fn render screen: (addr screen), _self: (addr environment) { - 36 clear-screen screen + 35 fn render screen: (addr screen), _self: (addr environment) { + 36 clear-screen screen 37 var self/esi: (addr environment) <- copy _self 38 var tmp-ah/ecx: (addr handle point) <- get self, p0 39 var tmp/eax: (addr point) <- lookup *tmp-ah @@ -108,21 +108,21 @@ if ('onhashchange' in window) { 45 tmp <- lookup *tmp-ah 46 var p2/ecx: (addr point) <- copy tmp 47 # control lines - 48 line screen, p0, p1, 7/color - 49 line screen, p1, p2, 7/color + 48 line screen, p0, p1, 7/color + 49 line screen, p1, p2, 7/color 50 # curve above control lines - 51 bezier screen, p0, p1, p2, 0xc/color + 51 bezier screen, p0, p1, p2, 0xc/color 52 # points above curve - 53 disc screen, p0, 3/radius, 7/color 0xf/border - 54 disc screen, p1, 3/radius, 7/color 0xf/border - 55 disc screen, p2, 3/radius, 7/color 0xf/border + 53 disc screen, p0, 3/radius, 7/color 0xf/border + 54 disc screen, p1, 3/radius, 7/color 0xf/border + 55 disc screen, p2, 3/radius, 7/color 0xf/border 56 # cursor last of all 57 var cursor-ah/eax: (addr handle point) <- get self, cursor 58 var cursor/eax: (addr point) <- lookup *cursor-ah - 59 cursor screen, cursor, 0xa/side, 3/color + 59 cursor screen, cursor, 0xa/side, 3/color 60 } 61 - 62 fn bezier screen: (addr screen), _p0: (addr point), _p1: (addr point), _p2: (addr point), color: int { + 62 fn bezier screen: (addr screen), _p0: (addr point), _p1: (addr point), _p2: (addr point), color: int { 63 var p0/esi: (addr point) <- copy _p0 64 var x0/ecx: (addr int) <- get p0, x 65 var y0/edx: (addr int) <- get p0, y @@ -132,10 +132,10 @@ if ('onhashchange' in window) { 69 var p2/esi: (addr point) <- copy _p2 70 var x2/edi: (addr int) <- get p2, x 71 var y2/esi: (addr int) <- get p2, y - 72 draw-monotonic-bezier screen, *x0 *y0, *x1 *y1, *x2 *y2, color + 72 draw-monotonic-bezier screen, *x0 *y0, *x1 *y1, *x2 *y2, color 73 } 74 - 75 fn cursor screen: (addr screen), _p: (addr point), side: int, color: int { + 75 fn cursor screen: (addr screen), _p: (addr point), side: int, color: int { 76 var half-side/eax: int <- copy side 77 half-side <- shift-right 1 78 var p/esi: (addr point) <- copy _p @@ -147,16 +147,16 @@ if ('onhashchange' in window) { 84 top-y <- subtract half-side 85 var max/eax: int <- copy left-x 86 max <- add side - 87 draw-horizontal-line screen, top-y, left-x, max, color + 87 draw-horizontal-line screen, top-y, left-x, max, color 88 max <- copy top-y 89 max <- add side - 90 draw-vertical-line screen, left-x, top-y, max, color + 90 draw-vertical-line screen, left-x, top-y, max, color 91 var right-x/ebx: int <- copy left-x 92 right-x <- add side - 93 draw-vertical-line screen, right-x, top-y, max, color + 93 draw-vertical-line screen, right-x, top-y, max, color 94 var bottom-y/edx: int <- copy top-y 95 bottom-y <- add side - 96 draw-horizontal-line screen, bottom-y, left-x, right-x, color + 96 draw-horizontal-line screen, bottom-y, left-x, right-x, color 97 } 98 99 fn edit keyboard: (addr keyboard), _self: (addr environment) { @@ -274,21 +274,21 @@ if ('onhashchange' in window) { 211 } 212 } 213 -214 fn line screen: (addr screen), _p0: (addr point), _p1: (addr point), color: int { +214 fn line screen: (addr screen), _p0: (addr point), _p1: (addr point), color: int { 215 var p0/esi: (addr point) <- copy _p0 216 var x0/ecx: (addr int) <- get p0, x 217 var y0/edx: (addr int) <- get p0, y 218 var p1/esi: (addr point) <- copy _p1 219 var x1/ebx: (addr int) <- get p1, x 220 var y1/eax: (addr int) <- get p1, y -221 draw-line screen, *x0 *y0, *x1 *y1, color +221 draw-line screen, *x0 *y0, *x1 *y1, color 222 } 223 -224 fn disc screen: (addr screen), _p: (addr point), radius: int, color: int, border-color: int { +224 fn disc screen: (addr screen), _p: (addr point), radius: int, color: int, border-color: int { 225 var p/esi: (addr point) <- copy _p 226 var x/ecx: (addr int) <- get p, x 227 var y/edx: (addr int) <- get p, y -228 draw-disc screen, *x *y, radius, color, border-color +228 draw-disc screen, *x *y, radius, color, border-color 229 } 230 231 fn initialize-environment _self: (addr environment), x0: int, y0: int, x1: int, y1: int, x2: int, y2: int { -- cgit 1.4.1-2-gfad0