diff --git a/html/103glyph.subx.html b/html/103glyph.subx.html index 1b724030..2930ea54 100644 --- a/html/103glyph.subx.html +++ b/html/103glyph.subx.html @@ -123,7 +123,7 @@ if ('onhashchange' in window) { 66 8b/-> *(ebp+8) 0/r32/eax 67 05/add-to-eax 4/imm32 68 # - 69 (draw-code-point-on-screen-buffer %eax *(ebp+0xc) *(ebp+0x10) *(ebp+0x14) *(ebp+0x18) *(ebp+0x1c) *(ebp+0x20) *(ebp+0x24)) # => eax + 69 (draw-code-point-on-screen-buffer %eax *(ebp+0xc) *(ebp+0x10) *(ebp+0x14) *(ebp+0x18) *(ebp+0x1c) 1 *(ebp+0x20) *(ebp+0x24)) # => eax 70 $draw-code-point-on-screen-array:end: 71 # . restore registers 72 5a/pop-to-edx @@ -134,10 +134,10 @@ if ('onhashchange' in window) { 77 c3/return 78 79 $draw-code-point-on-screen-array:overflow: - 80 (abort "draw-code-point-on-screen-array: screen dimensions too large") + 80 (abort "draw-code-point-on-screen-array: screen dimensions too large") 81 82 $draw-code-point-on-screen-array:abort: - 83 (abort "draw-code-point-on-screen-array: coordinates are off the screen. Are the screen dimensions correct?") + 83 (abort "draw-code-point-on-screen-array: coordinates are off the screen. Are the screen dimensions correct?") 84 85 # 'buffer' here is not a valid Mu type: a naked address without a length. 86 # returns number of 8x16 units printed to screen (1 or 2). diff --git a/html/315stack-debug.subx.html b/html/315stack-debug.subx.html index c7f1e1a9..0a588178 100644 --- a/html/315stack-debug.subx.html +++ b/html/315stack-debug.subx.html @@ -92,12 +92,12 @@ if ('onhashchange' in window) { 34 # 35 89/<- %edx 4/r32/esp 36 # save old cursor position - 37 (cursor-position 0) # => eax, ecx + 37 (cursor-position 0) # => eax, ecx 38 # print at top-right - 39 (set-cursor-position 0 0x70 0) + 39 (set-cursor-position 0 0x70 0) 40 (draw-int32-hex-wrapping-right-then-down-from-cursor-over-full-screen 0 %edx 0xf 0xc) 41 # restore cursor position - 42 (set-cursor-position %eax %ecx) + 42 (set-cursor-position %eax %ecx) 43 $show-stack-state:end: 44 # . restore registers 45 5a/pop-to-edx @@ -124,11 +124,11 @@ if ('onhashchange' in window) { 66 74/jump-if-= break/disp8 67 (draw-text-wrapping-right-then-down-from-cursor-over-full-screen 0 *(ebp+8) *(ebp+0xc) *(ebp+0x10)) 68 # clear the screen and continue if we got too close to the bottom - 69 (cursor-position 0) # => eax, ecx + 69 (cursor-position 0) # => eax, ecx 70 81 7/subop/compare %ecx 0x28/imm32 71 75/jump-if-!= break/disp8 - 72 (clear-screen 0) - 73 (set-cursor-position 0 0 0) + 72 (clear-screen 0) + 73 (set-cursor-position 0 0 0) 74 } 75 $debug-print:end: 76 # . restore registers diff --git a/html/412render-float-decimal.mu.html b/html/412render-float-decimal.mu.html index 89183c1a..d006069c 100644 --- a/html/412render-float-decimal.mu.html +++ b/html/412render-float-decimal.mu.html @@ -212,14 +212,14 @@ if ('onhashchange' in window) { 148 check-stream-equal s, "NaN", "F - test-write-float-decimal-approximate-not-a-number" 149 } 150 -151 fn render-float-decimal screen: (addr screen), in: float, precision: int, x: int, y: int, color: int, background-color: int -> _/eax: int { +151 fn render-float-decimal screen: (addr screen), in: float, precision: int, x: int, y: int, color: int, background-color: int -> _/eax: int { 152 var s-storage: (stream byte 0x10) 153 var s/esi: (addr stream byte) <- address s-storage 154 write-float-decimal-approximate s, in, precision 155 var width/eax: int <- copy 0 156 var height/ecx: int <- copy 0 -157 width, height <- screen-size screen -158 var result/eax: int <- draw-stream-rightward screen, s, x, width, y, color, background-color +157 width, height <- screen-size screen +158 var result/eax: int <- draw-stream-rightward screen, s, x, width, y, color, background-color 159 return result 160 } 161 diff --git a/html/500fake-screen.mu.html b/html/500fake-screen.mu.html index 330bf534..56909c43 100644 --- a/html/500fake-screen.mu.html +++ b/html/500fake-screen.mu.html @@ -73,714 +73,716 @@ if ('onhashchange' in window) { 10 # - Drawing pixels atop text or vice versa is not supported. Results in a fake 11 # screen will not mimic real screens in these situations. 12 # - Fake screens currently also assume a fixed-width 8x16 font. - 13 - 14 type screen { - 15 # text mode - 16 width: int - 17 height: int - 18 data: (handle array screen-cell) - 19 cursor-x: int # [0..width) - 20 cursor-y: int # [0..height) - 21 # pixel graphics - 22 pixels: (handle array byte) - 23 } - 24 - 25 type screen-cell { - 26 data: code-point # TODO: support combining characters overlaid on another character - 27 color: int - 28 background-color: int - 29 unused?: boolean - 30 } - 31 - 32 fn initialize-screen _screen: (addr screen), width: int, height: int, pixel-graphics?: boolean { - 33 var screen/esi: (addr screen) <- copy _screen - 34 var tmp/eax: int <- copy 0 - 35 var dest/edi: (addr int) <- copy 0 - 36 # screen->width = width - 37 dest <- get screen, width - 38 tmp <- copy width - 39 copy-to *dest, tmp - 40 # screen->height = height - 41 dest <- get screen, height - 42 tmp <- copy height - 43 copy-to *dest, tmp - 44 # populate screen->data - 45 { - 46 var data-ah/edi: (addr handle array screen-cell) <- get screen, data - 47 var capacity/eax: int <- copy width - 48 capacity <- multiply height - 49 # - 50 populate data-ah, capacity - 51 } - 52 # if necessary, populate screen->pixels - 53 { - 54 compare pixel-graphics?, 0/false - 55 break-if-= - 56 var pixels-ah/edi: (addr handle array byte) <- get screen, pixels - 57 var capacity/eax: int <- copy width - 58 capacity <- shift-left 3/log2-font-width - 59 capacity <- multiply height - 60 capacity <- shift-left 4/log2-font-height - 61 # - 62 populate pixels-ah, capacity - 63 } - 64 # screen->cursor-x = 0 - 65 dest <- get screen, cursor-x - 66 copy-to *dest, 0 - 67 # screen->cursor-y = 0 - 68 dest <- get screen, cursor-y - 69 copy-to *dest, 0 - 70 } - 71 - 72 # in graphemes - 73 fn screen-size _screen: (addr screen) -> _/eax: int, _/ecx: int { - 74 var screen/esi: (addr screen) <- copy _screen - 75 var width/eax: int <- copy 0 - 76 var height/ecx: int <- copy 0 - 77 compare screen, 0 - 78 { - 79 break-if-!= - 80 return 0x80/128, 0x30/48 - 81 } - 82 # fake screen - 83 var tmp/edx: (addr int) <- get screen, width - 84 width <- copy *tmp - 85 tmp <- get screen, height - 86 height <- copy *tmp - 87 return width, height - 88 } - 89 - 90 # testable screen primitive - 91 # return number of 8x16 units drawn - 92 fn draw-code-point _screen: (addr screen), c: code-point, x: int, y: int, color: int, background-color: int -> _/eax: int { - 93 var screen/esi: (addr screen) <- copy _screen - 94 { - 95 compare screen, 0 - 96 break-if-!= - 97 var result/eax: int <- draw-code-point-on-real-screen c, x, y, color, background-color - 98 return result - 99 } -100 # fake screen -101 var wide?/eax: boolean <- wide-code-point? c -102 compare wide?, 0/false -103 { -104 break-if-= -105 draw-wide-code-point-on-fake-screen screen, c, x, y, color, background-color -106 return 2 -107 } -108 draw-narrow-code-point-on-fake-screen screen, c, x, y, color, background-color -109 return 1 -110 } -111 -112 fn overlay-code-point _screen: (addr screen), c: code-point, x: int, y: int, color: int, background-color: int -> _/eax: int { -113 var screen/esi: (addr screen) <- copy _screen -114 { -115 compare screen, 0 -116 break-if-!= -117 var result/eax: int <- overlay-code-point-on-real-screen c, x, y, color, background-color -118 return result -119 } -120 # fake screen -121 # TODO: support overlays in fake screen -122 var wide?/eax: boolean <- wide-code-point? c -123 compare wide?, 0/false -124 { -125 break-if-= -126 draw-wide-code-point-on-fake-screen screen, c, x, y, color, background-color -127 return 2 -128 } -129 draw-narrow-code-point-on-fake-screen screen, c, x, y, color, background-color -130 return 1 -131 } -132 -133 fn draw-narrow-code-point-on-fake-screen _screen: (addr screen), c: code-point, x: int, y: int, color: int, background-color: int { -134 var screen/esi: (addr screen) <- copy _screen -135 # ignore if out of bounds -136 { -137 compare x, 0 -138 break-if->= -139 return -140 } -141 { -142 var xmax-addr/eax: (addr int) <- get screen, width -143 var xmax/eax: int <- copy *xmax-addr -144 compare x, xmax -145 break-if-< -146 { -147 loop -148 } -149 return -150 } -151 { -152 compare y, 0 -153 break-if->= -154 return -155 } -156 { -157 var ymax-addr/eax: (addr int) <- get screen, height -158 var ymax/eax: int <- copy *ymax-addr -159 compare y, ymax -160 break-if-< -161 return -162 } -163 # -164 var index/ecx: int <- screen-cell-index screen, x, y -165 var data-ah/eax: (addr handle array screen-cell) <- get screen, data -166 var data/eax: (addr array screen-cell) <- lookup *data-ah -167 var offset/ecx: (offset screen-cell) <- compute-offset data, index -168 var dest-cell/ecx: (addr screen-cell) <- index data, offset -169 var dest-code-point/eax: (addr code-point) <- get dest-cell, data -170 var c2/edx: code-point <- copy c -171 copy-to *dest-code-point, c2 -172 var dest-color/eax: (addr int) <- get dest-cell, color -173 var src-color/edx: int <- copy color -174 copy-to *dest-color, src-color -175 dest-color <- get dest-cell, background-color -176 src-color <- copy background-color -177 copy-to *dest-color, src-color -178 var dest/eax: (addr boolean) <- get dest-cell, unused? -179 copy-to *dest, 0/false -180 } -181 -182 fn draw-wide-code-point-on-fake-screen _screen: (addr screen), c: code-point, x: int, y: int, color: int, background-color: int { -183 var screen/esi: (addr screen) <- copy _screen -184 # ignore if out of bounds -185 { -186 compare x, 0 -187 break-if->= -188 return -189 } -190 { -191 var xmax-addr/eax: (addr int) <- get screen, width -192 var xmax/eax: int <- copy *xmax-addr -193 xmax <- decrement # wide code-points need an extra unit -194 compare x, xmax -195 break-if-< -196 return -197 } -198 { -199 compare y, 0 -200 break-if->= -201 return -202 } -203 { -204 var ymax-addr/eax: (addr int) <- get screen, height -205 var ymax/eax: int <- copy *ymax-addr -206 compare y, ymax -207 break-if-< -208 return -209 } -210 # -211 var index/ecx: int <- screen-cell-index screen, x, y -212 { -213 var data-ah/eax: (addr handle array screen-cell) <- get screen, data -214 var data/eax: (addr array screen-cell) <- lookup *data-ah -215 var offset/ecx: (offset screen-cell) <- compute-offset data, index -216 var dest-cell/ecx: (addr screen-cell) <- index data, offset -217 var dest-code-point/eax: (addr code-point) <- get dest-cell, data -218 var c2/edx: code-point <- copy c -219 copy-to *dest-code-point, c2 -220 var dest-color/eax: (addr int) <- get dest-cell, color -221 var src-color/edx: int <- copy color -222 copy-to *dest-color, src-color -223 dest-color <- get dest-cell, background-color -224 src-color <- copy background-color -225 copy-to *dest-color, src-color -226 var dest/eax: (addr boolean) <- get dest-cell, unused? -227 copy-to *dest, 0/false -228 } -229 # set next screen-cell to unused -230 index <- increment -231 { -232 var data-ah/eax: (addr handle array screen-cell) <- get screen, data -233 var data/eax: (addr array screen-cell) <- lookup *data-ah -234 var offset/ecx: (offset screen-cell) <- compute-offset data, index -235 var dest-cell/ecx: (addr screen-cell) <- index data, offset -236 var dest/eax: (addr boolean) <- get dest-cell, unused? -237 copy-to *dest, 1/true -238 } -239 } -240 -241 # fake screens only -242 fn screen-cell-index _screen: (addr screen), x: int, y: int -> _/ecx: int { -243 var screen/esi: (addr screen) <- copy _screen -244 var width-addr/eax: (addr int) <- get screen, width -245 var result/ecx: int <- copy y -246 result <- multiply *width-addr -247 result <- add x -248 return result -249 } -250 -251 fn cursor-position _screen: (addr screen) -> _/eax: int, _/ecx: int { -252 var screen/esi: (addr screen) <- copy _screen -253 { -254 compare screen, 0 -255 break-if-!= -256 var x/eax: int <- copy 0 -257 var y/ecx: int <- copy 0 -258 x, y <- cursor-position-on-real-screen -259 return x, y -260 } -261 # fake screen -262 var cursor-x-addr/eax: (addr int) <- get screen, cursor-x -263 var cursor-y-addr/ecx: (addr int) <- get screen, cursor-y -264 return *cursor-x-addr, *cursor-y-addr -265 } -266 -267 fn set-cursor-position _screen: (addr screen), x: int, y: int { -268 var screen/esi: (addr screen) <- copy _screen -269 { -270 compare screen, 0 -271 break-if-!= -272 set-cursor-position-on-real-screen x, y -273 return -274 } -275 # fake screen -276 # ignore x < 0 -277 { -278 compare x, 0 -279 break-if->= -280 return -281 } -282 # ignore x >= width -283 { -284 var width-addr/eax: (addr int) <- get screen, width -285 var width/eax: int <- copy *width-addr -286 compare x, width -287 break-if-<= -288 return -289 } -290 # ignore y < 0 -291 { -292 compare y, 0 -293 break-if->= -294 return -295 } -296 # ignore y >= height -297 { -298 var height-addr/eax: (addr int) <- get screen, height -299 var height/eax: int <- copy *height-addr -300 compare y, height -301 break-if-< -302 return -303 } -304 # screen->cursor-x = x -305 var dest/edi: (addr int) <- get screen, cursor-x -306 var src/eax: int <- copy x -307 copy-to *dest, src -308 # screen->cursor-y = y -309 dest <- get screen, cursor-y -310 src <- copy y -311 copy-to *dest, src -312 } -313 -314 fn draw-cursor screen: (addr screen), c: code-point { -315 { -316 compare screen, 0 -317 break-if-!= -318 draw-cursor-on-real-screen c -319 return -320 } -321 # fake screen -322 var cursor-x/eax: int <- copy 0 -323 var cursor-y/ecx: int <- copy 0 -324 cursor-x, cursor-y <- cursor-position screen -325 var dummy/eax: int <- draw-code-point screen, c, cursor-x, cursor-y, 0/fg, 7/bg -326 } -327 -328 fn clear-screen _screen: (addr screen) { -329 var screen/esi: (addr screen) <- copy _screen -330 { -331 compare screen, 0 -332 break-if-!= -333 clear-real-screen -334 return -335 } -336 # fake screen -337 set-cursor-position screen, 0, 0 -338 var y/eax: int <- copy 0 -339 var height/ecx: (addr int) <- get screen, height -340 { -341 compare y, *height -342 break-if->= -343 var x/edx: int <- copy 0 -344 var width/ebx: (addr int) <- get screen, width -345 { -346 compare x, *width -347 break-if->= -348 var dummy/eax: int <- draw-code-point screen, 0/nul, x, y, 0/fg=black, 0/bg=black -349 x <- increment -350 loop -351 } -352 y <- increment -353 loop -354 } -355 set-cursor-position screen, 0, 0 -356 var pixels-ah/eax: (addr handle array byte) <- get screen, pixels -357 var pixels/eax: (addr array byte) <- lookup *pixels-ah -358 var i/ecx: int <- copy 0 -359 var max/edx: int <- length pixels -360 { -361 compare i, max -362 break-if->= -363 var curr/eax: (addr byte) <- index pixels, i -364 var zero/ebx: byte <- copy 0 -365 copy-byte-to *curr, zero -366 i <- increment -367 loop -368 } -369 } -370 -371 fn fake-screen-empty? _screen: (addr screen) -> _/eax: boolean { -372 var screen/esi: (addr screen) <- copy _screen -373 var y/eax: int <- copy 0 -374 var height/ecx: (addr int) <- get screen, height -375 { -376 compare y, *height -377 break-if->= -378 var x/edx: int <- copy 0 -379 var width/ebx: (addr int) <- get screen, width -380 { -381 compare x, *width -382 break-if->= -383 var c/eax: code-point <- screen-code-point-at screen, x, y -384 { -385 compare c, 0 -386 break-if-= -387 compare c, 0x20/space + 13 # - Combining characters don't render like in a real screen (which itself + 14 # isn't ideal). + 15 + 16 type screen { + 17 # text mode + 18 width: int + 19 height: int + 20 data: (handle array screen-cell) + 21 cursor-x: int # [0..width) + 22 cursor-y: int # [0..height) + 23 # pixel graphics + 24 pixels: (handle array byte) + 25 } + 26 + 27 type screen-cell { + 28 data: code-point + 29 color: int + 30 background-color: int + 31 unused?: boolean + 32 } + 33 + 34 fn initialize-screen _screen: (addr screen), width: int, height: int, pixel-graphics?: boolean { + 35 var screen/esi: (addr screen) <- copy _screen + 36 var tmp/eax: int <- copy 0 + 37 var dest/edi: (addr int) <- copy 0 + 38 # screen->width = width + 39 dest <- get screen, width + 40 tmp <- copy width + 41 copy-to *dest, tmp + 42 # screen->height = height + 43 dest <- get screen, height + 44 tmp <- copy height + 45 copy-to *dest, tmp + 46 # populate screen->data + 47 { + 48 var data-ah/edi: (addr handle array screen-cell) <- get screen, data + 49 var capacity/eax: int <- copy width + 50 capacity <- multiply height + 51 # + 52 populate data-ah, capacity + 53 } + 54 # if necessary, populate screen->pixels + 55 { + 56 compare pixel-graphics?, 0/false + 57 break-if-= + 58 var pixels-ah/edi: (addr handle array byte) <- get screen, pixels + 59 var capacity/eax: int <- copy width + 60 capacity <- shift-left 3/log2-font-width + 61 capacity <- multiply height + 62 capacity <- shift-left 4/log2-font-height + 63 # + 64 populate pixels-ah, capacity + 65 } + 66 # screen->cursor-x = 0 + 67 dest <- get screen, cursor-x + 68 copy-to *dest, 0 + 69 # screen->cursor-y = 0 + 70 dest <- get screen, cursor-y + 71 copy-to *dest, 0 + 72 } + 73 + 74 # in graphemes + 75 fn screen-size _screen: (addr screen) -> _/eax: int, _/ecx: int { + 76 var screen/esi: (addr screen) <- copy _screen + 77 var width/eax: int <- copy 0 + 78 var height/ecx: int <- copy 0 + 79 compare screen, 0 + 80 { + 81 break-if-!= + 82 return 0x80/128, 0x30/48 + 83 } + 84 # fake screen + 85 var tmp/edx: (addr int) <- get screen, width + 86 width <- copy *tmp + 87 tmp <- get screen, height + 88 height <- copy *tmp + 89 return width, height + 90 } + 91 + 92 # testable screen primitive + 93 # return number of 8x16 units drawn + 94 fn draw-code-point _screen: (addr screen), c: code-point, x: int, y: int, color: int, background-color: int -> _/eax: int { + 95 var screen/esi: (addr screen) <- copy _screen + 96 { + 97 compare screen, 0 + 98 break-if-!= + 99 var result/eax: int <- draw-code-point-on-real-screen c, x, y, color, background-color +100 return result +101 } +102 # fake screen +103 var wide?/eax: boolean <- wide-code-point? c +104 compare wide?, 0/false +105 { +106 break-if-= +107 draw-wide-code-point-on-fake-screen screen, c, x, y, color, background-color +108 return 2 +109 } +110 draw-narrow-code-point-on-fake-screen screen, c, x, y, color, background-color +111 return 1 +112 } +113 +114 fn overlay-code-point _screen: (addr screen), c: code-point, x: int, y: int, color: int, background-color: int -> _/eax: int { +115 var screen/esi: (addr screen) <- copy _screen +116 { +117 compare screen, 0 +118 break-if-!= +119 var result/eax: int <- overlay-code-point-on-real-screen c, x, y, color, background-color +120 return result +121 } +122 # fake screen +123 # TODO: support overlays in fake screen +124 var wide?/eax: boolean <- wide-code-point? c +125 compare wide?, 0/false +126 { +127 break-if-= +128 draw-wide-code-point-on-fake-screen screen, c, x, y, color, background-color +129 return 2 +130 } +131 draw-narrow-code-point-on-fake-screen screen, c, x, y, color, background-color +132 return 1 +133 } +134 +135 fn draw-narrow-code-point-on-fake-screen _screen: (addr screen), c: code-point, x: int, y: int, color: int, background-color: int { +136 var screen/esi: (addr screen) <- copy _screen +137 # ignore if out of bounds +138 { +139 compare x, 0 +140 break-if->= +141 return +142 } +143 { +144 var xmax-addr/eax: (addr int) <- get screen, width +145 var xmax/eax: int <- copy *xmax-addr +146 compare x, xmax +147 break-if-< +148 { +149 loop +150 } +151 return +152 } +153 { +154 compare y, 0 +155 break-if->= +156 return +157 } +158 { +159 var ymax-addr/eax: (addr int) <- get screen, height +160 var ymax/eax: int <- copy *ymax-addr +161 compare y, ymax +162 break-if-< +163 return +164 } +165 # +166 var index/ecx: int <- screen-cell-index screen, x, y +167 var data-ah/eax: (addr handle array screen-cell) <- get screen, data +168 var data/eax: (addr array screen-cell) <- lookup *data-ah +169 var offset/ecx: (offset screen-cell) <- compute-offset data, index +170 var dest-cell/ecx: (addr screen-cell) <- index data, offset +171 var dest-code-point/eax: (addr code-point) <- get dest-cell, data +172 var c2/edx: code-point <- copy c +173 copy-to *dest-code-point, c2 +174 var dest-color/eax: (addr int) <- get dest-cell, color +175 var src-color/edx: int <- copy color +176 copy-to *dest-color, src-color +177 dest-color <- get dest-cell, background-color +178 src-color <- copy background-color +179 copy-to *dest-color, src-color +180 var dest/eax: (addr boolean) <- get dest-cell, unused? +181 copy-to *dest, 0/false +182 } +183 +184 fn draw-wide-code-point-on-fake-screen _screen: (addr screen), c: code-point, x: int, y: int, color: int, background-color: int { +185 var screen/esi: (addr screen) <- copy _screen +186 # ignore if out of bounds +187 { +188 compare x, 0 +189 break-if->= +190 return +191 } +192 { +193 var xmax-addr/eax: (addr int) <- get screen, width +194 var xmax/eax: int <- copy *xmax-addr +195 xmax <- decrement # wide code-points need an extra unit +196 compare x, xmax +197 break-if-< +198 return +199 } +200 { +201 compare y, 0 +202 break-if->= +203 return +204 } +205 { +206 var ymax-addr/eax: (addr int) <- get screen, height +207 var ymax/eax: int <- copy *ymax-addr +208 compare y, ymax +209 break-if-< +210 return +211 } +212 # +213 var index/ecx: int <- screen-cell-index screen, x, y +214 { +215 var data-ah/eax: (addr handle array screen-cell) <- get screen, data +216 var data/eax: (addr array screen-cell) <- lookup *data-ah +217 var offset/ecx: (offset screen-cell) <- compute-offset data, index +218 var dest-cell/ecx: (addr screen-cell) <- index data, offset +219 var dest-code-point/eax: (addr code-point) <- get dest-cell, data +220 var c2/edx: code-point <- copy c +221 copy-to *dest-code-point, c2 +222 var dest-color/eax: (addr int) <- get dest-cell, color +223 var src-color/edx: int <- copy color +224 copy-to *dest-color, src-color +225 dest-color <- get dest-cell, background-color +226 src-color <- copy background-color +227 copy-to *dest-color, src-color +228 var dest/eax: (addr boolean) <- get dest-cell, unused? +229 copy-to *dest, 0/false +230 } +231 # set next screen-cell to unused +232 index <- increment +233 { +234 var data-ah/eax: (addr handle array screen-cell) <- get screen, data +235 var data/eax: (addr array screen-cell) <- lookup *data-ah +236 var offset/ecx: (offset screen-cell) <- compute-offset data, index +237 var dest-cell/ecx: (addr screen-cell) <- index data, offset +238 var dest/eax: (addr boolean) <- get dest-cell, unused? +239 copy-to *dest, 1/true +240 } +241 } +242 +243 # fake screens only +244 fn screen-cell-index _screen: (addr screen), x: int, y: int -> _/ecx: int { +245 var screen/esi: (addr screen) <- copy _screen +246 var width-addr/eax: (addr int) <- get screen, width +247 var result/ecx: int <- copy y +248 result <- multiply *width-addr +249 result <- add x +250 return result +251 } +252 +253 fn cursor-position _screen: (addr screen) -> _/eax: int, _/ecx: int { +254 var screen/esi: (addr screen) <- copy _screen +255 { +256 compare screen, 0 +257 break-if-!= +258 var x/eax: int <- copy 0 +259 var y/ecx: int <- copy 0 +260 x, y <- cursor-position-on-real-screen +261 return x, y +262 } +263 # fake screen +264 var cursor-x-addr/eax: (addr int) <- get screen, cursor-x +265 var cursor-y-addr/ecx: (addr int) <- get screen, cursor-y +266 return *cursor-x-addr, *cursor-y-addr +267 } +268 +269 fn set-cursor-position _screen: (addr screen), x: int, y: int { +270 var screen/esi: (addr screen) <- copy _screen +271 { +272 compare screen, 0 +273 break-if-!= +274 set-cursor-position-on-real-screen x, y +275 return +276 } +277 # fake screen +278 # ignore x < 0 +279 { +280 compare x, 0 +281 break-if->= +282 return +283 } +284 # ignore x >= width +285 { +286 var width-addr/eax: (addr int) <- get screen, width +287 var width/eax: int <- copy *width-addr +288 compare x, width +289 break-if-<= +290 return +291 } +292 # ignore y < 0 +293 { +294 compare y, 0 +295 break-if->= +296 return +297 } +298 # ignore y >= height +299 { +300 var height-addr/eax: (addr int) <- get screen, height +301 var height/eax: int <- copy *height-addr +302 compare y, height +303 break-if-< +304 return +305 } +306 # screen->cursor-x = x +307 var dest/edi: (addr int) <- get screen, cursor-x +308 var src/eax: int <- copy x +309 copy-to *dest, src +310 # screen->cursor-y = y +311 dest <- get screen, cursor-y +312 src <- copy y +313 copy-to *dest, src +314 } +315 +316 fn draw-cursor screen: (addr screen), c: code-point { +317 { +318 compare screen, 0 +319 break-if-!= +320 draw-cursor-on-real-screen c +321 return +322 } +323 # fake screen +324 var cursor-x/eax: int <- copy 0 +325 var cursor-y/ecx: int <- copy 0 +326 cursor-x, cursor-y <- cursor-position screen +327 var dummy/eax: int <- draw-code-point screen, c, cursor-x, cursor-y, 0/fg, 7/bg +328 } +329 +330 fn clear-screen _screen: (addr screen) { +331 var screen/esi: (addr screen) <- copy _screen +332 { +333 compare screen, 0 +334 break-if-!= +335 clear-real-screen +336 return +337 } +338 # fake screen +339 set-cursor-position screen, 0, 0 +340 var y/eax: int <- copy 0 +341 var height/ecx: (addr int) <- get screen, height +342 { +343 compare y, *height +344 break-if->= +345 var x/edx: int <- copy 0 +346 var width/ebx: (addr int) <- get screen, width +347 { +348 compare x, *width +349 break-if->= +350 var dummy/eax: int <- draw-code-point screen, 0/nul, x, y, 0/fg=black, 0/bg=black +351 x <- increment +352 loop +353 } +354 y <- increment +355 loop +356 } +357 set-cursor-position screen, 0, 0 +358 var pixels-ah/eax: (addr handle array byte) <- get screen, pixels +359 var pixels/eax: (addr array byte) <- lookup *pixels-ah +360 var i/ecx: int <- copy 0 +361 var max/edx: int <- length pixels +362 { +363 compare i, max +364 break-if->= +365 var curr/eax: (addr byte) <- index pixels, i +366 var zero/ebx: byte <- copy 0 +367 copy-byte-to *curr, zero +368 i <- increment +369 loop +370 } +371 } +372 +373 fn fake-screen-empty? _screen: (addr screen) -> _/eax: boolean { +374 var screen/esi: (addr screen) <- copy _screen +375 var y/eax: int <- copy 0 +376 var height/ecx: (addr int) <- get screen, height +377 { +378 compare y, *height +379 break-if->= +380 var x/edx: int <- copy 0 +381 var width/ebx: (addr int) <- get screen, width +382 { +383 compare x, *width +384 break-if->= +385 var c/eax: code-point <- screen-code-point-at screen, x, y +386 { +387 compare c, 0 388 break-if-= -389 return 0/false -390 } -391 x <- increment -392 loop -393 } -394 y <- increment -395 loop -396 } -397 var pixels-ah/eax: (addr handle array byte) <- get screen, pixels -398 var pixels/eax: (addr array byte) <- lookup *pixels-ah -399 var y/ebx: int <- copy 0 -400 var height-addr/edx: (addr int) <- get screen, height -401 var height/edx: int <- copy *height-addr -402 height <- shift-left 4/log2-font-height -403 { -404 compare y, height -405 break-if->= -406 var width-addr/edx: (addr int) <- get screen, width -407 var width/edx: int <- copy *width-addr -408 width <- shift-left 3/log2-font-width -409 var x/edi: int <- copy 0 -410 { -411 compare x, width -412 break-if->= -413 var index/ecx: int <- pixel-index screen, x, y -414 var color-addr/ecx: (addr byte) <- index pixels, index -415 var color/ecx: byte <- copy-byte *color-addr -416 compare color, 0 -417 { -418 break-if-= -419 return 0/false -420 } -421 x <- increment -422 loop -423 } -424 y <- increment -425 loop -426 } -427 return 1/true -428 } -429 -430 fn clear-rect _screen: (addr screen), xmin: int, ymin: int, xmax: int, ymax: int, background-color: int { -431 var screen/esi: (addr screen) <- copy _screen -432 { -433 compare screen, 0 -434 break-if-!= -435 clear-rect-on-real-screen xmin, ymin, xmax, ymax, background-color -436 return -437 } -438 # fake screen -439 set-cursor-position screen, 0, 0 -440 var y/eax: int <- copy ymin -441 var ymax/ecx: int <- copy ymax -442 { -443 compare y, ymax -444 break-if->= -445 var x/edx: int <- copy xmin -446 var xmax/ebx: int <- copy xmax -447 { -448 compare x, xmax -449 break-if->= -450 var dummy/eax: int <- draw-code-point screen, 0x20/space, x, y, 0/fg, background-color -451 x <- increment -452 loop -453 } -454 y <- increment -455 loop -456 } -457 set-cursor-position screen, 0, 0 -458 } -459 -460 # there's no grapheme that guarantees to cover every pixel, so we'll bump down -461 # to pixels for a real screen -462 fn clear-real-screen { -463 var y/eax: int <- copy 0 -464 { -465 compare y, 0x300/screen-height=768 -466 break-if->= -467 var x/edx: int <- copy 0 -468 { -469 compare x, 0x400/screen-width=1024 -470 break-if->= -471 pixel-on-real-screen x, y, 0/color=black -472 x <- increment -473 loop -474 } -475 y <- increment -476 loop -477 } -478 } -479 -480 fn clear-rect-on-real-screen xmin: int, ymin: int, xmax: int, ymax: int, background-color: int { -481 var y/eax: int <- copy ymin -482 y <- shift-left 4/log2-font-height -483 var ymax/ecx: int <- copy ymax -484 ymax <- shift-left 4/log2-font-height -485 { -486 compare y, ymax -487 break-if->= -488 var x/edx: int <- copy xmin -489 x <- shift-left 3/log2-font-width -490 var xmax/ebx: int <- copy xmax -491 xmax <- shift-left 3/log2-font-width -492 { -493 compare x, xmax -494 break-if->= -495 pixel-on-real-screen x, y, background-color -496 x <- increment -497 loop -498 } -499 y <- increment -500 loop -501 } -502 } -503 -504 fn screen-cell-unused-at? _screen: (addr screen), x: int, y: int -> _/eax: boolean { -505 var screen/esi: (addr screen) <- copy _screen -506 var index/ecx: int <- screen-cell-index screen, x, y -507 var result/eax: boolean <- screen-cell-unused-at-index? screen, index -508 return result -509 } -510 -511 fn screen-cell-unused-at-index? _screen: (addr screen), _index: int -> _/eax: boolean { -512 var screen/esi: (addr screen) <- copy _screen -513 var data-ah/eax: (addr handle array screen-cell) <- get screen, data -514 var data/eax: (addr array screen-cell) <- lookup *data-ah -515 var index/ecx: int <- copy _index -516 var offset/ecx: (offset screen-cell) <- compute-offset data, index -517 var cell/eax: (addr screen-cell) <- index data, offset -518 var src/eax: (addr boolean) <- get cell, unused? -519 return *src -520 } -521 -522 fn screen-code-point-at _screen: (addr screen), x: int, y: int -> _/eax: code-point { -523 var screen/esi: (addr screen) <- copy _screen -524 var index/ecx: int <- screen-cell-index screen, x, y -525 var result/eax: code-point <- screen-code-point-at-index screen, index -526 return result -527 } -528 -529 fn screen-code-point-at-index _screen: (addr screen), _index: int -> _/eax: code-point { -530 var screen/esi: (addr screen) <- copy _screen -531 var data-ah/eax: (addr handle array screen-cell) <- get screen, data -532 var data/eax: (addr array screen-cell) <- lookup *data-ah -533 var index/ecx: int <- copy _index -534 var offset/ecx: (offset screen-cell) <- compute-offset data, index -535 var cell/eax: (addr screen-cell) <- index data, offset -536 var src/eax: (addr code-point) <- get cell, data -537 return *src -538 } -539 -540 fn screen-color-at _screen: (addr screen), x: int, y: int -> _/eax: int { -541 var screen/esi: (addr screen) <- copy _screen -542 var index/ecx: int <- screen-cell-index screen, x, y -543 var result/eax: int <- screen-color-at-index screen, index -544 return result -545 } -546 -547 fn screen-color-at-index _screen: (addr screen), _index: int -> _/eax: int { -548 var screen/esi: (addr screen) <- copy _screen -549 var data-ah/eax: (addr handle array screen-cell) <- get screen, data -550 var data/eax: (addr array screen-cell) <- lookup *data-ah -551 var index/ecx: int <- copy _index -552 var offset/ecx: (offset screen-cell) <- compute-offset data, index -553 var cell/eax: (addr screen-cell) <- index data, offset -554 var src/eax: (addr int) <- get cell, color -555 var result/eax: int <- copy *src -556 return result -557 } -558 -559 fn screen-background-color-at _screen: (addr screen), x: int, y: int -> _/eax: int { -560 var screen/esi: (addr screen) <- copy _screen -561 var index/ecx: int <- screen-cell-index screen, x, y -562 var result/eax: int <- screen-background-color-at-index screen, index -563 return result -564 } -565 -566 fn screen-background-color-at-index _screen: (addr screen), _index: int -> _/eax: int { -567 var screen/esi: (addr screen) <- copy _screen -568 var data-ah/eax: (addr handle array screen-cell) <- get screen, data -569 var data/eax: (addr array screen-cell) <- lookup *data-ah -570 var index/ecx: int <- copy _index -571 var offset/ecx: (offset screen-cell) <- compute-offset data, index -572 var cell/eax: (addr screen-cell) <- index data, offset -573 var src/eax: (addr int) <- get cell, background-color -574 var result/eax: int <- copy *src -575 return result -576 } -577 -578 fn pixel screen: (addr screen), x: int, y: int, color: int { -579 { -580 compare screen, 0 -581 break-if-!= -582 pixel-on-real-screen x, y, color -583 return -584 } -585 # fake screen -586 var screen/esi: (addr screen) <- copy screen -587 var pixels-ah/eax: (addr handle array byte) <- get screen, pixels -588 var pixels/eax: (addr array byte) <- lookup *pixels-ah -589 { -590 compare pixels, 0 -591 break-if-!= -592 abort "pixel graphics not enabled for this screen" -593 } -594 # ignore if out of bounds -595 { -596 compare x, 0 -597 break-if->= -598 return -599 } -600 { -601 var xmax-addr/eax: (addr int) <- get screen, width -602 var xmax/eax: int <- copy *xmax-addr -603 xmax <- shift-left 3/log2-font-width -604 compare x, xmax -605 break-if-< -606 return -607 } -608 { -609 compare y, 0 -610 break-if->= -611 return -612 } -613 { -614 var ymax-addr/eax: (addr int) <- get screen, height -615 var ymax/eax: int <- copy *ymax-addr -616 ymax <- shift-left 4/log2-font-height -617 compare y, ymax -618 break-if-< -619 return -620 } -621 # -622 var index/ecx: int <- pixel-index screen, x, y -623 var dest/ecx: (addr byte) <- index pixels, index -624 var src/eax: byte <- copy-byte color -625 copy-byte-to *dest, src -626 } -627 -628 fn pixel-index _screen: (addr screen), x: int, y: int -> _/ecx: int { -629 var screen/esi: (addr screen) <- copy _screen -630 var width-addr/eax: (addr int) <- get screen, width -631 var result/ecx: int <- copy y -632 result <- multiply *width-addr -633 result <- shift-left 3/log2-font-width -634 result <- add x -635 return result -636 } -637 -638 # double-buffering primitive -639 # 'screen' must be a fake screen. 'target-screen' is usually real. -640 # Both screens must have the same size. -641 fn copy-pixels _screen: (addr screen), target-screen: (addr screen) { -642 var screen/esi: (addr screen) <- copy _screen -643 var pixels-ah/eax: (addr handle array byte) <- get screen, pixels -644 var _pixels/eax: (addr array byte) <- lookup *pixels-ah -645 var pixels/edi: (addr array byte) <- copy _pixels -646 var width-a/edx: (addr int) <- get screen, width -647 var width/edx: int <- copy *width-a -648 width <- shift-left 3/log2-font-width -649 var height-a/ebx: (addr int) <- get screen, height -650 var height/ebx: int <- copy *height-a -651 height <- shift-left 4/log2-font-height -652 var i/esi: int <- copy 0 -653 var y/ecx: int <- copy 0 -654 { -655 # screen top left pixels x y width height -656 compare y, height -657 break-if->= -658 var x/eax: int <- copy 0 -659 { -660 compare x, width -661 break-if->= -662 { -663 var color-addr/ebx: (addr byte) <- index pixels, i -664 var color/ebx: byte <- copy-byte *color-addr -665 var color2/ebx: int <- copy color -666 pixel target-screen, x, y, color2 -667 } -668 x <- increment -669 i <- increment -670 loop -671 } -672 y <- increment -673 loop -674 } -675 } -676 -677 # It turns out double-buffering screen-cells is useless because rendering fonts -678 # takes too long. (At least under Qemu.) -679 # So we'll instead convert screen-cells to pixels when double-buffering. -680 # 'screen' must be a fake screen. -681 fn convert-screen-cells-to-pixels _screen: (addr screen) { -682 var screen/esi: (addr screen) <- copy _screen -683 var width-a/ebx: (addr int) <- get screen, width -684 var height-a/edx: (addr int) <- get screen, height -685 var data-ah/eax: (addr handle array byte) <- get screen, pixels -686 var _data/eax: (addr array byte) <- lookup *data-ah -687 var data: (addr array byte) -688 copy-to data, _data -689 var y/ecx: int <- copy 0 -690 { -691 compare y, *height-a -692 break-if->= -693 var x/edi: int <- copy 0 -694 $convert-screen-cells-to-pixels:loop-x: { -695 compare x, *width-a -696 break-if->= -697 { -698 var tmp/eax: code-point <- screen-code-point-at screen, x, y -699 # skip null code-points that only get created when clearing screen -700 # there may be other pixels drawn there, and we don't want to clobber them -701 # this is a situation where fake screens aren't faithful to real screens; we don't support overlap between screen-cells and raw pixels -702 compare tmp, 0 -703 break-if-= -704 var c: code-point -705 copy-to c, tmp -706 var tmp/eax: int <- screen-color-at screen, x, y -707 var fg: int -708 copy-to fg, tmp -709 var bg/eax: int <- screen-background-color-at screen, x, y -710 var offset/eax: int <- draw-code-point-on-screen-array data, c, x, y, fg, bg, *width-a, *height-a -711 x <- add offset -712 loop $convert-screen-cells-to-pixels:loop-x -713 } -714 x <- increment -715 loop -716 } -717 y <- increment -718 loop -719 } -720 } +389 compare c, 0x20/space +390 break-if-= +391 return 0/false +392 } +393 x <- increment +394 loop +395 } +396 y <- increment +397 loop +398 } +399 var pixels-ah/eax: (addr handle array byte) <- get screen, pixels +400 var pixels/eax: (addr array byte) <- lookup *pixels-ah +401 var y/ebx: int <- copy 0 +402 var height-addr/edx: (addr int) <- get screen, height +403 var height/edx: int <- copy *height-addr +404 height <- shift-left 4/log2-font-height +405 { +406 compare y, height +407 break-if->= +408 var width-addr/edx: (addr int) <- get screen, width +409 var width/edx: int <- copy *width-addr +410 width <- shift-left 3/log2-font-width +411 var x/edi: int <- copy 0 +412 { +413 compare x, width +414 break-if->= +415 var index/ecx: int <- pixel-index screen, x, y +416 var color-addr/ecx: (addr byte) <- index pixels, index +417 var color/ecx: byte <- copy-byte *color-addr +418 compare color, 0 +419 { +420 break-if-= +421 return 0/false +422 } +423 x <- increment +424 loop +425 } +426 y <- increment +427 loop +428 } +429 return 1/true +430 } +431 +432 fn clear-rect _screen: (addr screen), xmin: int, ymin: int, xmax: int, ymax: int, background-color: int { +433 var screen/esi: (addr screen) <- copy _screen +434 { +435 compare screen, 0 +436 break-if-!= +437 clear-rect-on-real-screen xmin, ymin, xmax, ymax, background-color +438 return +439 } +440 # fake screen +441 set-cursor-position screen, 0, 0 +442 var y/eax: int <- copy ymin +443 var ymax/ecx: int <- copy ymax +444 { +445 compare y, ymax +446 break-if->= +447 var x/edx: int <- copy xmin +448 var xmax/ebx: int <- copy xmax +449 { +450 compare x, xmax +451 break-if->= +452 var dummy/eax: int <- draw-code-point screen, 0x20/space, x, y, 0/fg, background-color +453 x <- increment +454 loop +455 } +456 y <- increment +457 loop +458 } +459 set-cursor-position screen, 0, 0 +460 } +461 +462 # there's no grapheme that guarantees to cover every pixel, so we'll bump down +463 # to pixels for a real screen +464 fn clear-real-screen { +465 var y/eax: int <- copy 0 +466 { +467 compare y, 0x300/screen-height=768 +468 break-if->= +469 var x/edx: int <- copy 0 +470 { +471 compare x, 0x400/screen-width=1024 +472 break-if->= +473 pixel-on-real-screen x, y, 0/color=black +474 x <- increment +475 loop +476 } +477 y <- increment +478 loop +479 } +480 } +481 +482 fn clear-rect-on-real-screen xmin: int, ymin: int, xmax: int, ymax: int, background-color: int { +483 var y/eax: int <- copy ymin +484 y <- shift-left 4/log2-font-height +485 var ymax/ecx: int <- copy ymax +486 ymax <- shift-left 4/log2-font-height +487 { +488 compare y, ymax +489 break-if->= +490 var x/edx: int <- copy xmin +491 x <- shift-left 3/log2-font-width +492 var xmax/ebx: int <- copy xmax +493 xmax <- shift-left 3/log2-font-width +494 { +495 compare x, xmax +496 break-if->= +497 pixel-on-real-screen x, y, background-color +498 x <- increment +499 loop +500 } +501 y <- increment +502 loop +503 } +504 } +505 +506 fn screen-cell-unused-at? _screen: (addr screen), x: int, y: int -> _/eax: boolean { +507 var screen/esi: (addr screen) <- copy _screen +508 var index/ecx: int <- screen-cell-index screen, x, y +509 var result/eax: boolean <- screen-cell-unused-at-index? screen, index +510 return result +511 } +512 +513 fn screen-cell-unused-at-index? _screen: (addr screen), _index: int -> _/eax: boolean { +514 var screen/esi: (addr screen) <- copy _screen +515 var data-ah/eax: (addr handle array screen-cell) <- get screen, data +516 var data/eax: (addr array screen-cell) <- lookup *data-ah +517 var index/ecx: int <- copy _index +518 var offset/ecx: (offset screen-cell) <- compute-offset data, index +519 var cell/eax: (addr screen-cell) <- index data, offset +520 var src/eax: (addr boolean) <- get cell, unused? +521 return *src +522 } +523 +524 fn screen-code-point-at _screen: (addr screen), x: int, y: int -> _/eax: code-point { +525 var screen/esi: (addr screen) <- copy _screen +526 var index/ecx: int <- screen-cell-index screen, x, y +527 var result/eax: code-point <- screen-code-point-at-index screen, index +528 return result +529 } +530 +531 fn screen-code-point-at-index _screen: (addr screen), _index: int -> _/eax: code-point { +532 var screen/esi: (addr screen) <- copy _screen +533 var data-ah/eax: (addr handle array screen-cell) <- get screen, data +534 var data/eax: (addr array screen-cell) <- lookup *data-ah +535 var index/ecx: int <- copy _index +536 var offset/ecx: (offset screen-cell) <- compute-offset data, index +537 var cell/eax: (addr screen-cell) <- index data, offset +538 var src/eax: (addr code-point) <- get cell, data +539 return *src +540 } +541 +542 fn screen-color-at _screen: (addr screen), x: int, y: int -> _/eax: int { +543 var screen/esi: (addr screen) <- copy _screen +544 var index/ecx: int <- screen-cell-index screen, x, y +545 var result/eax: int <- screen-color-at-index screen, index +546 return result +547 } +548 +549 fn screen-color-at-index _screen: (addr screen), _index: int -> _/eax: int { +550 var screen/esi: (addr screen) <- copy _screen +551 var data-ah/eax: (addr handle array screen-cell) <- get screen, data +552 var data/eax: (addr array screen-cell) <- lookup *data-ah +553 var index/ecx: int <- copy _index +554 var offset/ecx: (offset screen-cell) <- compute-offset data, index +555 var cell/eax: (addr screen-cell) <- index data, offset +556 var src/eax: (addr int) <- get cell, color +557 var result/eax: int <- copy *src +558 return result +559 } +560 +561 fn screen-background-color-at _screen: (addr screen), x: int, y: int -> _/eax: int { +562 var screen/esi: (addr screen) <- copy _screen +563 var index/ecx: int <- screen-cell-index screen, x, y +564 var result/eax: int <- screen-background-color-at-index screen, index +565 return result +566 } +567 +568 fn screen-background-color-at-index _screen: (addr screen), _index: int -> _/eax: int { +569 var screen/esi: (addr screen) <- copy _screen +570 var data-ah/eax: (addr handle array screen-cell) <- get screen, data +571 var data/eax: (addr array screen-cell) <- lookup *data-ah +572 var index/ecx: int <- copy _index +573 var offset/ecx: (offset screen-cell) <- compute-offset data, index +574 var cell/eax: (addr screen-cell) <- index data, offset +575 var src/eax: (addr int) <- get cell, background-color +576 var result/eax: int <- copy *src +577 return result +578 } +579 +580 fn pixel screen: (addr screen), x: int, y: int, color: int { +581 { +582 compare screen, 0 +583 break-if-!= +584 pixel-on-real-screen x, y, color +585 return +586 } +587 # fake screen +588 var screen/esi: (addr screen) <- copy screen +589 var pixels-ah/eax: (addr handle array byte) <- get screen, pixels +590 var pixels/eax: (addr array byte) <- lookup *pixels-ah +591 { +592 compare pixels, 0 +593 break-if-!= +594 abort "pixel graphics not enabled for this screen" +595 } +596 # ignore if out of bounds +597 { +598 compare x, 0 +599 break-if->= +600 return +601 } +602 { +603 var xmax-addr/eax: (addr int) <- get screen, width +604 var xmax/eax: int <- copy *xmax-addr +605 xmax <- shift-left 3/log2-font-width +606 compare x, xmax +607 break-if-< +608 return +609 } +610 { +611 compare y, 0 +612 break-if->= +613 return +614 } +615 { +616 var ymax-addr/eax: (addr int) <- get screen, height +617 var ymax/eax: int <- copy *ymax-addr +618 ymax <- shift-left 4/log2-font-height +619 compare y, ymax +620 break-if-< +621 return +622 } +623 # +624 var index/ecx: int <- pixel-index screen, x, y +625 var dest/ecx: (addr byte) <- index pixels, index +626 var src/eax: byte <- copy-byte color +627 copy-byte-to *dest, src +628 } +629 +630 fn pixel-index _screen: (addr screen), x: int, y: int -> _/ecx: int { +631 var screen/esi: (addr screen) <- copy _screen +632 var width-addr/eax: (addr int) <- get screen, width +633 var result/ecx: int <- copy y +634 result <- multiply *width-addr +635 result <- shift-left 3/log2-font-width +636 result <- add x +637 return result +638 } +639 +640 # double-buffering primitive +641 # 'screen' must be a fake screen. 'target-screen' is usually real. +642 # Both screens must have the same size. +643 fn copy-pixels _screen: (addr screen), target-screen: (addr screen) { +644 var screen/esi: (addr screen) <- copy _screen +645 var pixels-ah/eax: (addr handle array byte) <- get screen, pixels +646 var _pixels/eax: (addr array byte) <- lookup *pixels-ah +647 var pixels/edi: (addr array byte) <- copy _pixels +648 var width-a/edx: (addr int) <- get screen, width +649 var width/edx: int <- copy *width-a +650 width <- shift-left 3/log2-font-width +651 var height-a/ebx: (addr int) <- get screen, height +652 var height/ebx: int <- copy *height-a +653 height <- shift-left 4/log2-font-height +654 var i/esi: int <- copy 0 +655 var y/ecx: int <- copy 0 +656 { +657 # screen top left pixels x y width height +658 compare y, height +659 break-if->= +660 var x/eax: int <- copy 0 +661 { +662 compare x, width +663 break-if->= +664 { +665 var color-addr/ebx: (addr byte) <- index pixels, i +666 var color/ebx: byte <- copy-byte *color-addr +667 var color2/ebx: int <- copy color +668 pixel target-screen, x, y, color2 +669 } +670 x <- increment +671 i <- increment +672 loop +673 } +674 y <- increment +675 loop +676 } +677 } +678 +679 # It turns out double-buffering screen-cells is useless because rendering fonts +680 # takes too long. (At least under Qemu.) +681 # So we'll instead convert screen-cells to pixels when double-buffering. +682 # 'screen' must be a fake screen. +683 fn convert-screen-cells-to-pixels _screen: (addr screen) { +684 var screen/esi: (addr screen) <- copy _screen +685 var width-a/ebx: (addr int) <- get screen, width +686 var height-a/edx: (addr int) <- get screen, height +687 var data-ah/eax: (addr handle array byte) <- get screen, pixels +688 var _data/eax: (addr array byte) <- lookup *data-ah +689 var data: (addr array byte) +690 copy-to data, _data +691 var y/ecx: int <- copy 0 +692 { +693 compare y, *height-a +694 break-if->= +695 var x/edi: int <- copy 0 +696 $convert-screen-cells-to-pixels:loop-x: { +697 compare x, *width-a +698 break-if->= +699 { +700 var tmp/eax: code-point <- screen-code-point-at screen, x, y +701 # skip null code-points that only get created when clearing screen +702 # there may be other pixels drawn there, and we don't want to clobber them +703 # this is a situation where fake screens aren't faithful to real screens; we don't support overlap between screen-cells and raw pixels +704 compare tmp, 0 +705 break-if-= +706 var c: code-point +707 copy-to c, tmp +708 var tmp/eax: int <- screen-color-at screen, x, y +709 var fg: int +710 copy-to fg, tmp +711 var bg/eax: int <- screen-background-color-at screen, x, y +712 var offset/eax: int <- draw-code-point-on-screen-array data, c, x, y, fg, bg, *width-a, *height-a +713 x <- add offset +714 loop $convert-screen-cells-to-pixels:loop-x +715 } +716 x <- increment +717 loop +718 } +719 y <- increment +720 loop +721 } +722 } diff --git a/html/501draw-text.mu.html b/html/501draw-text.mu.html index 36e6c0bd..1abca213 100644 --- a/html/501draw-text.mu.html +++ b/html/501draw-text.mu.html @@ -63,77 +63,77 @@ if ('onhashchange' in window) {
   1 # some primitives for moving the cursor without making assumptions about
   2 # raster order
-  3 fn move-cursor-left screen: (addr screen) {
+  3 fn move-cursor-left screen: (addr screen) {
   4   var cursor-x/eax: int <- copy 0
   5   var cursor-y/ecx: int <- copy 0
-  6   cursor-x, cursor-y <- cursor-position screen
+  6   cursor-x, cursor-y <- cursor-position screen
   7   compare cursor-x, 0
   8   {
   9     break-if->
  10     return
  11   }
  12   cursor-x <- decrement
- 13   set-cursor-position screen, cursor-x, cursor-y
+ 13   set-cursor-position screen, cursor-x, cursor-y
  14 }
  15 
- 16 fn move-cursor-right screen: (addr screen) {
+ 16 fn move-cursor-right screen: (addr screen) {
  17   var _width/eax: int <- copy 0
  18   var dummy/ecx: int <- copy 0
- 19   _width, dummy <- screen-size screen
+ 19   _width, dummy <- screen-size screen
  20   var limit/edx: int <- copy _width
  21   limit <- decrement
  22   var cursor-x/eax: int <- copy 0
  23   var cursor-y/ecx: int <- copy 0
- 24   cursor-x, cursor-y <- cursor-position screen
+ 24   cursor-x, cursor-y <- cursor-position screen
  25   compare cursor-x, limit
  26   {
  27     break-if-<
  28     return
  29   }
  30   cursor-x <- increment
- 31   set-cursor-position screen, cursor-x, cursor-y
+ 31   set-cursor-position screen, cursor-x, cursor-y
  32 }
  33 
- 34 fn move-cursor-up screen: (addr screen) {
+ 34 fn move-cursor-up screen: (addr screen) {
  35   var cursor-x/eax: int <- copy 0
  36   var cursor-y/ecx: int <- copy 0
- 37   cursor-x, cursor-y <- cursor-position screen
+ 37   cursor-x, cursor-y <- cursor-position screen
  38   compare cursor-y, 0
  39   {
  40     break-if->
  41     return
  42   }
  43   cursor-y <- decrement
- 44   set-cursor-position screen, cursor-x, cursor-y
+ 44   set-cursor-position screen, cursor-x, cursor-y
  45 }
  46 
- 47 fn move-cursor-down screen: (addr screen) {
+ 47 fn move-cursor-down screen: (addr screen) {
  48   var dummy/eax: int <- copy 0
  49   var _height/ecx: int <- copy 0
- 50   dummy, _height <- screen-size screen
+ 50   dummy, _height <- screen-size screen
  51   var limit/edx: int <- copy _height
  52   limit <- decrement
  53   var cursor-x/eax: int <- copy 0
  54   var cursor-y/ecx: int <- copy 0
- 55   cursor-x, cursor-y <- cursor-position screen
+ 55   cursor-x, cursor-y <- cursor-position screen
  56   compare cursor-y, limit
  57   {
  58     break-if-<
  59     return
  60   }
  61   cursor-y <- increment
- 62   set-cursor-position screen, cursor-x, cursor-y
+ 62   set-cursor-position screen, cursor-x, cursor-y
  63 }
  64 
- 65 fn move-cursor-to-left-margin-of-next-line screen: (addr screen) {
+ 65 fn move-cursor-to-left-margin-of-next-line screen: (addr screen) {
  66   var dummy/eax: int <- copy 0
  67   var _height/ecx: int <- copy 0
- 68   dummy, _height <- screen-size screen
+ 68   dummy, _height <- screen-size screen
  69   var limit/edx: int <- copy _height
  70   limit <- decrement
  71   var cursor-x/eax: int <- copy 0
  72   var cursor-y/ecx: int <- copy 0
- 73   cursor-x, cursor-y <- cursor-position screen
+ 73   cursor-x, cursor-y <- cursor-position screen
  74   compare cursor-y, limit
  75   {
  76     break-if-<
@@ -141,99 +141,99 @@ if ('onhashchange' in window) {
  78   }
  79   cursor-y <- increment
  80   cursor-x <- copy 0
- 81   set-cursor-position screen, cursor-x, cursor-y
+ 81   set-cursor-position screen, cursor-x, cursor-y
  82 }
  83 
- 84 fn draw-code-point-at-cursor screen: (addr screen), c: code-point, color: int, background-color: int {
+ 84 fn draw-code-point-at-cursor screen: (addr screen), c: code-point, color: int, background-color: int {
  85   var cursor-x/eax: int <- copy 0
  86   var cursor-y/ecx: int <- copy 0
- 87   cursor-x, cursor-y <- cursor-position screen
- 88   var dummy/eax: int <- draw-code-point screen, c, cursor-x, cursor-y, color, background-color
+ 87   cursor-x, cursor-y <- cursor-position screen
+ 88   var dummy/eax: int <- draw-code-point screen, c, cursor-x, cursor-y, color, background-color
  89 }
  90 
- 91 fn draw-code-point-at-cursor-over-full-screen screen: (addr screen), c: code-point, color: int, background-color: int {
+ 91 fn draw-code-point-at-cursor-over-full-screen screen: (addr screen), c: code-point, color: int, background-color: int {
  92   var cursor-x/eax: int <- copy 0
  93   var cursor-y/ecx: int <- copy 0
- 94   cursor-x, cursor-y <- cursor-position screen
- 95   var _offset/eax: int <- draw-code-point screen, c, cursor-x, cursor-y, color, background-color
+ 94   cursor-x, cursor-y <- cursor-position screen
+ 95   var _offset/eax: int <- draw-code-point screen, c, cursor-x, cursor-y, color, background-color
  96   var offset/edx: int <- copy _offset
  97   var width/eax: int <- copy 0
  98   var dummy/ecx: int <- copy 0
- 99   width, dummy <- screen-size screen
-100   move-cursor-rightward-and-downward screen, 0 width
+ 99   width, dummy <- screen-size screen
+100   move-cursor-rightward-and-downward screen, 0 width
 101   offset <- decrement
 102   compare offset, 0
 103   {
 104     break-if-=
 105     # should never move downward here
-106     move-cursor-rightward-and-downward screen, 0 width
+106     move-cursor-rightward-and-downward screen, 0 width
 107   }
 108 }
 109 
 110 # draw a single line of text from x, y to xmax
 111 # return the next 'x' coordinate
 112 # if there isn't enough space, truncate
-113 fn draw-text-rightward screen: (addr screen), text: (addr array byte), x: int, xmax: int, y: int, color: int, background-color: int -> _/eax: int {
+113 fn draw-text-rightward screen: (addr screen), text: (addr array byte), x: int, xmax: int, y: int, color: int, background-color: int -> _/eax: int {
 114   var stream-storage: (stream byte 0x400/print-buffer-size)
 115   var stream/esi: (addr stream byte) <- address stream-storage
 116   write stream, text
-117   var xcurr/eax: int <- draw-stream-rightward screen, stream, x, xmax, y, color, background-color
+117   var xcurr/eax: int <- draw-stream-rightward screen, stream, x, xmax, y, color, background-color
 118   return xcurr
 119 }
 120 
 121 # draw a single-line stream from x, y to xmax
 122 # return the next 'x' coordinate
 123 # if there isn't enough space, truncate
-124 fn draw-stream-rightward screen: (addr screen), stream: (addr stream byte), x: int, xmax: int, y: int, color: int, background-color: int -> _/eax: int {
+124 fn draw-stream-rightward screen: (addr screen), stream: (addr stream byte), x: int, xmax: int, y: int, color: int, background-color: int -> _/eax: int {
 125   var xcurr/ecx: int <- copy x
 126   {
 127     var g/eax: grapheme <- read-grapheme stream
 128     compare g, 0xffffffff/end-of-file
 129     break-if-=
 130     var c/eax: code-point <- to-code-point g
-131     var offset/eax: int <- draw-code-point screen, c, xcurr, y, color, background-color
+131     var offset/eax: int <- draw-code-point screen, c, xcurr, y, color, background-color
 132     xcurr <- add offset
 133     loop
 134   }
-135   set-cursor-position screen, xcurr, y
+135   set-cursor-position screen, xcurr, y
 136   return xcurr
 137 }
 138 
-139 fn draw-text-rightward-over-full-screen screen: (addr screen), text: (addr array byte), x: int, y: int, color: int, background-color: int -> _/eax: int {
+139 fn draw-text-rightward-over-full-screen screen: (addr screen), text: (addr array byte), x: int, y: int, color: int, background-color: int -> _/eax: int {
 140   var width/eax: int <- copy 0
 141   var height/ecx: int <- copy 0
-142   width, height <- screen-size screen
-143   var result/eax: int <- draw-text-rightward screen, text, x, width, y, color, background-color
+142   width, height <- screen-size screen
+143   var result/eax: int <- draw-text-rightward screen, text, x, width, y, color, background-color
 144   return result
 145 }
 146 
-147 fn draw-text-rightward-from-cursor screen: (addr screen), text: (addr array byte), xmax: int, color: int, background-color: int {
+147 fn draw-text-rightward-from-cursor screen: (addr screen), text: (addr array byte), xmax: int, color: int, background-color: int {
 148   var cursor-x/eax: int <- copy 0
 149   var cursor-y/ecx: int <- copy 0
-150   cursor-x, cursor-y <- cursor-position screen
-151   cursor-x <- draw-text-rightward screen, text, cursor-x, xmax, cursor-y, color, background-color
-152   set-cursor-position screen, cursor-x, cursor-y
+150   cursor-x, cursor-y <- cursor-position screen
+151   cursor-x <- draw-text-rightward screen, text, cursor-x, xmax, cursor-y, color, background-color
+152   set-cursor-position screen, cursor-x, cursor-y
 153 }
 154 
-155 fn draw-text-rightward-from-cursor-over-full-screen screen: (addr screen), text: (addr array byte), color: int, background-color: int {
+155 fn draw-text-rightward-from-cursor-over-full-screen screen: (addr screen), text: (addr array byte), color: int, background-color: int {
 156   var width/eax: int <- copy 0
 157   var height/ecx: int <- copy 0
-158   width, height <- screen-size screen
-159   draw-text-rightward-from-cursor screen, text, width, color, background-color
+158   width, height <- screen-size screen
+159   draw-text-rightward-from-cursor screen, text, width, color, background-color
 160 }
 161 
-162 fn render-code-point screen: (addr screen), c: code-point, xmin: int, ymin: int, xmax: int, ymax: int, x: int, y: int, color: int, background-color: int -> _/eax: int, _/ecx: int {
+162 fn render-code-point screen: (addr screen), c: code-point, xmin: int, ymin: int, xmax: int, ymax: int, x: int, y: int, color: int, background-color: int -> _/eax: int, _/ecx: int {
 163   var x/ecx: int <- copy x
 164   compare c, 0xa/newline
 165   {
 166     break-if-!=
 167     # minimum effort to clear cursor
-168     var dummy/eax: int <- draw-code-point screen, 0x20/space, x, y, color, background-color
+168     var dummy/eax: int <- draw-code-point screen, 0x20/space, x, y, color, background-color
 169     x <- copy xmin
 170     increment y
 171     return x, y
 172   }
-173   var offset/eax: int <- draw-code-point screen, c, x, y, color, background-color
+173   var offset/eax: int <- draw-code-point screen, c, x, y, color, background-color
 174   x <- add offset
 175   compare x, xmax
 176   {
@@ -248,7 +248,7 @@ if ('onhashchange' in window) {
 185 # return the next (x, y) coordinate in raster order where drawing stopped
 186 # that way the caller can draw more if given the same min and max bounding-box.
 187 # if there isn't enough space, truncate
-188 fn draw-text-wrapping-right-then-down screen: (addr screen), _text: (addr array byte), xmin: int, ymin: int, xmax: int, ymax: int, _x: int, _y: int, color: int, background-color: int -> _/eax: int, _/ecx: int {
+188 fn draw-text-wrapping-right-then-down screen: (addr screen), _text: (addr array byte), xmin: int, ymin: int, xmax: int, ymax: int, _x: int, _y: int, color: int, background-color: int -> _/eax: int, _/ecx: int {
 189   var stream-storage: (stream byte 0x200/print-buffer-size)
 190   var stream/edi: (addr stream byte) <- address stream-storage
 191   var text/esi: (addr array byte) <- copy _text
@@ -265,7 +265,7 @@ if ('onhashchange' in window) {
 202   }
 203   var x/eax: int <- copy _x
 204   var y/ecx: int <- copy _y
-205   x, y <- draw-stream-wrapping-right-then-down screen, stream, xmin, ymin, xmax, ymax, x, y, color, background-color
+205   x, y <- draw-stream-wrapping-right-then-down screen, stream, xmin, ymin, xmax, ymax, x, y, color, background-color
 206   return x, y
 207 }
 208 
@@ -273,7 +273,7 @@ if ('onhashchange' in window) {
 210 # return the next (x, y) coordinate in raster order where drawing stopped
 211 # that way the caller can draw more if given the same min and max bounding-box.
 212 # if there isn't enough space, truncate
-213 fn draw-stream-wrapping-right-then-down screen: (addr screen), stream: (addr stream byte), xmin: int, ymin: int, xmax: int, ymax: int, x: int, y: int, color: int, background-color: int -> _/eax: int, _/ecx: int {
+213 fn draw-stream-wrapping-right-then-down screen: (addr screen), stream: (addr stream byte), xmin: int, ymin: int, xmax: int, ymax: int, x: int, y: int, color: int, background-color: int -> _/eax: int, _/ecx: int {
 214   var xcurr/ecx: int <- copy x
 215   var ycurr/edx: int <- copy y
 216   var c/ebx: code-point <- copy 0
@@ -298,12 +298,12 @@ if ('onhashchange' in window) {
 235     {
 236       break-if-!=
 237       # minimum effort to clear cursor
-238       var dummy/eax: int <- draw-code-point screen, 0x20/space, xcurr, ycurr, color, background-color
+238       var dummy/eax: int <- draw-code-point screen, 0x20/space, xcurr, ycurr, color, background-color
 239       xcurr <- copy xmin
 240       ycurr <- increment
 241       loop $draw-stream-wrapping-right-then-down:loop
 242     }
-243     var offset/eax: int <- draw-code-point screen, c, xcurr, ycurr, color, background-color
+243     var offset/eax: int <- draw-code-point screen, c, xcurr, ycurr, color, background-color
 244     # overlay a combining character if necessary
 245     $draw-stream-wrapping-right-then-down:read-combiner: {
 246       var done?/eax: boolean <- stream-empty? stream
@@ -325,7 +325,7 @@ if ('onhashchange' in window) {
 262       # otherwise overlay it without saving its width
 263       # This means strange results if a base and its combiner have different
 264       # widths. We'll always follow the base width.
-265       var dummy/eax: int <- overlay-code-point screen, c, xcurr, ycurr, color, background-color
+265       var dummy/eax: int <- overlay-code-point screen, c, xcurr, ycurr, color, background-color
 266     }
 267     xcurr <- add offset
 268     compare xcurr, xmax
@@ -336,14 +336,14 @@ if ('onhashchange' in window) {
 273     }
 274     loop
 275   }
-276   set-cursor-position screen, xcurr, ycurr
+276   set-cursor-position screen, xcurr, ycurr
 277   return xcurr, ycurr
 278 }
 279 
-280 fn draw-stream-wrapping-right-then-down-from-cursor screen: (addr screen), stream: (addr stream byte), xmin: int, ymin: int, xmax: int, ymax: int, color: int, background-color: int {
+280 fn draw-stream-wrapping-right-then-down-from-cursor screen: (addr screen), stream: (addr stream byte), xmin: int, ymin: int, xmax: int, ymax: int, color: int, background-color: int {
 281   var cursor-x/eax: int <- copy 0
 282   var cursor-y/ecx: int <- copy 0
-283   cursor-x, cursor-y <- cursor-position screen
+283   cursor-x, cursor-y <- cursor-position screen
 284   var end-x/edx: int <- copy cursor-x
 285   end-x <- increment
 286   compare end-x, xmax
@@ -352,20 +352,20 @@ if ('onhashchange' in window) {
 289     cursor-x <- copy xmin
 290     cursor-y <- increment
 291   }
-292   cursor-x, cursor-y <- draw-stream-wrapping-right-then-down screen, stream, xmin, ymin, xmax, ymax, cursor-x, cursor-y, color, background-color
+292   cursor-x, cursor-y <- draw-stream-wrapping-right-then-down screen, stream, xmin, ymin, xmax, ymax, cursor-x, cursor-y, color, background-color
 293 }
 294 
-295 fn draw-stream-wrapping-right-then-down-from-cursor-over-full-screen screen: (addr screen), stream: (addr stream byte), color: int, background-color: int {
+295 fn draw-stream-wrapping-right-then-down-from-cursor-over-full-screen screen: (addr screen), stream: (addr stream byte), color: int, background-color: int {
 296   var width/eax: int <- copy 0
 297   var height/ecx: int <- copy 0
-298   width, height <- screen-size screen
-299   draw-stream-wrapping-right-then-down-from-cursor screen, stream, 0/xmin, 0/ymin, width, height, color, background-color
+298   width, height <- screen-size screen
+299   draw-stream-wrapping-right-then-down-from-cursor screen, stream, 0/xmin, 0/ymin, width, height, color, background-color
 300 }
 301 
-302 fn move-cursor-rightward-and-downward screen: (addr screen), xmin: int, xmax: int {
+302 fn move-cursor-rightward-and-downward screen: (addr screen), xmin: int, xmax: int {
 303   var cursor-x/eax: int <- copy 0
 304   var cursor-y/ecx: int <- copy 0
-305   cursor-x, cursor-y <- cursor-position screen
+305   cursor-x, cursor-y <- cursor-position screen
 306   cursor-x <- increment
 307   compare cursor-x, xmax
 308   {
@@ -373,21 +373,21 @@ if ('onhashchange' in window) {
 310     cursor-x <- copy xmin
 311     cursor-y <- increment
 312   }
-313   set-cursor-position screen, cursor-x, cursor-y
+313   set-cursor-position screen, cursor-x, cursor-y
 314 }
 315 
-316 fn draw-text-wrapping-right-then-down-over-full-screen screen: (addr screen), text: (addr array byte), x: int, y: int, color: int, background-color: int -> _/eax: int, _/ecx: int {
+316 fn draw-text-wrapping-right-then-down-over-full-screen screen: (addr screen), text: (addr array byte), x: int, y: int, color: int, background-color: int -> _/eax: int, _/ecx: int {
 317   var x2/eax: int <- copy 0
 318   var y2/ecx: int <- copy 0
-319   x2, y2 <- screen-size screen  # width, height
-320   x2, y2 <- draw-text-wrapping-right-then-down screen, text, 0/xmin, 0/ymin, x2, y2, x, y, color, background-color
+319   x2, y2 <- screen-size screen  # width, height
+320   x2, y2 <- draw-text-wrapping-right-then-down screen, text, 0/xmin, 0/ymin, x2, y2, x, y, color, background-color
 321   return x2, y2  # cursor-x, cursor-y
 322 }
 323 
-324 fn draw-text-wrapping-right-then-down-from-cursor screen: (addr screen), text: (addr array byte), xmin: int, ymin: int, xmax: int, ymax: int, color: int, background-color: int {
+324 fn draw-text-wrapping-right-then-down-from-cursor screen: (addr screen), text: (addr array byte), xmin: int, ymin: int, xmax: int, ymax: int, color: int, background-color: int {
 325   var cursor-x/eax: int <- copy 0
 326   var cursor-y/ecx: int <- copy 0
-327   cursor-x, cursor-y <- cursor-position screen
+327   cursor-x, cursor-y <- cursor-position screen
 328   var end-x/edx: int <- copy cursor-x
 329   end-x <- increment
 330   compare end-x, xmax
@@ -396,17 +396,17 @@ if ('onhashchange' in window) {
 333     cursor-x <- copy xmin
 334     cursor-y <- increment
 335   }
-336   cursor-x, cursor-y <- draw-text-wrapping-right-then-down screen, text, xmin, ymin, xmax, ymax, cursor-x, cursor-y, color, background-color
+336   cursor-x, cursor-y <- draw-text-wrapping-right-then-down screen, text, xmin, ymin, xmax, ymax, cursor-x, cursor-y, color, background-color
 337 }
 338 
-339 fn draw-text-wrapping-right-then-down-from-cursor-over-full-screen screen: (addr screen), text: (addr array byte), color: int, background-color: int {
+339 fn draw-text-wrapping-right-then-down-from-cursor-over-full-screen screen: (addr screen), text: (addr array byte), color: int, background-color: int {
 340   var width/eax: int <- copy 0
 341   var height/ecx: int <- copy 0
-342   width, height <- screen-size screen
-343   draw-text-wrapping-right-then-down-from-cursor screen, text, 0/xmin, 0/ymin, width, height, color, background-color
+342   width, height <- screen-size screen
+343   draw-text-wrapping-right-then-down-from-cursor screen, text, 0/xmin, 0/ymin, width, height, color, background-color
 344 }
 345 
-346 fn draw-int32-hex-wrapping-right-then-down screen: (addr screen), n: int, xmin: int, ymin: int, xmax: int, ymax: int, x: int, y: int, color: int, background-color: int -> _/eax: int, _/ecx: int {
+346 fn draw-int32-hex-wrapping-right-then-down screen: (addr screen), n: int, xmin: int, ymin: int, xmax: int, ymax: int, x: int, y: int, color: int, background-color: int -> _/eax: int, _/ecx: int {
 347   var stream-storage: (stream byte 0x100)
 348   var stream/esi: (addr stream byte) <- address stream-storage
 349   write-int32-hex stream, n
@@ -417,7 +417,7 @@ if ('onhashchange' in window) {
 354     compare g, 0xffffffff/end-of-file
 355     break-if-=
 356     var c/eax: code-point <- to-code-point g
-357     var offset/eax: int <- draw-code-point screen, c, xcurr, ycurr, color, background-color
+357     var offset/eax: int <- draw-code-point screen, c, xcurr, ycurr, color, background-color
 358     xcurr <- add offset
 359     compare xcurr, xmax
 360     {
@@ -427,22 +427,22 @@ if ('onhashchange' in window) {
 364     }
 365     loop
 366   }
-367   set-cursor-position screen, xcurr, ycurr
+367   set-cursor-position screen, xcurr, ycurr
 368   return xcurr, ycurr
 369 }
 370 
-371 fn draw-int32-hex-wrapping-right-then-down-over-full-screen screen: (addr screen), n: int, x: int, y: int, color: int, background-color: int -> _/eax: int, _/ecx: int {
+371 fn draw-int32-hex-wrapping-right-then-down-over-full-screen screen: (addr screen), n: int, x: int, y: int, color: int, background-color: int -> _/eax: int, _/ecx: int {
 372   var x2/eax: int <- copy 0
 373   var y2/ecx: int <- copy 0
-374   x2, y2 <- screen-size screen  # width, height
-375   x2, y2 <- draw-int32-hex-wrapping-right-then-down screen, n, 0/xmin, 0/ymin, x2, y2, x, y, color, background-color
+374   x2, y2 <- screen-size screen  # width, height
+375   x2, y2 <- draw-int32-hex-wrapping-right-then-down screen, n, 0/xmin, 0/ymin, x2, y2, x, y, color, background-color
 376   return x2, y2  # cursor-x, cursor-y
 377 }
 378 
-379 fn draw-int32-hex-wrapping-right-then-down-from-cursor screen: (addr screen), n: int, xmin: int, ymin: int, xmax: int, ymax: int, color: int, background-color: int {
+379 fn draw-int32-hex-wrapping-right-then-down-from-cursor screen: (addr screen), n: int, xmin: int, ymin: int, xmax: int, ymax: int, color: int, background-color: int {
 380   var cursor-x/eax: int <- copy 0
 381   var cursor-y/ecx: int <- copy 0
-382   cursor-x, cursor-y <- cursor-position screen
+382   cursor-x, cursor-y <- cursor-position screen
 383   var end-x/edx: int <- copy cursor-x
 384   end-x <- increment
 385   compare end-x, xmax
@@ -451,17 +451,17 @@ if ('onhashchange' in window) {
 388     cursor-x <- copy xmin
 389     cursor-y <- increment
 390   }
-391   cursor-x, cursor-y <- draw-int32-hex-wrapping-right-then-down screen, n, xmin, ymin, xmax, ymax, cursor-x, cursor-y, color, background-color
+391   cursor-x, cursor-y <- draw-int32-hex-wrapping-right-then-down screen, n, xmin, ymin, xmax, ymax, cursor-x, cursor-y, color, background-color
 392 }
 393 
-394 fn draw-int32-hex-wrapping-right-then-down-from-cursor-over-full-screen screen: (addr screen), n: int, color: int, background-color: int {
+394 fn draw-int32-hex-wrapping-right-then-down-from-cursor-over-full-screen screen: (addr screen), n: int, color: int, background-color: int {
 395   var width/eax: int <- copy 0
 396   var height/ecx: int <- copy 0
-397   width, height <- screen-size screen
-398   draw-int32-hex-wrapping-right-then-down-from-cursor screen, n, 0/xmin, 0/ymin, width, height, color, background-color
+397   width, height <- screen-size screen
+398   draw-int32-hex-wrapping-right-then-down-from-cursor screen, n, 0/xmin, 0/ymin, width, height, color, background-color
 399 }
 400 
-401 fn draw-int32-decimal-wrapping-right-then-down screen: (addr screen), n: int, xmin: int, ymin: int, xmax: int, ymax: int, x: int, y: int, color: int, background-color: int -> _/eax: int, _/ecx: int {
+401 fn draw-int32-decimal-wrapping-right-then-down screen: (addr screen), n: int, xmin: int, ymin: int, xmax: int, ymax: int, x: int, y: int, color: int, background-color: int -> _/eax: int, _/ecx: int {
 402   var stream-storage: (stream byte 0x100)
 403   var stream/esi: (addr stream byte) <- address stream-storage
 404   write-int32-decimal stream, n
@@ -472,7 +472,7 @@ if ('onhashchange' in window) {
 409     compare g, 0xffffffff/end-of-file
 410     break-if-=
 411     var c/eax: code-point <- to-code-point g
-412     var offset/eax: int <- draw-code-point screen, c, xcurr, ycurr, color, background-color
+412     var offset/eax: int <- draw-code-point screen, c, xcurr, ycurr, color, background-color
 413     xcurr <- add offset
 414     compare xcurr, xmax
 415     {
@@ -482,22 +482,22 @@ if ('onhashchange' in window) {
 419     }
 420     loop
 421   }
-422   set-cursor-position screen, xcurr, ycurr
+422   set-cursor-position screen, xcurr, ycurr
 423   return xcurr, ycurr
 424 }
 425 
-426 fn draw-int32-decimal-wrapping-right-then-down-over-full-screen screen: (addr screen), n: int, x: int, y: int, color: int, background-color: int -> _/eax: int, _/ecx: int {
+426 fn draw-int32-decimal-wrapping-right-then-down-over-full-screen screen: (addr screen), n: int, x: int, y: int, color: int, background-color: int -> _/eax: int, _/ecx: int {
 427   var x2/eax: int <- copy 0
 428   var y2/ecx: int <- copy 0
-429   x2, y2 <- screen-size screen  # width, height
-430   x2, y2 <- draw-int32-decimal-wrapping-right-then-down screen, n, 0/xmin, 0/ymin, x2, y2, x, y, color, background-color
+429   x2, y2 <- screen-size screen  # width, height
+430   x2, y2 <- draw-int32-decimal-wrapping-right-then-down screen, n, 0/xmin, 0/ymin, x2, y2, x, y, color, background-color
 431   return x2, y2  # cursor-x, cursor-y
 432 }
 433 
-434 fn draw-int32-decimal-wrapping-right-then-down-from-cursor screen: (addr screen), n: int, xmin: int, ymin: int, xmax: int, ymax: int, color: int, background-color: int {
+434 fn draw-int32-decimal-wrapping-right-then-down-from-cursor screen: (addr screen), n: int, xmin: int, ymin: int, xmax: int, ymax: int, color: int, background-color: int {
 435   var cursor-x/eax: int <- copy 0
 436   var cursor-y/ecx: int <- copy 0
-437   cursor-x, cursor-y <- cursor-position screen
+437   cursor-x, cursor-y <- cursor-position screen
 438   var end-x/edx: int <- copy cursor-x
 439   end-x <- increment
 440   compare end-x, xmax
@@ -506,14 +506,14 @@ if ('onhashchange' in window) {
 443     cursor-x <- copy xmin
 444     cursor-y <- increment
 445   }
-446   cursor-x, cursor-y <- draw-int32-decimal-wrapping-right-then-down screen, n, xmin, ymin, xmax, ymax, cursor-x, cursor-y, color, background-color
+446   cursor-x, cursor-y <- draw-int32-decimal-wrapping-right-then-down screen, n, xmin, ymin, xmax, ymax, cursor-x, cursor-y, color, background-color
 447 }
 448 
-449 fn draw-int32-decimal-wrapping-right-then-down-from-cursor-over-full-screen screen: (addr screen), n: int, color: int, background-color: int {
+449 fn draw-int32-decimal-wrapping-right-then-down-from-cursor-over-full-screen screen: (addr screen), n: int, color: int, background-color: int {
 450   var width/eax: int <- copy 0
 451   var height/ecx: int <- copy 0
-452   width, height <- screen-size screen
-453   draw-int32-decimal-wrapping-right-then-down-from-cursor screen, n, 0/xmin, 0/ymin, width, height, color, background-color
+452   width, height <- screen-size screen
+453   draw-int32-decimal-wrapping-right-then-down-from-cursor screen, n, 0/xmin, 0/ymin, width, height, color, background-color
 454 }
 455 
 456 ## Text direction: down then right
@@ -521,11 +521,11 @@ if ('onhashchange' in window) {
 458 # draw a single line of text vertically from x, y to ymax
 459 # return the next 'y' coordinate
 460 # if there isn't enough space, truncate
-461 fn draw-text-downward screen: (addr screen), text: (addr array byte), x: int, y: int, ymax: int, color: int, background-color: int -> _/eax: int {
+461 fn draw-text-downward screen: (addr screen), text: (addr array byte), x: int, y: int, ymax: int, color: int, background-color: int -> _/eax: int {
 462   var stream-storage: (stream byte 0x100)
 463   var stream/esi: (addr stream byte) <- address stream-storage
 464   write stream, text
-465   var ycurr/eax: int <- draw-stream-downward screen, stream, x, y, ymax, color, background-color
+465   var ycurr/eax: int <- draw-stream-downward screen, stream, x, y, ymax, color, background-color
 466   return ycurr
 467 }
 468 
@@ -533,39 +533,39 @@ if ('onhashchange' in window) {
 470 # return the next 'y' coordinate
 471 # if there isn't enough space, truncate
 472 # TODO: should we track horizontal width?
-473 fn draw-stream-downward screen: (addr screen), stream: (addr stream byte), x: int, y: int, ymax: int, color: int, background-color: int -> _/eax: int {
+473 fn draw-stream-downward screen: (addr screen), stream: (addr stream byte), x: int, y: int, ymax: int, color: int, background-color: int -> _/eax: int {
 474   var ycurr/ecx: int <- copy y
 475   {
 476     var g/eax: grapheme <- read-grapheme stream
 477     compare g, 0xffffffff/end-of-file
 478     break-if-=
 479     var c/eax: code-point <- to-code-point g
-480     var dummy/eax: int <- draw-code-point screen, c, x, ycurr, color, background-color
+480     var dummy/eax: int <- draw-code-point screen, c, x, ycurr, color, background-color
 481     ycurr <- increment
 482     loop
 483   }
-484   set-cursor-position screen, x, ycurr
+484   set-cursor-position screen, x, ycurr
 485   return ycurr
 486 }
 487 
-488 fn draw-text-downward-from-cursor screen: (addr screen), text: (addr array byte), ymax: int, color: int, background-color: int {
+488 fn draw-text-downward-from-cursor screen: (addr screen), text: (addr array byte), ymax: int, color: int, background-color: int {
 489   var cursor-x/eax: int <- copy 0
 490   var cursor-y/ecx: int <- copy 0
-491   cursor-x, cursor-y <- cursor-position screen
-492   var result/eax: int <- draw-text-downward screen, text, cursor-x, cursor-y, ymax, color, background-color
+491   cursor-x, cursor-y <- cursor-position screen
+492   var result/eax: int <- draw-text-downward screen, text, cursor-x, cursor-y, ymax, color, background-color
 493 }
 494 
 495 # draw text down and right in the rectangle from (xmin, ymin) to (xmax, ymax), starting from (x, y), wrapping as necessary
 496 # return the next (x, y) coordinate in raster order where drawing stopped
 497 # that way the caller can draw more if given the same min and max bounding-box.
 498 # if there isn't enough space, truncate
-499 fn draw-text-wrapping-down-then-right screen: (addr screen), text: (addr array byte), xmin: int, ymin: int, xmax: int, ymax: int, _x: int, _y: int, color: int, background-color: int -> _/eax: int, _/ecx: int {
+499 fn draw-text-wrapping-down-then-right screen: (addr screen), text: (addr array byte), xmin: int, ymin: int, xmax: int, ymax: int, _x: int, _y: int, color: int, background-color: int -> _/eax: int, _/ecx: int {
 500   var stream-storage: (stream byte 0x100)
 501   var stream/esi: (addr stream byte) <- address stream-storage
 502   write stream, text
 503   var x/eax: int <- copy _x
 504   var y/ecx: int <- copy _y
-505   x, y <- draw-stream-wrapping-down-then-right screen, stream, xmin, ymin, xmax, ymax, x, y, color, background-color
+505   x, y <- draw-stream-wrapping-down-then-right screen, stream, xmin, ymin, xmax, ymax, x, y, color, background-color
 506   return x, y
 507 }
 508 
@@ -574,7 +574,7 @@ if ('onhashchange' in window) {
 511 # that way the caller can draw more if given the same min and max bounding-box.
 512 # if there isn't enough space, truncate
 513 # TODO: should we track horizontal width? just always offset by 2 for now
-514 fn draw-stream-wrapping-down-then-right screen: (addr screen), stream: (addr stream byte), xmin: int, ymin: int, xmax: int, ymax: int, x: int, y: int, color: int, background-color: int -> _/eax: int, _/ecx: int {
+514 fn draw-stream-wrapping-down-then-right screen: (addr screen), stream: (addr stream byte), xmin: int, ymin: int, xmax: int, ymax: int, x: int, y: int, color: int, background-color: int -> _/eax: int, _/ecx: int {
 515   var xcurr/edx: int <- copy x
 516   var ycurr/ecx: int <- copy y
 517   {
@@ -582,7 +582,7 @@ if ('onhashchange' in window) {
 519     compare g, 0xffffffff/end-of-file
 520     break-if-=
 521     var c/eax: code-point <- to-code-point g
-522     var offset/eax: int <- draw-code-point screen, c, xcurr, ycurr, color, background-color
+522     var offset/eax: int <- draw-code-point screen, c, xcurr, ycurr, color, background-color
 523     ycurr <- increment
 524     compare ycurr, ymax
 525     {
@@ -592,22 +592,22 @@ if ('onhashchange' in window) {
 529     }
 530     loop
 531   }
-532   set-cursor-position screen, xcurr, ycurr
+532   set-cursor-position screen, xcurr, ycurr
 533   return xcurr, ycurr
 534 }
 535 
-536 fn draw-text-wrapping-down-then-right-over-full-screen screen: (addr screen), text: (addr array byte), x: int, y: int, color: int, background-color: int -> _/eax: int, _/ecx: int {
+536 fn draw-text-wrapping-down-then-right-over-full-screen screen: (addr screen), text: (addr array byte), x: int, y: int, color: int, background-color: int -> _/eax: int, _/ecx: int {
 537   var x2/eax: int <- copy 0
 538   var y2/ecx: int <- copy 0
-539   x2, y2 <- screen-size screen  # width, height
-540   x2, y2 <- draw-text-wrapping-down-then-right screen, text, 0/xmin, 0/ymin, x2, y2, x, y, color, background-color
+539   x2, y2 <- screen-size screen  # width, height
+540   x2, y2 <- draw-text-wrapping-down-then-right screen, text, 0/xmin, 0/ymin, x2, y2, x, y, color, background-color
 541   return x2, y2  # cursor-x, cursor-y
 542 }
 543 
-544 fn draw-text-wrapping-down-then-right-from-cursor screen: (addr screen), text: (addr array byte), xmin: int, ymin: int, xmax: int, ymax: int, color: int, background-color: int {
+544 fn draw-text-wrapping-down-then-right-from-cursor screen: (addr screen), text: (addr array byte), xmin: int, ymin: int, xmax: int, ymax: int, color: int, background-color: int {
 545   var cursor-x/eax: int <- copy 0
 546   var cursor-y/ecx: int <- copy 0
-547   cursor-x, cursor-y <- cursor-position screen
+547   cursor-x, cursor-y <- cursor-position screen
 548   var end-y/edx: int <- copy cursor-y
 549   end-y <- increment
 550   compare end-y, ymax
@@ -616,14 +616,14 @@ if ('onhashchange' in window) {
 553     cursor-x <- increment
 554     cursor-y <- copy ymin
 555   }
-556   cursor-x, cursor-y <- draw-text-wrapping-down-then-right screen, text, xmin, ymin, xmax, ymax, cursor-x, cursor-y, color, background-color
+556   cursor-x, cursor-y <- draw-text-wrapping-down-then-right screen, text, xmin, ymin, xmax, ymax, cursor-x, cursor-y, color, background-color
 557 }
 558 
-559 fn draw-text-wrapping-down-then-right-from-cursor-over-full-screen screen: (addr screen), text: (addr array byte), color: int, background-color: int {
+559 fn draw-text-wrapping-down-then-right-from-cursor-over-full-screen screen: (addr screen), text: (addr array byte), color: int, background-color: int {
 560   var width/eax: int <- copy 0
 561   var height/ecx: int <- copy 0
-562   width, height <- screen-size screen
-563   draw-text-wrapping-down-then-right-from-cursor screen, text, 0/xmin, 0/ymin, width, height, color, background-color
+562   width, height <- screen-size screen
+563   draw-text-wrapping-down-then-right-from-cursor screen, text, 0/xmin, 0/ymin, width, height, color, background-color
 564 }
 
diff --git a/html/504test-screen.mu.html b/html/504test-screen.mu.html index 6c1d225f..086e25eb 100644 --- a/html/504test-screen.mu.html +++ b/html/504test-screen.mu.html @@ -68,14 +68,14 @@ if ('onhashchange' in window) { 4 # Mu doesn't have multi-line strings, so we provide functions for rows or portions of rows. 5 # Tab characters (that translate into multiple screen cells) not supported. 6 - 7 fn check-screen-row screen: (addr screen), y: int, expected: (addr array byte), msg: (addr array byte) { - 8 check-screen-row-from screen, 0/x, y, expected, msg + 7 fn check-screen-row screen: (addr screen), y: int, expected: (addr array byte), msg: (addr array byte) { + 8 check-screen-row-from screen, 0/x, y, expected, msg 9 } 10 - 11 fn check-screen-row-from _screen: (addr screen), x: int, y: int, expected: (addr array byte), msg: (addr array byte) { - 12 var screen/esi: (addr screen) <- copy _screen + 11 fn check-screen-row-from _screen: (addr screen), x: int, y: int, expected: (addr array byte), msg: (addr array byte) { + 12 var screen/esi: (addr screen) <- copy _screen 13 var failure-count/edi: int <- copy 0 - 14 var index/ecx: int <- screen-cell-index screen, x, y + 14 var index/ecx: int <- screen-cell-index screen, x, y 15 # compare 'expected' with the screen contents starting at 'index', grapheme by grapheme 16 var e: (stream byte 0x100) 17 var e-addr/edx: (addr stream byte) <- address e @@ -85,10 +85,10 @@ if ('onhashchange' in window) { 21 compare done?, 0 22 break-if-!= 23 { - 24 var unused?/eax: boolean <- screen-cell-unused-at-index? screen, index + 24 var unused?/eax: boolean <- screen-cell-unused-at-index? screen, index 25 compare unused?, 0/false 26 break-if-!= - 27 var _c/eax: code-point <- screen-code-point-at-index screen, index + 27 var _c/eax: code-point <- screen-code-point-at-index screen, index 28 var c/ebx: code-point <- copy _c 29 var expected-grapheme/eax: grapheme <- read-grapheme e-addr 30 var expected-code-point/eax: code-point <- to-code-point expected-grapheme @@ -136,13 +136,13 @@ if ('onhashchange' in window) { 72 73 # various variants by screen-cell attribute; spaces in the 'expected' data should not match the attribute 74 - 75 fn check-screen-row-in-color screen: (addr screen), fg: int, y: int, expected: (addr array byte), msg: (addr array byte) { - 76 check-screen-row-in-color-from screen, fg, y, 0/x, expected, msg + 75 fn check-screen-row-in-color screen: (addr screen), fg: int, y: int, expected: (addr array byte), msg: (addr array byte) { + 76 check-screen-row-in-color-from screen, fg, y, 0/x, expected, msg 77 } 78 - 79 fn check-screen-row-in-color-from _screen: (addr screen), fg: int, y: int, x: int, expected: (addr array byte), msg: (addr array byte) { - 80 var screen/esi: (addr screen) <- copy _screen - 81 var index/ecx: int <- screen-cell-index screen, x, y + 79 fn check-screen-row-in-color-from _screen: (addr screen), fg: int, y: int, x: int, expected: (addr array byte), msg: (addr array byte) { + 80 var screen/esi: (addr screen) <- copy _screen + 81 var index/ecx: int <- screen-cell-index screen, x, y 82 # compare 'expected' with the screen contents starting at 'index', grapheme by grapheme 83 var e: (stream byte 0x100) 84 var e-addr/edx: (addr stream byte) <- address e @@ -152,10 +152,10 @@ if ('onhashchange' in window) { 88 compare done?, 0 89 break-if-!= 90 { - 91 var unused?/eax: boolean <- screen-cell-unused-at-index? screen, index + 91 var unused?/eax: boolean <- screen-cell-unused-at-index? screen, index 92 compare unused?, 0/false 93 break-if-!= - 94 var _c/eax: code-point <- screen-code-point-at-index screen, index + 94 var _c/eax: code-point <- screen-code-point-at-index screen, index 95 var c/ebx: code-point <- copy _c 96 var expected-grapheme/eax: grapheme <- read-grapheme e-addr 97 var _expected-code-point/eax: code-point <- to-code-point expected-grapheme @@ -172,7 +172,7 @@ if ('onhashchange' in window) { 108 { 109 compare expected-code-point, 0x20 110 break-if-!= -111 var color/eax: int <- screen-color-at-index screen, index +111 var color/eax: int <- screen-color-at-index screen, index 112 compare color, fg 113 break-if-!= $check-screen-row-in-color-from:compare-cells 114 } @@ -200,7 +200,7 @@ if ('onhashchange' in window) { 136 move-cursor-to-left-margin-of-next-line 0/screen 137 } 138 $check-screen-row-in-color-from:compare-colors: { -139 var color/eax: int <- screen-color-at-index screen, index +139 var color/eax: int <- screen-color-at-index screen, index 140 compare fg, color 141 { 142 break-if-!= @@ -230,13 +230,13 @@ if ('onhashchange' in window) { 166 } 167 } 168 -169 fn check-screen-row-in-background-color screen: (addr screen), bg: int, y: int, expected: (addr array byte), msg: (addr array byte) { -170 check-screen-row-in-background-color-from screen, bg, y, 0/x, expected, msg +169 fn check-screen-row-in-background-color screen: (addr screen), bg: int, y: int, expected: (addr array byte), msg: (addr array byte) { +170 check-screen-row-in-background-color-from screen, bg, y, 0/x, expected, msg 171 } 172 -173 fn check-screen-row-in-background-color-from _screen: (addr screen), bg: int, y: int, x: int, expected: (addr array byte), msg: (addr array byte) { -174 var screen/esi: (addr screen) <- copy _screen -175 var index/ecx: int <- screen-cell-index screen, x, y +173 fn check-screen-row-in-background-color-from _screen: (addr screen), bg: int, y: int, x: int, expected: (addr array byte), msg: (addr array byte) { +174 var screen/esi: (addr screen) <- copy _screen +175 var index/ecx: int <- screen-cell-index screen, x, y 176 # compare 'expected' with the screen contents starting at 'index', grapheme by grapheme 177 var e: (stream byte 0x100) 178 var e-addr/edx: (addr stream byte) <- address e @@ -246,10 +246,10 @@ if ('onhashchange' in window) { 182 compare done?, 0 183 break-if-!= 184 { -185 var unused?/eax: boolean <- screen-cell-unused-at-index? screen, index +185 var unused?/eax: boolean <- screen-cell-unused-at-index? screen, index 186 compare unused?, 0/false 187 break-if-!= -188 var _g/eax: code-point <- screen-code-point-at-index screen, index +188 var _g/eax: code-point <- screen-code-point-at-index screen, index 189 var g/ebx: code-point <- copy _g 190 var expected-grapheme/eax: grapheme <- read-grapheme e-addr 191 var _expected-code-point/eax: code-point <- to-code-point expected-grapheme @@ -266,7 +266,7 @@ if ('onhashchange' in window) { 202 { 203 compare expected-code-point, 0x20 204 break-if-!= -205 var background-color/eax: int <- screen-background-color-at-index screen, index +205 var background-color/eax: int <- screen-background-color-at-index screen, index 206 compare background-color, bg 207 break-if-!= $check-screen-row-in-background-color-from:compare-cells 208 } @@ -295,7 +295,7 @@ if ('onhashchange' in window) { 231 break $check-screen-row-in-background-color-from:compare-graphemes 232 } 233 $check-screen-row-in-background-color-from:compare-background-colors: { -234 var background-color/eax: int <- screen-background-color-at-index screen, index +234 var background-color/eax: int <- screen-background-color-at-index screen, index 235 compare bg, background-color 236 { 237 break-if-!= @@ -328,14 +328,14 @@ if ('onhashchange' in window) { 264 # helpers for checking just background color, not screen contents 265 # these can validate bg for spaces 266 -267 fn check-background-color-in-screen-row screen: (addr screen), bg: int, y: int, expected-bitmap: (addr array byte), msg: (addr array byte) { -268 check-background-color-in-screen-row-from screen, bg, y, 0/x, expected-bitmap, msg +267 fn check-background-color-in-screen-row screen: (addr screen), bg: int, y: int, expected-bitmap: (addr array byte), msg: (addr array byte) { +268 check-background-color-in-screen-row-from screen, bg, y, 0/x, expected-bitmap, msg 269 } 270 -271 fn check-background-color-in-screen-row-from _screen: (addr screen), bg: int, y: int, x: int, expected-bitmap: (addr array byte), msg: (addr array byte) { -272 var screen/esi: (addr screen) <- copy _screen +271 fn check-background-color-in-screen-row-from _screen: (addr screen), bg: int, y: int, x: int, expected-bitmap: (addr array byte), msg: (addr array byte) { +272 var screen/esi: (addr screen) <- copy _screen 273 var failure-count: int -274 var index/ecx: int <- screen-cell-index screen, x, y +274 var index/ecx: int <- screen-cell-index screen, x, y 275 # compare background color where 'expected-bitmap' is a non-space 276 var e: (stream byte 0x100) 277 var e-addr/edx: (addr stream byte) <- address e @@ -345,13 +345,13 @@ if ('onhashchange' in window) { 281 compare done?, 0 282 break-if-!= 283 { -284 var unused?/eax: boolean <- screen-cell-unused-at-index? screen, index +284 var unused?/eax: boolean <- screen-cell-unused-at-index? screen, index 285 compare unused?, 0/false 286 break-if-!= 287 var _expected-bit/eax: grapheme <- read-grapheme e-addr 288 var expected-bit/edi: grapheme <- copy _expected-bit 289 $check-background-color-in-screen-row-from:compare-cells: { -290 var background-color/eax: int <- screen-background-color-at-index screen, index +290 var background-color/eax: int <- screen-background-color-at-index screen, index 291 # if expected-bit is space, assert that background is NOT bg 292 compare expected-bit, 0x20 293 { @@ -401,24 +401,24 @@ if ('onhashchange' in window) { 337 } 338 339 fn test-draw-single-grapheme { -340 var _screen: screen -341 var screen/esi: (addr screen) <- address _screen -342 initialize-screen screen, 5, 4, 0/no-pixel-graphics -343 var dummy/eax: int <- draw-code-point screen, 0x61/a, 0/x, 0/y, 1/fg, 2/bg -344 check-screen-row screen, 0/y, "a", "F - test-draw-single-grapheme" # top-left corner of the screen -345 check-screen-row-in-color screen, 1/fg, 0/y, "a", "F - test-draw-single-grapheme-fg" -346 check-screen-row-in-background-color screen, 2/bg, 0/y, "a", "F - test-draw-single-grapheme-bg" -347 check-background-color-in-screen-row screen, 2/bg, 0/y, "x ", "F - test-draw-single-grapheme-bg2" +340 var _screen: screen +341 var screen/esi: (addr screen) <- address _screen +342 initialize-screen screen, 5, 4, 0/no-pixel-graphics +343 var dummy/eax: int <- draw-code-point screen, 0x61/a, 0/x, 0/y, 1/fg, 2/bg +344 check-screen-row screen, 0/y, "a", "F - test-draw-single-grapheme" # top-left corner of the screen +345 check-screen-row-in-color screen, 1/fg, 0/y, "a", "F - test-draw-single-grapheme-fg" +346 check-screen-row-in-background-color screen, 2/bg, 0/y, "a", "F - test-draw-single-grapheme-bg" +347 check-background-color-in-screen-row screen, 2/bg, 0/y, "x ", "F - test-draw-single-grapheme-bg2" 348 } 349 350 fn test-draw-multiple-graphemes { -351 var _screen: screen -352 var screen/esi: (addr screen) <- address _screen -353 initialize-screen screen, 0x10/rows, 4/cols, 0/no-pixel-graphics -354 draw-text-wrapping-right-then-down-from-cursor-over-full-screen screen, "Hello, 世界", 1/fg, 2/bg -355 check-screen-row screen, 0/y, "Hello, 世界", "F - test-draw-multiple-graphemes" -356 check-screen-row-in-color screen, 1/fg, 0/y, "Hello, 世界", "F - test-draw-multiple-graphemes-fg" -357 check-background-color-in-screen-row screen, 2/bg, 0/y, "xxxxxxxxx ", "F - test-draw-multiple-graphemes-bg2" +351 var _screen: screen +352 var screen/esi: (addr screen) <- address _screen +353 initialize-screen screen, 0x10/rows, 4/cols, 0/no-pixel-graphics +354 draw-text-wrapping-right-then-down-from-cursor-over-full-screen screen, "Hello, 世界", 1/fg, 2/bg +355 check-screen-row screen, 0/y, "Hello, 世界", "F - test-draw-multiple-graphemes" +356 check-screen-row-in-color screen, 1/fg, 0/y, "Hello, 世界", "F - test-draw-multiple-graphemes-fg" +357 check-background-color-in-screen-row screen, 2/bg, 0/y, "xxxxxxxxx ", "F - test-draw-multiple-graphemes-bg2" 358 } diff --git a/html/507line.mu.html b/html/507line.mu.html index b591de21..2464ab0a 100644 --- a/html/507line.mu.html +++ b/html/507line.mu.html @@ -59,7 +59,7 @@ if ('onhashchange' in window) { https://github.com/akkartik/mu/blob/main/507line.mu
-  1 fn draw-line screen: (addr screen), x0: int, y0: int, x1: int, y1: int, color: int {
+  1 fn draw-line screen: (addr screen), x0: int, y0: int, x1: int, y1: int, color: int {
   2   var dx: int
   3   var dy: int
   4   var sx: int
@@ -90,7 +90,7 @@ if ('onhashchange' in window) {
  29   var x/ecx: int <- copy x0
  30   var y/edx: int <- copy y0
  31   $draw-line:loop: {
- 32     pixel screen, x, y, color
+ 32     pixel screen, x, y, color
  33     # if (x == x1 && y == y1) break
  34     {
  35       compare x, x1
@@ -122,34 +122,34 @@ if ('onhashchange' in window) {
  61   }
  62 }
  63 
- 64 fn draw-horizontal-line screen: (addr screen), y: int, x0: int, x1: int, color: int {
+ 64 fn draw-horizontal-line screen: (addr screen), y: int, x0: int, x1: int, color: int {
  65   var x/eax: int <- copy x0
  66   {
  67     compare x, x1
  68     break-if->=
- 69     pixel screen, x, y, color
+ 69     pixel screen, x, y, color
  70     x <- increment
  71     loop
  72   }
  73 }
  74 
- 75 fn draw-vertical-line screen: (addr screen), x: int, y0: int, y1: int, color: int {
+ 75 fn draw-vertical-line screen: (addr screen), x: int, y0: int, y1: int, color: int {
  76   var y/eax: int <- copy y0
  77   {
  78     compare y, y1
  79     break-if->=
- 80     pixel screen, x, y, color
+ 80     pixel screen, x, y, color
  81     y <- increment
  82     loop
  83   }
  84 }
  85 
- 86 fn draw-rect screen: (addr screen), xmin: int, ymin: int, xmax: int, ymax: int, color: int {
+ 86 fn draw-rect screen: (addr screen), xmin: int, ymin: int, xmax: int, ymax: int, color: int {
  87   var y/eax: int <- copy ymin
  88   {
  89     compare y, ymax
  90     break-if->=
- 91     draw-horizontal-line screen, y, xmin, xmax, color
+ 91     draw-horizontal-line screen, y, xmin, xmax, color
  92     y <- increment
  93     loop
  94   }
diff --git a/html/508circle.mu.html b/html/508circle.mu.html
index 53e853bb..3dd141e0 100644
--- a/html/508circle.mu.html
+++ b/html/508circle.mu.html
@@ -58,7 +58,7 @@ if ('onhashchange' in window) {
 
 https://github.com/akkartik/mu/blob/main/508circle.mu
 
- 1 fn draw-circle screen: (addr screen), cx: int, cy: int, radius: int, color: int {
+ 1 fn draw-circle screen: (addr screen), cx: int, cy: int, radius: int, color: int {
  2   var x: int
  3   var y: int
  4   var err: int
@@ -81,25 +81,25 @@ if ('onhashchange' in window) {
 21     tmpx <- subtract x
 22     tmpy <- copy cy
 23     tmpy <- add y
-24     pixel screen, tmpx, tmpy, color
+24     pixel screen, tmpx, tmpy, color
 25     # pixel(cx-y, cy-x)
 26     tmpx <- copy cx
 27     tmpx <- subtract y
 28     tmpy <- copy cy
 29     tmpy <- subtract x
-30     pixel screen, tmpx, tmpy, color
+30     pixel screen, tmpx, tmpy, color
 31     # pixel(cx+x, cy-y)
 32     tmpx <- copy cx
 33     tmpx <- add x
 34     tmpy <- copy cy
 35     tmpy <- subtract y
-36     pixel screen, tmpx, tmpy, color
+36     pixel screen, tmpx, tmpy, color
 37     # pixel(cx+y, cy+x)
 38     tmpx <- copy cx
 39     tmpx <- add y
 40     tmpy <- copy cy
 41     tmpy <- add x
-42     pixel screen, tmpx, tmpy, color
+42     pixel screen, tmpx, tmpy, color
 43     # r = err
 44     tmp <- copy err
 45     copy-to radius, tmp
@@ -137,16 +137,16 @@ if ('onhashchange' in window) {
 77   }
 78 }
 79 
-80 fn draw-disc screen: (addr screen), cx: int, cy: int, radius: int, color: int, border-color: int {
+80 fn draw-disc screen: (addr screen), cx: int, cy: int, radius: int, color: int, border-color: int {
 81   var r/eax: int <- copy 0
 82   {
 83     compare r, radius
 84     break-if->=
-85     draw-circle screen, cx cy, r, color
+85     draw-circle screen, cx cy, r, color
 86     r <- increment
 87     loop
 88   }
-89   draw-circle screen, cx cy, r, border-color
+89   draw-circle screen, cx cy, r, border-color
 90 }
 
diff --git a/html/509bezier.mu.html b/html/509bezier.mu.html index 274f2211..f21c74c5 100644 --- a/html/509bezier.mu.html +++ b/html/509bezier.mu.html @@ -72,7 +72,7 @@ if ('onhashchange' in window) { 11 # think it isn't. I think it's purely a property of the frame of reference. 12 # Rotating the axes can make the gradient change sign or stop changing sign 13 # even as 3 points preserve fixed relative bearings to each other. - 14 fn draw-monotonic-bezier screen: (addr screen), x0: int, y0: int, x1: int, y1: int, x2: int, y2: int, color: int { + 14 fn draw-monotonic-bezier screen: (addr screen), x0: int, y0: int, x1: int, y1: int, x2: int, y2: int, color: int { 15 var xx: int 16 var yy: int 17 var xy: int @@ -296,7 +296,7 @@ if ('onhashchange' in window) { 235 err-f <- add xy-f 236 # 237 $draw-monotonic-bezier:loop: { -238 pixel screen, x, y, color +238 pixel screen, x, y, color 239 # if (x == x2 && y == y2) return 240 { 241 compare x, x2 @@ -352,7 +352,7 @@ if ('onhashchange' in window) { 291 } 292 } 293 # plot the remaining straight line -294 draw-line screen, x y, x2 y2, color +294 draw-line screen, x y, x2 y2, color 295 } 296 297 # 0 <= u <= 1 diff --git a/html/511image.mu.html b/html/511image.mu.html index 5593195b..e51afe38 100644 --- a/html/511image.mu.html +++ b/html/511image.mu.html @@ -117,13 +117,13 @@ if ('onhashchange' in window) { 52 # dispatch to a few variants with mostly identical boilerplate 53 # TODO: if we have more resolution we could actually use it to improve 54 # dithering - 55 fn render-image screen: (addr screen), _img: (addr image), xmin: int, ymin: int, width: int, height: int { + 55 fn render-image screen: (addr screen), _img: (addr image), xmin: int, ymin: int, width: int, height: int { 56 var img/esi: (addr image) <- copy _img 57 var type-a/eax: (addr int) <- get img, type 58 { 59 compare *type-a, 1/pbm 60 break-if-!= - 61 render-pbm-image screen, img, xmin, ymin, width, height + 61 render-pbm-image screen, img, xmin, ymin, width, height 62 return 63 } 64 { @@ -132,7 +132,7 @@ if ('onhashchange' in window) { 67 var img2-storage: image 68 var img2/edi: (addr image) <- address img2-storage 69 dither-pgm-unordered img, img2 - 70 render-raw-image screen, img2, xmin, ymin, width, height + 70 render-raw-image screen, img2, xmin, ymin, width, height 71 return 72 } 73 { @@ -141,7 +141,7 @@ if ('onhashchange' in window) { 76 var img2-storage: image 77 var img2/edi: (addr image) <- address img2-storage 78 dither-ppm-unordered img, img2 - 79 render-raw-image screen, img2, xmin, ymin, width, height + 79 render-raw-image screen, img2, xmin, ymin, width, height 80 return 81 } 82 #? abort "render-image: unrecognized image type" @@ -189,7 +189,7 @@ if ('onhashchange' in window) { 124 } 125 126 # render a black-and-white ascii bitmap (each pixel is 0 or 1) - 127 fn render-pbm-image screen: (addr screen), _img: (addr image), xmin: int, ymin: int, width: int, height: int { + 127 fn render-pbm-image screen: (addr screen), _img: (addr image), xmin: int, ymin: int, width: int, height: int { 128 var img/esi: (addr image) <- copy _img 129 # yratio = height/img->height 130 var img-height-a/eax: (addr int) <- get img, height @@ -235,7 +235,7 @@ if ('onhashchange' in window) { 170 compare idx, len 171 { 172 break-if-< - 173 set-cursor-position 0/screen, 0x20/x 0x20/y + 173 set-cursor-position 0/screen, 0x20/x 0x20/y 174 draw-int32-decimal-wrapping-right-then-down-from-cursor-over-full-screen 0/screen, imgx, 3/fg 0/bg 175 draw-int32-decimal-wrapping-right-then-down-from-cursor-over-full-screen 0/screen, imgy, 4/fg 0/bg 176 draw-int32-decimal-wrapping-right-then-down-from-cursor-over-full-screen 0/screen, idx, 5/fg 0/bg @@ -252,7 +252,7 @@ if ('onhashchange' in window) { 187 screenx <- add xmin 188 var screeny/edx: int <- convert y 189 screeny <- add ymin - 190 pixel screen, screenx, screeny, color-int + 190 pixel screen, screenx, screeny, color-int 191 x <- add one-f 192 loop 193 } @@ -311,7 +311,7 @@ if ('onhashchange' in window) { 246 } 247 248 # render a greyscale ascii "greymap" (each pixel is a shade of grey from 0 to 255) by quantizing the shades - 249 fn render-pgm-image screen: (addr screen), _img: (addr image), xmin: int, ymin: int, width: int, height: int { + 249 fn render-pgm-image screen: (addr screen), _img: (addr image), xmin: int, ymin: int, width: int, height: int { 250 var img/esi: (addr image) <- copy _img 251 # yratio = height/img->height 252 var img-height-a/eax: (addr int) <- get img, height @@ -357,7 +357,7 @@ if ('onhashchange' in window) { 292 compare idx, len 293 { 294 break-if-< - 295 set-cursor-position 0/screen, 0x20/x 0x20/y + 295 set-cursor-position 0/screen, 0x20/x 0x20/y 296 draw-int32-decimal-wrapping-right-then-down-from-cursor-over-full-screen 0/screen, imgx, 3/fg 0/bg 297 draw-int32-decimal-wrapping-right-then-down-from-cursor-over-full-screen 0/screen, imgy, 4/fg 0/bg 298 draw-int32-decimal-wrapping-right-then-down-from-cursor-over-full-screen 0/screen, idx, 5/fg 0/bg @@ -369,7 +369,7 @@ if ('onhashchange' in window) { 304 screenx <- add xmin 305 var screeny/edx: int <- convert y 306 screeny <- add ymin - 307 pixel screen, screenx, screeny, color-int + 307 pixel screen, screenx, screeny, color-int 308 x <- add one-f 309 loop 310 } @@ -802,7 +802,7 @@ if ('onhashchange' in window) { 737 } 738 739 # import a color ascii "pixmap" (each pixel consists of 3 shades of r/g/b from 0 to 255) - 740 fn render-ppm-image screen: (addr screen), _img: (addr image), xmin: int, ymin: int, width: int, height: int { + 740 fn render-ppm-image screen: (addr screen), _img: (addr image), xmin: int, ymin: int, width: int, height: int { 741 var img/esi: (addr image) <- copy _img 742 # yratio = height/img->height 743 var img-height-a/eax: (addr int) <- get img, height @@ -854,7 +854,7 @@ if ('onhashchange' in window) { 789 compare idx, len 790 { 791 break-if-< - 792 set-cursor-position 0/screen, 0x20/x 0x20/y + 792 set-cursor-position 0/screen, 0x20/x 0x20/y 793 draw-int32-decimal-wrapping-right-then-down-from-cursor-over-full-screen 0/screen, imgx, 3/fg 0/bg 794 draw-int32-decimal-wrapping-right-then-down-from-cursor-over-full-screen 0/screen, imgy, 4/fg 0/bg 795 draw-int32-decimal-wrapping-right-then-down-from-cursor-over-full-screen 0/screen, idx, 5/fg 0/bg @@ -889,7 +889,7 @@ if ('onhashchange' in window) { 824 screenx <- add xmin 825 var screeny/edx: int <- convert y 826 screeny <- add ymin - 827 pixel screen, screenx, screeny, color + 827 pixel screen, screenx, screeny, color 828 x <- add one-f 829 loop 830 } @@ -1097,7 +1097,7 @@ if ('onhashchange' in window) { 1032 } 1033 1034 # each byte in the image data is a color of the current palette -1035 fn render-raw-image screen: (addr screen), _img: (addr image), xmin: int, ymin: int, width: int, height: int { +1035 fn render-raw-image screen: (addr screen), _img: (addr image), xmin: int, ymin: int, width: int, height: int { 1036 var img/esi: (addr image) <- copy _img 1037 # yratio = height/img->height 1038 var img-height-a/eax: (addr int) <- get img, height @@ -1143,7 +1143,7 @@ if ('onhashchange' in window) { 1078 compare idx, len 1079 { 1080 break-if-< -1081 set-cursor-position 0/screen, 0x20/x 0x20/y +1081 set-cursor-position 0/screen, 0x20/x 0x20/y 1082 draw-int32-decimal-wrapping-right-then-down-from-cursor-over-full-screen 0/screen, imgx, 3/fg 0/bg 1083 draw-int32-decimal-wrapping-right-then-down-from-cursor-over-full-screen 0/screen, imgy, 4/fg 0/bg 1084 draw-int32-decimal-wrapping-right-then-down-from-cursor-over-full-screen 0/screen, idx, 5/fg 0/bg @@ -1155,7 +1155,7 @@ if ('onhashchange' in window) { 1090 screenx <- add xmin 1091 var screeny/edx: int <- convert y 1092 screeny <- add ymin -1093 pixel screen, screenx, screeny, color-int +1093 pixel screen, screenx, screeny, color-int 1094 x <- add one-f 1095 loop 1096 } diff --git a/html/513grapheme-stack.mu.html b/html/513grapheme-stack.mu.html index f60e7703..4467a51c 100644 --- a/html/513grapheme-stack.mu.html +++ b/html/513grapheme-stack.mu.html @@ -148,7 +148,7 @@ if ('onhashchange' in window) { 84 # dump stack to screen from bottom to top 85 # hardcoded colors: 86 # matching paren - 87 fn render-stack-from-bottom-wrapping-right-then-down screen: (addr screen), _self: (addr grapheme-stack), xmin: int, ymin: int, xmax: int, ymax: int, _x: int, _y: int, highlight-matching-open-paren?: boolean, open-paren-depth: int, color: int, background-color: int -> _/eax: int, _/ecx: int { + 87 fn render-stack-from-bottom-wrapping-right-then-down screen: (addr screen), _self: (addr grapheme-stack), xmin: int, ymin: int, xmax: int, ymax: int, _x: int, _y: int, highlight-matching-open-paren?: boolean, open-paren-depth: int, color: int, background-color: int -> _/eax: int, _/ecx: int { 88 var self/esi: (addr grapheme-stack) <- copy _self 89 var matching-open-paren-index/edx: int <- get-matching-open-paren-index self, highlight-matching-open-paren?, open-paren-depth 90 var data-ah/edi: (addr handle array grapheme) <- get self, data @@ -178,7 +178,7 @@ if ('onhashchange' in window) { 114 break-if-!= 115 copy-to fg, 0xf/highlight 116 } -117 x, y <- render-code-point screen, c, xmin, ymin, xmax, ymax, x, y, fg, background-color # TODO: handle combining characters +117 x, y <- render-code-point screen, c, xmin, ymin, xmax, ymax, x, y, fg, background-color # TODO: handle combining characters 118 } 119 i <- increment 120 loop @@ -187,15 +187,15 @@ if ('onhashchange' in window) { 123 } 124 125 # helper for small words -126 fn render-stack-from-bottom screen: (addr screen), self: (addr grapheme-stack), x: int, y: int, highlight-matching-open-paren?: boolean, open-paren-depth: int -> _/eax: int { +126 fn render-stack-from-bottom screen: (addr screen), self: (addr grapheme-stack), x: int, y: int, highlight-matching-open-paren?: boolean, open-paren-depth: int -> _/eax: int { 127 var _width/eax: int <- copy 0 128 var _height/ecx: int <- copy 0 -129 _width, _height <- screen-size screen +129 _width, _height <- screen-size screen 130 var width/edx: int <- copy _width 131 var height/ebx: int <- copy _height 132 var x2/eax: int <- copy 0 133 var y2/ecx: int <- copy 0 -134 x2, y2 <- render-stack-from-bottom-wrapping-right-then-down screen, self, x, y, width, height, x, y, highlight-matching-open-paren?, open-paren-depth, 3/fg=cyan, 0xc5/bg=blue-bg +134 x2, y2 <- render-stack-from-bottom-wrapping-right-then-down screen, self, x, y, width, height, x, y, highlight-matching-open-paren?, open-paren-depth, 3/fg=cyan, 0xc5/bg=blue-bg 135 return x2 # y2? yolo 136 } 137 @@ -204,7 +204,7 @@ if ('onhashchange' in window) { 140 # hard-coded colors: 141 # matching paren 142 # cursor -143 fn render-stack-from-top-wrapping-right-then-down screen: (addr screen), _self: (addr grapheme-stack), xmin: int, ymin: int, xmax: int, ymax: int, _x: int, _y: int, render-cursor?: boolean, color: int, background-color: int -> _/eax: int, _/ecx: int { +143 fn render-stack-from-top-wrapping-right-then-down screen: (addr screen), _self: (addr grapheme-stack), xmin: int, ymin: int, xmax: int, ymax: int, _x: int, _y: int, render-cursor?: boolean, color: int, background-color: int -> _/eax: int, _/ecx: int { 144 var self/esi: (addr grapheme-stack) <- copy _self 145 var matching-close-paren-index/edx: int <- get-matching-close-paren-index self, render-cursor? 146 var data-ah/eax: (addr handle array grapheme) <- get self, data @@ -227,7 +227,7 @@ if ('onhashchange' in window) { 163 var tmp/eax: code-point <- to-code-point *g 164 copy-to c, tmp 165 } -166 x, y <- render-code-point screen, c, xmin, ymin, xmax, ymax, x, y, background-color, color +166 x, y <- render-code-point screen, c, xmin, ymin, xmax, ymax, x, y, background-color, color 167 i <- decrement 168 } 169 # remaining iterations @@ -252,7 +252,7 @@ if ('onhashchange' in window) { 188 var tmp/eax: code-point <- to-code-point *g 189 copy-to c, tmp 190 } -191 x, y <- render-code-point screen, c, xmin, ymin, xmax, ymax, x, y, fg, background-color +191 x, y <- render-code-point screen, c, xmin, ymin, xmax, ymax, x, y, fg, background-color 192 i <- decrement 193 loop 194 } @@ -260,15 +260,15 @@ if ('onhashchange' in window) { 196 } 197 198 # helper for small words -199 fn render-stack-from-top screen: (addr screen), self: (addr grapheme-stack), x: int, y: int, render-cursor?: boolean -> _/eax: int { +199 fn render-stack-from-top screen: (addr screen), self: (addr grapheme-stack), x: int, y: int, render-cursor?: boolean -> _/eax: int { 200 var _width/eax: int <- copy 0 201 var _height/ecx: int <- copy 0 -202 _width, _height <- screen-size screen +202 _width, _height <- screen-size screen 203 var width/edx: int <- copy _width 204 var height/ebx: int <- copy _height 205 var x2/eax: int <- copy 0 206 var y2/ecx: int <- copy 0 -207 x2, y2 <- render-stack-from-top-wrapping-right-then-down screen, self, x, y, width, height, x, y, render-cursor?, 3/fg=cyan, 0xc5/bg=blue-bg +207 x2, y2 <- render-stack-from-top-wrapping-right-then-down screen, self, x, y, width, height, x, y, render-cursor?, 3/fg=cyan, 0xc5/bg=blue-bg 208 return x2 # y2? yolo 209 } 210 @@ -284,24 +284,24 @@ if ('onhashchange' in window) { 220 g <- copy 0x63/c 221 push-grapheme-stack gs, g 222 # setup: screen -223 var screen-storage: screen -224 var screen/esi: (addr screen) <- address screen-storage -225 initialize-screen screen, 5, 4, 0/no-pixel-graphics +223 var screen-storage: screen +224 var screen/esi: (addr screen) <- address screen-storage +225 initialize-screen screen, 5, 4, 0/no-pixel-graphics 226 # -227 var x/eax: int <- render-stack-from-bottom screen, gs, 0/x, 0/y, 0/no-highlight-matching-open-paren, 0/open-paren-depth -228 check-screen-row screen, 0/y, "abc ", "F - test-render-grapheme-stack from bottom" +227 var x/eax: int <- render-stack-from-bottom screen, gs, 0/x, 0/y, 0/no-highlight-matching-open-paren, 0/open-paren-depth +228 check-screen-row screen, 0/y, "abc ", "F - test-render-grapheme-stack from bottom" 229 check-ints-equal x, 3, "F - test-render-grapheme-stack from bottom: result" -230 check-background-color-in-screen-row screen, 3/bg=reverse, 0/y, " ", "F - test-render-grapheme-stack from bottom: bg" +230 check-background-color-in-screen-row screen, 3/bg=reverse, 0/y, " ", "F - test-render-grapheme-stack from bottom: bg" 231 # -232 var x/eax: int <- render-stack-from-top screen, gs, 0/x, 1/y, 0/cursor=false -233 check-screen-row screen, 1/y, "cba ", "F - test-render-grapheme-stack from top without cursor" +232 var x/eax: int <- render-stack-from-top screen, gs, 0/x, 1/y, 0/cursor=false +233 check-screen-row screen, 1/y, "cba ", "F - test-render-grapheme-stack from top without cursor" 234 check-ints-equal x, 3, "F - test-render-grapheme-stack from top without cursor: result" -235 check-background-color-in-screen-row screen, 3/bg=reverse, 1/y, " ", "F - test-render-grapheme-stack from top without cursor: bg" +235 check-background-color-in-screen-row screen, 3/bg=reverse, 1/y, " ", "F - test-render-grapheme-stack from top without cursor: bg" 236 # -237 var x/eax: int <- render-stack-from-top screen, gs, 0/x, 2/y, 1/cursor=true -238 check-screen-row screen, 2/y, "cba ", "F - test-render-grapheme-stack from top with cursor" +237 var x/eax: int <- render-stack-from-top screen, gs, 0/x, 2/y, 1/cursor=true +238 check-screen-row screen, 2/y, "cba ", "F - test-render-grapheme-stack from top with cursor" 239 check-ints-equal x, 3, "F - test-render-grapheme-stack from top with cursor: result" -240 check-background-color-in-screen-row screen, 3/bg=reverse, 2/y, "| ", "F - test-render-grapheme-stack from top with cursor: bg" +240 check-background-color-in-screen-row screen, 3/bg=reverse, 2/y, "| ", "F - test-render-grapheme-stack from top with cursor: bg" 241 } 242 243 fn test-render-grapheme-stack-while-highlighting-matching-close-paren { @@ -316,14 +316,14 @@ if ('onhashchange' in window) { 252 g <- copy 0x28/open-paren 253 push-grapheme-stack gs, g 254 # setup: screen -255 var screen-storage: screen -256 var screen/esi: (addr screen) <- address screen-storage -257 initialize-screen screen, 5, 4, 0/no-pixel-graphics +255 var screen-storage: screen +256 var screen/esi: (addr screen) <- address screen-storage +257 initialize-screen screen, 5, 4, 0/no-pixel-graphics 258 # -259 var x/eax: int <- render-stack-from-top screen, gs, 0/x, 2/y, 1/cursor=true -260 check-screen-row screen, 2/y, "(b) ", "F - test-render-grapheme-stack-while-highlighting-matching-close-paren" -261 check-background-color-in-screen-row screen, 3/bg=reverse, 2/y, "| ", "F - test-render-grapheme-stack-while-highlighting-matching-close-paren: cursor" -262 check-screen-row-in-color screen, 0xf/fg=white, 2/y, " ) ", "F - test-render-grapheme-stack-while-highlighting-matching-close-paren: matching paren" +259 var x/eax: int <- render-stack-from-top screen, gs, 0/x, 2/y, 1/cursor=true +260 check-screen-row screen, 2/y, "(b) ", "F - test-render-grapheme-stack-while-highlighting-matching-close-paren" +261 check-background-color-in-screen-row screen, 3/bg=reverse, 2/y, "| ", "F - test-render-grapheme-stack-while-highlighting-matching-close-paren: cursor" +262 check-screen-row-in-color screen, 0xf/fg=white, 2/y, " ) ", "F - test-render-grapheme-stack-while-highlighting-matching-close-paren: matching paren" 263 } 264 265 fn test-render-grapheme-stack-while-highlighting-matching-close-paren-2 { @@ -350,14 +350,14 @@ if ('onhashchange' in window) { 286 g <- copy 0x28/open-paren 287 push-grapheme-stack gs, g 288 # setup: screen -289 var screen-storage: screen -290 var screen/esi: (addr screen) <- address screen-storage -291 initialize-screen screen, 5, 4, 0/no-pixel-graphics +289 var screen-storage: screen +290 var screen/esi: (addr screen) <- address screen-storage +291 initialize-screen screen, 5, 4, 0/no-pixel-graphics 292 # -293 var x/eax: int <- render-stack-from-top screen, gs, 0/x, 2/y, 1/cursor=true -294 check-screen-row screen, 2/y, "(a (b)) c ", "F - test-render-grapheme-stack-while-highlighting-matching-close-paren-2" -295 check-background-color-in-screen-row screen, 3/bg=reverse, 2/y, "| ", "F - test-render-grapheme-stack-while-highlighting-matching-close-paren-2: cursor" -296 check-screen-row-in-color screen, 0xf/fg=white, 2/y, " ) ", "F - test-render-grapheme-stack-while-highlighting-matching-close-paren-2: matching paren" +293 var x/eax: int <- render-stack-from-top screen, gs, 0/x, 2/y, 1/cursor=true +294 check-screen-row screen, 2/y, "(a (b)) c ", "F - test-render-grapheme-stack-while-highlighting-matching-close-paren-2" +295 check-background-color-in-screen-row screen, 3/bg=reverse, 2/y, "| ", "F - test-render-grapheme-stack-while-highlighting-matching-close-paren-2: cursor" +296 check-screen-row-in-color screen, 0xf/fg=white, 2/y, " ) ", "F - test-render-grapheme-stack-while-highlighting-matching-close-paren-2: matching paren" 297 } 298 299 fn test-render-grapheme-stack-while-highlighting-matching-open-paren-with-close-paren-at-end { @@ -372,13 +372,13 @@ if ('onhashchange' in window) { 308 g <- copy 0x29/close-paren 309 push-grapheme-stack gs, g 310 # setup: screen -311 var screen-storage: screen -312 var screen/esi: (addr screen) <- address screen-storage -313 initialize-screen screen, 5, 4, 0/no-pixel-graphics +311 var screen-storage: screen +312 var screen/esi: (addr screen) <- address screen-storage +313 initialize-screen screen, 5, 4, 0/no-pixel-graphics 314 # -315 var x/eax: int <- render-stack-from-bottom screen, gs, 0/x, 2/y, 1/highlight-matching-open-paren, 1/open-paren-depth -316 check-screen-row screen, 2/y, "(b) ", "F - test-render-grapheme-stack-while-highlighting-matching-open-paren-with-close-paren-at-end" -317 check-screen-row-in-color screen, 0xf/fg=white, 2/y, "( ", "F - test-render-grapheme-stack-while-highlighting-matching-open-paren-with-close-paren-at-end: matching paren" +315 var x/eax: int <- render-stack-from-bottom screen, gs, 0/x, 2/y, 1/highlight-matching-open-paren, 1/open-paren-depth +316 check-screen-row screen, 2/y, "(b) ", "F - test-render-grapheme-stack-while-highlighting-matching-open-paren-with-close-paren-at-end" +317 check-screen-row-in-color screen, 0xf/fg=white, 2/y, "( ", "F - test-render-grapheme-stack-while-highlighting-matching-open-paren-with-close-paren-at-end: matching paren" 318 } 319 320 fn test-render-grapheme-stack-while-highlighting-matching-open-paren-with-close-paren-at-end-2 { @@ -399,13 +399,13 @@ if ('onhashchange' in window) { 335 g <- copy 0x29/close-paren 336 push-grapheme-stack gs, g 337 # setup: screen -338 var screen-storage: screen -339 var screen/esi: (addr screen) <- address screen-storage -340 initialize-screen screen, 5, 4, 0/no-pixel-graphics +338 var screen-storage: screen +339 var screen/esi: (addr screen) <- address screen-storage +340 initialize-screen screen, 5, 4, 0/no-pixel-graphics 341 # -342 var x/eax: int <- render-stack-from-bottom screen, gs, 0/x, 2/y, 1/highlight-matching-open-paren, 1/open-paren-depth -343 check-screen-row screen, 2/y, "a((b)) ", "F - test-render-grapheme-stack-while-highlighting-matching-open-paren-with-close-paren-at-end-2" -344 check-screen-row-in-color screen, 0xf/fg=white, 2/y, " ( ", "F - test-render-grapheme-stack-while-highlighting-matching-open-paren-with-close-paren-at-end-2: matching paren" +342 var x/eax: int <- render-stack-from-bottom screen, gs, 0/x, 2/y, 1/highlight-matching-open-paren, 1/open-paren-depth +343 check-screen-row screen, 2/y, "a((b)) ", "F - test-render-grapheme-stack-while-highlighting-matching-open-paren-with-close-paren-at-end-2" +344 check-screen-row-in-color screen, 0xf/fg=white, 2/y, " ( ", "F - test-render-grapheme-stack-while-highlighting-matching-open-paren-with-close-paren-at-end-2: matching paren" 345 } 346 347 fn test-render-grapheme-stack-while-highlighting-matching-open-paren { @@ -418,13 +418,13 @@ if ('onhashchange' in window) { 354 g <- copy 0x62/b 355 push-grapheme-stack gs, g 356 # setup: screen -357 var screen-storage: screen -358 var screen/esi: (addr screen) <- address screen-storage -359 initialize-screen screen, 5, 4, 0/no-pixel-graphics +357 var screen-storage: screen +358 var screen/esi: (addr screen) <- address screen-storage +359 initialize-screen screen, 5, 4, 0/no-pixel-graphics 360 # -361 var x/eax: int <- render-stack-from-bottom screen, gs, 0/x, 2/y, 1/highlight-matching-open-paren, 0/open-paren-depth -362 check-screen-row screen, 2/y, "(b ", "F - test-render-grapheme-stack-while-highlighting-matching-open-paren" -363 check-screen-row-in-color screen, 0xf/fg=white, 2/y, "( ", "F - test-render-grapheme-stack-while-highlighting-matching-open-paren: matching paren" +361 var x/eax: int <- render-stack-from-bottom screen, gs, 0/x, 2/y, 1/highlight-matching-open-paren, 0/open-paren-depth +362 check-screen-row screen, 2/y, "(b ", "F - test-render-grapheme-stack-while-highlighting-matching-open-paren" +363 check-screen-row-in-color screen, 0xf/fg=white, 2/y, "( ", "F - test-render-grapheme-stack-while-highlighting-matching-open-paren: matching paren" 364 } 365 366 fn test-render-grapheme-stack-while-highlighting-matching-open-paren-2 { @@ -443,13 +443,13 @@ if ('onhashchange' in window) { 379 g <- copy 0x29/close-paren 380 push-grapheme-stack gs, g 381 # setup: screen -382 var screen-storage: screen -383 var screen/esi: (addr screen) <- address screen-storage -384 initialize-screen screen, 5, 4, 0/no-pixel-graphics +382 var screen-storage: screen +383 var screen/esi: (addr screen) <- address screen-storage +384 initialize-screen screen, 5, 4, 0/no-pixel-graphics 385 # -386 var x/eax: int <- render-stack-from-bottom screen, gs, 0/x, 2/y, 1/highlight-matching-open-paren, 0/open-paren-depth -387 check-screen-row screen, 2/y, "a((b) ", "F - test-render-grapheme-stack-while-highlighting-matching-open-paren-2" -388 check-screen-row-in-color screen, 0xf/fg=white, 2/y, " ( ", "F - test-render-grapheme-stack-while-highlighting-matching-open-paren-2: matching paren" +386 var x/eax: int <- render-stack-from-bottom screen, gs, 0/x, 2/y, 1/highlight-matching-open-paren, 0/open-paren-depth +387 check-screen-row screen, 2/y, "a((b) ", "F - test-render-grapheme-stack-while-highlighting-matching-open-paren-2" +388 check-screen-row-in-color screen, 0xf/fg=white, 2/y, " ( ", "F - test-render-grapheme-stack-while-highlighting-matching-open-paren-2: matching paren" 389 } 390 391 # return the index of the matching close-paren of the grapheme at cursor (top of stack) diff --git a/html/514gap-buffer.mu.html b/html/514gap-buffer.mu.html index 31266745..662aa1d0 100644 --- a/html/514gap-buffer.mu.html +++ b/html/514gap-buffer.mu.html @@ -446,7 +446,7 @@ if ('onhashchange' in window) { 382 383 # We implicitly render everything editable in a single color, and assume the 384 # cursor is a single other color. - 385 fn render-gap-buffer-wrapping-right-then-down screen: (addr screen), _gap: (addr gap-buffer), xmin: int, ymin: int, xmax: int, ymax: int, render-cursor?: boolean, color: int, background-color: int -> _/eax: int, _/ecx: int { + 385 fn render-gap-buffer-wrapping-right-then-down screen: (addr screen), _gap: (addr gap-buffer), xmin: int, ymin: int, xmax: int, ymax: int, render-cursor?: boolean, color: int, background-color: int -> _/eax: int, _/ecx: int { 386 var gap/esi: (addr gap-buffer) <- copy _gap 387 var left/edx: (addr grapheme-stack) <- get gap, left 388 var highlight-matching-open-paren?/ebx: boolean <- copy 0/false @@ -454,9 +454,9 @@ if ('onhashchange' in window) { 390 highlight-matching-open-paren?, matching-open-paren-depth <- highlight-matching-open-paren? gap, render-cursor? 391 var x2/eax: int <- copy 0 392 var y2/ecx: int <- copy 0 - 393 x2, y2 <- render-stack-from-bottom-wrapping-right-then-down screen, left, xmin, ymin, xmax, ymax, xmin, ymin, highlight-matching-open-paren?, matching-open-paren-depth, color, background-color + 393 x2, y2 <- render-stack-from-bottom-wrapping-right-then-down screen, left, xmin, ymin, xmax, ymax, xmin, ymin, highlight-matching-open-paren?, matching-open-paren-depth, color, background-color 394 var right/edx: (addr grapheme-stack) <- get gap, right - 395 x2, y2 <- render-stack-from-top-wrapping-right-then-down screen, right, xmin, ymin, xmax, ymax, x2, y2, render-cursor?, color, background-color + 395 x2, y2 <- render-stack-from-top-wrapping-right-then-down screen, right, xmin, ymin, xmax, ymax, x2, y2, render-cursor?, color, background-color 396 # decide whether we still need to print a cursor 397 var fg/edi: int <- copy color 398 var bg/ebx: int <- copy background-color @@ -473,19 +473,19 @@ if ('onhashchange' in window) { 409 } 410 # print a grapheme either way so that cursor position doesn't affect printed width 411 var space/edx: code-point <- copy 0x20 - 412 x2, y2 <- render-code-point screen, space, xmin, ymin, xmax, ymax, x2, y2, fg, bg + 412 x2, y2 <- render-code-point screen, space, xmin, ymin, xmax, ymax, x2, y2, fg, bg 413 return x2, y2 414 } 415 - 416 fn render-gap-buffer screen: (addr screen), gap: (addr gap-buffer), x: int, y: int, render-cursor?: boolean, color: int, background-color: int -> _/eax: int { + 416 fn render-gap-buffer screen: (addr screen), gap: (addr gap-buffer), x: int, y: int, render-cursor?: boolean, color: int, background-color: int -> _/eax: int { 417 var _width/eax: int <- copy 0 418 var _height/ecx: int <- copy 0 - 419 _width, _height <- screen-size screen + 419 _width, _height <- screen-size screen 420 var width/edx: int <- copy _width 421 var height/ebx: int <- copy _height 422 var x2/eax: int <- copy 0 423 var y2/ecx: int <- copy 0 - 424 x2, y2 <- render-gap-buffer-wrapping-right-then-down screen, gap, x, y, width, height, render-cursor?, color, background-color + 424 x2, y2 <- render-gap-buffer-wrapping-right-then-down screen, gap, x, y, width, height, render-cursor?, color, background-color 425 return x2 # y2? yolo 426 } 427 @@ -881,15 +881,15 @@ if ('onhashchange' in window) { 817 var gap/esi: (addr gap-buffer) <- address gap-storage 818 initialize-gap-buffer-with gap, "abc" 819 # setup: screen - 820 var screen-storage: screen - 821 var screen/edi: (addr screen) <- address screen-storage - 822 initialize-screen screen, 5, 4, 0/no-pixel-graphics + 820 var screen-storage: screen + 821 var screen/edi: (addr screen) <- address screen-storage + 822 initialize-screen screen, 5, 4, 0/no-pixel-graphics 823 # - 824 var x/eax: int <- render-gap-buffer screen, gap, 0/x, 0/y, 0/no-cursor, 3/fg, 0xc5/bg=blue-bg - 825 check-screen-row screen, 0/y, "abc ", "F - test-render-gap-buffer-without-cursor" + 824 var x/eax: int <- render-gap-buffer screen, gap, 0/x, 0/y, 0/no-cursor, 3/fg, 0xc5/bg=blue-bg + 825 check-screen-row screen, 0/y, "abc ", "F - test-render-gap-buffer-without-cursor" 826 check-ints-equal x, 4, "F - test-render-gap-buffer-without-cursor: result" 827 # abc - 828 check-background-color-in-screen-row screen, 3/bg=reverse, 0/y, " ", "F - test-render-gap-buffer-without-cursor: bg" + 828 check-background-color-in-screen-row screen, 3/bg=reverse, 0/y, " ", "F - test-render-gap-buffer-without-cursor: bg" 829 } 830 831 fn test-render-gap-buffer-with-cursor-at-end { @@ -899,16 +899,16 @@ if ('onhashchange' in window) { 835 initialize-gap-buffer-with gap, "abc" 836 gap-to-end gap 837 # setup: screen - 838 var screen-storage: screen - 839 var screen/edi: (addr screen) <- address screen-storage - 840 initialize-screen screen, 5, 4, 0/no-pixel-graphics + 838 var screen-storage: screen + 839 var screen/edi: (addr screen) <- address screen-storage + 840 initialize-screen screen, 5, 4, 0/no-pixel-graphics 841 # - 842 var x/eax: int <- render-gap-buffer screen, gap, 0/x, 0/y, 1/show-cursor, 3/fg, 0xc5/bg=blue-bg - 843 check-screen-row screen, 0/y, "abc ", "F - test-render-gap-buffer-with-cursor-at-end" + 842 var x/eax: int <- render-gap-buffer screen, gap, 0/x, 0/y, 1/show-cursor, 3/fg, 0xc5/bg=blue-bg + 843 check-screen-row screen, 0/y, "abc ", "F - test-render-gap-buffer-with-cursor-at-end" 844 # we've drawn one extra grapheme for the cursor 845 check-ints-equal x, 4, "F - test-render-gap-buffer-with-cursor-at-end: result" 846 # abc - 847 check-background-color-in-screen-row screen, 3/bg=reverse, 0/y, " |", "F - test-render-gap-buffer-with-cursor-at-end: bg" + 847 check-background-color-in-screen-row screen, 3/bg=reverse, 0/y, " |", "F - test-render-gap-buffer-with-cursor-at-end: bg" 848 } 849 850 fn test-render-gap-buffer-with-cursor-in-middle { @@ -919,15 +919,15 @@ if ('onhashchange' in window) { 855 gap-to-end gap 856 var dummy/eax: grapheme <- gap-left gap 857 # setup: screen - 858 var screen-storage: screen - 859 var screen/edi: (addr screen) <- address screen-storage - 860 initialize-screen screen, 5, 4, 0/no-pixel-graphics + 858 var screen-storage: screen + 859 var screen/edi: (addr screen) <- address screen-storage + 860 initialize-screen screen, 5, 4, 0/no-pixel-graphics 861 # - 862 var x/eax: int <- render-gap-buffer screen, gap, 0/x, 0/y, 1/show-cursor, 3/fg, 0xc5/bg=blue-bg - 863 check-screen-row screen, 0/y, "abc ", "F - test-render-gap-buffer-with-cursor-in-middle" + 862 var x/eax: int <- render-gap-buffer screen, gap, 0/x, 0/y, 1/show-cursor, 3/fg, 0xc5/bg=blue-bg + 863 check-screen-row screen, 0/y, "abc ", "F - test-render-gap-buffer-with-cursor-in-middle" 864 check-ints-equal x, 4, "F - test-render-gap-buffer-with-cursor-in-middle: result" 865 # abc - 866 check-background-color-in-screen-row screen, 3/bg=reverse, 0/y, " | ", "F - test-render-gap-buffer-with-cursor-in-middle: bg" + 866 check-background-color-in-screen-row screen, 3/bg=reverse, 0/y, " | ", "F - test-render-gap-buffer-with-cursor-in-middle: bg" 867 } 868 869 fn test-render-gap-buffer-with-cursor-at-start { @@ -936,15 +936,15 @@ if ('onhashchange' in window) { 872 initialize-gap-buffer-with gap, "abc" 873 gap-to-start gap 874 # setup: screen - 875 var screen-storage: screen - 876 var screen/edi: (addr screen) <- address screen-storage - 877 initialize-screen screen, 5, 4, 0/no-pixel-graphics + 875 var screen-storage: screen + 876 var screen/edi: (addr screen) <- address screen-storage + 877 initialize-screen screen, 5, 4, 0/no-pixel-graphics 878 # - 879 var x/eax: int <- render-gap-buffer screen, gap, 0/x, 0/y, 1/show-cursor, 3/fg, 0xc5/bg=blue-bg - 880 check-screen-row screen, 0/y, "abc ", "F - test-render-gap-buffer-with-cursor-at-start" + 879 var x/eax: int <- render-gap-buffer screen, gap, 0/x, 0/y, 1/show-cursor, 3/fg, 0xc5/bg=blue-bg + 880 check-screen-row screen, 0/y, "abc ", "F - test-render-gap-buffer-with-cursor-at-start" 881 check-ints-equal x, 4, "F - test-render-gap-buffer-with-cursor-at-start: result" 882 # abc - 883 check-background-color-in-screen-row screen, 3/bg=reverse, 0/y, "| ", "F - test-render-gap-buffer-with-cursor-at-start: bg" + 883 check-background-color-in-screen-row screen, 3/bg=reverse, 0/y, "| ", "F - test-render-gap-buffer-with-cursor-at-start: bg" 884 } 885 886 fn test-render-gap-buffer-highlight-matching-close-paren { @@ -953,15 +953,15 @@ if ('onhashchange' in window) { 889 initialize-gap-buffer-with gap, "(a)" 890 gap-to-start gap 891 # setup: screen - 892 var screen-storage: screen - 893 var screen/edi: (addr screen) <- address screen-storage - 894 initialize-screen screen, 5, 4, 0/no-pixel-graphics + 892 var screen-storage: screen + 893 var screen/edi: (addr screen) <- address screen-storage + 894 initialize-screen screen, 5, 4, 0/no-pixel-graphics 895 # - 896 var x/eax: int <- render-gap-buffer screen, gap, 0/x, 0/y, 1/show-cursor, 3/fg, 0xc5/bg=blue-bg - 897 check-screen-row screen, 0/y, "(a) ", "F - test-render-gap-buffer-highlight-matching-close-paren" + 896 var x/eax: int <- render-gap-buffer screen, gap, 0/x, 0/y, 1/show-cursor, 3/fg, 0xc5/bg=blue-bg + 897 check-screen-row screen, 0/y, "(a) ", "F - test-render-gap-buffer-highlight-matching-close-paren" 898 check-ints-equal x, 4, "F - test-render-gap-buffer-highlight-matching-close-paren: result" - 899 check-background-color-in-screen-row screen, 3/bg=reverse, 0/y, "| ", "F - test-render-gap-buffer-highlight-matching-close-paren: cursor" - 900 check-screen-row-in-color screen, 0xf/fg=highlight, 0/y, " ) ", "F - test-render-gap-buffer-highlight-matching-close-paren: matching paren" + 899 check-background-color-in-screen-row screen, 3/bg=reverse, 0/y, "| ", "F - test-render-gap-buffer-highlight-matching-close-paren: cursor" + 900 check-screen-row-in-color screen, 0xf/fg=highlight, 0/y, " ) ", "F - test-render-gap-buffer-highlight-matching-close-paren: matching paren" 901 } 902 903 fn test-render-gap-buffer-highlight-matching-open-paren { @@ -971,15 +971,15 @@ if ('onhashchange' in window) { 907 gap-to-end gap 908 var dummy/eax: grapheme <- gap-left gap 909 # setup: screen - 910 var screen-storage: screen - 911 var screen/edi: (addr screen) <- address screen-storage - 912 initialize-screen screen, 5, 4, 0/no-pixel-graphics + 910 var screen-storage: screen + 911 var screen/edi: (addr screen) <- address screen-storage + 912 initialize-screen screen, 5, 4, 0/no-pixel-graphics 913 # - 914 var x/eax: int <- render-gap-buffer screen, gap, 0/x, 0/y, 1/show-cursor, 3/fg, 0xc5/bg=blue-bg - 915 check-screen-row screen, 0/y, "(a) ", "F - test-render-gap-buffer-highlight-matching-open-paren" + 914 var x/eax: int <- render-gap-buffer screen, gap, 0/x, 0/y, 1/show-cursor, 3/fg, 0xc5/bg=blue-bg + 915 check-screen-row screen, 0/y, "(a) ", "F - test-render-gap-buffer-highlight-matching-open-paren" 916 check-ints-equal x, 4, "F - test-render-gap-buffer-highlight-matching-open-paren: result" - 917 check-background-color-in-screen-row screen, 3/bg=reverse, 0/y, " | ", "F - test-render-gap-buffer-highlight-matching-open-paren: cursor" - 918 check-screen-row-in-color screen, 0xf/fg=highlight, 0/y, "( ", "F - test-render-gap-buffer-highlight-matching-open-paren: matching paren" + 917 check-background-color-in-screen-row screen, 3/bg=reverse, 0/y, " | ", "F - test-render-gap-buffer-highlight-matching-open-paren: cursor" + 918 check-screen-row-in-color screen, 0xf/fg=highlight, 0/y, "( ", "F - test-render-gap-buffer-highlight-matching-open-paren: matching paren" 919 } 920 921 fn test-render-gap-buffer-highlight-matching-open-paren-of-end { @@ -988,15 +988,15 @@ if ('onhashchange' in window) { 924 initialize-gap-buffer-with gap, "(a)" 925 gap-to-end gap 926 # setup: screen - 927 var screen-storage: screen - 928 var screen/edi: (addr screen) <- address screen-storage - 929 initialize-screen screen, 5, 4, 0/no-pixel-graphics + 927 var screen-storage: screen + 928 var screen/edi: (addr screen) <- address screen-storage + 929 initialize-screen screen, 5, 4, 0/no-pixel-graphics 930 # - 931 var x/eax: int <- render-gap-buffer screen, gap, 0/x, 0/y, 1/show-cursor, 3/fg, 0xc5/bg=blue-bg - 932 check-screen-row screen, 0/y, "(a) ", "F - test-render-gap-buffer-highlight-matching-open-paren-of-end" + 931 var x/eax: int <- render-gap-buffer screen, gap, 0/x, 0/y, 1/show-cursor, 3/fg, 0xc5/bg=blue-bg + 932 check-screen-row screen, 0/y, "(a) ", "F - test-render-gap-buffer-highlight-matching-open-paren-of-end" 933 check-ints-equal x, 4, "F - test-render-gap-buffer-highlight-matching-open-paren-of-end: result" - 934 check-background-color-in-screen-row screen, 3/bg=reverse, 0/y, " |", "F - test-render-gap-buffer-highlight-matching-open-paren-of-end: cursor" - 935 check-screen-row-in-color screen, 0xf/fg=highlight, 0/y, "( ", "F - test-render-gap-buffer-highlight-matching-open-paren-of-end: matching paren" + 934 check-background-color-in-screen-row screen, 3/bg=reverse, 0/y, " |", "F - test-render-gap-buffer-highlight-matching-open-paren-of-end: cursor" + 935 check-screen-row-in-color screen, 0xf/fg=highlight, 0/y, "( ", "F - test-render-gap-buffer-highlight-matching-open-paren-of-end: matching paren" 936 } 937 938 # should I highlight a matching open paren? And if so, at what depth from top of left? diff --git a/html/apps/color-game.mu.html b/html/apps/color-game.mu.html index 224409d9..a0592701 100644 --- a/html/apps/color-game.mu.html +++ b/html/apps/color-game.mu.html @@ -63,20 +63,20 @@ if ('onhashchange' in window) {
  1 # Guess the result of mixing two colors.
  2 
- 3 fn main screen: (addr screen), keyboard: (addr keyboard), data-disk: (addr disk) {
- 4   var second-buffer: screen
- 5   var second-screen/edi: (addr screen) <- address second-buffer
- 6   initialize-screen second-screen, 0x80, 0x30, 1/include-pixels
+ 3 fn main screen: (addr screen), keyboard: (addr keyboard), data-disk: (addr disk) {
+ 4   var second-buffer: screen
+ 5   var second-screen/edi: (addr screen) <- address second-buffer
+ 6   initialize-screen second-screen, 0x80, 0x30, 1/include-pixels
  7   var leftx/edx: int <- copy 0x80
  8   var rightx/ebx: int <- copy 0x380
  9   {
 10     compare leftx, rightx
 11     break-if->=
-12     clear-screen second-screen
+12     clear-screen second-screen
 13     # interesting value: 9/blue with 0xe/yellow
 14     color-field second-screen, leftx 0x40/y, 0x40/width 0x40/height, 1/blue
 15     color-field second-screen, rightx 0x41/y, 0x40/width 0x40/height, 2/green
-16     copy-pixels second-screen, screen
+16     copy-pixels second-screen, screen
 17     # on the first iteration, give everyone a chance to make their guess
 18     {
 19       compare leftx, 0x80
@@ -91,7 +91,7 @@ if ('onhashchange' in window) {
 28   }
 29 }
 30 
-31 fn color-field screen: (addr screen), xmin: int, ymin: int, width: int, height: int, color: int {
+31 fn color-field screen: (addr screen), xmin: int, ymin: int, width: int, height: int, color: int {
 32   var xmax/esi: int <- copy xmin
 33   xmax <- add width
 34   var ymax/edi: int <- copy ymin
@@ -104,7 +104,7 @@ if ('onhashchange' in window) {
 41     {
 42       compare x, xmax
 43       break-if->=
-44       pixel screen, x, y, color
+44       pixel screen, x, y, color
 45       x <- add 2
 46       loop
 47     }
@@ -116,7 +116,7 @@ if ('onhashchange' in window) {
 53     {
 54       compare x, xmax
 55       break-if->=
-56       pixel screen, x, y, color
+56       pixel screen, x, y, color
 57       x <- add 2
 58       loop
 59     }
diff --git a/html/apps/colors.mu.html b/html/apps/colors.mu.html
index 2602ae6b..d7de09d0 100644
--- a/html/apps/colors.mu.html
+++ b/html/apps/colors.mu.html
@@ -73,16 +73,16 @@ if ('onhashchange' in window) {
  10 #   5
  11 # This means only color 5 in the default palette is similar to #aa00aa.
  12 
- 13 fn main screen: (addr screen), keyboard: (addr keyboard), data-disk: (addr disk) {
+ 13 fn main screen: (addr screen), keyboard: (addr keyboard), data-disk: (addr disk) {
  14   var in-storage: (stream byte 0x10)
  15   var in/esi: (addr stream byte) <- address in-storage
  16   {
  17     # print prompt
- 18     var x/eax: int <- draw-text-rightward screen, "Enter 3 hex bytes for r, g, b (lowercase; no 0x prefix) separated by a single space> ", 0x10/x, 0x80/xmax, 0x28/y, 3/fg/cyan, 0/bg
+ 18     var x/eax: int <- draw-text-rightward screen, "Enter 3 hex bytes for r, g, b (lowercase; no 0x prefix) separated by a single space> ", 0x10/x, 0x80/xmax, 0x28/y, 3/fg/cyan, 0/bg
  19     # read line from keyboard
  20     clear-stream in
  21     {
- 22       draw-cursor screen, 0x20/space
+ 22       draw-cursor screen, 0x20/space
  23       var key/eax: byte <- read-key keyboard
  24       compare key, 0xa/newline
  25       break-if-=
@@ -91,10 +91,10 @@ if ('onhashchange' in window) {
  28       var key2/eax: int <- copy key
  29       append-byte in, key2
  30       var c/eax: code-point <- copy key2  # TODO: unicode input
- 31       draw-code-point-at-cursor-over-full-screen screen, c, 0xf/fg, 0/bg
+ 31       draw-code-point-at-cursor-over-full-screen screen, c, 0xf/fg, 0/bg
  32       loop
  33     }
- 34     clear-screen screen
+ 34     clear-screen screen
  35     # parse
  36     var a/ecx: int <- copy 0
  37     var b/edx: int <- copy 0
@@ -109,14 +109,14 @@ if ('onhashchange' in window) {
  46 #?     draw-int32-hex-wrapping-right-then-down-from-cursor-over-full-screen screen, c, 7/fg, 0/bg
  47     a, b, c <- hsl a, b, c
  48     # return all colors in the same quadrant in h, s and l
- 49     print-nearby-colors screen, a, b, c
+ 49     print-nearby-colors screen, a, b, c
  50     # another metric
  51     var color/eax: int <- nearest-color-euclidean-hsl a, b, c
- 52     set-cursor-position screen, 0x10/x, 0x26/y
- 53     draw-text-wrapping-right-then-down-from-cursor-over-full-screen screen, "nearest (euclidean, h/s/l): ", 0xf/fg, 0/bg
- 54     draw-int32-decimal-wrapping-right-then-down-from-cursor-over-full-screen screen, color, 7/fg, 0/bg
- 55     draw-text-wrapping-right-then-down-from-cursor-over-full-screen screen, " ", 0xf/fg, 0/bg
- 56     draw-text-wrapping-right-then-down-from-cursor-over-full-screen screen, "               ", 0/fg, color
+ 52     set-cursor-position screen, 0x10/x, 0x26/y
+ 53     draw-text-wrapping-right-then-down-from-cursor-over-full-screen screen, "nearest (euclidean, h/s/l): ", 0xf/fg, 0/bg
+ 54     draw-int32-decimal-wrapping-right-then-down-from-cursor-over-full-screen screen, color, 7/fg, 0/bg
+ 55     draw-text-wrapping-right-then-down-from-cursor-over-full-screen screen, " ", 0xf/fg, 0/bg
+ 56     draw-text-wrapping-right-then-down-from-cursor-over-full-screen screen, "               ", 0/fg, color
  57     #
  58     loop
  59   }
@@ -248,7 +248,7 @@ if ('onhashchange' in window) {
 185   return result
 186 }
 187 
-188 fn print-nearby-colors screen: (addr screen), h: int, s: int, l: int {
+188 fn print-nearby-colors screen: (addr screen), h: int, s: int, l: int {
 189 #?   set-cursor-position screen, 0x10/x, 0x1c/y
 190 #?   draw-int32-hex-wrapping-right-then-down-from-cursor-over-full-screen screen, h, 7/fg, 0/bg
 191 #?   draw-text-wrapping-right-then-down-from-cursor-over-full-screen screen, " ", 7/fg, 0/bg
@@ -285,11 +285,11 @@ if ('onhashchange' in window) {
 222       break-if-!=
 223       compare c, l
 224       break-if-!=
-225       set-cursor-position screen, 0x10/x, y
-226       draw-int32-decimal-wrapping-right-then-down-from-cursor-over-full-screen screen, color, 7/fg, 0/bg
-227       set-cursor-position screen, 0x14/x, y
-228       draw-text-wrapping-right-then-down-from-cursor-over-full-screen screen, " ", 7/fg, 0/bg
-229       draw-text-wrapping-right-then-down-from-cursor-over-full-screen screen, "               ", 0/fg, color
+225       set-cursor-position screen, 0x10/x, y
+226       draw-int32-decimal-wrapping-right-then-down-from-cursor-over-full-screen screen, color, 7/fg, 0/bg
+227       set-cursor-position screen, 0x14/x, y
+228       draw-text-wrapping-right-then-down-from-cursor-over-full-screen screen, " ", 7/fg, 0/bg
+229       draw-text-wrapping-right-then-down-from-cursor-over-full-screen screen, "               ", 0/fg, color
 230 #?       draw-text-wrapping-right-then-down-from-cursor-over-full-screen screen, " ", 7/fg, 0/bg
 231 #?       draw-int32-hex-wrapping-right-then-down-from-cursor-over-full-screen screen, a, 7/fg, 0/bg
 232 #?       draw-text-wrapping-right-then-down-from-cursor-over-full-screen screen, " ", 7/fg, 0/bg
diff --git a/html/apps/ex1.mu.html b/html/apps/ex1.mu.html
index e03c946b..f78887e3 100644
--- a/html/apps/ex1.mu.html
+++ b/html/apps/ex1.mu.html
@@ -63,7 +63,7 @@ if ('onhashchange' in window) {
  7 #
  8 # Expected output: blank screen with no errors
  9 
-10 fn main screen: (addr screen), keyboard: (addr keyboard), data-disk: (addr disk) {
+10 fn main screen: (addr screen), keyboard: (addr keyboard), data-disk: (addr disk) {
 11   loop
 12 }
 
diff --git a/html/apps/ex10.mu.html b/html/apps/ex10.mu.html index 46ee2178..87b2fe5d 100644 --- a/html/apps/ex10.mu.html +++ b/html/apps/ex10.mu.html @@ -68,7 +68,7 @@ if ('onhashchange' in window) { 9 # Values between -256 and +255 as you move the mouse over the window. 10 # You might need to click on the window once. 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 # repeatedly print out mouse driver results if non-zero 14 $main:event-loop: { 15 var dx/eax: int <- copy 0 @@ -84,15 +84,15 @@ if ('onhashchange' in window) { 25 { 26 var dummy1/eax: int <- copy 0 27 var dummy2/ecx: int <- copy 0 -28 dummy1, dummy2 <- draw-text-wrapping-right-then-down-over-full-screen screen, " ", 0/x, 0x10/y, 0x31/fg, 0/bg +28 dummy1, dummy2 <- draw-text-wrapping-right-then-down-over-full-screen screen, " ", 0/x, 0x10/y, 0x31/fg, 0/bg 29 } 30 { 31 var dummy/ecx: int <- copy 0 -32 dx, dummy <- draw-int32-decimal-wrapping-right-then-down-over-full-screen screen, dx, 0/x, 0x10/y, 0x31/fg, 0/bg +32 dx, dummy <- draw-int32-decimal-wrapping-right-then-down-over-full-screen screen, dx, 0/x, 0x10/y, 0x31/fg, 0/bg 33 } 34 { 35 var dummy/eax: int <- copy 0 -36 dummy, dy <- draw-int32-decimal-wrapping-right-then-down-over-full-screen screen, dy, 5/x, 0x10/y, 0x31/fg, 0/bg +36 dummy, dy <- draw-int32-decimal-wrapping-right-then-down-over-full-screen screen, dy, 5/x, 0x10/y, 0x31/fg, 0/bg 37 } 38 loop 39 } 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 { diff --git a/html/apps/ex12.mu.html b/html/apps/ex12.mu.html index ddfd58e4..aa5d36e0 100644 --- a/html/apps/ex12.mu.html +++ b/html/apps/ex12.mu.html @@ -67,11 +67,11 @@ if ('onhashchange' in window) { 7 # 8 # Expected output: text with slowly updating colors 9 -10 fn main screen: (addr screen), keyboard: (addr keyboard), data-disk: (addr disk) { +10 fn main screen: (addr screen), keyboard: (addr keyboard), data-disk: (addr disk) { 11 var fg/ecx: int <- copy 0 12 var prev-timer-counter/edx: int <- copy 0 13 { -14 var dummy/eax: int <- draw-text-rightward screen, "hello from baremetal Mu!", 0x10/x, 0x400/xmax, 0x10/y, fg, 0/bg +14 var dummy/eax: int <- draw-text-rightward screen, "hello from baremetal Mu!", 0x10/x, 0x400/xmax, 0x10/y, fg, 0/bg 15 # wait for timer to bump 16 { 17 var curr-timer-counter/eax: int <- timer-counter diff --git a/html/apps/ex13.mu.html b/html/apps/ex13.mu.html index 9eb76a6c..6a8a9c48 100644 --- a/html/apps/ex13.mu.html +++ b/html/apps/ex13.mu.html @@ -68,11 +68,11 @@ if ('onhashchange' in window) { 8 # Run: 9 # $ qemu-system-i386 -hda code.img -hdb data.img 10 -11 fn main screen: (addr screen), keyboard: (addr keyboard), data-disk: (addr disk) { +11 fn main screen: (addr screen), keyboard: (addr keyboard), data-disk: (addr disk) { 12 var img-storage: image 13 var img/esi: (addr image) <- address img-storage 14 load-image img, data-disk -15 render-image screen, img, 0/x, 0/y, 0x300/width, 0x300/height +15 render-image screen, img, 0/x, 0/y, 0x300/width, 0x300/height 16 } 17 18 fn load-image self: (addr image), data-disk: (addr disk) { diff --git a/html/apps/ex14.mu.html b/html/apps/ex14.mu.html index 3c93e761..5dc12735 100644 --- a/html/apps/ex14.mu.html +++ b/html/apps/ex14.mu.html @@ -73,11 +73,11 @@ if ('onhashchange' in window) { 14 # 15 # Expected output: 'நட' in green near the top-left corner of screen 16 -17 fn main screen: (addr screen), keyboard: (addr keyboard), data-disk: (addr disk) { +17 fn main screen: (addr screen), keyboard: (addr keyboard), data-disk: (addr disk) { 18 var text-storage: (stream byte 0x200) 19 var text/esi: (addr stream byte) <- address text-storage 20 load-sectors data-disk, 0/lba, 1/num-sectors, text -21 var dummy/eax: int <- draw-stream-rightward screen, text, 0/x 0x80/xmax 0/y, 0xa/fg, 0/bg +21 var dummy/eax: int <- draw-stream-rightward screen, text, 0/x 0x80/xmax 0/y, 0xa/fg, 0/bg 22 }
diff --git a/html/apps/ex15.mu.html b/html/apps/ex15.mu.html index 838838b1..714fbff3 100644 --- a/html/apps/ex15.mu.html +++ b/html/apps/ex15.mu.html @@ -87,7 +87,7 @@ if ('onhashchange' in window) { 27 # Others? (Patches welcome.) I suspect Tibetan in particular will not work 28 # well with this approach. But I need native readers to assess quality. 29 - 30 fn main screen: (addr screen), keyboard: (addr keyboard), data-disk: (addr disk) { + 30 fn main screen: (addr screen), keyboard: (addr keyboard), data-disk: (addr disk) { 31 # at the top of screen, the accent is almost cropped 32 var dummy/eax: int <- draw-code-point-on-real-screen 0x61/a, 0/x 0/y, 3/fg 0/bg 33 var dummy/eax: int <- overlay-code-point-on-real-screen 0x0300/combining-grave-accent, 0/x 0/y, 3/fg 0/bg @@ -194,17 +194,17 @@ if ('onhashchange' in window) { 134 g <- to-grapheme 0x0903/devanagari-visarga 135 write-grapheme text, g 136 # render everything -137 set-cursor-position screen, 4/x 0xe/y -138 draw-stream-wrapping-right-then-down-from-cursor-over-full-screen screen, text, 3/fg 0/bg +137 set-cursor-position screen, 4/x 0xe/y +138 draw-stream-wrapping-right-then-down-from-cursor-over-full-screen screen, text, 3/fg 0/bg 139 140 # a stream of tamil graphemes (with interspersed spaces for clarity) that don't look the same in Mu -141 set-cursor-position 0, 4/x 0x12/y +141 set-cursor-position 0, 4/x 0x12/y 142 draw-text-wrapping-right-then-down-from-cursor-over-full-screen 0, "எ ஃ கு ", 3/fg 0/bg -143 set-cursor-position 0, 4/x 0x13/y +143 set-cursor-position 0, 4/x 0x13/y 144 draw-text-wrapping-right-then-down-from-cursor-over-full-screen 0, "அ ன் று ", 3/fg 0/bg -145 set-cursor-position 0, 4/x 0x14/y +145 set-cursor-position 0, 4/x 0x14/y 146 draw-text-wrapping-right-then-down-from-cursor-over-full-screen 0, "அ தா வ து " , 3/fg 0/bg -147 set-cursor-position 0, 4/x 0x15/y +147 set-cursor-position 0, 4/x 0x15/y 148 draw-text-wrapping-right-then-down-from-cursor-over-full-screen 0, "அ ஃ தா ன் று ", 3/fg 0/bg 149 } diff --git a/html/apps/ex2.mu.html b/html/apps/ex2.mu.html index a8b5b427..43b210c1 100644 --- a/html/apps/ex2.mu.html +++ b/html/apps/ex2.mu.html @@ -65,7 +65,7 @@ if ('onhashchange' in window) { 5 # To run: 6 # qemu-system-i386 code.img 7 - 8 fn main screen: (addr screen), keyboard: (addr keyboard), data-disk: (addr disk) { + 8 fn main screen: (addr screen), keyboard: (addr keyboard), data-disk: (addr disk) { 9 var y/eax: int <- copy 0 10 { 11 compare y, 0x300/screen-height=768 @@ -76,7 +76,7 @@ if ('onhashchange' in window) { 16 break-if->= 17 var color/ecx: int <- copy x 18 color <- and 0xff -19 pixel screen x, y, color +19 pixel screen x, y, color 20 x <- increment 21 loop 22 } diff --git a/html/apps/ex3.mu.html b/html/apps/ex3.mu.html index 60a92bc8..e11ddb08 100644 --- a/html/apps/ex3.mu.html +++ b/html/apps/ex3.mu.html @@ -69,7 +69,7 @@ if ('onhashchange' in window) { 9 # Expected output: a new green pixel starting from the top left corner of the 10 # screen every time you press a key (letter or digit) 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 x/ecx: int <- copy 0 14 var y/edx: int <- copy 0 15 { diff --git a/html/apps/ex4.mu.html b/html/apps/ex4.mu.html index 93affdd9..1efa09d3 100644 --- a/html/apps/ex4.mu.html +++ b/html/apps/ex4.mu.html @@ -66,8 +66,8 @@ if ('onhashchange' in window) { 7 # 8 # Expected output: letter 'A' in green near the top-left corner of screen 9 -10 fn main screen: (addr screen), keyboard: (addr keyboard), data-disk: (addr disk) { -11 var dummy/eax: int <- draw-code-point screen, 0x41/A, 2/row, 1/col, 0xa/fg, 0/bg +10 fn main screen: (addr screen), keyboard: (addr keyboard), data-disk: (addr disk) { +11 var dummy/eax: int <- draw-code-point screen, 0x41/A, 2/row, 1/col, 0xa/fg, 0/bg 12 # wide glyph 13 #? var dummy/eax: int <- draw-code-point screen, 0x1b/esc, 2/row, 1/col, 0xa/fg, 0/bg 14 } diff --git a/html/apps/ex5.mu.html b/html/apps/ex5.mu.html index 539b2bf8..1671193c 100644 --- a/html/apps/ex5.mu.html +++ b/html/apps/ex5.mu.html @@ -66,9 +66,9 @@ if ('onhashchange' in window) { 8 # 9 # Expected output: text in green near the top-left corner of screen 10 -11 fn main screen: (addr screen), keyboard: (addr keyboard), data-disk: (addr disk) { -12 var dummy/eax: int <- draw-text-rightward screen, "hello from baremetal Mu!", 0x10/x, 0x400/xmax, 0x10/y, 0xa/fg, 0/bg -13 dummy <- draw-text-rightward screen, "you shouldn't see this", 0x10/x, 0xa0/xmax, 0x30/y, 3/fg, 0/bg # xmax is too narrow +11 fn main screen: (addr screen), keyboard: (addr keyboard), data-disk: (addr disk) { +12 var dummy/eax: int <- draw-text-rightward screen, "hello from baremetal Mu!", 0x10/x, 0x400/xmax, 0x10/y, 0xa/fg, 0/bg +13 dummy <- draw-text-rightward screen, "you shouldn't see this", 0x10/x, 0xa0/xmax, 0x30/y, 3/fg, 0/bg # xmax is too narrow 14 } diff --git a/html/apps/ex6.mu.html b/html/apps/ex6.mu.html index 91fe110e..a5112540 100644 --- a/html/apps/ex6.mu.html +++ b/html/apps/ex6.mu.html @@ -66,26 +66,26 @@ if ('onhashchange' in window) { 7 # 8 # Expected output: a box and text that doesn't overflow it 9 -10 fn main screen: (addr screen), keyboard: (addr keyboard), data-disk: (addr disk) { +10 fn main screen: (addr screen), keyboard: (addr keyboard), data-disk: (addr disk) { 11 # drawing text within a bounding box 12 draw-box-on-real-screen 0xf, 0x1f, 0x79, 0x51, 0x4 13 var x/eax: int <- copy 0x20 14 var y/ecx: int <- copy 0x20 -15 x, y <- draw-text-wrapping-right-then-down screen, "hello ", 0x10/xmin, 0x20/ymin, 0x78/xmax, 0x50/ymax, x, y, 0xa/fg, 0/bg -16 x, y <- draw-text-wrapping-right-then-down screen, "from ", 0x10/xmin, 0x20/ymin, 0x78/xmax, 0x50/ymax, x, y, 0xa/fg, 0/bg -17 x, y <- draw-text-wrapping-right-then-down screen, "baremetal ", 0x10/xmin, 0x20/ymin, 0x78/xmax, 0x50/ymax, x, y, 0xa/fg, 0/bg -18 x, y <- draw-text-wrapping-right-then-down screen, "Mu!", 0x10/xmin, 0x20/ymin, 0x78/xmax, 0x50/ymax, x, y, 0xa/fg, 0/bg +15 x, y <- draw-text-wrapping-right-then-down screen, "hello ", 0x10/xmin, 0x20/ymin, 0x78/xmax, 0x50/ymax, x, y, 0xa/fg, 0/bg +16 x, y <- draw-text-wrapping-right-then-down screen, "from ", 0x10/xmin, 0x20/ymin, 0x78/xmax, 0x50/ymax, x, y, 0xa/fg, 0/bg +17 x, y <- draw-text-wrapping-right-then-down screen, "baremetal ", 0x10/xmin, 0x20/ymin, 0x78/xmax, 0x50/ymax, x, y, 0xa/fg, 0/bg +18 x, y <- draw-text-wrapping-right-then-down screen, "Mu!", 0x10/xmin, 0x20/ymin, 0x78/xmax, 0x50/ymax, x, y, 0xa/fg, 0/bg 19 20 # drawing at the cursor in multiple directions -21 draw-text-wrapping-down-then-right-from-cursor-over-full-screen screen, "abc", 0xa/fg, 0/bg -22 draw-text-wrapping-right-then-down-from-cursor-over-full-screen screen, "def", 0xa/fg, 0/bg +21 draw-text-wrapping-down-then-right-from-cursor-over-full-screen screen, "abc", 0xa/fg, 0/bg +22 draw-text-wrapping-right-then-down-from-cursor-over-full-screen screen, "def", 0xa/fg, 0/bg 23 24 # test drawing near the edge -25 x <- draw-text-rightward screen, "R", 0x7f/x, 0x80/xmax=screen-width, 0x18/y, 0xa/fg, 0/bg -26 draw-text-wrapping-right-then-down-from-cursor-over-full-screen screen, "wrapped from R", 0xa/fg, 0/bg +25 x <- draw-text-rightward screen, "R", 0x7f/x, 0x80/xmax=screen-width, 0x18/y, 0xa/fg, 0/bg +26 draw-text-wrapping-right-then-down-from-cursor-over-full-screen screen, "wrapped from R", 0xa/fg, 0/bg 27 -28 x <- draw-text-downward screen, "D", 0x20/x, 0x2f/y, 0x30/ymax=screen-height, 0xa/fg, 0/bg -29 draw-text-wrapping-down-then-right-from-cursor-over-full-screen screen, "wrapped from D", 0xa/fg, 0/bg +28 x <- draw-text-downward screen, "D", 0x20/x, 0x2f/y, 0x30/ymax=screen-height, 0xa/fg, 0/bg +29 draw-text-wrapping-down-then-right-from-cursor-over-full-screen screen, "wrapped from D", 0xa/fg, 0/bg 30 } diff --git a/html/apps/ex7.mu.html b/html/apps/ex7.mu.html index 50d9d4b5..ebc5a800 100644 --- a/html/apps/ex7.mu.html +++ b/html/apps/ex7.mu.html @@ -66,34 +66,34 @@ if ('onhashchange' in window) { 8 # Expected output: an interactive game a bit like "snakes". Try pressing h, j, 9 # k, l. 10 -11 fn main screen: (addr screen), keyboard: (addr keyboard), data-disk: (addr disk) { -12 set-cursor-position screen, 0, 0 +11 fn main screen: (addr screen), keyboard: (addr keyboard), data-disk: (addr disk) { +12 set-cursor-position screen, 0, 0 13 { -14 draw-cursor screen, 0x20/space +14 draw-cursor screen, 0x20/space 15 var key/eax: byte <- read-key keyboard 16 { 17 compare key, 0x80/left-arrow 18 break-if-!= -19 draw-code-point-at-cursor screen, 0x2d/dash, 0x31/fg, 0/bg +19 draw-code-point-at-cursor screen, 0x2d/dash, 0x31/fg, 0/bg 20 move-cursor-left 0 21 } 22 { 23 compare key, 0x81/down-arrow 24 break-if-!= -25 draw-code-point-at-cursor screen, 0x7c/vertical-bar, 0x31/fg, 0/bg +25 draw-code-point-at-cursor screen, 0x7c/vertical-bar, 0x31/fg, 0/bg 26 move-cursor-down 0 27 } 28 { 29 compare key, 0x82/up-arrow 30 break-if-!= -31 draw-code-point-at-cursor screen, 0x7c/vertical-bar, 0x31/fg, 0/bg +31 draw-code-point-at-cursor screen, 0x7c/vertical-bar, 0x31/fg, 0/bg 32 move-cursor-up 0 33 } 34 { 35 compare key, 0x83/right-arrow 36 break-if-!= 37 var g/eax: code-point <- copy 0x2d/dash -38 draw-code-point-at-cursor screen, 0x2d/dash, 0x31/fg, 0/bg +38 draw-code-point-at-cursor screen, 0x2d/dash, 0x31/fg, 0/bg 39 move-cursor-right 0 40 } 41 loop diff --git a/html/apps/ex8.mu.html b/html/apps/ex8.mu.html index d27adafd..db2e5f38 100644 --- a/html/apps/ex8.mu.html +++ b/html/apps/ex8.mu.html @@ -64,7 +64,7 @@ if ('onhashchange' in window) { 6 # qemu-system-i386 code.img 7 # You shouldn't see any exceptions. 8 - 9 fn main screen: (addr screen), keyboard: (addr keyboard), data-disk: (addr disk) { + 9 fn main screen: (addr screen), keyboard: (addr keyboard), data-disk: (addr disk) { 10 var n/eax: int <- copy 0 11 var result/xmm0: float <- convert n 12 } diff --git a/html/apps/ex9.mu.html b/html/apps/ex9.mu.html index 88eecf70..d5d08e67 100644 --- a/html/apps/ex9.mu.html +++ b/html/apps/ex9.mu.html @@ -74,7 +74,7 @@ if ('onhashchange' in window) { 14 # 6. Notice that the data disk now contains the word count of the original text. 15 # xxd data.img |head 16 -17 fn main screen: (addr screen), keyboard: (addr keyboard), data-disk: (addr disk) { +17 fn main screen: (addr screen), keyboard: (addr keyboard), data-disk: (addr disk) { 18 var text-storage: (stream byte 0x200) 19 var text/esi: (addr stream byte) <- address text-storage 20 load-sectors data-disk, 0/lba, 1/num-sectors, text diff --git a/html/apps/hest-life.mu.html b/html/apps/hest-life.mu.html index c98137d4..451bb147 100644 --- a/html/apps/hest-life.mu.html +++ b/html/apps/hest-life.mu.html @@ -84,16 +84,16 @@ if ('onhashchange' in window) { 20 # +: zoom in 21 # -: zoom out 22 - 23 fn main screen: (addr screen), keyboard: (addr keyboard), data-disk: (addr disk) { + 23 fn main screen: (addr screen), keyboard: (addr keyboard), data-disk: (addr disk) { 24 var env-storage: environment 25 var env/esi: (addr environment) <- address env-storage 26 initialize-environment env - 27 var second-buffer: screen - 28 var second-screen/edi: (addr screen) <- address second-buffer - 29 initialize-screen second-screen, 0x80, 0x30, 1/include-pixels + 27 var second-buffer: screen + 28 var second-screen/edi: (addr screen) <- address second-buffer + 29 initialize-screen second-screen, 0x80, 0x30, 1/include-pixels 30 render second-screen, env 31 convert-graphemes-to-pixels second-screen - 32 copy-pixels second-screen, screen + 32 copy-pixels second-screen, screen 33 { 34 edit keyboard, env 35 var play?/eax: (addr boolean) <- get env, play? @@ -101,10 +101,10 @@ if ('onhashchange' in window) { 37 { 38 break-if-= 39 step env - 40 clear-screen second-screen + 40 clear-screen second-screen 41 render second-screen, env 42 convert-graphemes-to-pixels second-screen - 43 copy-pixels second-screen, screen + 43 copy-pixels second-screen, screen 44 } 45 linger 46 loop @@ -124,99 +124,99 @@ if ('onhashchange' in window) { 60 next: boolean 61 } 62 - 63 fn render screen: (addr screen), _self: (addr environment) { + 63 fn render screen: (addr screen), _self: (addr environment) { 64 var self/esi: (addr environment) <- copy _self 65 var zoom/eax: (addr int) <- get self, zoom 66 compare *zoom, 0 67 { 68 break-if-!= - 69 clear-screen screen - 70 render0 screen, self + 69 clear-screen screen + 70 render0 screen, self 71 } 72 compare *zoom, 1 73 { 74 break-if-!= - 75 clear-screen screen - 76 render1 screen, self + 75 clear-screen screen + 76 render1 screen, self 77 } 78 compare *zoom, 4 79 { 80 break-if-!= - 81 render4 screen, self + 81 render4 screen, self 82 } 83 # clock 84 var tick-a/eax: (addr int) <- get self, tick - 85 set-cursor-position screen, 0x78/x, 0/y - 86 draw-int32-decimal-wrapping-right-then-down-from-cursor-over-full-screen screen, *tick-a, 7/fg 0/bg + 85 set-cursor-position screen, 0x78/x, 0/y + 86 draw-int32-decimal-wrapping-right-then-down-from-cursor-over-full-screen screen, *tick-a, 7/fg 0/bg 87 } 88 89 # Lots of hardcoded constants for now. 90 # TODO: split this up into a primitive to render a single cell and its 91 # incoming edges (but not the neighboring nodes they emanate from) - 92 fn render0 screen: (addr screen), _self: (addr environment) { + 92 fn render0 screen: (addr screen), _self: (addr environment) { 93 var self/esi: (addr environment) <- copy _self 94 # cell border - 95 draw-vertical-line screen, 0xc0/x, 0/ymin, 0x300/ymax, 0x16/color=dark-grey - 96 draw-vertical-line screen, 0x340/x, 0/ymin, 0x300/ymax, 0x16/color=dark-grey - 97 draw-horizontal-line screen, 0x40/y, 0/xmin, 0x400/xmax, 0x16/color=dark-grey - 98 draw-horizontal-line screen, 0x2c0/y, 0/xmin, 0x400/xmax, 0x16/color=dark-grey + 95 draw-vertical-line screen, 0xc0/x, 0/ymin, 0x300/ymax, 0x16/color=dark-grey + 96 draw-vertical-line screen, 0x340/x, 0/ymin, 0x300/ymax, 0x16/color=dark-grey + 97 draw-horizontal-line screen, 0x40/y, 0/xmin, 0x400/xmax, 0x16/color=dark-grey + 98 draw-horizontal-line screen, 0x2c0/y, 0/xmin, 0x400/xmax, 0x16/color=dark-grey 99 # neighboring inputs, corners 100 var color/eax: int <- state-color self, 0x7f/cur-topleftx, 0x5f/cur-toplefty - 101 draw-rect screen, 0x90/xmin 0x10/ymin, 0xb0/xmax 0x30/ymax, color + 101 draw-rect screen, 0x90/xmin 0x10/ymin, 0xb0/xmax 0x30/ymax, color 102 color <- state-color self, 0x81/cur-toprightx, 0x5f/cur-toprighty - 103 draw-rect screen, 0x350/xmin 0x10/ymin, 0x370/xmax 0x30/ymax, color + 103 draw-rect screen, 0x350/xmin 0x10/ymin, 0x370/xmax 0x30/ymax, color 104 color <- state-color self, 0x7f/cur-botleftx, 0x61/cur-botlefty - 105 draw-rect screen, 0x90/xmin 0x2d0/ymin, 0xb0/xmax 0x2f0/ymax, color + 105 draw-rect screen, 0x90/xmin 0x2d0/ymin, 0xb0/xmax 0x2f0/ymax, color 106 color <- state-color self, 0x81/cur-botrightx, 0x61/cur-botrighty - 107 draw-rect screen, 0x350/xmin 0x2d0/ymin, 0x370/xmax 0x2f0/ymax, color + 107 draw-rect screen, 0x350/xmin 0x2d0/ymin, 0x370/xmax 0x2f0/ymax, color 108 # neighboring inputs, edges 109 color <- state-color self, 0x80/cur-topx, 0x5f/cur-topy - 110 draw-rect screen, 0x1f0/xmin 0x10/ymin, 0x210/xmax 0x30/ymax, color + 110 draw-rect screen, 0x1f0/xmin 0x10/ymin, 0x210/xmax 0x30/ymax, color 111 color <- state-color self, 0x7f/cur-leftx, 0x60/cur-lefty - 112 draw-rect screen, 0x90/xmin 0x170/ymin, 0xb0/xmax 0x190/ymax, color + 112 draw-rect screen, 0x90/xmin 0x170/ymin, 0xb0/xmax 0x190/ymax, color 113 color <- state-color self, 0x80/cur-botx, 0x61/cur-boty - 114 draw-rect screen, 0x1f0/xmin 0x2d0/ymin, 0x210/xmax 0x2f0/ymax, color + 114 draw-rect screen, 0x1f0/xmin 0x2d0/ymin, 0x210/xmax 0x2f0/ymax, color 115 color <- state-color self, 0x81/cur-rightx, 0x60/cur-righty - 116 draw-rect screen, 0x350/xmin 0x170/ymin, 0x370/xmax 0x190/ymax, color + 116 draw-rect screen, 0x350/xmin 0x170/ymin, 0x370/xmax 0x190/ymax, color 117 # sum node - 118 draw-rect screen, 0x170/xsmin 0x140/ysmin, 0x190/xsmax 0x160/ysmax, 0x40/color - 119 set-cursor-position screen, 0x2d/scol, 0x13/srow - 120 draw-text-wrapping-right-then-down-from-cursor-over-full-screen screen, "+", 0xf/color, 0/bg + 118 draw-rect screen, 0x170/xsmin 0x140/ysmin, 0x190/xsmax 0x160/ysmax, 0x40/color + 119 set-cursor-position screen, 0x2d/scol, 0x13/srow + 120 draw-text-wrapping-right-then-down-from-cursor-over-full-screen screen, "+", 0xf/color, 0/bg 121 # conveyors from neighboring inputs to sum node - 122 draw-monotonic-bezier screen, 0xa0/x0 0x20/y0, 0x100/x1 0x150/ys, 0x180/xs 0x150/ys, 4/color - 123 draw-monotonic-bezier screen, 0xa0/x0 0x180/y0, 0xc0/x1 0x150/ys, 0x180/xs 0x150/ys, 4/color - 124 draw-monotonic-bezier screen, 0xa0/x0 0x2e0/y0, 0x100/x1 0x150/ys, 0x180/xs 0x150/ys, 4/color - 125 draw-monotonic-bezier screen, 0x200/x0 0x20/y0, 0x180/x1 0x90/y1, 0x180/xs 0x150/ys, 4/color - 126 draw-monotonic-bezier screen, 0x200/x0 0x2e0/y0, 0x180/x1 0x200/y1, 0x180/xs 0x150/ys, 4/color - 127 draw-monotonic-bezier screen, 0x360/x0 0x20/y0, 0x180/x1 0xc0/y1, 0x180/xs 0x150/ys, 4/color - 128 draw-monotonic-bezier screen, 0x360/x0 0x180/y0, 0x35c/x1 0x150/ys, 0x180/xs 0x150/ys, 4/color - 129 draw-monotonic-bezier screen, 0x360/x0 0x2e0/y0, 0x180/x1 0x200/y1, 0x180/xs 0x150/ys, 4/color + 122 draw-monotonic-bezier screen, 0xa0/x0 0x20/y0, 0x100/x1 0x150/ys, 0x180/xs 0x150/ys, 4/color + 123 draw-monotonic-bezier screen, 0xa0/x0 0x180/y0, 0xc0/x1 0x150/ys, 0x180/xs 0x150/ys, 4/color + 124 draw-monotonic-bezier screen, 0xa0/x0 0x2e0/y0, 0x100/x1 0x150/ys, 0x180/xs 0x150/ys, 4/color + 125 draw-monotonic-bezier screen, 0x200/x0 0x20/y0, 0x180/x1 0x90/y1, 0x180/xs 0x150/ys, 4/color + 126 draw-monotonic-bezier screen, 0x200/x0 0x2e0/y0, 0x180/x1 0x200/y1, 0x180/xs 0x150/ys, 4/color + 127 draw-monotonic-bezier screen, 0x360/x0 0x20/y0, 0x180/x1 0xc0/y1, 0x180/xs 0x150/ys, 4/color + 128 draw-monotonic-bezier screen, 0x360/x0 0x180/y0, 0x35c/x1 0x150/ys, 0x180/xs 0x150/ys, 4/color + 129 draw-monotonic-bezier screen, 0x360/x0 0x2e0/y0, 0x180/x1 0x200/y1, 0x180/xs 0x150/ys, 4/color 130 # filter node - 131 draw-rect screen, 0x200/xfmin 0x1c0/yfmin, 0x220/xfmax 0x1e0/yfmax, 0x31/color - 132 set-cursor-position screen, 0x40/fcol, 0x1b/frow - 133 draw-text-wrapping-right-then-down-from-cursor-over-full-screen screen, "?", 0xf/color, 0/bg + 131 draw-rect screen, 0x200/xfmin 0x1c0/yfmin, 0x220/xfmax 0x1e0/yfmax, 0x31/color + 132 set-cursor-position screen, 0x40/fcol, 0x1b/frow + 133 draw-text-wrapping-right-then-down-from-cursor-over-full-screen screen, "?", 0xf/color, 0/bg 134 # conveyor from sum node to filter node - 135 draw-line screen 0x180/xs, 0x150/ys, 0x210/xf, 0x1d0/yf, 0xa2/color + 135 draw-line screen 0x180/xs, 0x150/ys, 0x210/xf, 0x1d0/yf, 0xa2/color 136 # cell outputs at corners 137 var color/eax: int <- state-color self, 0x80/curx, 0x60/cury - 138 draw-rect screen, 0xd0/xmin 0x50/ymin, 0xf0/xmax 0x70/ymax, color - 139 draw-rect screen, 0x310/xmin 0x50/ymin, 0x330/xmax 0x70/ymax, color - 140 draw-rect screen, 0xd0/xmin 0x290/ymin, 0xf0/xmax 0x2b0/ymax, color - 141 draw-rect screen, 0x310/xmin 0x290/ymin, 0x330/xmax 0x2b0/ymax, color + 138 draw-rect screen, 0xd0/xmin 0x50/ymin, 0xf0/xmax 0x70/ymax, color + 139 draw-rect screen, 0x310/xmin 0x50/ymin, 0x330/xmax 0x70/ymax, color + 140 draw-rect screen, 0xd0/xmin 0x290/ymin, 0xf0/xmax 0x2b0/ymax, color + 141 draw-rect screen, 0x310/xmin 0x290/ymin, 0x330/xmax 0x2b0/ymax, color 142 # cell outputs at edges - 143 draw-rect screen, 0x1f0/xmin 0x50/ymin, 0x210/xmax 0x70/ymax, color - 144 draw-rect screen, 0xd0/xmin 0x170/ymin, 0xf0/xmax 0x190/ymax, color - 145 draw-rect screen, 0x1f0/xmin 0x290/ymin, 0x210/xmax 0x2b0/ymax, color - 146 draw-rect screen, 0x310/xmin 0x170/ymin, 0x330/xmax 0x190/ymax, color + 143 draw-rect screen, 0x1f0/xmin 0x50/ymin, 0x210/xmax 0x70/ymax, color + 144 draw-rect screen, 0xd0/xmin 0x170/ymin, 0xf0/xmax 0x190/ymax, color + 145 draw-rect screen, 0x1f0/xmin 0x290/ymin, 0x210/xmax 0x2b0/ymax, color + 146 draw-rect screen, 0x310/xmin 0x170/ymin, 0x330/xmax 0x190/ymax, color 147 # conveyors from filter to outputs - 148 draw-monotonic-bezier screen, 0x210/xf 0x1d0/yf, 0x1c0/x1 0x60/y1, 0xe0/x2 0x60/y2, 0x2a/color - 149 draw-monotonic-bezier screen, 0x210/xf 0x1d0/yf, 0xe0/x1 0x1c0/y1, 0xe0/x2 0x180/y2, 0x2a/color - 150 draw-monotonic-bezier screen, 0x210/xf 0x1d0/yf, 0x1c0/x1 0x2a0/y1, 0xe0/x2 0x2a0/y2, 0x2a/color - 151 draw-monotonic-bezier screen, 0x210/xf 0x1d0/yf, 0x210/x1 0x60/y1, 0x200/x2 0x60/y2, 0x2a/color - 152 draw-monotonic-bezier screen, 0x210/xf 0x1d0/yf, 0x210/x1 0x230/y1, 0x200/x2 0x2a0/y2, 0x2a/color - 153 draw-monotonic-bezier screen, 0x210/xf 0x1d0/yf, 0x320/x1 0x120/y1, 0x320/x2 0x60/y2, 0x2a/color - 154 draw-monotonic-bezier screen, 0x210/xf 0x1d0/yf, 0x320/x1 0x1c0/y1 0x320/x2 0x180/y2, 0x2a/color - 155 draw-monotonic-bezier screen, 0x210/xf 0x1d0/yf, 0x320/x1 0x230/y1, 0x320/x2 0x2a0/y2, 0x2a/color + 148 draw-monotonic-bezier screen, 0x210/xf 0x1d0/yf, 0x1c0/x1 0x60/y1, 0xe0/x2 0x60/y2, 0x2a/color + 149 draw-monotonic-bezier screen, 0x210/xf 0x1d0/yf, 0xe0/x1 0x1c0/y1, 0xe0/x2 0x180/y2, 0x2a/color + 150 draw-monotonic-bezier screen, 0x210/xf 0x1d0/yf, 0x1c0/x1 0x2a0/y1, 0xe0/x2 0x2a0/y2, 0x2a/color + 151 draw-monotonic-bezier screen, 0x210/xf 0x1d0/yf, 0x210/x1 0x60/y1, 0x200/x2 0x60/y2, 0x2a/color + 152 draw-monotonic-bezier screen, 0x210/xf 0x1d0/yf, 0x210/x1 0x230/y1, 0x200/x2 0x2a0/y2, 0x2a/color + 153 draw-monotonic-bezier screen, 0x210/xf 0x1d0/yf, 0x320/x1 0x120/y1, 0x320/x2 0x60/y2, 0x2a/color + 154 draw-monotonic-bezier screen, 0x210/xf 0x1d0/yf, 0x320/x1 0x1c0/y1 0x320/x2 0x180/y2, 0x2a/color + 155 draw-monotonic-bezier screen, 0x210/xf 0x1d0/yf, 0x320/x1 0x230/y1, 0x320/x2 0x2a0/y2, 0x2a/color 156 # time-variant portion: 16 repeating steps 157 var tick-a/eax: (addr int) <- get self, tick 158 var progress/eax: int <- copy *tick-a @@ -230,14 +230,14 @@ if ('onhashchange' in window) { 166 var six-f/xmm0: float <- convert six 167 u <- divide six-f 168 # points on conveyors from neighboring cells - 169 draw-bezier-point screen, u, 0xa0/x0 0x20/y0, 0x100/x1 0x150/ys, 0x180/xs 0x150/ys, 7/color, 4/radius - 170 draw-bezier-point screen, u, 0xa0/x0 0x180/y0, 0xc0/x1 0x150/ys, 0x180/xs 0x150/ys, 7/color, 4/radius - 171 draw-bezier-point screen, u, 0xa0/x0 0x2e0/y0, 0x100/x1 0x150/ys, 0x180/xs 0x150/ys, 7/color, 4/radius - 172 draw-bezier-point screen, u, 0x200/x0 0x20/y0, 0x180/x1 0x90/y1, 0x180/xs 0x150/ys, 7/color, 4/radius - 173 draw-bezier-point screen, u, 0x200/x0 0x2e0/y0, 0x180/x1 0x200/y1, 0x180/xs 0x150/ys, 7/color, 4/radius - 174 draw-bezier-point screen, u, 0x360/x0 0x20/y0, 0x180/x1 0xc0/y1, 0x180/xs 0x150/ys, 7/color, 4/radius - 175 draw-bezier-point screen, u, 0x360/x0 0x180/y0, 0x35c/x1 0x150/ys, 0x180/xs 0x150/ys, 7/color, 4/radius - 176 draw-bezier-point screen, u, 0x360/x0 0x2e0/y0, 0x180/x1 0x200/y1, 0x180/xs 0x150/ys, 7/color, 4/radius + 169 draw-bezier-point screen, u, 0xa0/x0 0x20/y0, 0x100/x1 0x150/ys, 0x180/xs 0x150/ys, 7/color, 4/radius + 170 draw-bezier-point screen, u, 0xa0/x0 0x180/y0, 0xc0/x1 0x150/ys, 0x180/xs 0x150/ys, 7/color, 4/radius + 171 draw-bezier-point screen, u, 0xa0/x0 0x2e0/y0, 0x100/x1 0x150/ys, 0x180/xs 0x150/ys, 7/color, 4/radius + 172 draw-bezier-point screen, u, 0x200/x0 0x20/y0, 0x180/x1 0x90/y1, 0x180/xs 0x150/ys, 7/color, 4/radius + 173 draw-bezier-point screen, u, 0x200/x0 0x2e0/y0, 0x180/x1 0x200/y1, 0x180/xs 0x150/ys, 7/color, 4/radius + 174 draw-bezier-point screen, u, 0x360/x0 0x20/y0, 0x180/x1 0xc0/y1, 0x180/xs 0x150/ys, 7/color, 4/radius + 175 draw-bezier-point screen, u, 0x360/x0 0x180/y0, 0x35c/x1 0x150/ys, 0x180/xs 0x150/ys, 7/color, 4/radius + 176 draw-bezier-point screen, u, 0x360/x0 0x2e0/y0, 0x180/x1 0x200/y1, 0x180/xs 0x150/ys, 7/color, 4/radius 177 return 178 } 179 # two time steps for getting count to filter @@ -250,10 +250,10 @@ if ('onhashchange' in window) { 186 var three/eax: int <- copy 3 187 var three-f/xmm0: float <- convert three 188 u <- divide three-f - 189 draw-linear-point screen, u, 0x180/xs, 0x150/ys, 0x210/xf, 0x1d0/yf, 7/color, 4/radius - 190 set-cursor-position screen, 0x3a/scol, 0x18/srow + 189 draw-linear-point screen, u, 0x180/xs, 0x150/ys, 0x210/xf, 0x1d0/yf, 7/color, 4/radius + 190 set-cursor-position screen, 0x3a/scol, 0x18/srow 191 var n/eax: int <- num-live-neighbors self, 0x80/curx, 0x60/cury - 192 draw-int32-decimal-wrapping-right-then-down-from-cursor-over-full-screen screen, n, 0xf/fg 0/bg + 192 draw-int32-decimal-wrapping-right-then-down-from-cursor-over-full-screen screen, n, 0xf/fg 0/bg 193 return 194 } 195 # final 7 time steps for updating output @@ -263,141 +263,141 @@ if ('onhashchange' in window) { 199 var six/eax: int <- copy 6 200 var six-f/xmm0: float <- convert six 201 u <- divide six-f - 202 draw-bezier-point screen, u, 0x210/xf 0x1d0/yf, 0x1c0/x1 0x60/y1, 0xe0/x2 0x60/y2, 7/color, 4/radius - 203 draw-bezier-point screen, u, 0x210/xf 0x1d0/yf, 0xe0/x1 0x1c0/y1, 0xe0/x2 0x180/y2, 7/color, 4/radius - 204 draw-bezier-point screen, u, 0x210/xf 0x1d0/yf, 0x1c0/x1 0x2a0/y1, 0xe0/x2 0x2a0/y2, 7/color, 4/radius - 205 draw-bezier-point screen, u, 0x210/xf 0x1d0/yf, 0x210/xf 0x60/y1, 0x200/x2 0x60/y2, 7/color, 4/radius - 206 draw-bezier-point screen, u, 0x210/xf 0x1d0/yf, 0x210/xf 0x230/y1, 0x200/x2 0x2a0/y2, 7/color, 4/radius - 207 draw-bezier-point screen, u, 0x210/xf 0x1d0/yf, 0x320/x1 0x120/y1, 0x320/x2 0x60/y2, 7/color, 4/radius - 208 draw-bezier-point screen, u, 0x210/xf 0x1d0/yf, 0x320/x1 0x1c0/y1, 0x320/x2 0x180/y2, 7/color, 4/radius - 209 draw-bezier-point screen, u, 0x210/xf 0x1d0/yf, 0x320/x1 0x230/y1, 0x320/x2 0x2a0/y2, 7/color, 4/radius + 202 draw-bezier-point screen, u, 0x210/xf 0x1d0/yf, 0x1c0/x1 0x60/y1, 0xe0/x2 0x60/y2, 7/color, 4/radius + 203 draw-bezier-point screen, u, 0x210/xf 0x1d0/yf, 0xe0/x1 0x1c0/y1, 0xe0/x2 0x180/y2, 7/color, 4/radius + 204 draw-bezier-point screen, u, 0x210/xf 0x1d0/yf, 0x1c0/x1 0x2a0/y1, 0xe0/x2 0x2a0/y2, 7/color, 4/radius + 205 draw-bezier-point screen, u, 0x210/xf 0x1d0/yf, 0x210/xf 0x60/y1, 0x200/x2 0x60/y2, 7/color, 4/radius + 206 draw-bezier-point screen, u, 0x210/xf 0x1d0/yf, 0x210/xf 0x230/y1, 0x200/x2 0x2a0/y2, 7/color, 4/radius + 207 draw-bezier-point screen, u, 0x210/xf 0x1d0/yf, 0x320/x1 0x120/y1, 0x320/x2 0x60/y2, 7/color, 4/radius + 208 draw-bezier-point screen, u, 0x210/xf 0x1d0/yf, 0x320/x1 0x1c0/y1, 0x320/x2 0x180/y2, 7/color, 4/radius + 209 draw-bezier-point screen, u, 0x210/xf 0x1d0/yf, 0x320/x1 0x230/y1, 0x320/x2 0x2a0/y2, 7/color, 4/radius 210 } 211 - 212 fn render1 screen: (addr screen), _self: (addr environment) { + 212 fn render1 screen: (addr screen), _self: (addr environment) { 213 var self/esi: (addr environment) <- copy _self 214 # cell borders - 215 draw-vertical-line screen, 0xe0/x, 0/ymin, 0x300/ymax, 0x16/color=dark-grey - 216 draw-vertical-line screen, 0x200/x, 0/ymin, 0x300/ymax, 0x16/color=dark-grey - 217 draw-vertical-line screen, 0x320/x, 0/ymin, 0x300/ymax, 0x16/color=dark-grey - 218 draw-horizontal-line screen, 0x60/y, 0/xmin, 0x400/xmax, 0x16/color=dark-grey - 219 draw-horizontal-line screen, 0x180/y, 0/xmin, 0x400/xmax, 0x16/color=dark-grey - 220 draw-horizontal-line screen, 0x2a0/y, 0/xmin, 0x400/xmax, 0x16/color=dark-grey + 215 draw-vertical-line screen, 0xe0/x, 0/ymin, 0x300/ymax, 0x16/color=dark-grey + 216 draw-vertical-line screen, 0x200/x, 0/ymin, 0x300/ymax, 0x16/color=dark-grey + 217 draw-vertical-line screen, 0x320/x, 0/ymin, 0x300/ymax, 0x16/color=dark-grey + 218 draw-horizontal-line screen, 0x60/y, 0/xmin, 0x400/xmax, 0x16/color=dark-grey + 219 draw-horizontal-line screen, 0x180/y, 0/xmin, 0x400/xmax, 0x16/color=dark-grey + 220 draw-horizontal-line screen, 0x2a0/y, 0/xmin, 0x400/xmax, 0x16/color=dark-grey 221 # cell 0: outputs 222 var color/eax: int <- state-color self, 0x80/curx, 0x60/cury - 223 draw-rect screen, 0xe8/xmin 0x68/ymin, 0x118/xmax 0x98/ymax, color - 224 draw-rect screen, 0xe8/xmin 0xd0/ymin, 0x118/xmax 0x100/ymax, color - 225 draw-rect screen, 0xe8/xmin 0x148/ymin, 0x118/xmax 0x178/ymax, color - 226 draw-rect screen, 0x158/xmin 0x68/ymin, 0x188/xmax 0x98/ymax, color - 227 draw-rect screen, 0x158/xmin 0x148/ymin, 0x188/xmax 0x178/ymax, color - 228 draw-rect screen, 0x1c8/xmin 0x68/ymin, 0x1f8/xmax 0x98/ymax, color - 229 draw-rect screen, 0x1c8/xmin 0xd0/ymin, 0x1f8/xmax 0x100/ymax, color - 230 draw-rect screen, 0x1c8/xmin 0x148/ymin, 0x1f8/xmax 0x178/ymax, color + 223 draw-rect screen, 0xe8/xmin 0x68/ymin, 0x118/xmax 0x98/ymax, color + 224 draw-rect screen, 0xe8/xmin 0xd0/ymin, 0x118/xmax 0x100/ymax, color + 225 draw-rect screen, 0xe8/xmin 0x148/ymin, 0x118/xmax 0x178/ymax, color + 226 draw-rect screen, 0x158/xmin 0x68/ymin, 0x188/xmax 0x98/ymax, color + 227 draw-rect screen, 0x158/xmin 0x148/ymin, 0x188/xmax 0x178/ymax, color + 228 draw-rect screen, 0x1c8/xmin 0x68/ymin, 0x1f8/xmax 0x98/ymax, color + 229 draw-rect screen, 0x1c8/xmin 0xd0/ymin, 0x1f8/xmax 0x100/ymax, color + 230 draw-rect screen, 0x1c8/xmin 0x148/ymin, 0x1f8/xmax 0x178/ymax, color 231 # cell 1: outputs 232 var color/eax: int <- state-color self, 0x81/curx, 0x60/cury - 233 draw-rect screen, 0x208/xmin 0x68/ymin, 0x238/xmax 0x98/ymax, color - 234 draw-rect screen, 0x208/xmin 0xd0/ymin, 0x238/xmax 0x100/ymax, color - 235 draw-rect screen, 0x208/xmin 0x148/ymin, 0x238/xmax 0x178/ymax, color - 236 draw-rect screen, 0x278/xmin 0x68/ymin, 0x2a8/xmax 0x98/ymax, color - 237 draw-rect screen, 0x278/xmin 0x148/ymin, 0x2a8/xmax 0x178/ymax, color - 238 draw-rect screen, 0x2e8/xmin 0x68/ymin, 0x318/xmax 0x98/ymax, color - 239 draw-rect screen, 0x2e8/xmin 0xd0/ymin, 0x318/xmax 0x100/ymax, color - 240 draw-rect screen, 0x2e8/xmin 0x148/ymin, 0x318/xmax 0x178/ymax, color + 233 draw-rect screen, 0x208/xmin 0x68/ymin, 0x238/xmax 0x98/ymax, color + 234 draw-rect screen, 0x208/xmin 0xd0/ymin, 0x238/xmax 0x100/ymax, color + 235 draw-rect screen, 0x208/xmin 0x148/ymin, 0x238/xmax 0x178/ymax, color + 236 draw-rect screen, 0x278/xmin 0x68/ymin, 0x2a8/xmax 0x98/ymax, color + 237 draw-rect screen, 0x278/xmin 0x148/ymin, 0x2a8/xmax 0x178/ymax, color + 238 draw-rect screen, 0x2e8/xmin 0x68/ymin, 0x318/xmax 0x98/ymax, color + 239 draw-rect screen, 0x2e8/xmin 0xd0/ymin, 0x318/xmax 0x100/ymax, color + 240 draw-rect screen, 0x2e8/xmin 0x148/ymin, 0x318/xmax 0x178/ymax, color 241 # cell 2: outputs 242 var color/eax: int <- state-color self, 0x80/curx, 0x61/cury - 243 draw-rect screen, 0xe8/xmin 0x188/ymin, 0x118/xmax 0x1b8/ymax, color - 244 draw-rect screen, 0xe8/xmin 0x1f0/ymin, 0x118/xmax 0x220/ymax, color - 245 draw-rect screen, 0xe8/xmin 0x268/ymin, 0x118/xmax 0x298/ymax, color - 246 draw-rect screen, 0x158/xmin 0x188/ymin, 0x188/xmax 0x1b8/ymax, color - 247 draw-rect screen, 0x158/xmin 0x268/ymin, 0x188/xmax 0x298/ymax, color - 248 draw-rect screen, 0x1c8/xmin 0x188/ymin, 0x1f8/xmax 0x1b8/ymax, color - 249 draw-rect screen, 0x1c8/xmin 0x1f0/ymin, 0x1f8/xmax 0x220/ymax, color - 250 draw-rect screen, 0x1c8/xmin 0x268/ymin, 0x1f8/xmax 0x298/ymax, color + 243 draw-rect screen, 0xe8/xmin 0x188/ymin, 0x118/xmax 0x1b8/ymax, color + 244 draw-rect screen, 0xe8/xmin 0x1f0/ymin, 0x118/xmax 0x220/ymax, color + 245 draw-rect screen, 0xe8/xmin 0x268/ymin, 0x118/xmax 0x298/ymax, color + 246 draw-rect screen, 0x158/xmin 0x188/ymin, 0x188/xmax 0x1b8/ymax, color + 247 draw-rect screen, 0x158/xmin 0x268/ymin, 0x188/xmax 0x298/ymax, color + 248 draw-rect screen, 0x1c8/xmin 0x188/ymin, 0x1f8/xmax 0x1b8/ymax, color + 249 draw-rect screen, 0x1c8/xmin 0x1f0/ymin, 0x1f8/xmax 0x220/ymax, color + 250 draw-rect screen, 0x1c8/xmin 0x268/ymin, 0x1f8/xmax 0x298/ymax, color 251 # cell 3: outputs 252 var color/eax: int <- state-color self, 0x81/curx, 0x61/cury - 253 draw-rect screen, 0x208/xmin 0x188/ymin, 0x238/xmax 0x1b8/ymax, color - 254 draw-rect screen, 0x208/xmin 0x1f0/ymin, 0x238/xmax 0x220/ymax, color - 255 draw-rect screen, 0x208/xmin 0x268/ymin, 0x238/xmax 0x298/ymax, color - 256 draw-rect screen, 0x278/xmin 0x188/ymin, 0x2a8/xmax 0x1b8/ymax, color - 257 draw-rect screen, 0x278/xmin 0x268/ymin, 0x2a8/xmax 0x298/ymax, color - 258 draw-rect screen, 0x2e8/xmin 0x188/ymin, 0x318/xmax 0x1b8/ymax, color - 259 draw-rect screen, 0x2e8/xmin 0x1f0/ymin, 0x318/xmax 0x220/ymax, color - 260 draw-rect screen, 0x2e8/xmin 0x268/ymin, 0x318/xmax 0x298/ymax, color + 253 draw-rect screen, 0x208/xmin 0x188/ymin, 0x238/xmax 0x1b8/ymax, color + 254 draw-rect screen, 0x208/xmin 0x1f0/ymin, 0x238/xmax 0x220/ymax, color + 255 draw-rect screen, 0x208/xmin 0x268/ymin, 0x238/xmax 0x298/ymax, color + 256 draw-rect screen, 0x278/xmin 0x188/ymin, 0x2a8/xmax 0x1b8/ymax, color + 257 draw-rect screen, 0x278/xmin 0x268/ymin, 0x2a8/xmax 0x298/ymax, color + 258 draw-rect screen, 0x2e8/xmin 0x188/ymin, 0x318/xmax 0x1b8/ymax, color + 259 draw-rect screen, 0x2e8/xmin 0x1f0/ymin, 0x318/xmax 0x220/ymax, color + 260 draw-rect screen, 0x2e8/xmin 0x268/ymin, 0x318/xmax 0x298/ymax, color 261 # neighboring nodes 262 var color/eax: int <- state-color self, 0x7f/curx, 0x5f/cury - 263 draw-rect screen, 0xa8/xmin 0x28/ymin, 0xd8/xmax 0x58/ymax, color + 263 draw-rect screen, 0xa8/xmin 0x28/ymin, 0xd8/xmax 0x58/ymax, color 264 var color/eax: int <- state-color self, 0x80/curx, 0x5f/cury - 265 draw-rect screen, 0x158/xmin 0x28/ymin, 0x188/xmax 0x58/ymax, color - 266 draw-rect screen, 0x1c8/xmin 0x28/ymin, 0x1f8/xmax 0x58/ymax, color + 265 draw-rect screen, 0x158/xmin 0x28/ymin, 0x188/xmax 0x58/ymax, color + 266 draw-rect screen, 0x1c8/xmin 0x28/ymin, 0x1f8/xmax 0x58/ymax, color 267 var color/eax: int <- state-color self, 0x81/curx, 0x5f/cury - 268 draw-rect screen, 0x208/xmin 0x28/ymin, 0x238/xmax 0x58/ymax, color - 269 draw-rect screen, 0x278/xmin 0x28/ymin, 0x2a8/xmax 0x58/ymax, color + 268 draw-rect screen, 0x208/xmin 0x28/ymin, 0x238/xmax 0x58/ymax, color + 269 draw-rect screen, 0x278/xmin 0x28/ymin, 0x2a8/xmax 0x58/ymax, color 270 var color/eax: int <- state-color self, 0x82/curx, 0x5f/cury - 271 draw-rect screen, 0x328/xmin 0x28/ymin, 0x358/xmax 0x58/ymax, color + 271 draw-rect screen, 0x328/xmin 0x28/ymin, 0x358/xmax 0x58/ymax, color 272 var color/eax: int <- state-color self, 0x7f/curx, 0x60/cury - 273 draw-rect screen, 0xa8/xmin 0xd0/ymin, 0xd8/xmax 0x100/ymax, color - 274 draw-rect screen, 0xa8/xmin 0x148/ymin, 0xd8/xmax 0x178/ymax, color + 273 draw-rect screen, 0xa8/xmin 0xd0/ymin, 0xd8/xmax 0x100/ymax, color + 274 draw-rect screen, 0xa8/xmin 0x148/ymin, 0xd8/xmax 0x178/ymax, color 275 var color/eax: int <- state-color self, 0x82/curx, 0x60/cury - 276 draw-rect screen, 0x328/xmin 0xd0/ymin, 0x358/xmax 0x100/ymax, color - 277 draw-rect screen, 0x328/xmin 0x148/ymin, 0x358/xmax 0x178/ymax, color + 276 draw-rect screen, 0x328/xmin 0xd0/ymin, 0x358/xmax 0x100/ymax, color + 277 draw-rect screen, 0x328/xmin 0x148/ymin, 0x358/xmax 0x178/ymax, color 278 var color/eax: int <- state-color self, 0x7f/curx, 0x61/cury - 279 draw-rect screen, 0xa8/xmin 0x188/ymin, 0xd8/xmax 0x1b8/ymax, color - 280 draw-rect screen, 0xa8/xmin 0x1f0/ymin, 0xd8/xmax 0x220/ymax, color + 279 draw-rect screen, 0xa8/xmin 0x188/ymin, 0xd8/xmax 0x1b8/ymax, color + 280 draw-rect screen, 0xa8/xmin 0x1f0/ymin, 0xd8/xmax 0x220/ymax, color 281 var color/eax: int <- state-color self, 0x82/curx, 0x61/cury - 282 draw-rect screen, 0x328/xmin 0x188/ymin, 0x358/xmax 0x1b8/ymax, color - 283 draw-rect screen, 0x328/xmin 0x1f0/ymin, 0x358/xmax 0x220/ymax, color + 282 draw-rect screen, 0x328/xmin 0x188/ymin, 0x358/xmax 0x1b8/ymax, color + 283 draw-rect screen, 0x328/xmin 0x1f0/ymin, 0x358/xmax 0x220/ymax, color 284 var color/eax: int <- state-color self, 0x7f/curx, 0x62/cury - 285 draw-rect screen, 0xa8/xmin 0x2a8/ymin, 0xd8/xmax 0x2d8/ymax, color + 285 draw-rect screen, 0xa8/xmin 0x2a8/ymin, 0xd8/xmax 0x2d8/ymax, color 286 var color/eax: int <- state-color self, 0x80/curx, 0x62/cury - 287 draw-rect screen, 0x158/xmin 0x2a8/ymin, 0x188/xmax 0x2d8/ymax, color - 288 draw-rect screen, 0x1c8/xmin 0x2a8/ymin, 0x1f8/xmax 0x2d8/ymax, color + 287 draw-rect screen, 0x158/xmin 0x2a8/ymin, 0x188/xmax 0x2d8/ymax, color + 288 draw-rect screen, 0x1c8/xmin 0x2a8/ymin, 0x1f8/xmax 0x2d8/ymax, color 289 var color/eax: int <- state-color self, 0x81/curx, 0x62/cury - 290 draw-rect screen, 0x208/xmin 0x2a8/ymin, 0x238/xmax 0x2d8/ymax, color - 291 draw-rect screen, 0x278/xmin 0x2a8/ymin, 0x2a8/xmax 0x2d8/ymax, color + 290 draw-rect screen, 0x208/xmin 0x2a8/ymin, 0x238/xmax 0x2d8/ymax, color + 291 draw-rect screen, 0x278/xmin 0x2a8/ymin, 0x2a8/xmax 0x2d8/ymax, color 292 var color/eax: int <- state-color self, 0x82/curx, 0x62/cury - 293 draw-rect screen, 0x328/xmin 0x2a8/ymin, 0x358/xmax 0x2d8/ymax, color + 293 draw-rect screen, 0x328/xmin 0x2a8/ymin, 0x358/xmax 0x2d8/ymax, color 294 # cell 0: sum and filter nodes - 295 draw-rect screen, 0x148/xsmin 0xc8/ysmin, 0x158/xsmax 0xd8/ysmax, 0x40/color - 296 draw-rect screen, 0x180/xfmin 0xf8/yfmin, 0x190/xfmax 0x108/yfmax, 0x31/color + 295 draw-rect screen, 0x148/xsmin 0xc8/ysmin, 0x158/xsmax 0xd8/ysmax, 0x40/color + 296 draw-rect screen, 0x180/xfmin 0xf8/yfmin, 0x190/xfmax 0x108/yfmax, 0x31/color 297 # cell 1: sum and filter nodes - 298 draw-rect screen, 0x268/xsmin 0xc8/ysmin, 0x278/xsmax 0xd8/ysmax, 0x40/color - 299 draw-rect screen, 0x2a0/xfmin 0xf8/yfmin, 0x2b0/xfmax 0x108/yfmax, 0x31/color + 298 draw-rect screen, 0x268/xsmin 0xc8/ysmin, 0x278/xsmax 0xd8/ysmax, 0x40/color + 299 draw-rect screen, 0x2a0/xfmin 0xf8/yfmin, 0x2b0/xfmax 0x108/yfmax, 0x31/color 300 # cell 2: sum and filter nodes - 301 draw-rect screen, 0x148/xsmin 0x1e8/ysmin, 0x158/xsmax 0x1f8/ysmax, 0x40/color - 302 draw-rect screen, 0x180/xfmin 0x218/yfmin, 0x190/xfmax 0x228/yfmax, 0x31/color + 301 draw-rect screen, 0x148/xsmin 0x1e8/ysmin, 0x158/xsmax 0x1f8/ysmax, 0x40/color + 302 draw-rect screen, 0x180/xfmin 0x218/yfmin, 0x190/xfmax 0x228/yfmax, 0x31/color 303 # cell 3: sum and filter nodes - 304 draw-rect screen, 0x268/xsmin 0x1e8/ysmin, 0x278/xsmax 0x1f8/ysmax, 0x40/color - 305 draw-rect screen, 0x2a0/xfmin 0x218/yfmin, 0x2b0/xfmax 0x228/yfmax, 0x31/color + 304 draw-rect screen, 0x268/xsmin 0x1e8/ysmin, 0x278/xsmax 0x1f8/ysmax, 0x40/color + 305 draw-rect screen, 0x2a0/xfmin 0x218/yfmin, 0x2b0/xfmax 0x228/yfmax, 0x31/color 306 # neighbor counts 307 var n/eax: int <- num-live-neighbors self, 0x80/curx, 0x60/cury - 308 set-cursor-position screen, 0x2d, 0xe - 309 draw-int32-decimal-wrapping-right-then-down-from-cursor-over-full-screen screen, n, 0xf/fg 0/bg + 308 set-cursor-position screen, 0x2d, 0xe + 309 draw-int32-decimal-wrapping-right-then-down-from-cursor-over-full-screen screen, n, 0xf/fg 0/bg 310 var n/eax: int <- num-live-neighbors self, 0x81/curx, 0x60/cury - 311 set-cursor-position screen, 0x52, 0xe - 312 draw-int32-decimal-wrapping-right-then-down-from-cursor-over-full-screen screen, n, 0xf/fg 0/bg + 311 set-cursor-position screen, 0x52, 0xe + 312 draw-int32-decimal-wrapping-right-then-down-from-cursor-over-full-screen screen, n, 0xf/fg 0/bg 313 var n/eax: int <- num-live-neighbors self, 0x80/curx, 0x61/cury - 314 set-cursor-position screen, 0x2d, 0x20 - 315 draw-int32-decimal-wrapping-right-then-down-from-cursor-over-full-screen screen, n, 0xf/fg 0/bg + 314 set-cursor-position screen, 0x2d, 0x20 + 315 draw-int32-decimal-wrapping-right-then-down-from-cursor-over-full-screen screen, n, 0xf/fg 0/bg 316 var n/eax: int <- num-live-neighbors self, 0x81/curx, 0x61/cury - 317 set-cursor-position screen, 0x52, 0x20 - 318 draw-int32-decimal-wrapping-right-then-down-from-cursor-over-full-screen screen, n, 0xf/fg 0/bg + 317 set-cursor-position screen, 0x52, 0x20 + 318 draw-int32-decimal-wrapping-right-then-down-from-cursor-over-full-screen screen, n, 0xf/fg 0/bg 319 # cell 0: conveyors from neighboring inputs to sum node - 320 draw-monotonic-bezier screen, 0xc0/x0 0x40/y0, 0x100/x1 0xd0/ys, 0x150/xs 0xd0/ys, 4/color - 321 draw-monotonic-bezier screen, 0xc0/x0 0xe8/y0, 0xc0/x1 0xd0/ys, 0x150/xs 0xd0/ys, 4/color - 322 draw-monotonic-bezier screen, 0xc0/x0 0x1a0/y0, 0xe0/x1 0xd0/ys, 0x150/xs 0xd0/ys, 4/color - 323 draw-monotonic-bezier screen, 0x170/x0 0x40/y0, 0x150/x1 0x80/y1, 0x150/xs 0xd0/ys, 4/color - 324 draw-monotonic-bezier screen, 0x170/x0 0x1a0/y0, 0x150/x1 0x1a0/y1, 0x150/xs 0xd0/ys, 4/color - 325 draw-monotonic-bezier screen, 0x220/x0 0x40/y0, 0x150/x1 0x80/y1, 0x150/xs 0xd0/ys, 4/color - 326 draw-monotonic-bezier screen, 0x220/x0 0xe8/y0, 0x220/x1 0xd0/y1, 0x150/xs 0xd0/ys, 4/color - 327 draw-monotonic-bezier screen, 0x220/x0 0x1a0/y0, 0x180/x1 0x1a0/y1, 0x150/xs 0xd0/ys, 4/color + 320 draw-monotonic-bezier screen, 0xc0/x0 0x40/y0, 0x100/x1 0xd0/ys, 0x150/xs 0xd0/ys, 4/color + 321 draw-monotonic-bezier screen, 0xc0/x0 0xe8/y0, 0xc0/x1 0xd0/ys, 0x150/xs 0xd0/ys, 4/color + 322 draw-monotonic-bezier screen, 0xc0/x0 0x1a0/y0, 0xe0/x1 0xd0/ys, 0x150/xs 0xd0/ys, 4/color + 323 draw-monotonic-bezier screen, 0x170/x0 0x40/y0, 0x150/x1 0x80/y1, 0x150/xs 0xd0/ys, 4/color + 324 draw-monotonic-bezier screen, 0x170/x0 0x1a0/y0, 0x150/x1 0x1a0/y1, 0x150/xs 0xd0/ys, 4/color + 325 draw-monotonic-bezier screen, 0x220/x0 0x40/y0, 0x150/x1 0x80/y1, 0x150/xs 0xd0/ys, 4/color + 326 draw-monotonic-bezier screen, 0x220/x0 0xe8/y0, 0x220/x1 0xd0/y1, 0x150/xs 0xd0/ys, 4/color + 327 draw-monotonic-bezier screen, 0x220/x0 0x1a0/y0, 0x180/x1 0x1a0/y1, 0x150/xs 0xd0/ys, 4/color 328 # cell 0: conveyors from filter to outputs - 329 draw-monotonic-bezier screen, 0x188/xf 0x100/yf, 0x160/x1 0x8c/y1, 0x100/x2 0x80/y2, 0x2a/color - 330 draw-monotonic-bezier screen, 0x188/xf 0x100/yf, 0x100/x1 0x100/y1, 0x100/x2 0xe8/y2, 0x2a/color - 331 draw-monotonic-bezier screen, 0x188/xf 0x100/yf, 0x100/x1 0x100/y1, 0x100/x2 0x160/y2, 0x2a/color - 332 draw-monotonic-bezier screen, 0x188/xf 0x100/yf, 0x188/x1 0x80/y1, 0x170/x2 0x80/y2, 0x2a/color - 333 draw-monotonic-bezier screen, 0x188/xf 0x100/yf, 0x188/x1 0x160/y1, 0x170/x2 0x160/y2, 0x2a/color - 334 draw-monotonic-bezier screen, 0x188/xf 0x100/yf, 0x1e0/x1 0x100/y1, 0x1e0/x2 0x80/y2, 0x2a/color - 335 draw-monotonic-bezier screen, 0x188/xf 0x100/yf, 0x1e0/x1 0x100/y1 0x1e0/x2 0xe8/y2, 0x2a/color - 336 draw-monotonic-bezier screen, 0x188/xf 0x100/yf, 0x1e0/x1 0x100/y1, 0x1e0/x2 0x160/y2, 0x2a/color + 329 draw-monotonic-bezier screen, 0x188/xf 0x100/yf, 0x160/x1 0x8c/y1, 0x100/x2 0x80/y2, 0x2a/color + 330 draw-monotonic-bezier screen, 0x188/xf 0x100/yf, 0x100/x1 0x100/y1, 0x100/x2 0xe8/y2, 0x2a/color + 331 draw-monotonic-bezier screen, 0x188/xf 0x100/yf, 0x100/x1 0x100/y1, 0x100/x2 0x160/y2, 0x2a/color + 332 draw-monotonic-bezier screen, 0x188/xf 0x100/yf, 0x188/x1 0x80/y1, 0x170/x2 0x80/y2, 0x2a/color + 333 draw-monotonic-bezier screen, 0x188/xf 0x100/yf, 0x188/x1 0x160/y1, 0x170/x2 0x160/y2, 0x2a/color + 334 draw-monotonic-bezier screen, 0x188/xf 0x100/yf, 0x1e0/x1 0x100/y1, 0x1e0/x2 0x80/y2, 0x2a/color + 335 draw-monotonic-bezier screen, 0x188/xf 0x100/yf, 0x1e0/x1 0x100/y1 0x1e0/x2 0xe8/y2, 0x2a/color + 336 draw-monotonic-bezier screen, 0x188/xf 0x100/yf, 0x1e0/x1 0x100/y1, 0x1e0/x2 0x160/y2, 0x2a/color 337 # cell 0: time-variant portion: 16 repeating steps 338 $render1:cell0: { 339 var tick-a/eax: (addr int) <- get self, tick @@ -412,14 +412,14 @@ if ('onhashchange' in window) { 348 var six-f/xmm0: float <- convert six 349 u <- divide six-f 350 # points on conveyors from neighboring cells - 351 draw-bezier-point screen, u, 0xc0/x0 0x40/y0, 0x100/x1 0xd0/ys, 0x150/xs 0xd0/ys, 7/color, 4/radius - 352 draw-bezier-point screen, u, 0xc0/x0 0xe8/y0, 0xc0/x1 0xd0/ys, 0x150/xs 0xd0/ys, 7/color, 4/radius - 353 draw-bezier-point screen, u, 0xc0/x0 0x1a0/y0, 0xe0/x1 0xd0/ys, 0x150/xs 0xd0/ys, 7/color, 4/radius - 354 draw-bezier-point screen, u, 0x170/x0 0x40/y0, 0x150/x1 0x80/y1, 0x150/xs 0xd0/ys, 7/color, 4/radius - 355 draw-bezier-point screen, u, 0x170/x0 0x1a0/y0, 0x150/x1 0x1a0/y1, 0x150/xs 0xd0/ys, 7/color, 4/radius - 356 draw-bezier-point screen, u, 0x220/x0 0x40/y0, 0x150/x1 0x80/y1, 0x150/xs 0xd0/ys, 7/color, 4/radius - 357 draw-bezier-point screen, u, 0x220/x0 0xe8/y0, 0x220/x1 0xd0/y1, 0x150/xs 0xd0/ys, 7/color, 4/radius - 358 draw-bezier-point screen, u, 0x220/x0 0x1a0/y0, 0x180/x1 0x1a0/y1, 0x150/xs 0xd0/ys, 7/color, 4/radius + 351 draw-bezier-point screen, u, 0xc0/x0 0x40/y0, 0x100/x1 0xd0/ys, 0x150/xs 0xd0/ys, 7/color, 4/radius + 352 draw-bezier-point screen, u, 0xc0/x0 0xe8/y0, 0xc0/x1 0xd0/ys, 0x150/xs 0xd0/ys, 7/color, 4/radius + 353 draw-bezier-point screen, u, 0xc0/x0 0x1a0/y0, 0xe0/x1 0xd0/ys, 0x150/xs 0xd0/ys, 7/color, 4/radius + 354 draw-bezier-point screen, u, 0x170/x0 0x40/y0, 0x150/x1 0x80/y1, 0x150/xs 0xd0/ys, 7/color, 4/radius + 355 draw-bezier-point screen, u, 0x170/x0 0x1a0/y0, 0x150/x1 0x1a0/y1, 0x150/xs 0xd0/ys, 7/color, 4/radius + 356 draw-bezier-point screen, u, 0x220/x0 0x40/y0, 0x150/x1 0x80/y1, 0x150/xs 0xd0/ys, 7/color, 4/radius + 357 draw-bezier-point screen, u, 0x220/x0 0xe8/y0, 0x220/x1 0xd0/y1, 0x150/xs 0xd0/ys, 7/color, 4/radius + 358 draw-bezier-point screen, u, 0x220/x0 0x1a0/y0, 0x180/x1 0x1a0/y1, 0x150/xs 0xd0/ys, 7/color, 4/radius 359 break $render1:cell0 360 } 361 # cell 0: two time steps for getting count to filter @@ -436,33 +436,33 @@ if ('onhashchange' in window) { 372 var six/eax: int <- copy 6 373 var six-f/xmm0: float <- convert six 374 u <- divide six-f - 375 draw-bezier-point screen, u, 0x188/xf 0x100/yf, 0x160/x1 0x8c/y1, 0x100/x2 0x80/y2, 7/color, 4/radius - 376 draw-bezier-point screen, u, 0x188/xf 0x100/yf, 0x100/x1 0x100/y1, 0x100/x2 0xe8/y2, 7/color, 4/radius - 377 draw-bezier-point screen, u, 0x188/xf 0x100/yf, 0x100/x1 0x100/y1, 0x100/x2 0x160/y2, 7/color, 4/radius - 378 draw-bezier-point screen, u, 0x188/xf 0x100/yf, 0x188/xf 0x80/y1, 0x170/x2 0x80/y2, 7/color, 4/radius - 379 draw-bezier-point screen, u, 0x188/xf 0x100/yf, 0x188/xf 0x160/y1, 0x170/x2 0x160/y2, 7/color, 4/radius - 380 draw-bezier-point screen, u, 0x188/xf 0x100/yf, 0x1e0/x1 0x100/y1, 0x1e0/x2 0x80/y2, 7/color, 4/radius - 381 draw-bezier-point screen, u, 0x188/xf 0x100/yf, 0x1e0/x1 0x100/y1, 0x1e0/x2 0xe8/y2, 7/color, 4/radius - 382 draw-bezier-point screen, u, 0x188/xf 0x100/yf, 0x1e0/x1 0x100/y1, 0x1e0/x2 0x160/y2, 7/color, 4/radius + 375 draw-bezier-point screen, u, 0x188/xf 0x100/yf, 0x160/x1 0x8c/y1, 0x100/x2 0x80/y2, 7/color, 4/radius + 376 draw-bezier-point screen, u, 0x188/xf 0x100/yf, 0x100/x1 0x100/y1, 0x100/x2 0xe8/y2, 7/color, 4/radius + 377 draw-bezier-point screen, u, 0x188/xf 0x100/yf, 0x100/x1 0x100/y1, 0x100/x2 0x160/y2, 7/color, 4/radius + 378 draw-bezier-point screen, u, 0x188/xf 0x100/yf, 0x188/xf 0x80/y1, 0x170/x2 0x80/y2, 7/color, 4/radius + 379 draw-bezier-point screen, u, 0x188/xf 0x100/yf, 0x188/xf 0x160/y1, 0x170/x2 0x160/y2, 7/color, 4/radius + 380 draw-bezier-point screen, u, 0x188/xf 0x100/yf, 0x1e0/x1 0x100/y1, 0x1e0/x2 0x80/y2, 7/color, 4/radius + 381 draw-bezier-point screen, u, 0x188/xf 0x100/yf, 0x1e0/x1 0x100/y1, 0x1e0/x2 0xe8/y2, 7/color, 4/radius + 382 draw-bezier-point screen, u, 0x188/xf 0x100/yf, 0x1e0/x1 0x100/y1, 0x1e0/x2 0x160/y2, 7/color, 4/radius 383 } 384 # cell 1: conveyors from neighboring inputs to sum node - 385 draw-monotonic-bezier screen, 0x1e0/x0 0x40/y0, 0x220/x1 0xd0/ys, 0x270/xs 0xd0/ys, 4/color - 386 draw-monotonic-bezier screen, 0x1e0/x0 0xe8/y0, 0x1e0/x1 0xd0/ys, 0x270/xs 0xd0/ys, 4/color - 387 draw-monotonic-bezier screen, 0x1e0/x0 0x1a0/y0, 0x200/x1 0xd0/ys, 0x270/xs 0xd0/ys, 4/color - 388 draw-monotonic-bezier screen, 0x290/x0 0x40/y0, 0x270/x1 0x80/y1, 0x270/xs 0xd0/ys, 4/color - 389 draw-monotonic-bezier screen, 0x290/x0 0x1a0/y0, 0x270/x1 0x1a0/y1, 0x270/xs 0xd0/ys, 4/color - 390 draw-monotonic-bezier screen, 0x340/x0 0x40/y0, 0x270/x1 0x80/y1, 0x270/xs 0xd0/ys, 4/color - 391 draw-monotonic-bezier screen, 0x340/x0 0xe8/y0, 0x340/x1 0xd0/y1, 0x270/xs 0xd0/ys, 4/color - 392 draw-monotonic-bezier screen, 0x340/x0 0x1a0/y0, 0x2a0/x1 0x1a0/y1, 0x270/xs 0xd0/ys, 4/color + 385 draw-monotonic-bezier screen, 0x1e0/x0 0x40/y0, 0x220/x1 0xd0/ys, 0x270/xs 0xd0/ys, 4/color + 386 draw-monotonic-bezier screen, 0x1e0/x0 0xe8/y0, 0x1e0/x1 0xd0/ys, 0x270/xs 0xd0/ys, 4/color + 387 draw-monotonic-bezier screen, 0x1e0/x0 0x1a0/y0, 0x200/x1 0xd0/ys, 0x270/xs 0xd0/ys, 4/color + 388 draw-monotonic-bezier screen, 0x290/x0 0x40/y0, 0x270/x1 0x80/y1, 0x270/xs 0xd0/ys, 4/color + 389 draw-monotonic-bezier screen, 0x290/x0 0x1a0/y0, 0x270/x1 0x1a0/y1, 0x270/xs 0xd0/ys, 4/color + 390 draw-monotonic-bezier screen, 0x340/x0 0x40/y0, 0x270/x1 0x80/y1, 0x270/xs 0xd0/ys, 4/color + 391 draw-monotonic-bezier screen, 0x340/x0 0xe8/y0, 0x340/x1 0xd0/y1, 0x270/xs 0xd0/ys, 4/color + 392 draw-monotonic-bezier screen, 0x340/x0 0x1a0/y0, 0x2a0/x1 0x1a0/y1, 0x270/xs 0xd0/ys, 4/color 393 # cell 1: conveyors from filter to outputs - 394 draw-monotonic-bezier screen, 0x2a8/xf 0x100/yf, 0x280/x1 0x8c/y1, 0x220/x2 0x80/y2, 0x2a/color - 395 draw-monotonic-bezier screen, 0x2a8/xf 0x100/yf, 0x220/x1 0x100/y1, 0x220/x2 0xe8/y2, 0x2a/color - 396 draw-monotonic-bezier screen, 0x2a8/xf 0x100/yf, 0x220/x1 0x100/y1, 0x220/x2 0x160/y2, 0x2a/color - 397 draw-monotonic-bezier screen, 0x2a8/xf 0x100/yf, 0x2a8/x1 0x80/y1, 0x290/x2 0x80/y2, 0x2a/color - 398 draw-monotonic-bezier screen, 0x2a8/xf 0x100/yf, 0x2a8/x1 0x160/y1, 0x290/x2 0x160/y2, 0x2a/color - 399 draw-monotonic-bezier screen, 0x2a8/xf 0x100/yf, 0x300/x1 0x100/y1, 0x300/x2 0x80/y2, 0x2a/color - 400 draw-monotonic-bezier screen, 0x2a8/xf 0x100/yf, 0x300/x1 0x100/y1 0x300/x2 0xe8/y2, 0x2a/color - 401 draw-monotonic-bezier screen, 0x2a8/xf 0x100/yf, 0x300/x1 0x100/y1, 0x300/x2 0x160/y2, 0x2a/color + 394 draw-monotonic-bezier screen, 0x2a8/xf 0x100/yf, 0x280/x1 0x8c/y1, 0x220/x2 0x80/y2, 0x2a/color + 395 draw-monotonic-bezier screen, 0x2a8/xf 0x100/yf, 0x220/x1 0x100/y1, 0x220/x2 0xe8/y2, 0x2a/color + 396 draw-monotonic-bezier screen, 0x2a8/xf 0x100/yf, 0x220/x1 0x100/y1, 0x220/x2 0x160/y2, 0x2a/color + 397 draw-monotonic-bezier screen, 0x2a8/xf 0x100/yf, 0x2a8/x1 0x80/y1, 0x290/x2 0x80/y2, 0x2a/color + 398 draw-monotonic-bezier screen, 0x2a8/xf 0x100/yf, 0x2a8/x1 0x160/y1, 0x290/x2 0x160/y2, 0x2a/color + 399 draw-monotonic-bezier screen, 0x2a8/xf 0x100/yf, 0x300/x1 0x100/y1, 0x300/x2 0x80/y2, 0x2a/color + 400 draw-monotonic-bezier screen, 0x2a8/xf 0x100/yf, 0x300/x1 0x100/y1 0x300/x2 0xe8/y2, 0x2a/color + 401 draw-monotonic-bezier screen, 0x2a8/xf 0x100/yf, 0x300/x1 0x100/y1, 0x300/x2 0x160/y2, 0x2a/color 402 # cell 1: time-variant portion: 16 repeating steps 403 $render1:cell1: { 404 var tick-a/eax: (addr int) <- get self, tick @@ -477,14 +477,14 @@ if ('onhashchange' in window) { 413 var six-f/xmm0: float <- convert six 414 u <- divide six-f 415 # points on conveyors from neighboring cells - 416 draw-bezier-point screen, u, 0x1e0/x0 0x40/y0, 0x220/x1 0xd0/ys, 0x270/xs 0xd0/ys, 7/color, 4/radius - 417 draw-bezier-point screen, u, 0x1e0/x0 0xe8/y0, 0x1e0/x1 0xd0/ys, 0x270/xs 0xd0/ys, 7/color, 4/radius - 418 draw-bezier-point screen, u, 0x1e0/x0 0x1a0/y0, 0x200/x1 0xd0/ys, 0x270/xs 0xd0/ys, 7/color, 4/radius - 419 draw-bezier-point screen, u, 0x290/x0 0x40/y0, 0x270/x1 0x80/y1, 0x270/xs 0xd0/ys, 7/color, 4/radius - 420 draw-bezier-point screen, u, 0x290/x0 0x1a0/y0, 0x270/x1 0x1a0/y1, 0x270/xs 0xd0/ys, 7/color, 4/radius - 421 draw-bezier-point screen, u, 0x340/x0 0x40/y0, 0x270/x1 0x80/y1, 0x270/xs 0xd0/ys, 7/color, 4/radius - 422 draw-bezier-point screen, u, 0x340/x0 0xe8/y0, 0x340/x1 0xd0/y1, 0x270/xs 0xd0/ys, 7/color, 4/radius - 423 draw-bezier-point screen, u, 0x340/x0 0x1a0/y0, 0x2a0/x1 0x1a0/y1, 0x270/xs 0xd0/ys, 7/color, 4/radius + 416 draw-bezier-point screen, u, 0x1e0/x0 0x40/y0, 0x220/x1 0xd0/ys, 0x270/xs 0xd0/ys, 7/color, 4/radius + 417 draw-bezier-point screen, u, 0x1e0/x0 0xe8/y0, 0x1e0/x1 0xd0/ys, 0x270/xs 0xd0/ys, 7/color, 4/radius + 418 draw-bezier-point screen, u, 0x1e0/x0 0x1a0/y0, 0x200/x1 0xd0/ys, 0x270/xs 0xd0/ys, 7/color, 4/radius + 419 draw-bezier-point screen, u, 0x290/x0 0x40/y0, 0x270/x1 0x80/y1, 0x270/xs 0xd0/ys, 7/color, 4/radius + 420 draw-bezier-point screen, u, 0x290/x0 0x1a0/y0, 0x270/x1 0x1a0/y1, 0x270/xs 0xd0/ys, 7/color, 4/radius + 421 draw-bezier-point screen, u, 0x340/x0 0x40/y0, 0x270/x1 0x80/y1, 0x270/xs 0xd0/ys, 7/color, 4/radius + 422 draw-bezier-point screen, u, 0x340/x0 0xe8/y0, 0x340/x1 0xd0/y1, 0x270/xs 0xd0/ys, 7/color, 4/radius + 423 draw-bezier-point screen, u, 0x340/x0 0x1a0/y0, 0x2a0/x1 0x1a0/y1, 0x270/xs 0xd0/ys, 7/color, 4/radius 424 break $render1:cell1 425 } 426 # cell 1: two time steps for getting count to filter @@ -501,33 +501,33 @@ if ('onhashchange' in window) { 437 var six/eax: int <- copy 6 438 var six-f/xmm0: float <- convert six 439 u <- divide six-f - 440 draw-bezier-point screen, u, 0x2a8/xf 0x100/yf, 0x280/x1 0x8c/y1, 0x220/x2 0x80/y2, 7/color, 4/radius - 441 draw-bezier-point screen, u, 0x2a8/xf 0x100/yf, 0x220/x1 0x100/y1, 0x220/x2 0xe8/y2, 7/color, 4/radius - 442 draw-bezier-point screen, u, 0x2a8/xf 0x100/yf, 0x220/x1 0x100/y1, 0x220/x2 0x160/y2, 7/color, 4/radius - 443 draw-bezier-point screen, u, 0x2a8/xf 0x100/yf, 0x2a8/xf 0x80/y1, 0x290/x2 0x80/y2, 7/color, 4/radius - 444 draw-bezier-point screen, u, 0x2a8/xf 0x100/yf, 0x2a8/xf 0x160/y1, 0x290/x2 0x160/y2, 7/color, 4/radius - 445 draw-bezier-point screen, u, 0x2a8/xf 0x100/yf, 0x300/x1 0x100/y1, 0x300/x2 0x80/y2, 7/color, 4/radius - 446 draw-bezier-point screen, u, 0x2a8/xf 0x100/yf, 0x300/x1 0x100/y1, 0x300/x2 0xe8/y2, 7/color, 4/radius - 447 draw-bezier-point screen, u, 0x2a8/xf 0x100/yf, 0x300/x1 0x100/y1, 0x300/x2 0x160/y2, 7/color, 4/radius + 440 draw-bezier-point screen, u, 0x2a8/xf 0x100/yf, 0x280/x1 0x8c/y1, 0x220/x2 0x80/y2, 7/color, 4/radius + 441 draw-bezier-point screen, u, 0x2a8/xf 0x100/yf, 0x220/x1 0x100/y1, 0x220/x2 0xe8/y2, 7/color, 4/radius + 442 draw-bezier-point screen, u, 0x2a8/xf 0x100/yf, 0x220/x1 0x100/y1, 0x220/x2 0x160/y2, 7/color, 4/radius + 443 draw-bezier-point screen, u, 0x2a8/xf 0x100/yf, 0x2a8/xf 0x80/y1, 0x290/x2 0x80/y2, 7/color, 4/radius + 444 draw-bezier-point screen, u, 0x2a8/xf 0x100/yf, 0x2a8/xf 0x160/y1, 0x290/x2 0x160/y2, 7/color, 4/radius + 445 draw-bezier-point screen, u, 0x2a8/xf 0x100/yf, 0x300/x1 0x100/y1, 0x300/x2 0x80/y2, 7/color, 4/radius + 446 draw-bezier-point screen, u, 0x2a8/xf 0x100/yf, 0x300/x1 0x100/y1, 0x300/x2 0xe8/y2, 7/color, 4/radius + 447 draw-bezier-point screen, u, 0x2a8/xf 0x100/yf, 0x300/x1 0x100/y1, 0x300/x2 0x160/y2, 7/color, 4/radius 448 } 449 # cell 2: conveyors from neighboring inputs to sum node - 450 draw-monotonic-bezier screen, 0xc0/x0 0x160/y0, 0x100/x1 0x1f0/ys, 0x150/xs 0x1f0/ys, 4/color - 451 draw-monotonic-bezier screen, 0xc0/x0 0x208/y0, 0xc0/x1 0x1f0/ys, 0x150/xs 0x1f0/ys, 4/color - 452 draw-monotonic-bezier screen, 0xc0/x0 0x2c0/y0, 0xe0/x1 0x1f0/ys, 0x150/xs 0x1f0/ys, 4/color - 453 draw-monotonic-bezier screen, 0x170/x0 0x160/y0, 0x150/x1 0x1a0/y1, 0x150/xs 0x1f0/ys, 4/color - 454 draw-monotonic-bezier screen, 0x170/x0 0x2c0/y0, 0x150/x1 0x2c0/y1, 0x150/xs 0x1f0/ys, 4/color - 455 draw-monotonic-bezier screen, 0x220/x0 0x160/y0, 0x150/x1 0x1a0/y1, 0x150/xs 0x1f0/ys, 4/color - 456 draw-monotonic-bezier screen, 0x220/x0 0x208/y0, 0x220/x1 0x1f0/y1, 0x150/xs 0x1f0/ys, 4/color - 457 draw-monotonic-bezier screen, 0x220/x0 0x2c0/y0, 0x180/x1 0x2c0/y1, 0x150/xs 0x1f0/ys, 4/color + 450 draw-monotonic-bezier screen, 0xc0/x0 0x160/y0, 0x100/x1 0x1f0/ys, 0x150/xs 0x1f0/ys, 4/color + 451 draw-monotonic-bezier screen, 0xc0/x0 0x208/y0, 0xc0/x1 0x1f0/ys, 0x150/xs 0x1f0/ys, 4/color + 452 draw-monotonic-bezier screen, 0xc0/x0 0x2c0/y0, 0xe0/x1 0x1f0/ys, 0x150/xs 0x1f0/ys, 4/color + 453 draw-monotonic-bezier screen, 0x170/x0 0x160/y0, 0x150/x1 0x1a0/y1, 0x150/xs 0x1f0/ys, 4/color + 454 draw-monotonic-bezier screen, 0x170/x0 0x2c0/y0, 0x150/x1 0x2c0/y1, 0x150/xs 0x1f0/ys, 4/color + 455 draw-monotonic-bezier screen, 0x220/x0 0x160/y0, 0x150/x1 0x1a0/y1, 0x150/xs 0x1f0/ys, 4/color + 456 draw-monotonic-bezier screen, 0x220/x0 0x208/y0, 0x220/x1 0x1f0/y1, 0x150/xs 0x1f0/ys, 4/color + 457 draw-monotonic-bezier screen, 0x220/x0 0x2c0/y0, 0x180/x1 0x2c0/y1, 0x150/xs 0x1f0/ys, 4/color 458 # cell 2: conveyors from filter to outputs - 459 draw-monotonic-bezier screen, 0x188/xf 0x220/yf, 0x160/x1 0x1ac/y1, 0x100/x2 0x1a0/y2, 0x2a/color - 460 draw-monotonic-bezier screen, 0x188/xf 0x220/yf, 0x100/x1 0x220/y1, 0x100/x2 0x208/y2, 0x2a/color - 461 draw-monotonic-bezier screen, 0x188/xf 0x220/yf, 0x100/x1 0x220/y1, 0x100/x2 0x280/y2, 0x2a/color - 462 draw-monotonic-bezier screen, 0x188/xf 0x220/yf, 0x188/x1 0x1a0/y1, 0x170/x2 0x1a0/y2, 0x2a/color - 463 draw-monotonic-bezier screen, 0x188/xf 0x220/yf, 0x188/x1 0x280/y1, 0x170/x2 0x280/y2, 0x2a/color - 464 draw-monotonic-bezier screen, 0x188/xf 0x220/yf, 0x1e0/x1 0x220/y1, 0x1e0/x2 0x1a0/y2, 0x2a/color - 465 draw-monotonic-bezier screen, 0x188/xf 0x220/yf, 0x1e0/x1 0x220/y1 0x1e0/x2 0x208/y2, 0x2a/color - 466 draw-monotonic-bezier screen, 0x188/xf 0x220/yf, 0x1e0/x1 0x220/y1, 0x1e0/x2 0x280/y2, 0x2a/color + 459 draw-monotonic-bezier screen, 0x188/xf 0x220/yf, 0x160/x1 0x1ac/y1, 0x100/x2 0x1a0/y2, 0x2a/color + 460 draw-monotonic-bezier screen, 0x188/xf 0x220/yf, 0x100/x1 0x220/y1, 0x100/x2 0x208/y2, 0x2a/color + 461 draw-monotonic-bezier screen, 0x188/xf 0x220/yf, 0x100/x1 0x220/y1, 0x100/x2 0x280/y2, 0x2a/color + 462 draw-monotonic-bezier screen, 0x188/xf 0x220/yf, 0x188/x1 0x1a0/y1, 0x170/x2 0x1a0/y2, 0x2a/color + 463 draw-monotonic-bezier screen, 0x188/xf 0x220/yf, 0x188/x1 0x280/y1, 0x170/x2 0x280/y2, 0x2a/color + 464 draw-monotonic-bezier screen, 0x188/xf 0x220/yf, 0x1e0/x1 0x220/y1, 0x1e0/x2 0x1a0/y2, 0x2a/color + 465 draw-monotonic-bezier screen, 0x188/xf 0x220/yf, 0x1e0/x1 0x220/y1 0x1e0/x2 0x208/y2, 0x2a/color + 466 draw-monotonic-bezier screen, 0x188/xf 0x220/yf, 0x1e0/x1 0x220/y1, 0x1e0/x2 0x280/y2, 0x2a/color 467 # cell 2: time-variant portion: 16 repeating steps 468 $render1:cell2: { 469 var tick-a/eax: (addr int) <- get self, tick @@ -542,14 +542,14 @@ if ('onhashchange' in window) { 478 var six-f/xmm0: float <- convert six 479 u <- divide six-f 480 # points on conveyors from neighboring cells - 481 draw-bezier-point screen, u, 0xc0/x0 0x160/y0, 0x100/x1 0x1f0/ys, 0x150/xs 0x1f0/ys, 7/color, 4/radius - 482 draw-bezier-point screen, u, 0xc0/x0 0x208/y0, 0xc0/x1 0x1f0/ys, 0x150/xs 0x1f0/ys, 7/color, 4/radius - 483 draw-bezier-point screen, u, 0xc0/x0 0x2c0/y0, 0xe0/x1 0x1f0/ys, 0x150/xs 0x1f0/ys, 7/color, 4/radius - 484 draw-bezier-point screen, u, 0x170/x0 0x160/y0, 0x150/x1 0x1a0/y1, 0x150/xs 0x1f0/ys, 7/color, 4/radius - 485 draw-bezier-point screen, u, 0x170/x0 0x2c0/y0, 0x150/x1 0x2c0/y1, 0x150/xs 0x1f0/ys, 7/color, 4/radius - 486 draw-bezier-point screen, u, 0x220/x0 0x160/y0, 0x150/x1 0x1a0/y1, 0x150/xs 0x1f0/ys, 7/color, 4/radius - 487 draw-bezier-point screen, u, 0x220/x0 0x208/y0, 0x220/x1 0x1f0/y1, 0x150/xs 0x1f0/ys, 7/color, 4/radius - 488 draw-bezier-point screen, u, 0x220/x0 0x2c0/y0, 0x180/x1 0x2c0/y1, 0x150/xs 0x1f0/ys, 7/color, 4/radius + 481 draw-bezier-point screen, u, 0xc0/x0 0x160/y0, 0x100/x1 0x1f0/ys, 0x150/xs 0x1f0/ys, 7/color, 4/radius + 482 draw-bezier-point screen, u, 0xc0/x0 0x208/y0, 0xc0/x1 0x1f0/ys, 0x150/xs 0x1f0/ys, 7/color, 4/radius + 483 draw-bezier-point screen, u, 0xc0/x0 0x2c0/y0, 0xe0/x1 0x1f0/ys, 0x150/xs 0x1f0/ys, 7/color, 4/radius + 484 draw-bezier-point screen, u, 0x170/x0 0x160/y0, 0x150/x1 0x1a0/y1, 0x150/xs 0x1f0/ys, 7/color, 4/radius + 485 draw-bezier-point screen, u, 0x170/x0 0x2c0/y0, 0x150/x1 0x2c0/y1, 0x150/xs 0x1f0/ys, 7/color, 4/radius + 486 draw-bezier-point screen, u, 0x220/x0 0x160/y0, 0x150/x1 0x1a0/y1, 0x150/xs 0x1f0/ys, 7/color, 4/radius + 487 draw-bezier-point screen, u, 0x220/x0 0x208/y0, 0x220/x1 0x1f0/y1, 0x150/xs 0x1f0/ys, 7/color, 4/radius + 488 draw-bezier-point screen, u, 0x220/x0 0x2c0/y0, 0x180/x1 0x2c0/y1, 0x150/xs 0x1f0/ys, 7/color, 4/radius 489 break $render1:cell2 490 } 491 # cell 2: two time steps for getting count to filter @@ -566,33 +566,33 @@ if ('onhashchange' in window) { 502 var six/eax: int <- copy 6 503 var six-f/xmm0: float <- convert six 504 u <- divide six-f - 505 draw-bezier-point screen, u, 0x188/xf 0x220/yf, 0x160/x1 0x1ac/y1, 0x100/x2 0x1a0/y2, 7/color, 4/radius - 506 draw-bezier-point screen, u, 0x188/xf 0x220/yf, 0x100/x1 0x220/y1, 0x100/x2 0x208/y2, 7/color, 4/radius - 507 draw-bezier-point screen, u, 0x188/xf 0x220/yf, 0x100/x1 0x220/y1, 0x100/x2 0x280/y2, 7/color, 4/radius - 508 draw-bezier-point screen, u, 0x188/xf 0x220/yf, 0x188/xf 0x1a0/y1, 0x170/x2 0x1a0/y2, 7/color, 4/radius - 509 draw-bezier-point screen, u, 0x188/xf 0x220/yf, 0x188/xf 0x280/y1, 0x170/x2 0x280/y2, 7/color, 4/radius - 510 draw-bezier-point screen, u, 0x188/xf 0x220/yf, 0x1e0/x1 0x220/y1, 0x1e0/x2 0x1a0/y2, 7/color, 4/radius - 511 draw-bezier-point screen, u, 0x188/xf 0x220/yf, 0x1e0/x1 0x220/y1, 0x1e0/x2 0x208/y2, 7/color, 4/radius - 512 draw-bezier-point screen, u, 0x188/xf 0x220/yf, 0x1e0/x1 0x220/y1, 0x1e0/x2 0x280/y2, 7/color, 4/radius + 505 draw-bezier-point screen, u, 0x188/xf 0x220/yf, 0x160/x1 0x1ac/y1, 0x100/x2 0x1a0/y2, 7/color, 4/radius + 506 draw-bezier-point screen, u, 0x188/xf 0x220/yf, 0x100/x1 0x220/y1, 0x100/x2 0x208/y2, 7/color, 4/radius + 507 draw-bezier-point screen, u, 0x188/xf 0x220/yf, 0x100/x1 0x220/y1, 0x100/x2 0x280/y2, 7/color, 4/radius + 508 draw-bezier-point screen, u, 0x188/xf 0x220/yf, 0x188/xf 0x1a0/y1, 0x170/x2 0x1a0/y2, 7/color, 4/radius + 509 draw-bezier-point screen, u, 0x188/xf 0x220/yf, 0x188/xf 0x280/y1, 0x170/x2 0x280/y2, 7/color, 4/radius + 510 draw-bezier-point screen, u, 0x188/xf 0x220/yf, 0x1e0/x1 0x220/y1, 0x1e0/x2 0x1a0/y2, 7/color, 4/radius + 511 draw-bezier-point screen, u, 0x188/xf 0x220/yf, 0x1e0/x1 0x220/y1, 0x1e0/x2 0x208/y2, 7/color, 4/radius + 512 draw-bezier-point screen, u, 0x188/xf 0x220/yf, 0x1e0/x1 0x220/y1, 0x1e0/x2 0x280/y2, 7/color, 4/radius 513 } 514 # cell 3: conveyors from neighboring inputs to sum node - 515 draw-monotonic-bezier screen, 0x1e0/x0 0x160/y0, 0x220/x1 0x1f0/ys, 0x270/xs 0x1f0/ys, 4/color - 516 draw-monotonic-bezier screen, 0x1e0/x0 0x208/y0, 0x1e0/x1 0x1f0/ys, 0x270/xs 0x1f0/ys, 4/color - 517 draw-monotonic-bezier screen, 0x1e0/x0 0x2c0/y0, 0x200/x1 0x1f0/ys, 0x270/xs 0x1f0/ys, 4/color - 518 draw-monotonic-bezier screen, 0x290/x0 0x160/y0, 0x270/x1 0x1a0/y1, 0x270/xs 0x1f0/ys, 4/color - 519 draw-monotonic-bezier screen, 0x290/x0 0x2c0/y0, 0x270/x1 0x2c0/y1, 0x270/xs 0x1f0/ys, 4/color - 520 draw-monotonic-bezier screen, 0x340/x0 0x160/y0, 0x270/x1 0x1a0/y1, 0x270/xs 0x1f0/ys, 4/color - 521 draw-monotonic-bezier screen, 0x340/x0 0x208/y0, 0x340/x1 0x1f0/y1, 0x270/xs 0x1f0/ys, 4/color - 522 draw-monotonic-bezier screen, 0x340/x0 0x2c0/y0, 0x2a0/x1 0x2c0/y1, 0x270/xs 0x1f0/ys, 4/color + 515 draw-monotonic-bezier screen, 0x1e0/x0 0x160/y0, 0x220/x1 0x1f0/ys, 0x270/xs 0x1f0/ys, 4/color + 516 draw-monotonic-bezier screen, 0x1e0/x0 0x208/y0, 0x1e0/x1 0x1f0/ys, 0x270/xs 0x1f0/ys, 4/color + 517 draw-monotonic-bezier screen, 0x1e0/x0 0x2c0/y0, 0x200/x1 0x1f0/ys, 0x270/xs 0x1f0/ys, 4/color + 518 draw-monotonic-bezier screen, 0x290/x0 0x160/y0, 0x270/x1 0x1a0/y1, 0x270/xs 0x1f0/ys, 4/color + 519 draw-monotonic-bezier screen, 0x290/x0 0x2c0/y0, 0x270/x1 0x2c0/y1, 0x270/xs 0x1f0/ys, 4/color + 520 draw-monotonic-bezier screen, 0x340/x0 0x160/y0, 0x270/x1 0x1a0/y1, 0x270/xs 0x1f0/ys, 4/color + 521 draw-monotonic-bezier screen, 0x340/x0 0x208/y0, 0x340/x1 0x1f0/y1, 0x270/xs 0x1f0/ys, 4/color + 522 draw-monotonic-bezier screen, 0x340/x0 0x2c0/y0, 0x2a0/x1 0x2c0/y1, 0x270/xs 0x1f0/ys, 4/color 523 # cell 3: conveyors from filter to outputs - 524 draw-monotonic-bezier screen, 0x2a8/xf 0x220/yf, 0x280/x1 0x1ac/y1, 0x220/x2 0x1a0/y2, 0x2a/color - 525 draw-monotonic-bezier screen, 0x2a8/xf 0x220/yf, 0x220/x1 0x220/y1, 0x220/x2 0x208/y2, 0x2a/color - 526 draw-monotonic-bezier screen, 0x2a8/xf 0x220/yf, 0x220/x1 0x220/y1, 0x220/x2 0x280/y2, 0x2a/color - 527 draw-monotonic-bezier screen, 0x2a8/xf 0x220/yf, 0x2a8/x1 0x1a0/y1, 0x290/x2 0x1a0/y2, 0x2a/color - 528 draw-monotonic-bezier screen, 0x2a8/xf 0x220/yf, 0x2a8/x1 0x280/y1, 0x290/x2 0x280/y2, 0x2a/color - 529 draw-monotonic-bezier screen, 0x2a8/xf 0x220/yf, 0x300/x1 0x220/y1, 0x300/x2 0x1a0/y2, 0x2a/color - 530 draw-monotonic-bezier screen, 0x2a8/xf 0x220/yf, 0x300/x1 0x220/y1 0x300/x2 0x208/y2, 0x2a/color - 531 draw-monotonic-bezier screen, 0x2a8/xf 0x220/yf, 0x300/x1 0x220/y1, 0x300/x2 0x280/y2, 0x2a/color + 524 draw-monotonic-bezier screen, 0x2a8/xf 0x220/yf, 0x280/x1 0x1ac/y1, 0x220/x2 0x1a0/y2, 0x2a/color + 525 draw-monotonic-bezier screen, 0x2a8/xf 0x220/yf, 0x220/x1 0x220/y1, 0x220/x2 0x208/y2, 0x2a/color + 526 draw-monotonic-bezier screen, 0x2a8/xf 0x220/yf, 0x220/x1 0x220/y1, 0x220/x2 0x280/y2, 0x2a/color + 527 draw-monotonic-bezier screen, 0x2a8/xf 0x220/yf, 0x2a8/x1 0x1a0/y1, 0x290/x2 0x1a0/y2, 0x2a/color + 528 draw-monotonic-bezier screen, 0x2a8/xf 0x220/yf, 0x2a8/x1 0x280/y1, 0x290/x2 0x280/y2, 0x2a/color + 529 draw-monotonic-bezier screen, 0x2a8/xf 0x220/yf, 0x300/x1 0x220/y1, 0x300/x2 0x1a0/y2, 0x2a/color + 530 draw-monotonic-bezier screen, 0x2a8/xf 0x220/yf, 0x300/x1 0x220/y1 0x300/x2 0x208/y2, 0x2a/color + 531 draw-monotonic-bezier screen, 0x2a8/xf 0x220/yf, 0x300/x1 0x220/y1, 0x300/x2 0x280/y2, 0x2a/color 532 # cell 3: time-variant portion: 16 repeating steps 533 $render1:cell3: { 534 var tick-a/eax: (addr int) <- get self, tick @@ -607,14 +607,14 @@ if ('onhashchange' in window) { 543 var six-f/xmm0: float <- convert six 544 u <- divide six-f 545 # points on conveyors from neighboring cells - 546 draw-bezier-point screen, u, 0x1e0/x0 0x160/y0, 0x220/x1 0x1f0/ys, 0x270/xs 0x1f0/ys, 7/color, 4/radius - 547 draw-bezier-point screen, u, 0x1e0/x0 0x208/y0, 0x1e0/x1 0x1f0/ys, 0x270/xs 0x1f0/ys, 7/color, 4/radius - 548 draw-bezier-point screen, u, 0x1e0/x0 0x2c0/y0, 0x200/x1 0x1f0/ys, 0x270/xs 0x1f0/ys, 7/color, 4/radius - 549 draw-bezier-point screen, u, 0x290/x0 0x160/y0, 0x270/x1 0x1a0/y1, 0x270/xs 0x1f0/ys, 7/color, 4/radius - 550 draw-bezier-point screen, u, 0x290/x0 0x2c0/y0, 0x270/x1 0x2c0/y1, 0x270/xs 0x1f0/ys, 7/color, 4/radius - 551 draw-bezier-point screen, u, 0x340/x0 0x160/y0, 0x270/x1 0x1a0/y1, 0x270/xs 0x1f0/ys, 7/color, 4/radius - 552 draw-bezier-point screen, u, 0x340/x0 0x208/y0, 0x340/x1 0x1f0/y1, 0x270/xs 0x1f0/ys, 7/color, 4/radius - 553 draw-bezier-point screen, u, 0x340/x0 0x2c0/y0, 0x2a0/x1 0x2c0/y1, 0x270/xs 0x1f0/ys, 7/color, 4/radius + 546 draw-bezier-point screen, u, 0x1e0/x0 0x160/y0, 0x220/x1 0x1f0/ys, 0x270/xs 0x1f0/ys, 7/color, 4/radius + 547 draw-bezier-point screen, u, 0x1e0/x0 0x208/y0, 0x1e0/x1 0x1f0/ys, 0x270/xs 0x1f0/ys, 7/color, 4/radius + 548 draw-bezier-point screen, u, 0x1e0/x0 0x2c0/y0, 0x200/x1 0x1f0/ys, 0x270/xs 0x1f0/ys, 7/color, 4/radius + 549 draw-bezier-point screen, u, 0x290/x0 0x160/y0, 0x270/x1 0x1a0/y1, 0x270/xs 0x1f0/ys, 7/color, 4/radius + 550 draw-bezier-point screen, u, 0x290/x0 0x2c0/y0, 0x270/x1 0x2c0/y1, 0x270/xs 0x1f0/ys, 7/color, 4/radius + 551 draw-bezier-point screen, u, 0x340/x0 0x160/y0, 0x270/x1 0x1a0/y1, 0x270/xs 0x1f0/ys, 7/color, 4/radius + 552 draw-bezier-point screen, u, 0x340/x0 0x208/y0, 0x340/x1 0x1f0/y1, 0x270/xs 0x1f0/ys, 7/color, 4/radius + 553 draw-bezier-point screen, u, 0x340/x0 0x2c0/y0, 0x2a0/x1 0x2c0/y1, 0x270/xs 0x1f0/ys, 7/color, 4/radius 554 break $render1:cell3 555 } 556 # cell 3: two time steps for getting count to filter @@ -631,29 +631,29 @@ if ('onhashchange' in window) { 567 var six/eax: int <- copy 6 568 var six-f/xmm0: float <- convert six 569 u <- divide six-f - 570 draw-bezier-point screen, u, 0x2a8/xf 0x220/yf, 0x280/x1 0x1ac/y1, 0x220/x2 0x1a0/y2, 7/color, 4/radius - 571 draw-bezier-point screen, u, 0x2a8/xf 0x220/yf, 0x220/x1 0x220/y1, 0x220/x2 0x208/y2, 7/color, 4/radius - 572 draw-bezier-point screen, u, 0x2a8/xf 0x220/yf, 0x220/x1 0x220/y1, 0x220/x2 0x280/y2, 7/color, 4/radius - 573 draw-bezier-point screen, u, 0x2a8/xf 0x220/yf, 0x2a8/xf 0x1a0/y1, 0x290/x2 0x1a0/y2, 7/color, 4/radius - 574 draw-bezier-point screen, u, 0x2a8/xf 0x220/yf, 0x2a8/xf 0x280/y1, 0x290/x2 0x280/y2, 7/color, 4/radius - 575 draw-bezier-point screen, u, 0x2a8/xf 0x220/yf, 0x300/x1 0x220/y1, 0x300/x2 0x1a0/y2, 7/color, 4/radius - 576 draw-bezier-point screen, u, 0x2a8/xf 0x220/yf, 0x300/x1 0x220/y1, 0x300/x2 0x208/y2, 7/color, 4/radius - 577 draw-bezier-point screen, u, 0x2a8/xf 0x220/yf, 0x300/x1 0x220/y1, 0x300/x2 0x280/y2, 7/color, 4/radius + 570 draw-bezier-point screen, u, 0x2a8/xf 0x220/yf, 0x280/x1 0x1ac/y1, 0x220/x2 0x1a0/y2, 7/color, 4/radius + 571 draw-bezier-point screen, u, 0x2a8/xf 0x220/yf, 0x220/x1 0x220/y1, 0x220/x2 0x208/y2, 7/color, 4/radius + 572 draw-bezier-point screen, u, 0x2a8/xf 0x220/yf, 0x220/x1 0x220/y1, 0x220/x2 0x280/y2, 7/color, 4/radius + 573 draw-bezier-point screen, u, 0x2a8/xf 0x220/yf, 0x2a8/xf 0x1a0/y1, 0x290/x2 0x1a0/y2, 7/color, 4/radius + 574 draw-bezier-point screen, u, 0x2a8/xf 0x220/yf, 0x2a8/xf 0x280/y1, 0x290/x2 0x280/y2, 7/color, 4/radius + 575 draw-bezier-point screen, u, 0x2a8/xf 0x220/yf, 0x300/x1 0x220/y1, 0x300/x2 0x1a0/y2, 7/color, 4/radius + 576 draw-bezier-point screen, u, 0x2a8/xf 0x220/yf, 0x300/x1 0x220/y1, 0x300/x2 0x208/y2, 7/color, 4/radius + 577 draw-bezier-point screen, u, 0x2a8/xf 0x220/yf, 0x300/x1 0x220/y1, 0x300/x2 0x280/y2, 7/color, 4/radius 578 } 579 } 580 - 581 fn draw-bezier-point screen: (addr screen), u: float, x0: int, y0: int, x1: int, y1: int, x2: int, y2: int, color: int, radius: int { + 581 fn draw-bezier-point screen: (addr screen), u: float, x0: int, y0: int, x1: int, y1: int, x2: int, y2: int, color: int, radius: int { 582 var _cy/eax: int <- bezier-point u, y0, y1, y2 583 var cy/ecx: int <- copy _cy 584 var cx/eax: int <- bezier-point u, x0, x1, x2 - 585 draw-disc screen, cx, cy, radius, color, 0xf/border-color=white + 585 draw-disc screen, cx, cy, radius, color, 0xf/border-color=white 586 } 587 - 588 fn draw-linear-point screen: (addr screen), u: float, x0: int, y0: int, x1: int, y1: int, color: int, radius: int { + 588 fn draw-linear-point screen: (addr screen), u: float, x0: int, y0: int, x1: int, y1: int, color: int, radius: int { 589 var _cy/eax: int <- line-point u, y0, y1 590 var cy/ecx: int <- copy _cy 591 var cx/eax: int <- line-point u, x0, x1 - 592 draw-disc screen, cx, cy, radius, color, 0xf/border-color=white + 592 draw-disc screen, cx, cy, radius, color, 0xf/border-color=white 593 } 594 595 fn edit keyboard: (addr keyboard), _self: (addr environment) { @@ -928,7 +928,7 @@ if ('onhashchange' in window) { 864 } 865 } 866 - 867 fn render4 screen: (addr screen), _self: (addr environment) { + 867 fn render4 screen: (addr screen), _self: (addr environment) { 868 var self/esi: (addr environment) <- copy _self 869 var y/ecx: int <- copy 0 870 { @@ -942,12 +942,12 @@ if ('onhashchange' in window) { 878 compare state, 0/false 879 { 880 break-if-= - 881 render4-cell screen, x, y, 0xf/alive + 881 render4-cell screen, x, y, 0xf/alive 882 } 883 compare state, 0/false 884 { 885 break-if-!= - 886 render4-cell screen, x, y, 0x1a/dead + 886 render4-cell screen, x, y, 0x1a/dead 887 } 888 x <- increment 889 loop @@ -957,7 +957,7 @@ if ('onhashchange' in window) { 893 } 894 } 895 - 896 fn render4-cell screen: (addr screen), x: int, y: int, color: int { + 896 fn render4-cell screen: (addr screen), x: int, y: int, color: int { 897 var xmin/eax: int <- copy x 898 xmin <- shift-left 2 899 var xmax/ecx: int <- copy xmin @@ -966,7 +966,7 @@ if ('onhashchange' in window) { 902 ymin <- shift-left 2 903 var ymax/ebx: int <- copy ymin 904 ymax <- add 4 - 905 draw-rect screen, xmin ymin, xmax ymax, color + 905 draw-rect screen, xmin ymin, xmax ymax, color 906 } 907 908 fn step4 _self: (addr environment) { diff --git a/html/apps/life.mu.html b/html/apps/life.mu.html index a9c75a16..9ec493ae 100644 --- a/html/apps/life.mu.html +++ b/html/apps/life.mu.html @@ -275,7 +275,7 @@ if ('onhashchange' in window) { 211 } 212 } 213 -214 fn main screen: (addr screen), keyboard: (addr keyboard), data-disk: (addr disk) { +214 fn main screen: (addr screen), keyboard: (addr keyboard), data-disk: (addr disk) { 215 #? # allocate on the stack 216 #? var grid1-storage: (array boolean 0xc000) # width * height 217 #? var grid1/esi: (addr array boolean) <- address grid1-storage diff --git a/html/apps/mandelbrot-fixed.mu.html b/html/apps/mandelbrot-fixed.mu.html index a5214703..36735482 100644 --- a/html/apps/mandelbrot-fixed.mu.html +++ b/html/apps/mandelbrot-fixed.mu.html @@ -74,7 +74,7 @@ if ('onhashchange' in window) { 10 # Run: 11 # $ qemu-system-i386 code.img 12 - 13 fn main screen: (addr screen), keyboard: (addr keyboard), data-disk: (addr disk) { + 13 fn main screen: (addr screen), keyboard: (addr keyboard), data-disk: (addr disk) { 14 # Initially the viewport is centered at 0, 0 in the scene. 15 var scene-cx-f: int 16 var scene-cy-f: int @@ -82,7 +82,7 @@ if ('onhashchange' in window) { 18 var scene-width-f: int 19 copy-to scene-width-f, 0x400/4 20 { - 21 mandelbrot screen scene-cx-f, scene-cy-f, scene-width-f + 21 mandelbrot screen scene-cx-f, scene-cy-f, scene-width-f 22 # move at an angle slowly towards the edge 23 var adj-f/eax: int <- multiply-fixed scene-width-f, 0x12/0.07 24 subtract-from scene-cx-f, adj-f @@ -188,10 +188,10 @@ if ('onhashchange' in window) { 124 125 # adding and subtracting two fixed-point numbers can use existing instructions. 126 -127 fn mandelbrot screen: (addr screen), scene-cx-f: int, scene-cy-f: int, scene-width-f: int { +127 fn mandelbrot screen: (addr screen), scene-cx-f: int, scene-cy-f: int, scene-width-f: int { 128 var a/eax: int <- copy 0 129 var b/ecx: int <- copy 0 -130 a, b <- screen-size screen +130 a, b <- screen-size screen 131 var width/esi: int <- copy a 132 width <- shift-left 3/log2-font-width 133 var height/edi: int <- copy b @@ -214,7 +214,7 @@ if ('onhashchange' in window) { 150 dummy, color <- integer-divide iterations, 0x18/24/size-of-cycle-0 151 color <- add 0x20/cycle-0 152 } -153 pixel screen, x, y, color +153 pixel screen, x, y, color 154 x <- increment 155 loop 156 } diff --git a/html/apps/mandelbrot-silhouette.mu.html b/html/apps/mandelbrot-silhouette.mu.html index 572c9b2e..1ed40805 100644 --- a/html/apps/mandelbrot-silhouette.mu.html +++ b/html/apps/mandelbrot-silhouette.mu.html @@ -72,14 +72,14 @@ if ('onhashchange' in window) { 10 # Run: 11 # $ qemu-system-i386 code.img 12 - 13 fn main screen: (addr screen), keyboard: (addr keyboard), data-disk: (addr disk) { - 14 mandelbrot screen + 13 fn main screen: (addr screen), keyboard: (addr keyboard), data-disk: (addr disk) { + 14 mandelbrot screen 15 } 16 - 17 fn mandelbrot screen: (addr screen) { + 17 fn mandelbrot screen: (addr screen) { 18 var a/eax: int <- copy 0 19 var b/ecx: int <- copy 0 - 20 a, b <- screen-size screen + 20 a, b <- screen-size screen 21 var width/esi: int <- copy a 22 width <- shift-left 3/log2-font-width 23 var height/edi: int <- copy b @@ -98,12 +98,12 @@ if ('onhashchange' in window) { 36 compare iterations, 0x400/max 37 { 38 break-if->= - 39 pixel screen, x, y, 0xf/white + 39 pixel screen, x, y, 0xf/white 40 } 41 compare iterations, 0x400/max 42 { 43 break-if-< - 44 pixel screen, x, y, 0/black + 44 pixel screen, x, y, 0/black 45 } 46 x <- increment 47 loop diff --git a/html/apps/mandelbrot.mu.html b/html/apps/mandelbrot.mu.html index 0c193903..d1ac6068 100644 --- a/html/apps/mandelbrot.mu.html +++ b/html/apps/mandelbrot.mu.html @@ -73,7 +73,7 @@ if ('onhashchange' in window) { 10 # Run: 11 # $ qemu-system-i386 code.img 12 - 13 fn main screen: (addr screen), keyboard: (addr keyboard), data-disk: (addr disk) { + 13 fn main screen: (addr screen), keyboard: (addr keyboard), data-disk: (addr disk) { 14 # Initially the viewport is centered at 0, 0 in the scene. 15 var zero: float 16 var scene-cx/xmm1: float <- copy zero @@ -89,7 +89,7 @@ if ('onhashchange' in window) { 26 fill-in-rational dest, 4, 1 27 var scene-width/xmm3: float <- copy four 28 { - 29 mandelbrot screen scene-cx, scene-cy, scene-width + 29 mandelbrot screen scene-cx, scene-cy, scene-width 30 # move the center some % of the current screen-width 31 var adj/xmm0: float <- rational 2, 0x1c/28 32 adj <- multiply scene-width @@ -101,10 +101,10 @@ if ('onhashchange' in window) { 38 } 39 } 40 - 41 fn mandelbrot screen: (addr screen), scene-cx: float, scene-cy: float, scene-width: float { + 41 fn mandelbrot screen: (addr screen), scene-cx: float, scene-cy: float, scene-width: float { 42 var a/eax: int <- copy 0 43 var b/ecx: int <- copy 0 - 44 a, b <- screen-size screen + 44 a, b <- screen-size screen 45 var width/esi: int <- copy a 46 width <- shift-left 3/log2-font-width 47 var height/edi: int <- copy b @@ -124,7 +124,7 @@ if ('onhashchange' in window) { 61 var color/edx: int <- copy 0 62 iterations, color <- integer-divide iterations, 0x18/24/size-of-cycle-0 63 color <- add 0x20/cycle-0 - 64 pixel screen, x, y, color + 64 pixel screen, x, y, color 65 x <- increment 66 loop 67 } diff --git a/html/apps/rpn.mu.html b/html/apps/rpn.mu.html index 8b34a5c3..e7c85c30 100644 --- a/html/apps/rpn.mu.html +++ b/html/apps/rpn.mu.html @@ -77,7 +77,7 @@ if ('onhashchange' in window) { 15 # 16 # Error handling is non-existent. This is just a prototype. 17 - 18 fn main screen: (addr screen), keyboard: (addr keyboard), data-disk: (addr disk) { + 18 fn main screen: (addr screen), keyboard: (addr keyboard), data-disk: (addr disk) { 19 var in-storage: (stream byte 0x80) 20 var in/esi: (addr stream byte) <- address in-storage 21 var y/ecx: int <- copy 0 @@ -85,11 +85,11 @@ if ('onhashchange' in window) { 23 # read-eval-print loop 24 { 25 # print prompt - 26 var x/eax: int <- draw-text-rightward screen, "> ", 0/x, 0x80/xmax, y, 3/fg/cyan, 0/bg + 26 var x/eax: int <- draw-text-rightward screen, "> ", 0/x, 0x80/xmax, y, 3/fg/cyan, 0/bg 27 # read line from keyboard 28 clear-stream in 29 { - 30 draw-cursor screen, space + 30 draw-cursor screen, space 31 var key/eax: byte <- read-key keyboard 32 compare key, 0xa/newline 33 break-if-= @@ -98,16 +98,16 @@ if ('onhashchange' in window) { 36 var key2/eax: int <- copy key 37 append-byte in, key2 38 var c/eax: code-point <- copy key2 - 39 draw-code-point-at-cursor-over-full-screen screen, c, 0xf/fg, 0/bg + 39 draw-code-point-at-cursor-over-full-screen screen, c, 0xf/fg, 0/bg 40 loop 41 } 42 # clear cursor - 43 draw-code-point-at-cursor-over-full-screen screen, space, 3/fg/never-used, 0/bg + 43 draw-code-point-at-cursor-over-full-screen screen, space, 3/fg/never-used, 0/bg 44 # parse and eval 45 var out/eax: int <- simplify in 46 # print 47 y <- increment - 48 out, y <- draw-int32-decimal-wrapping-right-then-down screen, out, 0/xmin, y, 0x80/xmax, 0x30/ymax, 0/x, y, 7/fg, 0/bg + 48 out, y <- draw-int32-decimal-wrapping-right-then-down screen, out, 0/xmin, y, 0x80/xmax, 0x30/ymax, 0/x, y, 7/fg, 0/bg 49 # newline 50 y <- increment 51 # diff --git a/html/browse-slack/environment.mu.html b/html/browse-slack/environment.mu.html index 131badd0..7aa80b46 100644 --- a/html/browse-slack/environment.mu.html +++ b/html/browse-slack/environment.mu.html @@ -130,7 +130,7 @@ if ('onhashchange' in window) { 66 67 ### Render 68 - 69 fn render-environment screen: (addr screen), _env: (addr environment), users: (addr array user), channels: (addr array channel), items: (addr item-list) { + 69 fn render-environment screen: (addr screen), _env: (addr environment), users: (addr array user), channels: (addr array channel), items: (addr item-list) { 70 var env/esi: (addr environment) <- copy _env 71 { 72 var dirty?/eax: (addr boolean) <- get env, dirty? @@ -141,9 +141,9 @@ if ('onhashchange' in window) { 77 var cursor-in-search?/eax: (addr boolean) <- get env, cursor-in-search? 78 compare *cursor-in-search?, 0/false 79 break-if-= - 80 render-search-input screen, env - 81 clear-rect screen, 0/x 0x2f/y, 0x80/x 0x30/y, 0/bg - 82 render-search-menu screen, env + 80 render-search-input screen, env + 81 clear-rect screen, 0/x 0x2f/y, 0x80/x 0x30/y, 0/bg + 82 render-search-menu screen, env 83 return 84 } 85 # minimize repaints when focus in channel nav @@ -151,23 +151,23 @@ if ('onhashchange' in window) { 87 var cursor-in-channels?/eax: (addr boolean) <- get env, cursor-in-channels? 88 compare *cursor-in-channels?, 0/false 89 break-if-= - 90 render-channels screen, env, channels - 91 clear-rect screen, 0/x 0x2f/y, 0x80/x 0x30/y, 0/bg - 92 render-channels-menu screen, env + 90 render-channels screen, env, channels + 91 clear-rect screen, 0/x 0x2f/y, 0x80/x 0x30/y, 0/bg + 92 render-channels-menu screen, env 93 return 94 } 95 } 96 # full repaint - 97 clear-screen screen - 98 render-search-input screen, env - 99 render-channels screen, env, channels - 100 render-item-list screen, env, users, channels, items - 101 render-menu screen, env + 97 clear-screen screen + 98 render-search-input screen, env + 99 render-channels screen, env, channels + 100 render-item-list screen, env, users, channels, items + 101 render-menu screen, env 102 var dirty?/eax: (addr boolean) <- get env, dirty? 103 copy-to *dirty?, 0/false 104 } 105 - 106 fn render-channels screen: (addr screen), _env: (addr environment), _channels: (addr array channel) { + 106 fn render-channels screen: (addr screen), _env: (addr environment), _channels: (addr array channel) { 107 var env/esi: (addr environment) <- copy _env 108 var cursor-index/edi: int <- copy -1 109 { @@ -194,19 +194,19 @@ if ('onhashchange' in window) { 130 var name/eax: (addr array byte) <- lookup *name-ah 131 compare name, 0 132 break-if-= - 133 set-cursor-position screen, 2/x y + 133 set-cursor-position screen, 2/x y 134 { 135 compare cursor-index, i 136 break-if-= - 137 draw-text-wrapping-right-then-down-from-cursor-over-full-screen screen, "#", 7/grey 0/black - 138 draw-text-wrapping-right-then-down-from-cursor-over-full-screen screen, name, 7/grey 0/black + 137 draw-text-wrapping-right-then-down-from-cursor-over-full-screen screen, "#", 7/grey 0/black + 138 draw-text-wrapping-right-then-down-from-cursor-over-full-screen screen, name, 7/grey 0/black 139 } 140 { 141 compare cursor-index, i 142 break-if-!= 143 # cursor; reverse video - 144 draw-text-wrapping-right-then-down-from-cursor-over-full-screen screen, "#", 0/black 0xf/white - 145 draw-text-wrapping-right-then-down-from-cursor-over-full-screen screen, name, 0/black 0xf/white + 144 draw-text-wrapping-right-then-down-from-cursor-over-full-screen screen, "#", 0/black 0xf/white + 145 draw-text-wrapping-right-then-down-from-cursor-over-full-screen screen, name, 0/black 0xf/white 146 } 147 y <- add 2/channel-padding 148 i <- increment @@ -214,11 +214,11 @@ if ('onhashchange' in window) { 150 } 151 } 152 - 153 fn render-item-list screen: (addr screen), _env: (addr environment), users: (addr array user), channels: (addr array channel), items: (addr item-list) { + 153 fn render-item-list screen: (addr screen), _env: (addr environment), users: (addr array user), channels: (addr array channel), items: (addr item-list) { 154 var env/esi: (addr environment) <- copy _env 155 var tmp-width/eax: int <- copy 0 156 var tmp-height/ecx: int <- copy 0 - 157 tmp-width, tmp-height <- screen-size screen + 157 tmp-width, tmp-height <- screen-size screen 158 var screen-width: int 159 copy-to screen-width, tmp-width 160 var screen-height: int @@ -241,48 +241,48 @@ if ('onhashchange' in window) { 177 break-if-!= 178 copy-to show-cursor?, 1/true 179 } - 180 render-tab screen, current-tab, show-cursor?, users, channels, items, screen-height + 180 render-tab screen, current-tab, show-cursor?, users, channels, items, screen-height 181 var top/eax: int <- copy screen-height 182 top <- subtract 2/menu-space-ver - 183 clear-rect screen, 0 top, screen-width screen-height, 0/bg + 183 clear-rect screen, 0 top, screen-width screen-height, 0/bg 184 } 185 - 186 fn render-tab screen: (addr screen), _current-tab: (addr tab), show-cursor?: boolean, users: (addr array user), channels: (addr array channel), items: (addr item-list), screen-height: int { + 186 fn render-tab screen: (addr screen), _current-tab: (addr tab), show-cursor?: boolean, users: (addr array user), channels: (addr array channel), items: (addr item-list), screen-height: int { 187 var current-tab/esi: (addr tab) <- copy _current-tab 188 var current-tab-type/eax: (addr int) <- get current-tab, type 189 compare *current-tab-type, 0/all-items 190 { 191 break-if-!= - 192 render-all-items screen, current-tab, show-cursor?, items, users, screen-height + 192 render-all-items screen, current-tab, show-cursor?, items, users, screen-height 193 return 194 } 195 compare *current-tab-type, 1/channel 196 { 197 break-if-!= - 198 render-channel-tab screen, current-tab, show-cursor?, users, channels, items, screen-height + 198 render-channel-tab screen, current-tab, show-cursor?, users, channels, items, screen-height 199 return 200 } 201 compare *current-tab-type, 2/search 202 { 203 break-if-!= - 204 render-search-tab screen, current-tab, show-cursor?, users, channels, items, screen-height + 204 render-search-tab screen, current-tab, show-cursor?, users, channels, items, screen-height 205 return 206 } 207 compare *current-tab-type, 3/thread 208 { 209 break-if-!= - 210 render-thread-tab screen, current-tab, show-cursor?, users, channels, items, screen-height + 210 render-thread-tab screen, current-tab, show-cursor?, users, channels, items, screen-height 211 return 212 } 213 } 214 - 215 fn render-all-items screen: (addr screen), _current-tab: (addr tab), show-cursor?: boolean, _items: (addr item-list), users: (addr array user), screen-height: int { + 215 fn render-all-items screen: (addr screen), _current-tab: (addr tab), show-cursor?: boolean, _items: (addr item-list), users: (addr array user), screen-height: int { 216 var current-tab/esi: (addr tab) <- copy _current-tab 217 var items/edi: (addr item-list) <- copy _items 218 var newest-item/eax: (addr int) <- get current-tab, item-index 219 var i/ebx: int <- copy *newest-item 220 var items-data-first-free-addr/eax: (addr int) <- get items, data-first-free - 221 render-progress screen, i, *items-data-first-free-addr + 221 render-progress screen, i, *items-data-first-free-addr 222 var items-data-ah/eax: (addr handle array item) <- get items, data 223 var _items-data/eax: (addr array item) <- lookup *items-data-ah 224 var items-data/edi: (addr array item) <- copy _items-data @@ -302,7 +302,7 @@ if ('onhashchange' in window) { 238 break-if->= 239 var offset/eax: (offset item) <- compute-offset items-data, i 240 var curr-item/eax: (addr item) <- index items-data, offset - 241 y <- render-item screen, curr-item, users, show-cursor?, y, screen-height + 241 y <- render-item screen, curr-item, users, show-cursor?, y, screen-height 242 # cursor always at top item 243 copy-to show-cursor?, 0/false 244 i <- decrement @@ -310,7 +310,7 @@ if ('onhashchange' in window) { 246 } 247 } 248 - 249 fn render-channel-tab screen: (addr screen), _current-tab: (addr tab), show-cursor?: boolean, users: (addr array user), _channels: (addr array channel), _items: (addr item-list), screen-height: int { + 249 fn render-channel-tab screen: (addr screen), _current-tab: (addr tab), show-cursor?: boolean, users: (addr array user), _channels: (addr array channel), _items: (addr item-list), screen-height: int { 250 var current-tab/esi: (addr tab) <- copy _current-tab 251 var items/edi: (addr item-list) <- copy _items 252 var channels/ebx: (addr array channel) <- copy _channels @@ -324,9 +324,9 @@ if ('onhashchange' in window) { 260 var current-channel-first-channel-item-addr/eax: (addr int) <- get current-tab, item-index 261 var i/ebx: int <- copy *current-channel-first-channel-item-addr 262 var current-channel-posts-first-free-addr/eax: (addr int) <- get current-channel, posts-first-free - 263 set-cursor-position 0/screen, 0x68/x 0/y - 264 draw-text-wrapping-right-then-down-from-cursor-over-full-screen screen, "channel", 7/fg 0/bg - 265 render-progress screen, i, *current-channel-posts-first-free-addr + 263 set-cursor-position 0/screen, 0x68/x 0/y + 264 draw-text-wrapping-right-then-down-from-cursor-over-full-screen screen, "channel", 7/fg 0/bg + 265 render-progress screen, i, *current-channel-posts-first-free-addr 266 var items-data-ah/eax: (addr handle array item) <- get items, data 267 var _items-data/eax: (addr array item) <- lookup *items-data-ah 268 var items-data/edi: (addr array item) <- copy _items-data @@ -341,7 +341,7 @@ if ('onhashchange' in window) { 277 var item-index/eax: int <- copy *item-index-addr 278 var item-offset/eax: (offset item) <- compute-offset items-data, item-index 279 var curr-item/eax: (addr item) <- index items-data, item-offset - 280 y <- render-item screen, curr-item, users, show-cursor?, y, screen-height + 280 y <- render-item screen, curr-item, users, show-cursor?, y, screen-height 281 # cursor always at top item 282 copy-to show-cursor?, 0/false 283 i <- decrement @@ -349,7 +349,7 @@ if ('onhashchange' in window) { 285 } 286 } 287 - 288 fn render-search-tab screen: (addr screen), _current-tab: (addr tab), show-cursor?: boolean, users: (addr array user), channels: (addr array channel), _items: (addr item-list), screen-height: int { + 288 fn render-search-tab screen: (addr screen), _current-tab: (addr tab), show-cursor?: boolean, users: (addr array user), channels: (addr array channel), _items: (addr item-list), screen-height: int { 289 var current-tab/esi: (addr tab) <- copy _current-tab 290 var items/edi: (addr item-list) <- copy _items 291 var current-tab-search-items-ah/eax: (addr handle array int) <- get current-tab, search-items @@ -358,14 +358,14 @@ if ('onhashchange' in window) { 294 var current-tab-top-item-addr/eax: (addr int) <- get current-tab, item-index 295 var i/edx: int <- copy *current-tab-top-item-addr 296 var current-tab-search-items-first-free-addr/eax: (addr int) <- get current-tab, search-items-first-free - 297 set-cursor-position 0/screen, 0x68/x 0/y - 298 draw-text-wrapping-right-then-down-from-cursor-over-full-screen screen, "search", 7/fg 0/bg - 299 render-progress screen, i, *current-tab-search-items-first-free-addr + 297 set-cursor-position 0/screen, 0x68/x 0/y + 298 draw-text-wrapping-right-then-down-from-cursor-over-full-screen screen, "search", 7/fg 0/bg + 299 render-progress screen, i, *current-tab-search-items-first-free-addr 300 { 301 compare *current-tab-search-items-first-free-addr, 0x100/max-search-results 302 break-if-< - 303 set-cursor-position 0/screen, 0x68/x 1/y - 304 draw-text-wrapping-right-then-down-from-cursor-over-full-screen screen, "too many results", 4/fg 0/bg + 303 set-cursor-position 0/screen, 0x68/x 1/y + 304 draw-text-wrapping-right-then-down-from-cursor-over-full-screen screen, "too many results", 4/fg 0/bg 305 } 306 var items-data-ah/eax: (addr handle array item) <- get items, data 307 var _items-data/eax: (addr array item) <- lookup *items-data-ah @@ -381,7 +381,7 @@ if ('onhashchange' in window) { 317 var item-index/eax: int <- copy *item-index-addr 318 var item-offset/eax: (offset item) <- compute-offset items-data, item-index 319 var curr-item/eax: (addr item) <- index items-data, item-offset - 320 y <- render-item screen, curr-item, users, show-cursor?, y, screen-height + 320 y <- render-item screen, curr-item, users, show-cursor?, y, screen-height 321 # cursor always at top item 322 copy-to show-cursor?, 0/false 323 i <- decrement @@ -389,7 +389,7 @@ if ('onhashchange' in window) { 325 } 326 } 327 - 328 fn render-thread-tab screen: (addr screen), _current-tab: (addr tab), show-cursor?: boolean, users: (addr array user), channels: (addr array channel), _items: (addr item-list), screen-height: int { + 328 fn render-thread-tab screen: (addr screen), _current-tab: (addr tab), show-cursor?: boolean, users: (addr array user), channels: (addr array channel), _items: (addr item-list), screen-height: int { 329 var current-tab/esi: (addr tab) <- copy _current-tab 330 var items/eax: (addr item-list) <- copy _items 331 var items-data-ah/eax: (addr handle array item) <- get items, data @@ -402,9 +402,9 @@ if ('onhashchange' in window) { 338 var current-tab-top-item-addr/eax: (addr int) <- get current-tab, item-index 339 var i/edx: int <- copy *current-tab-top-item-addr 340 var post-comments-first-free-addr/eax: (addr int) <- get post, comments-first-free - 341 set-cursor-position 0/screen, 0x68/x 0/y - 342 draw-text-wrapping-right-then-down-from-cursor-over-full-screen screen, "thread", 7/fg 0/bg - 343 render-progress screen, i, *post-comments-first-free-addr + 341 set-cursor-position 0/screen, 0x68/x 0/y + 342 draw-text-wrapping-right-then-down-from-cursor-over-full-screen screen, "thread", 7/fg 0/bg + 343 render-progress screen, i, *post-comments-first-free-addr 344 var post-comments-ah/eax: (addr handle array int) <- get post, comments 345 var post-comments/eax: (addr array int) <- lookup *post-comments-ah 346 var y/ecx: int <- copy 2/search-space-ver @@ -418,146 +418,146 @@ if ('onhashchange' in window) { 354 var item-index/eax: int <- copy *item-index-addr 355 var item-offset/eax: (offset item) <- compute-offset items-data, item-index 356 var curr-item/eax: (addr item) <- index items-data, item-offset - 357 y <- render-item screen, curr-item, users, show-cursor?, y, screen-height + 357 y <- render-item screen, curr-item, users, show-cursor?, y, screen-height 358 # cursor always at top item 359 copy-to show-cursor?, 0/false 360 i <- decrement 361 loop 362 } 363 # finally render the parent -- though we'll never focus on it - 364 y <- render-item screen, post, users, 0/no-cursor, y, screen-height + 364 y <- render-item screen, post, users, 0/no-cursor, y, screen-height 365 } 366 367 # side-effect: mutates cursor position - 368 fn render-progress screen: (addr screen), curr: int, max: int { - 369 set-cursor-position 0/screen, 0x70/x 0/y + 368 fn render-progress screen: (addr screen), curr: int, max: int { + 369 set-cursor-position 0/screen, 0x70/x 0/y 370 var top-index/eax: int <- copy max 371 top-index <- subtract curr # happy accident: 1-based - 372 draw-int32-decimal-wrapping-right-then-down-from-cursor-over-full-screen screen, top-index, 7/fg 0/bg - 373 draw-text-wrapping-right-then-down-from-cursor-over-full-screen screen, "/", 7/fg 0/bg - 374 draw-int32-decimal-wrapping-right-then-down-from-cursor-over-full-screen screen, max, 7/fg 0/bg + 372 draw-int32-decimal-wrapping-right-then-down-from-cursor-over-full-screen screen, top-index, 7/fg 0/bg + 373 draw-text-wrapping-right-then-down-from-cursor-over-full-screen screen, "/", 7/fg 0/bg + 374 draw-int32-decimal-wrapping-right-then-down-from-cursor-over-full-screen screen, max, 7/fg 0/bg 375 } 376 - 377 fn render-search-input screen: (addr screen), _env: (addr environment) { + 377 fn render-search-input screen: (addr screen), _env: (addr environment) { 378 var env/esi: (addr environment) <- copy _env 379 var cursor-in-search?/ecx: (addr boolean) <- get env, cursor-in-search? - 380 set-cursor-position 0/screen, 0x22/x=search-position-x 1/y - 381 draw-text-wrapping-right-then-down-from-cursor-over-full-screen screen, "search ", 7/fg 0/bg + 380 set-cursor-position 0/screen, 0x22/x=search-position-x 1/y + 381 draw-text-wrapping-right-then-down-from-cursor-over-full-screen screen, "search ", 7/fg 0/bg 382 var search-terms-ah/eax: (addr handle gap-buffer) <- get env, search-terms 383 var search-terms/eax: (addr gap-buffer) <- lookup *search-terms-ah 384 rewind-gap-buffer search-terms - 385 var x/eax: int <- render-gap-buffer screen, search-terms, 0x2a/x 1/y, *cursor-in-search?, 0xf/fg 0/bg + 385 var x/eax: int <- render-gap-buffer screen, search-terms, 0x2a/x 1/y, *cursor-in-search?, 0xf/fg 0/bg 386 { 387 compare x, 0x4a/end-search 388 break-if-> 389 var y/ecx: int <- copy 0 - 390 x, y <- render-code-point screen, 0x5f/underscore, 0/xmin 1/ymin, 0x80/xmax, 1/ymax, x, 1/y, 0xf/fg 0/bg + 390 x, y <- render-code-point screen, 0x5f/underscore, 0/xmin 1/ymin, 0x80/xmax, 1/ymax, x, 1/y, 0xf/fg 0/bg 391 loop 392 } 393 } 394 395 # not used in search mode - 396 fn render-menu screen: (addr screen), _env: (addr environment) { + 396 fn render-menu screen: (addr screen), _env: (addr environment) { 397 var env/edi: (addr environment) <- copy _env 398 { 399 var cursor-in-search?/eax: (addr boolean) <- get env, cursor-in-search? 400 compare *cursor-in-search?, 0/false 401 break-if-= - 402 render-search-menu screen, env + 402 render-search-menu screen, env 403 return 404 } 405 var cursor-in-channels?/eax: (addr boolean) <- get env, cursor-in-channels? 406 compare *cursor-in-channels?, 0/false 407 { 408 break-if-= - 409 render-channels-menu screen, env + 409 render-channels-menu screen, env 410 return 411 } - 412 render-main-menu screen, env + 412 render-main-menu screen, env 413 } 414 - 415 fn render-main-menu screen: (addr screen), _env: (addr environment) { + 415 fn render-main-menu screen: (addr screen), _env: (addr environment) { 416 var width/eax: int <- copy 0 417 var y/ecx: int <- copy 0 - 418 width, y <- screen-size screen + 418 width, y <- screen-size screen 419 y <- decrement - 420 set-cursor-position screen, 2/x, y + 420 set-cursor-position screen, 2/x, y 421 { 422 var env/edi: (addr environment) <- copy _env 423 var num-tabs/edi: (addr int) <- get env, current-tab-index 424 compare *num-tabs, 0 425 break-if-<= - 426 draw-text-rightward-from-cursor screen, " Esc ", width, 0/fg 0xf/bg - 427 draw-text-rightward-from-cursor screen, " go back ", width, 0xf/fg, 0/bg + 426 draw-text-rightward-from-cursor screen, " Esc ", width, 0/fg 0xf/bg + 427 draw-text-rightward-from-cursor screen, " go back ", width, 0xf/fg, 0/bg 428 } - 429 draw-text-rightward-from-cursor screen, " / ", width, 0/fg 0xf/bg - 430 draw-text-rightward-from-cursor screen, " search ", width, 0xf/fg, 0/bg - 431 draw-text-rightward-from-cursor screen, " Tab ", width, 0/fg 0xf/bg - 432 draw-text-rightward-from-cursor screen, " go to channels ", width, 0xf/fg, 0/bg - 433 draw-text-rightward-from-cursor screen, " Enter ", width, 0/fg 0xf/bg - 434 draw-text-rightward-from-cursor screen, " go to thread ", width, 0xf/fg, 0/bg + 429 draw-text-rightward-from-cursor screen, " / ", width, 0/fg 0xf/bg + 430 draw-text-rightward-from-cursor screen, " search ", width, 0xf/fg, 0/bg + 431 draw-text-rightward-from-cursor screen, " Tab ", width, 0/fg 0xf/bg + 432 draw-text-rightward-from-cursor screen, " go to channels ", width, 0xf/fg, 0/bg + 433 draw-text-rightward-from-cursor screen, " Enter ", width, 0/fg 0xf/bg + 434 draw-text-rightward-from-cursor screen, " go to thread ", width, 0xf/fg, 0/bg 435 { 436 { 437 var is-all-items-or-channel?/eax: boolean <- current-tab-is-all-items-or-channel? _env 438 compare is-all-items-or-channel?, 0/false 439 } 440 break-if-= - 441 draw-text-rightward-from-cursor screen, " ^h ", width, 0/fg 0xf/bg - 442 draw-text-rightward-from-cursor screen, " hide thread ", width, 0xf/fg, 0/bg - 443 draw-text-rightward-from-cursor screen, " ^u ", width, 0/fg 0xf/bg - 444 draw-text-rightward-from-cursor screen, " unhide all ", width, 0xf/fg, 0/bg + 441 draw-text-rightward-from-cursor screen, " ^h ", width, 0/fg 0xf/bg + 442 draw-text-rightward-from-cursor screen, " hide thread ", width, 0xf/fg, 0/bg + 443 draw-text-rightward-from-cursor screen, " ^u ", width, 0/fg 0xf/bg + 444 draw-text-rightward-from-cursor screen, " unhide all ", width, 0xf/fg, 0/bg 445 } - 446 draw-text-rightward-from-cursor screen, " ^b ", width, 0/fg 0xf/bg - 447 draw-text-rightward-from-cursor screen, " << page ", width, 0xf/fg, 0/bg - 448 draw-text-rightward-from-cursor screen, " ^f ", width, 0/fg 0xf/bg - 449 draw-text-rightward-from-cursor screen, " page >> ", width, 0xf/fg, 0/bg + 446 draw-text-rightward-from-cursor screen, " ^b ", width, 0/fg 0xf/bg + 447 draw-text-rightward-from-cursor screen, " << page ", width, 0xf/fg, 0/bg + 448 draw-text-rightward-from-cursor screen, " ^f ", width, 0/fg 0xf/bg + 449 draw-text-rightward-from-cursor screen, " page >> ", width, 0xf/fg, 0/bg 450 } 451 - 452 fn render-channels-menu screen: (addr screen), _env: (addr environment) { + 452 fn render-channels-menu screen: (addr screen), _env: (addr environment) { 453 var width/eax: int <- copy 0 454 var y/ecx: int <- copy 0 - 455 width, y <- screen-size screen + 455 width, y <- screen-size screen 456 y <- decrement - 457 set-cursor-position screen, 2/x, y + 457 set-cursor-position screen, 2/x, y 458 { 459 var env/edi: (addr environment) <- copy _env 460 var num-tabs/edi: (addr int) <- get env, current-tab-index 461 compare *num-tabs, 0 462 break-if-<= - 463 draw-text-rightward-from-cursor screen, " Esc ", width, 0/fg 0xf/bg - 464 draw-text-rightward-from-cursor screen, " go back ", width, 0xf/fg, 0/bg + 463 draw-text-rightward-from-cursor screen, " Esc ", width, 0/fg 0xf/bg + 464 draw-text-rightward-from-cursor screen, " go back ", width, 0xf/fg, 0/bg 465 } - 466 draw-text-rightward-from-cursor screen, " / ", width, 0/fg 0xf/bg - 467 draw-text-rightward-from-cursor screen, " search ", width, 0xf/fg, 0/bg - 468 draw-text-rightward-from-cursor screen, " Tab ", width, 0/fg 0xf/bg - 469 draw-text-rightward-from-cursor screen, " go to items ", width, 0xf/fg, 0/bg - 470 draw-text-rightward-from-cursor screen, " Enter ", width, 0/fg 0xf/bg - 471 draw-text-rightward-from-cursor screen, " select ", width, 0xf/fg, 0/bg + 466 draw-text-rightward-from-cursor screen, " / ", width, 0/fg 0xf/bg + 467 draw-text-rightward-from-cursor screen, " search ", width, 0xf/fg, 0/bg + 468 draw-text-rightward-from-cursor screen, " Tab ", width, 0/fg 0xf/bg + 469 draw-text-rightward-from-cursor screen, " go to items ", width, 0xf/fg, 0/bg + 470 draw-text-rightward-from-cursor screen, " Enter ", width, 0/fg 0xf/bg + 471 draw-text-rightward-from-cursor screen, " select ", width, 0xf/fg, 0/bg 472 } 473 - 474 fn render-search-menu screen: (addr screen), _env: (addr environment) { + 474 fn render-search-menu screen: (addr screen), _env: (addr environment) { 475 var width/eax: int <- copy 0 476 var y/ecx: int <- copy 0 - 477 width, y <- screen-size screen + 477 width, y <- screen-size screen 478 y <- decrement - 479 set-cursor-position screen, 2/x, y - 480 draw-text-rightward-from-cursor screen, " Esc ", width, 0/fg 0xf/bg - 481 draw-text-rightward-from-cursor screen, " cancel ", width, 0xf/fg, 0/bg - 482 draw-text-rightward-from-cursor screen, " Enter ", width, 0/fg 0xf/bg - 483 draw-text-rightward-from-cursor screen, " select ", width, 0xf/fg, 0/bg - 484 draw-text-rightward-from-cursor screen, " ^a ", width, 0/fg, 0xf/bg - 485 draw-text-rightward-from-cursor screen, " << ", width, 0xf/fg, 0/bg - 486 draw-text-rightward-from-cursor screen, " ^b ", width, 0/fg, 0xf/bg - 487 draw-text-rightward-from-cursor screen, " <word ", width, 0xf/fg, 0/bg - 488 draw-text-rightward-from-cursor screen, " ^f ", width, 0/fg, 0xf/bg - 489 draw-text-rightward-from-cursor screen, " word> ", width, 0xf/fg, 0/bg - 490 draw-text-rightward-from-cursor screen, " ^e ", width, 0/fg, 0xf/bg - 491 draw-text-rightward-from-cursor screen, " >> ", width, 0xf/fg, 0/bg - 492 draw-text-rightward-from-cursor screen, " ^u ", width, 0/fg, 0xf/bg - 493 draw-text-rightward-from-cursor screen, " clear ", width, 0xf/fg, 0/bg + 479 set-cursor-position screen, 2/x, y + 480 draw-text-rightward-from-cursor screen, " Esc ", width, 0/fg 0xf/bg + 481 draw-text-rightward-from-cursor screen, " cancel ", width, 0xf/fg, 0/bg + 482 draw-text-rightward-from-cursor screen, " Enter ", width, 0/fg 0xf/bg + 483 draw-text-rightward-from-cursor screen, " select ", width, 0xf/fg, 0/bg + 484 draw-text-rightward-from-cursor screen, " ^a ", width, 0/fg, 0xf/bg + 485 draw-text-rightward-from-cursor screen, " << ", width, 0xf/fg, 0/bg + 486 draw-text-rightward-from-cursor screen, " ^b ", width, 0/fg, 0xf/bg + 487 draw-text-rightward-from-cursor screen, " <word ", width, 0xf/fg, 0/bg + 488 draw-text-rightward-from-cursor screen, " ^f ", width, 0/fg, 0xf/bg + 489 draw-text-rightward-from-cursor screen, " word> ", width, 0xf/fg, 0/bg + 490 draw-text-rightward-from-cursor screen, " ^e ", width, 0/fg, 0xf/bg + 491 draw-text-rightward-from-cursor screen, " >> ", width, 0xf/fg, 0/bg + 492 draw-text-rightward-from-cursor screen, " ^u ", width, 0/fg, 0xf/bg + 493 draw-text-rightward-from-cursor screen, " clear ", width, 0xf/fg, 0/bg 494 } 495 - 496 fn render-item screen: (addr screen), _item: (addr item), _users: (addr array user), show-cursor?: boolean, y: int, screen-height: int -> _/ecx: int { + 496 fn render-item screen: (addr screen), _item: (addr item), _users: (addr array user), show-cursor?: boolean, y: int, screen-height: int -> _/ecx: int { 497 var item/esi: (addr item) <- copy _item 498 var users/edi: (addr array user) <- copy _users 499 var author-index-addr/ecx: (addr int) <- get item, by @@ -576,7 +576,7 @@ if ('onhashchange' in window) { 512 var x/eax: int <- copy 0x20/main-panel-hor 513 x <- shift-left 3/log2font-width 514 x <- add 0x18/item-padding-hor - 515 render-image screen, author-avatar, x, y, 0x50/avatar-side, 0x50/avatar-side + 515 render-image screen, author-avatar, x, y, 0x50/avatar-side, 0x50/avatar-side 516 } 517 # channel 518 var channel-name-ah/eax: (addr handle array byte) <- get item, channel @@ -584,25 +584,25 @@ if ('onhashchange' in window) { 520 { 521 var x/eax: int <- copy 0x20/main-panel-hor 522 x <- add 0x40/channel-offset-x - 523 set-cursor-position screen, x y + 523 set-cursor-position screen, x y 524 } - 525 draw-text-wrapping-right-then-down-from-cursor-over-full-screen screen, "#", 7/grey 0/black - 526 draw-text-wrapping-right-then-down-from-cursor-over-full-screen screen, channel-name, 7/grey 0/black + 525 draw-text-wrapping-right-then-down-from-cursor-over-full-screen screen, "#", 7/grey 0/black + 526 draw-text-wrapping-right-then-down-from-cursor-over-full-screen screen, channel-name, 7/grey 0/black 527 # author name 528 { 529 var author-real-name-ah/eax: (addr handle array byte) <- get author, real-name 530 var author-real-name/eax: (addr array byte) <- lookup *author-real-name-ah 531 var x/ecx: int <- copy 0x20/main-panel-hor 532 x <- add 0x10/avatar-space-hor - 533 set-cursor-position screen, x y - 534 draw-text-wrapping-right-then-down-from-cursor-over-full-screen screen, author-real-name, 0xf/white 0/black + 533 set-cursor-position screen, x y + 534 draw-text-wrapping-right-then-down-from-cursor-over-full-screen screen, author-real-name, 0xf/white 0/black 535 } 536 increment y 537 # text 538 var text-ah/eax: (addr handle array byte) <- get item, text 539 var _text/eax: (addr array byte) <- lookup *text-ah 540 var text/edx: (addr array byte) <- copy _text - 541 var text-y/eax: int <- render-slack-message screen, text, show-cursor?, y, screen-height + 541 var text-y/eax: int <- render-slack-message screen, text, show-cursor?, y, screen-height 542 # flush 543 add-to y, 6/avatar-space-ver 544 compare y, text-y @@ -613,7 +613,7 @@ if ('onhashchange' in window) { 549 return text-y 550 } 551 - 552 fn render-slack-message screen: (addr screen), text: (addr array byte), highlight?: boolean, ymin: int, ymax: int -> _/eax: int { + 552 fn render-slack-message screen: (addr screen), text: (addr array byte), highlight?: boolean, ymin: int, ymax: int -> _/eax: int { 553 var x/eax: int <- copy 0x20/main-panel-hor 554 x <- add 0x10/avatar-space-hor 555 var y/ecx: int <- copy ymin @@ -622,10 +622,10 @@ if ('onhashchange' in window) { 558 compare highlight?, 0/false 559 { 560 break-if-= - 561 x, y <- draw-json-text-wrapping-right-then-down screen, text, x y, 0x70/xmax=post-right-coord ymax, x y, 0/fg 7/bg + 561 x, y <- draw-json-text-wrapping-right-then-down screen, text, x y, 0x70/xmax=post-right-coord ymax, x y, 0/fg 7/bg 562 break $render-slack-message:draw 563 } - 564 x, y <- draw-json-text-wrapping-right-then-down screen, text, x y, 0x70/xmax=post-right-coord ymax, x y, 7/fg 0/bg + 564 x, y <- draw-json-text-wrapping-right-then-down screen, text, x y, 0x70/xmax=post-right-coord ymax, x y, 7/fg 0/bg 565 } 566 y <- add 2/item-padding-ver 567 return y @@ -635,7 +635,7 @@ if ('onhashchange' in window) { 571 # return the next (x, y) coordinate in raster order where drawing stopped 572 # that way the caller can draw more if given the same min and max bounding-box. 573 # if there isn't enough space, truncate - 574 fn draw-json-text-wrapping-right-then-down screen: (addr screen), _text: (addr array byte), xmin: int, ymin: int, xmax: int, ymax: int, _x: int, _y: int, color: int, background-color: int -> _/eax: int, _/ecx: int { + 574 fn draw-json-text-wrapping-right-then-down screen: (addr screen), _text: (addr array byte), xmin: int, ymin: int, xmax: int, ymax: int, _x: int, _y: int, color: int, background-color: int -> _/eax: int, _/ecx: int { 575 var stream-storage: (stream byte 0x4000/print-buffer-size) 576 var stream/edi: (addr stream byte) <- address stream-storage 577 var text/esi: (addr array byte) <- copy _text @@ -652,7 +652,7 @@ if ('onhashchange' in window) { 588 } 589 var x/eax: int <- copy _x 590 var y/ecx: int <- copy _y - 591 x, y <- draw-json-stream-wrapping-right-then-down screen, stream, xmin, ymin, xmax, ymax, x, y, color, background-color + 591 x, y <- draw-json-stream-wrapping-right-then-down screen, stream, xmin, ymin, xmax, ymax, x, y, color, background-color 592 return x, y 593 } 594 @@ -660,7 +660,7 @@ if ('onhashchange' in window) { 596 # return the next (x, y) coordinate in raster order where drawing stopped 597 # that way the caller can draw more if given the same min and max bounding-box. 598 # if there isn't enough space, truncate - 599 fn draw-json-stream-wrapping-right-then-down screen: (addr screen), stream: (addr stream byte), xmin: int, ymin: int, xmax: int, ymax: int, x: int, y: int, color: int, background-color: int -> _/eax: int, _/ecx: int { + 599 fn draw-json-stream-wrapping-right-then-down screen: (addr screen), stream: (addr stream byte), xmin: int, ymin: int, xmax: int, ymax: int, x: int, y: int, color: int, background-color: int -> _/eax: int, _/ecx: int { 600 var xcurr/ecx: int <- copy x 601 var ycurr/edx: int <- copy y 602 var c/ebx: code-point <- copy 0 @@ -683,19 +683,19 @@ if ('onhashchange' in window) { 619 compare c, 0x5c/backslash 620 { 621 break-if-!= - 622 xcurr, ycurr <- render-json-escaped-code-point screen, stream, xmin, ymin, xmax, ymax, xcurr, ycurr, color, background-color + 622 xcurr, ycurr <- render-json-escaped-code-point screen, stream, xmin, ymin, xmax, ymax, xcurr, ycurr, color, background-color 623 break $draw-json-stream-wrapping-right-then-down:render-grapheme 624 } 625 compare c, 0xa/newline 626 { 627 break-if-!= 628 # minimum effort to clear cursor - 629 var dummy/eax: int <- draw-code-point screen, 0x20/space, xcurr, ycurr, color, background-color + 629 var dummy/eax: int <- draw-code-point screen, 0x20/space, xcurr, ycurr, color, background-color 630 xcurr <- copy xmin 631 ycurr <- increment 632 break $draw-json-stream-wrapping-right-then-down:render-grapheme 633 } - 634 var offset/eax: int <- draw-code-point screen, c, xcurr, ycurr, color, background-color + 634 var offset/eax: int <- draw-code-point screen, c, xcurr, ycurr, color, background-color 635 # overlay a combining character if necessary 636 $draw-json-stream-wrapping-right-then-down:read-combiner: { 637 var done?/eax: boolean <- stream-empty? stream @@ -718,7 +718,7 @@ if ('onhashchange' in window) { 654 # otherwise overlay it without saving its width 655 # This means strange results if a base and its combiner have different 656 # widths. We'll always follow the base width. - 657 var dummy/eax: int <- overlay-code-point screen, c, xcurr, ycurr, color, background-color + 657 var dummy/eax: int <- overlay-code-point screen, c, xcurr, ycurr, color, background-color 658 } 659 xcurr <- add offset 660 compare xcurr, xmax @@ -730,7 +730,7 @@ if ('onhashchange' in window) { 666 } 667 loop 668 } - 669 set-cursor-position screen, xcurr, ycurr + 669 set-cursor-position screen, xcurr, ycurr 670 return xcurr, ycurr 671 } 672 @@ -743,7 +743,7 @@ if ('onhashchange' in window) { 679 680 # '\' encountered 681 # https://www.json.org/json-en.html - 682 fn render-json-escaped-code-point screen: (addr screen), stream: (addr stream byte), xmin: int, ymin: int, xmax: int, ymax: int, xcurr: int, ycurr: int, color: int, background-color: int -> _/ecx: int, _/edx: int { + 682 fn render-json-escaped-code-point screen: (addr screen), stream: (addr stream byte), xmin: int, ymin: int, xmax: int, ymax: int, xcurr: int, ycurr: int, color: int, background-color: int -> _/ecx: int, _/edx: int { 683 var g/ebx: code-point <- read-json-code-point stream 684 compare g, 0xffffffff/end-of-file 685 { @@ -784,19 +784,19 @@ if ('onhashchange' in window) { 720 { 721 compare g, 0x75/u 722 break-if-!= - 723 x, y <- render-json-escaped-unicode-code-point screen, stream, xmin, ymin, xmax, ymax, xcurr, ycurr, color, background-color + 723 x, y <- render-json-escaped-unicode-code-point screen, stream, xmin, ymin, xmax, ymax, xcurr, ycurr, color, background-color 724 var y/edx: int <- copy y 725 return x, y 726 } 727 # most characters escape to themselves 728 # combining characters not supported after backslash - 729 x, y <- render-code-point screen, g, xmin, ymin, xmax, ymax, xcurr, ycurr, color, background-color + 729 x, y <- render-code-point screen, g, xmin, ymin, xmax, ymax, xcurr, ycurr, color, background-color 730 var y/edx: int <- copy y 731 return x, y 732 } 733 734 # '\u' encountered - 735 fn render-json-escaped-unicode-code-point screen: (addr screen), stream: (addr stream byte), xmin: int, ymin: int, xmax: int, ymax: int, xcurr: int, ycurr: int, color: int, background-color: int -> _/eax: int, _/ecx: int { + 735 fn render-json-escaped-unicode-code-point screen: (addr screen), stream: (addr stream byte), xmin: int, ymin: int, xmax: int, ymax: int, xcurr: int, ycurr: int, color: int, background-color: int -> _/eax: int, _/ecx: int { 736 var hex-digits-storage: (array byte 4) 737 var hex-digits/esi: (addr array byte) <- address hex-digits-storage 738 # slurp 4 bytes exactly @@ -819,7 +819,7 @@ if ('onhashchange' in window) { 755 break-if-= 756 var x/eax: int <- copy 0 757 var y/ecx: int <- copy 0 - 758 x, y <- render-code-point screen, 0x2d/dash, xmin, ymin, xmax, ymax, xcurr, ycurr, color, background-color + 758 x, y <- render-code-point screen, 0x2d/dash, xmin, ymin, xmax, ymax, xcurr, ycurr, color, background-color 759 return x, y 760 } 761 # \u2014 = - @@ -829,7 +829,7 @@ if ('onhashchange' in window) { 765 break-if-= 766 var x/eax: int <- copy 0 767 var y/ecx: int <- copy 0 - 768 x, y <- render-code-point screen, 0x2d/dash, xmin, ymin, xmax, ymax, xcurr, ycurr, color, background-color + 768 x, y <- render-code-point screen, 0x2d/dash, xmin, ymin, xmax, ymax, xcurr, ycurr, color, background-color 769 return x, y 770 } 771 # \u2018 = ' @@ -839,7 +839,7 @@ if ('onhashchange' in window) { 775 break-if-= 776 var x/eax: int <- copy 0 777 var y/ecx: int <- copy 0 - 778 x, y <- render-code-point screen, 0x27/quote, xmin, ymin, xmax, ymax, xcurr, ycurr, color, background-color + 778 x, y <- render-code-point screen, 0x27/quote, xmin, ymin, xmax, ymax, xcurr, ycurr, color, background-color 779 return x, y 780 } 781 # \u2019 = ' @@ -849,7 +849,7 @@ if ('onhashchange' in window) { 785 break-if-= 786 var x/eax: int <- copy 0 787 var y/ecx: int <- copy 0 - 788 x, y <- render-code-point screen, 0x27/quote, xmin, ymin, xmax, ymax, xcurr, ycurr, color, background-color + 788 x, y <- render-code-point screen, 0x27/quote, xmin, ymin, xmax, ymax, xcurr, ycurr, color, background-color 789 return x, y 790 } 791 # \u201c = " @@ -859,7 +859,7 @@ if ('onhashchange' in window) { 795 break-if-= 796 var x/eax: int <- copy 0 797 var y/ecx: int <- copy 0 - 798 x, y <- render-code-point screen, 0x22/dquote, xmin, ymin, xmax, ymax, xcurr, ycurr, color, background-color + 798 x, y <- render-code-point screen, 0x22/dquote, xmin, ymin, xmax, ymax, xcurr, ycurr, color, background-color 799 return x, y 800 } 801 # \u201d = " @@ -869,7 +869,7 @@ if ('onhashchange' in window) { 805 break-if-= 806 var x/eax: int <- copy 0 807 var y/ecx: int <- copy 0 - 808 x, y <- render-code-point screen, 0x22/dquote, xmin, ymin, xmax, ymax, xcurr, ycurr, color, background-color + 808 x, y <- render-code-point screen, 0x22/dquote, xmin, ymin, xmax, ymax, xcurr, ycurr, color, background-color 809 return x, y 810 } 811 # \u2022 = * @@ -879,7 +879,7 @@ if ('onhashchange' in window) { 815 break-if-= 816 var x/eax: int <- copy 0 817 var y/ecx: int <- copy 0 - 818 x, y <- render-code-point screen, 0x2a/asterisk, xmin, ymin, xmax, ymax, xcurr, ycurr, color, background-color + 818 x, y <- render-code-point screen, 0x2a/asterisk, xmin, ymin, xmax, ymax, xcurr, ycurr, color, background-color 819 return x, y 820 } 821 # \u2026 = ... @@ -889,14 +889,14 @@ if ('onhashchange' in window) { 825 break-if-= 826 var x/eax: int <- copy 0 827 var y/ecx: int <- copy 0 - 828 x, y <- draw-text-wrapping-right-then-down screen, "...", xmin, ymin, xmax, ymax, xcurr, ycurr, color, background-color + 828 x, y <- draw-text-wrapping-right-then-down screen, "...", xmin, ymin, xmax, ymax, xcurr, ycurr, color, background-color 829 return x, y 830 } 831 var n/eax: int <- parse-hex-int hex-digits 832 var c/edx: code-point <- copy n 833 var x/eax: int <- copy 0 834 var y/ecx: int <- copy 0 - 835 x, y <- render-code-point screen, c, xmin, ymin, xmax, ymax, xcurr, ycurr, color, background-color + 835 x, y <- render-code-point screen, c, xmin, ymin, xmax, ymax, xcurr, ycurr, color, background-color 836 return x, y 837 } 838 diff --git a/html/browse-slack/main.mu.html b/html/browse-slack/main.mu.html index 410ee14d..649d0f1f 100644 --- a/html/browse-slack/main.mu.html +++ b/html/browse-slack/main.mu.html @@ -112,7 +112,7 @@ if ('onhashchange' in window) { 48 # message-text-limit 49 # channel-capacity 50 - 51 fn main screen: (addr screen), keyboard: (addr keyboard), data-disk: (addr disk) { + 51 fn main screen: (addr screen), keyboard: (addr keyboard), data-disk: (addr disk) { 52 # load entire disk contents to a single enormous stream 53 var s-h: (handle stream byte) # the stream is too large to put on the stack 54 var s-ah/eax: (addr handle stream byte) <- address s-h @@ -121,12 +121,12 @@ if ('onhashchange' in window) { 57 var s/ebx: (addr stream byte) <- copy _s 58 var sector-count/eax: int <- copy 0x400 # test_data 59 #? var sector-count/eax: int <- copy 0x20000 # largest size tested; slow - 60 set-cursor-position 0/screen, 0x20/x 0/y # aborts clobber the screen starting x=0 - 61 draw-text-wrapping-right-then-down-from-cursor-over-full-screen screen, "loading ", 3/fg 0/bg - 62 draw-int32-decimal-wrapping-right-then-down-from-cursor-over-full-screen screen, sector-count, 3/fg 0/bg - 63 draw-text-wrapping-right-then-down-from-cursor-over-full-screen screen, " sectors from data disk..", 3/fg 0/bg + 60 set-cursor-position 0/screen, 0x20/x 0/y # aborts clobber the screen starting x=0 + 61 draw-text-wrapping-right-then-down-from-cursor-over-full-screen screen, "loading ", 3/fg 0/bg + 62 draw-int32-decimal-wrapping-right-then-down-from-cursor-over-full-screen screen, sector-count, 3/fg 0/bg + 63 draw-text-wrapping-right-then-down-from-cursor-over-full-screen screen, " sectors from data disk..", 3/fg 0/bg 64 load-sectors data-disk, 0/lba, sector-count, s - 65 draw-text-wrapping-right-then-down-from-cursor-over-full-screen screen, "done", 3/fg 0/bg + 65 draw-text-wrapping-right-then-down-from-cursor-over-full-screen screen, "done", 3/fg 0/bg 66 # parse global data structures out of the stream 67 var users-h: (handle array user) 68 var users-ah/eax: (addr handle array user) <- address users-h @@ -148,7 +148,7 @@ if ('onhashchange' in window) { 84 var env/ebx: (addr environment) <- address env-storage 85 initialize-environment env, items 86 { - 87 render-environment screen, env, users, channels, items + 87 render-environment screen, env, users, channels, items 88 { 89 var key/eax: byte <- read-key keyboard 90 compare key, 0 @@ -176,7 +176,7 @@ if ('onhashchange' in window) { 112 var c/eax: byte <- peek-byte in 113 compare c, 0 114 break-if-= -115 set-cursor-position 0/screen, 0x20/x 1/y +115 set-cursor-position 0/screen, 0x20/x 1/y 116 draw-text-wrapping-right-then-down-from-cursor-over-full-screen 0/screen, "parsed " 3/fg 0/bg 117 draw-int32-decimal-wrapping-right-then-down-from-cursor-over-full-screen 0/screen, user-idx, 3/fg 0/bg 118 draw-text-wrapping-right-then-down-from-cursor-over-full-screen 0/screen, " users, " 3/fg 0/bg @@ -208,7 +208,7 @@ if ('onhashchange' in window) { 144 compare paren, 0x28/open-paren 145 { 146 break-if-= -147 set-cursor-position 0/screen, 0x20 0x10 +147 set-cursor-position 0/screen, 0x20 0x10 148 var c/eax: int <- copy paren 149 draw-int32-decimal-wrapping-right-then-down-from-cursor-over-full-screen 0/screen c, 5/fg 0/bg 150 abort "parse-record: (" diff --git a/html/mu-init.subx.html b/html/mu-init.subx.html index 417cb811..5ec91d63 100644 --- a/html/mu-init.subx.html +++ b/html/mu-init.subx.html @@ -78,7 +78,7 @@ if ('onhashchange' in window) { 22 3d/compare-eax-and 0/imm32 23 75/jump-if-!= break/disp8 24 c7 0/subop/copy *Running-tests? 0/imm32/false -25 (clear-real-screen) +25 (clear-real-screen) 26 c7 0/subop/copy *Real-screen-cursor-x 0/imm32 27 c7 0/subop/copy *Real-screen-cursor-y 0/imm32 28 (main 0 0 Primary-bus-secondary-drive) diff --git a/html/shell/cell.mu.html b/html/shell/cell.mu.html index 618b296a..acbc8594 100644 --- a/html/shell/cell.mu.html +++ b/html/shell/cell.mu.html @@ -71,7 +71,7 @@ if ('onhashchange' in window) { 11 # type 4: primitive function 12 index-data: int 13 # type 5: screen - 14 screen-data: (handle screen) + 14 screen-data: (handle screen) 15 # type 6: keyboard 16 keyboard-data: (handle gap-buffer) 17 # type 7: array @@ -265,10 +265,10 @@ if ('onhashchange' in window) { 205 var out/eax: (addr handle cell) <- copy _out 206 allocate-screen out 207 var out-addr/eax: (addr cell) <- lookup *out -208 var dest-ah/eax: (addr handle screen) <- get out-addr, screen-data +208 var dest-ah/eax: (addr handle screen) <- get out-addr, screen-data 209 allocate dest-ah -210 var dest-addr/eax: (addr screen) <- lookup *dest-ah -211 initialize-screen dest-addr, width, height, pixel-graphics? +210 var dest-addr/eax: (addr screen) <- lookup *dest-ah +211 initialize-screen dest-addr, width, height, pixel-graphics? 212 } 213 214 fn screen? _x: (addr cell) -> _/eax: boolean { @@ -290,9 +290,9 @@ if ('onhashchange' in window) { 230 break-if-!= 231 return 232 } -233 var screen-ah/eax: (addr handle screen) <- get self, screen-data -234 var screen/eax: (addr screen) <- lookup *screen-ah -235 clear-screen screen +233 var screen-ah/eax: (addr handle screen) <- get self, screen-data +234 var screen/eax: (addr screen) <- lookup *screen-ah +235 clear-screen screen 236 } 237 238 fn allocate-keyboard _out: (addr handle cell) { diff --git a/html/shell/environment.mu.html b/html/shell/environment.mu.html index 4d3742cc..5b04be1b 100644 --- a/html/shell/environment.mu.html +++ b/html/shell/environment.mu.html @@ -87,34 +87,34 @@ if ('onhashchange' in window) { 22 var env/esi: (addr environment) <- address env-storage 23 initialize-environment env, 8/fake-screen-width, 3/fake-screen-height 24 # setup: screen - 25 var screen-on-stack: screen - 26 var screen/edi: (addr screen) <- address screen-on-stack - 27 initialize-screen screen, 0x80/width, 0x30/height, 0/no-pixel-graphics + 25 var screen-on-stack: screen + 26 var screen/edi: (addr screen) <- address screen-on-stack + 27 initialize-screen screen, 0x80/width, 0x30/height, 0/no-pixel-graphics 28 # type some code into sandbox - 29 type-in env, screen, "(+ 3 4)" # we don't have any global definitions here, so no macros + 29 type-in env, screen, "(+ 3 4)" # we don't have any global definitions here, so no macros 30 # run code in sandbox 31 edit-environment env, 0x13/ctrl-s, 0/no-disk - 32 render-environment screen, env + 32 render-environment screen, env 33 # | global definitions | sandbox 34 # top row blank for now - 35 check-screen-row screen, 0/y, " ", "F - test-environment/0" - 36 check-screen-row screen, 1/y, " screen: ", "F - test-environment/1" - 37 check-background-color-in-screen-row screen, 0/bg, 2/y, " ........ ", "F - test-environment/2" - 38 check-background-color-in-screen-row screen, 0/bg, 3/y, " ........ ", "F - test-environment/3" - 39 check-background-color-in-screen-row screen, 0/bg, 4/y, " ........ ", "F - test-environment/4" - 40 check-screen-row screen, 5/y, " ", "F - test-environment/5" - 41 check-screen-row screen, 6/y, " keyboard: ", "F - test-environment/6" - 42 check-background-color-in-screen-row screen, 0/bg, 6/y, " ................ ", "F - test-environment/6-2" - 43 check-screen-row screen, 7/y, " ", "F - test-environment/7" - 44 check-screen-row screen, 8/y, " (+ 3 4) ", "F - test-environment/8" - 45 check-screen-row screen, 9/y, " ... trace depth: 4 ", "F - test-environment/9" - 46 check-screen-row screen, 0xa/y, " => 7 ", "F - test-environment/10" - 47 check-screen-row screen, 0xb/y, " ", "F - test-environment/11" - 48 check-screen-row screen, 0xc/y, " ", "F - test-environment/12" - 49 check-screen-row screen, 0xd/y, " ", "F - test-environment/13" - 50 check-screen-row screen, 0xe/y, " ", "F - test-environment/14" + 35 check-screen-row screen, 0/y, " ", "F - test-environment/0" + 36 check-screen-row screen, 1/y, " screen: ", "F - test-environment/1" + 37 check-background-color-in-screen-row screen, 0/bg, 2/y, " ........ ", "F - test-environment/2" + 38 check-background-color-in-screen-row screen, 0/bg, 3/y, " ........ ", "F - test-environment/3" + 39 check-background-color-in-screen-row screen, 0/bg, 4/y, " ........ ", "F - test-environment/4" + 40 check-screen-row screen, 5/y, " ", "F - test-environment/5" + 41 check-screen-row screen, 6/y, " keyboard: ", "F - test-environment/6" + 42 check-background-color-in-screen-row screen, 0/bg, 6/y, " ................ ", "F - test-environment/6-2" + 43 check-screen-row screen, 7/y, " ", "F - test-environment/7" + 44 check-screen-row screen, 8/y, " (+ 3 4) ", "F - test-environment/8" + 45 check-screen-row screen, 9/y, " ... trace depth: 4 ", "F - test-environment/9" + 46 check-screen-row screen, 0xa/y, " => 7 ", "F - test-environment/10" + 47 check-screen-row screen, 0xb/y, " ", "F - test-environment/11" + 48 check-screen-row screen, 0xc/y, " ", "F - test-environment/12" + 49 check-screen-row screen, 0xd/y, " ", "F - test-environment/13" + 50 check-screen-row screen, 0xe/y, " ", "F - test-environment/14" 51 # bottom row is for a wordstar-style menu - 52 check-screen-row screen, 0x2f/y, " ^r run main ^s run sandbox ^g go to ^m to trace ^a << ^b <word ^f word> ^e >> ", "F - test-environment/15" + 52 check-screen-row screen, 0x2f/y, " ^r run main ^s run sandbox ^g go to ^m to trace ^a << ^b <word ^f word> ^e >> ", "F - test-environment/15" 53 } 54 55 fn test-definition-in-environment { @@ -122,34 +122,34 @@ if ('onhashchange' in window) { 57 var env/esi: (addr environment) <- address env-storage 58 initialize-environment env, 8/fake-screen-width, 3/fake-screen-height 59 # setup: screen - 60 var screen-on-stack: screen - 61 var screen/edi: (addr screen) <- address screen-on-stack - 62 initialize-screen screen, 0x80/width, 0x30/height, 0/no-pixel-graphics + 60 var screen-on-stack: screen + 61 var screen/edi: (addr screen) <- address screen-on-stack + 62 initialize-screen screen, 0x80/width, 0x30/height, 0/no-pixel-graphics 63 # define a global on the right (sandbox) side - 64 type-in env, screen, "(define f 42)" + 64 type-in env, screen, "(define f 42)" 65 edit-environment env, 0x13/ctrl-s, 0/no-disk - 66 render-environment screen, env + 66 render-environment screen, env 67 # | global definitions | sandbox - 68 check-screen-row screen, 0/y, " ", "F - test-definition-in-environment/0" + 68 check-screen-row screen, 0/y, " ", "F - test-definition-in-environment/0" 69 # global definition is now on the left side - 70 check-screen-row screen, 1/y, " (define f 42) screen: ", "F - test-definition-in-environment/1" - 71 check-background-color-in-screen-row screen, 0/bg, 2/y, " ........ ", "F - test-definition-in-environment/2" - 72 check-background-color-in-screen-row screen, 0/bg, 3/y, " ........ ", "F - test-definition-in-environment/3" - 73 check-background-color-in-screen-row screen, 0/bg, 4/y, " ........ ", "F - test-definition-in-environment/4" - 74 check-screen-row screen, 5/y, " ", "F - test-definition-in-environment/4" - 75 check-screen-row screen, 6/y, " keyboard: ", "F - test-definition-in-environment/5" - 76 check-background-color-in-screen-row screen, 0/bg, 6/y, " ................ ", "F - test-definition-in-environment/5-2" - 77 check-screen-row screen, 7/y, " ", "F - test-definition-in-environment/6" - 78 check-screen-row screen, 8/y, " ", "F - test-definition-in-environment/7" + 70 check-screen-row screen, 1/y, " (define f 42) screen: ", "F - test-definition-in-environment/1" + 71 check-background-color-in-screen-row screen, 0/bg, 2/y, " ........ ", "F - test-definition-in-environment/2" + 72 check-background-color-in-screen-row screen, 0/bg, 3/y, " ........ ", "F - test-definition-in-environment/3" + 73 check-background-color-in-screen-row screen, 0/bg, 4/y, " ........ ", "F - test-definition-in-environment/4" + 74 check-screen-row screen, 5/y, " ", "F - test-definition-in-environment/4" + 75 check-screen-row screen, 6/y, " keyboard: ", "F - test-definition-in-environment/5" + 76 check-background-color-in-screen-row screen, 0/bg, 6/y, " ................ ", "F - test-definition-in-environment/5-2" + 77 check-screen-row screen, 7/y, " ", "F - test-definition-in-environment/6" + 78 check-screen-row screen, 8/y, " ", "F - test-definition-in-environment/7" 79 # you can still see the trace on the right for what you just added to the left - 80 check-screen-row screen, 9/y, " ... trace depth: 4 ", "F - test-definition-in-environment/8" + 80 check-screen-row screen, 9/y, " ... trace depth: 4 ", "F - test-definition-in-environment/8" 81 } 82 83 # helper for testing - 84 fn type-in self: (addr environment), screen: (addr screen), keys: (addr array byte) { + 84 fn type-in self: (addr environment), screen: (addr screen), keys: (addr array byte) { 85 # clear the buffer 86 edit-environment self, 0x15/ctrl-u, 0/no-disk - 87 render-environment screen, self + 87 render-environment screen, self 88 # type in all the keys 89 var input-stream-storage: (stream byte 0x40/capacity) 90 var input-stream/ecx: (addr stream byte) <- address input-stream-storage @@ -160,7 +160,7 @@ if ('onhashchange' in window) { 95 break-if-!= 96 var key/eax: grapheme <- read-grapheme input-stream 97 edit-environment self, key, 0/no-disk - 98 render-environment screen, self + 98 render-environment screen, self 99 loop 100 } 101 } @@ -177,7 +177,7 @@ if ('onhashchange' in window) { 112 initialize-gap-buffer partial-global-name, 0x40/global-name-capacity 113 } 114 - 115 fn render-environment screen: (addr screen), _self: (addr environment) { + 115 fn render-environment screen: (addr screen), _self: (addr environment) { 116 # globals layout: 1 char padding, 41 code, 1 padding, 41 code, 1 padding = 85 117 # sandbox layout: 1 padding, 41 code, 1 padding = 43 118 # total = 128 chars @@ -185,18 +185,18 @@ if ('onhashchange' in window) { 120 var cursor-in-globals-a/eax: (addr boolean) <- get self, cursor-in-globals? 121 var cursor-in-globals?/eax: boolean <- copy *cursor-in-globals-a 122 var globals/ecx: (addr global-table) <- get self, globals - 123 render-globals screen, globals, cursor-in-globals? + 123 render-globals screen, globals, cursor-in-globals? 124 var sandbox/edx: (addr sandbox) <- get self, sandbox 125 var cursor-in-sandbox?/ebx: boolean <- copy 1/true 126 cursor-in-sandbox? <- subtract cursor-in-globals? - 127 render-sandbox screen, sandbox, 0x55/sandbox-left-margin, 0/sandbox-top-margin, 0x80/screen-width, 0x2f/screen-height-without-menu, cursor-in-sandbox? + 127 render-sandbox screen, sandbox, 0x55/sandbox-left-margin, 0/sandbox-top-margin, 0x80/screen-width, 0x2f/screen-height-without-menu, cursor-in-sandbox? 128 # modal if necessary 129 { 130 var cursor-in-go-modal-a/eax: (addr boolean) <- get self, cursor-in-go-modal? 131 compare *cursor-in-go-modal-a, 0/false 132 break-if-= - 133 render-go-modal screen, self - 134 render-go-modal-menu screen, self + 133 render-go-modal screen, self + 134 render-go-modal-menu screen, self 135 return 136 } 137 # render menu @@ -204,10 +204,10 @@ if ('onhashchange' in window) { 139 var cursor-in-globals?/eax: (addr boolean) <- get self, cursor-in-globals? 140 compare *cursor-in-globals?, 0/false 141 break-if-= - 142 render-globals-menu screen, globals + 142 render-globals-menu screen, globals 143 return 144 } - 145 render-sandbox-menu screen, sandbox + 145 render-sandbox-menu screen, sandbox 146 } 147 148 fn edit-environment _self: (addr environment), key: grapheme, data-disk: (addr disk) { @@ -246,8 +246,8 @@ if ('onhashchange' in window) { 181 tmp <- address args 182 new-pair tmp, main, *tmp 183 # clear real screen - 184 clear-screen 0/screen - 185 set-cursor-position 0/screen, 0, 0 + 184 clear-screen 0/screen + 185 set-cursor-position 0/screen, 0, 0 186 # run 187 var out: (handle cell) 188 var out-ah/ecx: (addr handle cell) <- address out @@ -498,34 +498,34 @@ if ('onhashchange' in window) { 433 var env/esi: (addr environment) <- address env-storage 434 initialize-environment env, 8/fake-screen-width, 3/fake-screen-height 435 # setup: screen - 436 var screen-on-stack: screen - 437 var screen/edi: (addr screen) <- address screen-on-stack - 438 initialize-screen screen, 0x80/width, 0x10/height, 0/no-pixel-graphics + 436 var screen-on-stack: screen + 437 var screen/edi: (addr screen) <- address screen-on-stack + 438 initialize-screen screen, 0x80/width, 0x10/height, 0/no-pixel-graphics 439 # hit ctrl-g 440 edit-environment env, 7/ctrl-g, 0/no-disk - 441 render-environment screen, env + 441 render-environment screen, env 442 # - 443 check-background-color-in-screen-row screen, 0xf/bg=modal, 0/y, " ", "F - test-go-modal/0" - 444 check-background-color-in-screen-row screen, 0xf/bg=modal, 1/y, " ", "F - test-go-modal/1" - 445 check-background-color-in-screen-row screen, 0xf/bg=modal, 2/y, " ", "F - test-go-modal/2" - 446 check-background-color-in-screen-row screen, 0xf/bg=modal, 3/y, " ", "F - test-go-modal/3" - 447 check-background-color-in-screen-row screen, 0xf/bg=modal, 4/y, " ", "F - test-go-modal/4" - 448 check-background-color-in-screen-row screen, 0xf/bg=modal, 5/y, " ", "F - test-go-modal/5" - 449 check-screen-row screen, 6/y, " go to global (or leave blank to go to REPL) ", "F - test-go-modal/6-text" - 450 check-background-color-in-screen-row screen, 0xf/bg=modal, 6/y, " ................................................................ ", "F - test-go-modal/6" - 451 check-background-color-in-screen-row screen, 0xf/bg=modal, 7/y, " ................................................................ ", "F - test-go-modal/7" + 443 check-background-color-in-screen-row screen, 0xf/bg=modal, 0/y, " ", "F - test-go-modal/0" + 444 check-background-color-in-screen-row screen, 0xf/bg=modal, 1/y, " ", "F - test-go-modal/1" + 445 check-background-color-in-screen-row screen, 0xf/bg=modal, 2/y, " ", "F - test-go-modal/2" + 446 check-background-color-in-screen-row screen, 0xf/bg=modal, 3/y, " ", "F - test-go-modal/3" + 447 check-background-color-in-screen-row screen, 0xf/bg=modal, 4/y, " ", "F - test-go-modal/4" + 448 check-background-color-in-screen-row screen, 0xf/bg=modal, 5/y, " ", "F - test-go-modal/5" + 449 check-screen-row screen, 6/y, " go to global (or leave blank to go to REPL) ", "F - test-go-modal/6-text" + 450 check-background-color-in-screen-row screen, 0xf/bg=modal, 6/y, " ................................................................ ", "F - test-go-modal/6" + 451 check-background-color-in-screen-row screen, 0xf/bg=modal, 7/y, " ................................................................ ", "F - test-go-modal/7" 452 # cursor is in the modal - 453 check-background-color-in-screen-row screen, 0/bg=cursor, 8/y, " | ", "F - test-go-modal/8-cursor" - 454 check-background-color-in-screen-row screen, 0xf/bg=modal, 8/y, " ............................................................... ", "F - test-go-modal/8" - 455 check-background-color-in-screen-row screen, 0xf/bg=modal, 9/y, " ", "F - test-go-modal/9" - 456 check-background-color-in-screen-row screen, 0xf/bg=modal, 0xa/y, " ", "F - test-go-modal/10" - 457 check-background-color-in-screen-row screen, 0xf/bg=modal, 0xb/y, " ", "F - test-go-modal/11" - 458 check-background-color-in-screen-row screen, 0xf/bg=modal, 0xc/y, " ", "F - test-go-modal/12" - 459 check-background-color-in-screen-row screen, 0xf/bg=modal, 0xd/y, " ", "F - test-go-modal/13" - 460 check-background-color-in-screen-row screen, 0xf/bg=modal, 0xe/y, " ", "F - test-go-modal/14" + 453 check-background-color-in-screen-row screen, 0/bg=cursor, 8/y, " | ", "F - test-go-modal/8-cursor" + 454 check-background-color-in-screen-row screen, 0xf/bg=modal, 8/y, " ............................................................... ", "F - test-go-modal/8" + 455 check-background-color-in-screen-row screen, 0xf/bg=modal, 9/y, " ", "F - test-go-modal/9" + 456 check-background-color-in-screen-row screen, 0xf/bg=modal, 0xa/y, " ", "F - test-go-modal/10" + 457 check-background-color-in-screen-row screen, 0xf/bg=modal, 0xb/y, " ", "F - test-go-modal/11" + 458 check-background-color-in-screen-row screen, 0xf/bg=modal, 0xc/y, " ", "F - test-go-modal/12" + 459 check-background-color-in-screen-row screen, 0xf/bg=modal, 0xd/y, " ", "F - test-go-modal/13" + 460 check-background-color-in-screen-row screen, 0xf/bg=modal, 0xe/y, " ", "F - test-go-modal/14" 461 # menu at bottom is correct in context - 462 check-screen-row screen, 0xf/y, " ^r run main enter go ^m create esc cancel ^a << ^b <word ^f word> ^e >> ", "F - test-go-modal/15-text" - 463 check-background-color-in-screen-row screen, 0xf/bg=modal, 0xf/y, " ", "F - test-go-modal/15" + 462 check-screen-row screen, 0xf/y, " ^r run main enter go ^m create esc cancel ^a << ^b <word ^f word> ^e >> ", "F - test-go-modal/15-text" + 463 check-background-color-in-screen-row screen, 0xf/bg=modal, 0xf/y, " ", "F - test-go-modal/15" 464 } 465 466 fn test-leave-go-modal { @@ -533,32 +533,32 @@ if ('onhashchange' in window) { 468 var env/esi: (addr environment) <- address env-storage 469 initialize-environment env, 8/fake-screen-width, 3/fake-screen-height 470 # setup: screen - 471 var screen-on-stack: screen - 472 var screen/edi: (addr screen) <- address screen-on-stack - 473 initialize-screen screen, 0x80/width, 0x10/height, 0/no-pixel-graphics + 471 var screen-on-stack: screen + 472 var screen/edi: (addr screen) <- address screen-on-stack + 473 initialize-screen screen, 0x80/width, 0x10/height, 0/no-pixel-graphics 474 # hit ctrl-g 475 edit-environment env, 7/ctrl-g, 0/no-disk - 476 render-environment screen, env + 476 render-environment screen, env 477 # cancel 478 edit-environment env, 0x1b/escape, 0/no-disk - 479 render-environment screen, env + 479 render-environment screen, env 480 # no modal - 481 check-background-color-in-screen-row screen, 0xf/bg=modal, 0/y, " ", "F - test-leave-go-modal/0" - 482 check-background-color-in-screen-row screen, 0xf/bg=modal, 1/y, " ", "F - test-leave-go-modal/1" - 483 check-background-color-in-screen-row screen, 0xf/bg=modal, 2/y, " ", "F - test-leave-go-modal/2" - 484 check-background-color-in-screen-row screen, 0xf/bg=modal, 3/y, " ", "F - test-leave-go-modal/3" - 485 check-background-color-in-screen-row screen, 0xf/bg=modal, 4/y, " ", "F - test-leave-go-modal/4" - 486 check-background-color-in-screen-row screen, 0xf/bg=modal, 5/y, " ", "F - test-leave-go-modal/5" - 487 check-background-color-in-screen-row screen, 0xf/bg=modal, 6/y, " ", "F - test-leave-go-modal/6" - 488 check-background-color-in-screen-row screen, 0xf/bg=modal, 7/y, " ", "F - test-leave-go-modal/7" - 489 check-background-color-in-screen-row screen, 0xf/bg=modal, 8/y, " ", "F - test-leave-go-modal/8" - 490 check-background-color-in-screen-row screen, 0xf/bg=modal, 9/y, " ", "F - test-leave-go-modal/9" - 491 check-background-color-in-screen-row screen, 0xf/bg=modal, 0xa/y, " ", "F - test-leave-go-modal/10" - 492 check-background-color-in-screen-row screen, 0xf/bg=modal, 0xb/y, " ", "F - test-leave-go-modal/11" - 493 check-background-color-in-screen-row screen, 0xf/bg=modal, 0xc/y, " ", "F - test-leave-go-modal/12" - 494 check-background-color-in-screen-row screen, 0xf/bg=modal, 0xd/y, " ", "F - test-leave-go-modal/13" - 495 check-background-color-in-screen-row screen, 0xf/bg=modal, 0xe/y, " ", "F - test-leave-go-modal/14" - 496 check-background-color-in-screen-row screen, 0xf/bg=modal, 0xf/y, " ", "F - test-leave-go-modal/15" + 481 check-background-color-in-screen-row screen, 0xf/bg=modal, 0/y, " ", "F - test-leave-go-modal/0" + 482 check-background-color-in-screen-row screen, 0xf/bg=modal, 1/y, " ", "F - test-leave-go-modal/1" + 483 check-background-color-in-screen-row screen, 0xf/bg=modal, 2/y, " ", "F - test-leave-go-modal/2" + 484 check-background-color-in-screen-row screen, 0xf/bg=modal, 3/y, " ", "F - test-leave-go-modal/3" + 485 check-background-color-in-screen-row screen, 0xf/bg=modal, 4/y, " ", "F - test-leave-go-modal/4" + 486 check-background-color-in-screen-row screen, 0xf/bg=modal, 5/y, " ", "F - test-leave-go-modal/5" + 487 check-background-color-in-screen-row screen, 0xf/bg=modal, 6/y, " ", "F - test-leave-go-modal/6" + 488 check-background-color-in-screen-row screen, 0xf/bg=modal, 7/y, " ", "F - test-leave-go-modal/7" + 489 check-background-color-in-screen-row screen, 0xf/bg=modal, 8/y, " ", "F - test-leave-go-modal/8" + 490 check-background-color-in-screen-row screen, 0xf/bg=modal, 9/y, " ", "F - test-leave-go-modal/9" + 491 check-background-color-in-screen-row screen, 0xf/bg=modal, 0xa/y, " ", "F - test-leave-go-modal/10" + 492 check-background-color-in-screen-row screen, 0xf/bg=modal, 0xb/y, " ", "F - test-leave-go-modal/11" + 493 check-background-color-in-screen-row screen, 0xf/bg=modal, 0xc/y, " ", "F - test-leave-go-modal/12" + 494 check-background-color-in-screen-row screen, 0xf/bg=modal, 0xd/y, " ", "F - test-leave-go-modal/13" + 495 check-background-color-in-screen-row screen, 0xf/bg=modal, 0xe/y, " ", "F - test-leave-go-modal/14" + 496 check-background-color-in-screen-row screen, 0xf/bg=modal, 0xf/y, " ", "F - test-leave-go-modal/15" 497 } 498 499 fn test-jump-to-global { @@ -566,42 +566,42 @@ if ('onhashchange' in window) { 501 var env/esi: (addr environment) <- address env-storage 502 initialize-environment env, 8/fake-screen-width, 3/fake-screen-height 503 # setup: screen - 504 var screen-on-stack: screen - 505 var screen/edi: (addr screen) <- address screen-on-stack - 506 initialize-screen screen, 0x80/width, 0x30/height, 0/no-pixel-graphics + 504 var screen-on-stack: screen + 505 var screen/edi: (addr screen) <- address screen-on-stack + 506 initialize-screen screen, 0x80/width, 0x30/height, 0/no-pixel-graphics 507 # define a global - 508 type-in env, screen, "(define f 42)" + 508 type-in env, screen, "(define f 42)" 509 edit-environment env, 0x13/ctrl-s, 0/no-disk - 510 render-environment screen, env + 510 render-environment screen, env 511 # hit ctrl-g 512 edit-environment env, 7/ctrl-g, 0/no-disk - 513 render-environment screen, env + 513 render-environment screen, env 514 # type global name - 515 type-in env, screen, "f" + 515 type-in env, screen, "f" 516 # submit 517 edit-environment env, 0xa/newline, 0/no-disk - 518 render-environment screen, env + 518 render-environment screen, env 519 # | global definitions | sandbox 520 # cursor now in global definition - 521 check-screen-row screen, 1/y, " (define f 42) screen: ", "F - test-jump-to-global/1" - 522 check-background-color-in-screen-row screen, 7/bg=cursor, 1/y, " | ", "F - test-jump-to-global/1-cursor" + 521 check-screen-row screen, 1/y, " (define f 42) screen: ", "F - test-jump-to-global/1" + 522 check-background-color-in-screen-row screen, 7/bg=cursor, 1/y, " | ", "F - test-jump-to-global/1-cursor" 523 # no modal - 524 check-background-color-in-screen-row screen, 0xf/bg=modal, 0/y, " ", "F - test-jump-to-global/bg0" - 525 check-background-color-in-screen-row screen, 0xf/bg=modal, 1/y, " ", "F - test-jump-to-global/bg1" - 526 check-background-color-in-screen-row screen, 0xf/bg=modal, 2/y, " ", "F - test-jump-to-global/bg2" - 527 check-background-color-in-screen-row screen, 0xf/bg=modal, 3/y, " ", "F - test-jump-to-global/bg3" - 528 check-background-color-in-screen-row screen, 0xf/bg=modal, 4/y, " ", "F - test-jump-to-global/bg4" - 529 check-background-color-in-screen-row screen, 0xf/bg=modal, 5/y, " ", "F - test-jump-to-global/bg5" - 530 check-background-color-in-screen-row screen, 0xf/bg=modal, 6/y, " ", "F - test-jump-to-global/bg6" - 531 check-background-color-in-screen-row screen, 0xf/bg=modal, 7/y, " ", "F - test-jump-to-global/bg7" - 532 check-background-color-in-screen-row screen, 0xf/bg=modal, 8/y, " ", "F - test-jump-to-global/bg8" - 533 check-background-color-in-screen-row screen, 0xf/bg=modal, 9/y, " ", "F - test-jump-to-global/bg9" - 534 check-background-color-in-screen-row screen, 0xf/bg=modal, 0xa/y, " ", "F - test-jump-to-global/bg10" - 535 check-background-color-in-screen-row screen, 0xf/bg=modal, 0xb/y, " ", "F - test-jump-to-global/bg11" - 536 check-background-color-in-screen-row screen, 0xf/bg=modal, 0xc/y, " ", "F - test-jump-to-global/bg12" - 537 check-background-color-in-screen-row screen, 0xf/bg=modal, 0xd/y, " ", "F - test-jump-to-global/bg13" - 538 check-background-color-in-screen-row screen, 0xf/bg=modal, 0xe/y, " ", "F - test-jump-to-global/bg14" - 539 check-background-color-in-screen-row screen, 0xf/bg=modal, 0xf/y, " ", "F - test-jump-to-global/bg15" + 524 check-background-color-in-screen-row screen, 0xf/bg=modal, 0/y, " ", "F - test-jump-to-global/bg0" + 525 check-background-color-in-screen-row screen, 0xf/bg=modal, 1/y, " ", "F - test-jump-to-global/bg1" + 526 check-background-color-in-screen-row screen, 0xf/bg=modal, 2/y, " ", "F - test-jump-to-global/bg2" + 527 check-background-color-in-screen-row screen, 0xf/bg=modal, 3/y, " ", "F - test-jump-to-global/bg3" + 528 check-background-color-in-screen-row screen, 0xf/bg=modal, 4/y, " ", "F - test-jump-to-global/bg4" + 529 check-background-color-in-screen-row screen, 0xf/bg=modal, 5/y, " ", "F - test-jump-to-global/bg5" + 530 check-background-color-in-screen-row screen, 0xf/bg=modal, 6/y, " ", "F - test-jump-to-global/bg6" + 531 check-background-color-in-screen-row screen, 0xf/bg=modal, 7/y, " ", "F - test-jump-to-global/bg7" + 532 check-background-color-in-screen-row screen, 0xf/bg=modal, 8/y, " ", "F - test-jump-to-global/bg8" + 533 check-background-color-in-screen-row screen, 0xf/bg=modal, 9/y, " ", "F - test-jump-to-global/bg9" + 534 check-background-color-in-screen-row screen, 0xf/bg=modal, 0xa/y, " ", "F - test-jump-to-global/bg10" + 535 check-background-color-in-screen-row screen, 0xf/bg=modal, 0xb/y, " ", "F - test-jump-to-global/bg11" + 536 check-background-color-in-screen-row screen, 0xf/bg=modal, 0xc/y, " ", "F - test-jump-to-global/bg12" + 537 check-background-color-in-screen-row screen, 0xf/bg=modal, 0xd/y, " ", "F - test-jump-to-global/bg13" + 538 check-background-color-in-screen-row screen, 0xf/bg=modal, 0xe/y, " ", "F - test-jump-to-global/bg14" + 539 check-background-color-in-screen-row screen, 0xf/bg=modal, 0xf/y, " ", "F - test-jump-to-global/bg15" 540 } 541 542 fn test-go-modal-prepopulates-word-at-cursor { @@ -609,100 +609,100 @@ if ('onhashchange' in window) { 544 var env/esi: (addr environment) <- address env-storage 545 initialize-environment env, 8/fake-screen-width, 3/fake-screen-height 546 # setup: screen - 547 var screen-on-stack: screen - 548 var screen/edi: (addr screen) <- address screen-on-stack - 549 initialize-screen screen, 0x80/width, 0x10/height, 0/no-pixel-graphics + 547 var screen-on-stack: screen + 548 var screen/edi: (addr screen) <- address screen-on-stack + 549 initialize-screen screen, 0x80/width, 0x10/height, 0/no-pixel-graphics 550 # type a word at the cursor - 551 type-in env, screen, "fn1" + 551 type-in env, screen, "fn1" 552 # hit ctrl-g 553 edit-environment env, 7/ctrl-g, 0/no-disk - 554 render-environment screen, env + 554 render-environment screen, env 555 # modal prepopulates word at cursor - 556 check-background-color-in-screen-row screen, 0xf/bg=modal, 0/y, " ", "F - test-go-modal-prepopulates-word-at-cursor/0" - 557 check-background-color-in-screen-row screen, 0xf/bg=modal, 1/y, " ", "F - test-go-modal-prepopulates-word-at-cursor/1" - 558 check-background-color-in-screen-row screen, 0xf/bg=modal, 2/y, " ", "F - test-go-modal-prepopulates-word-at-cursor/2" - 559 check-background-color-in-screen-row screen, 0xf/bg=modal, 3/y, " ", "F - test-go-modal-prepopulates-word-at-cursor/3" - 560 check-background-color-in-screen-row screen, 0xf/bg=modal, 4/y, " ", "F - test-go-modal-prepopulates-word-at-cursor/4" - 561 check-background-color-in-screen-row screen, 0xf/bg=modal, 5/y, " ", "F - test-go-modal-prepopulates-word-at-cursor/5" - 562 check-screen-row screen, 6/y, " go to global (or leave blank to go to REPL) ", "F - test-go-modal-prepopulates-word-at-cursor/6-text" - 563 check-background-color-in-screen-row screen, 0xf/bg=modal, 6/y, " ................................................................ ", "F - test-go-modal-prepopulates-word-at-cursor/6" - 564 check-background-color-in-screen-row screen, 0xf/bg=modal, 7/y, " ................................................................ ", "F - test-go-modal-prepopulates-word-at-cursor/7" + 556 check-background-color-in-screen-row screen, 0xf/bg=modal, 0/y, " ", "F - test-go-modal-prepopulates-word-at-cursor/0" + 557 check-background-color-in-screen-row screen, 0xf/bg=modal, 1/y, " ", "F - test-go-modal-prepopulates-word-at-cursor/1" + 558 check-background-color-in-screen-row screen, 0xf/bg=modal, 2/y, " ", "F - test-go-modal-prepopulates-word-at-cursor/2" + 559 check-background-color-in-screen-row screen, 0xf/bg=modal, 3/y, " ", "F - test-go-modal-prepopulates-word-at-cursor/3" + 560 check-background-color-in-screen-row screen, 0xf/bg=modal, 4/y, " ", "F - test-go-modal-prepopulates-word-at-cursor/4" + 561 check-background-color-in-screen-row screen, 0xf/bg=modal, 5/y, " ", "F - test-go-modal-prepopulates-word-at-cursor/5" + 562 check-screen-row screen, 6/y, " go to global (or leave blank to go to REPL) ", "F - test-go-modal-prepopulates-word-at-cursor/6-text" + 563 check-background-color-in-screen-row screen, 0xf/bg=modal, 6/y, " ................................................................ ", "F - test-go-modal-prepopulates-word-at-cursor/6" + 564 check-background-color-in-screen-row screen, 0xf/bg=modal, 7/y, " ................................................................ ", "F - test-go-modal-prepopulates-word-at-cursor/7" 565 # word at cursor - 566 check-screen-row screen, 8/y, " fn1 ", "F - test-go-modal-prepopulates-word-at-cursor/8-text" + 566 check-screen-row screen, 8/y, " fn1 ", "F - test-go-modal-prepopulates-word-at-cursor/8-text" 567 # new cursor position - 568 check-background-color-in-screen-row screen, 0/bg=cursor, 8/y, " | ", "F - test-go-modal-prepopulates-word-at-cursor/8-cursor" - 569 check-background-color-in-screen-row screen, 0xf/bg=modal, 8/y, " ... ............................................................ ", "F - test-go-modal-prepopulates-word-at-cursor/8" - 570 check-background-color-in-screen-row screen, 0xf/bg=modal, 9/y, " ", "F - test-go-modal-prepopulates-word-at-cursor/9" - 571 check-background-color-in-screen-row screen, 0xf/bg=modal, 0xa/y, " ", "F - test-go-modal-prepopulates-word-at-cursor/10" - 572 check-background-color-in-screen-row screen, 0xf/bg=modal, 0xb/y, " ", "F - test-go-modal-prepopulates-word-at-cursor/11" - 573 check-background-color-in-screen-row screen, 0xf/bg=modal, 0xc/y, " ", "F - test-go-modal-prepopulates-word-at-cursor/12" - 574 check-background-color-in-screen-row screen, 0xf/bg=modal, 0xd/y, " ", "F - test-go-modal-prepopulates-word-at-cursor/13" - 575 check-background-color-in-screen-row screen, 0xf/bg=modal, 0xe/y, " ", "F - test-go-modal-prepopulates-word-at-cursor/14" - 576 check-background-color-in-screen-row screen, 0xf/bg=modal, 0xf/y, " ", "F - test-go-modal-prepopulates-word-at-cursor/15" + 568 check-background-color-in-screen-row screen, 0/bg=cursor, 8/y, " | ", "F - test-go-modal-prepopulates-word-at-cursor/8-cursor" + 569 check-background-color-in-screen-row screen, 0xf/bg=modal, 8/y, " ... ............................................................ ", "F - test-go-modal-prepopulates-word-at-cursor/8" + 570 check-background-color-in-screen-row screen, 0xf/bg=modal, 9/y, " ", "F - test-go-modal-prepopulates-word-at-cursor/9" + 571 check-background-color-in-screen-row screen, 0xf/bg=modal, 0xa/y, " ", "F - test-go-modal-prepopulates-word-at-cursor/10" + 572 check-background-color-in-screen-row screen, 0xf/bg=modal, 0xb/y, " ", "F - test-go-modal-prepopulates-word-at-cursor/11" + 573 check-background-color-in-screen-row screen, 0xf/bg=modal, 0xc/y, " ", "F - test-go-modal-prepopulates-word-at-cursor/12" + 574 check-background-color-in-screen-row screen, 0xf/bg=modal, 0xd/y, " ", "F - test-go-modal-prepopulates-word-at-cursor/13" + 575 check-background-color-in-screen-row screen, 0xf/bg=modal, 0xe/y, " ", "F - test-go-modal-prepopulates-word-at-cursor/14" + 576 check-background-color-in-screen-row screen, 0xf/bg=modal, 0xf/y, " ", "F - test-go-modal-prepopulates-word-at-cursor/15" 577 # cancel 578 edit-environment env, 0x1b/escape, 0/no-disk - 579 render-environment screen, env + 579 render-environment screen, env 580 # type one more space 581 edit-environment env, 0x20/space, 0/no-disk - 582 render-environment screen, env + 582 render-environment screen, env 583 # hit ctrl-g again 584 edit-environment env, 7/ctrl-g, 0/no-disk - 585 render-environment screen, env + 585 render-environment screen, env 586 # no word prepopulated since cursor is not on the word - 587 check-background-color-in-screen-row screen, 0xf/bg=modal, 0/y, " ", "F - test-go-modal-prepopulates-word-at-cursor/test2-0" - 588 check-background-color-in-screen-row screen, 0xf/bg=modal, 1/y, " ", "F - test-go-modal-prepopulates-word-at-cursor/test2-1" - 589 check-background-color-in-screen-row screen, 0xf/bg=modal, 2/y, " ", "F - test-go-modal-prepopulates-word-at-cursor/test2-2" - 590 check-background-color-in-screen-row screen, 0xf/bg=modal, 3/y, " ", "F - test-go-modal-prepopulates-word-at-cursor/test2-3" - 591 check-background-color-in-screen-row screen, 0xf/bg=modal, 4/y, " ", "F - test-go-modal-prepopulates-word-at-cursor/test2-4" - 592 check-background-color-in-screen-row screen, 0xf/bg=modal, 5/y, " ", "F - test-go-modal-prepopulates-word-at-cursor/test2-5" - 593 check-screen-row screen, 6/y, " go to global (or leave blank to go to REPL) ", "F - test-go-modal-prepopulates-word-at-cursor/test2-6-text" - 594 check-background-color-in-screen-row screen, 0xf/bg=modal, 6/y, " ................................................................ ", "F - test-go-modal-prepopulates-word-at-cursor/test2-6" - 595 check-background-color-in-screen-row screen, 0xf/bg=modal, 7/y, " ................................................................ ", "F - test-go-modal-prepopulates-word-at-cursor/test2-7" + 587 check-background-color-in-screen-row screen, 0xf/bg=modal, 0/y, " ", "F - test-go-modal-prepopulates-word-at-cursor/test2-0" + 588 check-background-color-in-screen-row screen, 0xf/bg=modal, 1/y, " ", "F - test-go-modal-prepopulates-word-at-cursor/test2-1" + 589 check-background-color-in-screen-row screen, 0xf/bg=modal, 2/y, " ", "F - test-go-modal-prepopulates-word-at-cursor/test2-2" + 590 check-background-color-in-screen-row screen, 0xf/bg=modal, 3/y, " ", "F - test-go-modal-prepopulates-word-at-cursor/test2-3" + 591 check-background-color-in-screen-row screen, 0xf/bg=modal, 4/y, " ", "F - test-go-modal-prepopulates-word-at-cursor/test2-4" + 592 check-background-color-in-screen-row screen, 0xf/bg=modal, 5/y, " ", "F - test-go-modal-prepopulates-word-at-cursor/test2-5" + 593 check-screen-row screen, 6/y, " go to global (or leave blank to go to REPL) ", "F - test-go-modal-prepopulates-word-at-cursor/test2-6-text" + 594 check-background-color-in-screen-row screen, 0xf/bg=modal, 6/y, " ................................................................ ", "F - test-go-modal-prepopulates-word-at-cursor/test2-6" + 595 check-background-color-in-screen-row screen, 0xf/bg=modal, 7/y, " ................................................................ ", "F - test-go-modal-prepopulates-word-at-cursor/test2-7" 596 # no word at cursor - 597 check-screen-row screen, 8/y, " ", "F - test-go-modal-prepopulates-word-at-cursor/test2-8-text" + 597 check-screen-row screen, 8/y, " ", "F - test-go-modal-prepopulates-word-at-cursor/test2-8-text" 598 # new cursor position - 599 check-background-color-in-screen-row screen, 0/bg=cursor, 8/y, " | ", "F - test-go-modal-prepopulates-word-at-cursor/test2-8-cursor" - 600 check-background-color-in-screen-row screen, 0xf/bg=modal, 8/y, " ............................................................... ", "F - test-go-modal-prepopulates-word-at-cursor/test2-8" - 601 check-background-color-in-screen-row screen, 0xf/bg=modal, 9/y, " ", "F - test-go-modal-prepopulates-word-at-cursor/test2-9" - 602 check-background-color-in-screen-row screen, 0xf/bg=modal, 0xa/y, " ", "F - test-go-modal-prepopulates-word-at-cursor/test2-10" - 603 check-background-color-in-screen-row screen, 0xf/bg=modal, 0xb/y, " ", "F - test-go-modal-prepopulates-word-at-cursor/test2-11" - 604 check-background-color-in-screen-row screen, 0xf/bg=modal, 0xc/y, " ", "F - test-go-modal-prepopulates-word-at-cursor/test2-12" - 605 check-background-color-in-screen-row screen, 0xf/bg=modal, 0xd/y, " ", "F - test-go-modal-prepopulates-word-at-cursor/test2-13" - 606 check-background-color-in-screen-row screen, 0xf/bg=modal, 0xe/y, " ", "F - test-go-modal-prepopulates-word-at-cursor/test2-14" - 607 check-background-color-in-screen-row screen, 0xf/bg=modal, 0xf/y, " ", "F - test-go-modal-prepopulates-word-at-cursor/test2-15" + 599 check-background-color-in-screen-row screen, 0/bg=cursor, 8/y, " | ", "F - test-go-modal-prepopulates-word-at-cursor/test2-8-cursor" + 600 check-background-color-in-screen-row screen, 0xf/bg=modal, 8/y, " ............................................................... ", "F - test-go-modal-prepopulates-word-at-cursor/test2-8" + 601 check-background-color-in-screen-row screen, 0xf/bg=modal, 9/y, " ", "F - test-go-modal-prepopulates-word-at-cursor/test2-9" + 602 check-background-color-in-screen-row screen, 0xf/bg=modal, 0xa/y, " ", "F - test-go-modal-prepopulates-word-at-cursor/test2-10" + 603 check-background-color-in-screen-row screen, 0xf/bg=modal, 0xb/y, " ", "F - test-go-modal-prepopulates-word-at-cursor/test2-11" + 604 check-background-color-in-screen-row screen, 0xf/bg=modal, 0xc/y, " ", "F - test-go-modal-prepopulates-word-at-cursor/test2-12" + 605 check-background-color-in-screen-row screen, 0xf/bg=modal, 0xd/y, " ", "F - test-go-modal-prepopulates-word-at-cursor/test2-13" + 606 check-background-color-in-screen-row screen, 0xf/bg=modal, 0xe/y, " ", "F - test-go-modal-prepopulates-word-at-cursor/test2-14" + 607 check-background-color-in-screen-row screen, 0xf/bg=modal, 0xf/y, " ", "F - test-go-modal-prepopulates-word-at-cursor/test2-15" 608 # cancel 609 edit-environment env, 0x1b/escape, 0/no-disk - 610 render-environment screen, env + 610 render-environment screen, env 611 # move cursor to the left until it's on the word again 612 edit-environment env, 0x80/left-arrow, 0/no-disk - 613 render-environment screen, env + 613 render-environment screen, env 614 edit-environment env, 0x80/left-arrow, 0/no-disk - 615 render-environment screen, env + 615 render-environment screen, env 616 # hit ctrl-g again 617 edit-environment env, 7/ctrl-g, 0/no-disk - 618 render-environment screen, env + 618 render-environment screen, env 619 # word prepopulated like before - 620 check-background-color-in-screen-row screen, 0xf/bg=modal, 0/y, " ", "F - test-go-modal-prepopulates-word-at-cursor/test3-0" - 621 check-background-color-in-screen-row screen, 0xf/bg=modal, 1/y, " ", "F - test-go-modal-prepopulates-word-at-cursor/test3-1" - 622 check-background-color-in-screen-row screen, 0xf/bg=modal, 2/y, " ", "F - test-go-modal-prepopulates-word-at-cursor/test3-2" - 623 check-background-color-in-screen-row screen, 0xf/bg=modal, 3/y, " ", "F - test-go-modal-prepopulates-word-at-cursor/test3-3" - 624 check-background-color-in-screen-row screen, 0xf/bg=modal, 4/y, " ", "F - test-go-modal-prepopulates-word-at-cursor/test3-4" - 625 check-background-color-in-screen-row screen, 0xf/bg=modal, 5/y, " ", "F - test-go-modal-prepopulates-word-at-cursor/test3-5" - 626 check-screen-row screen, 6/y, " go to global (or leave blank to go to REPL) ", "F - test-go-modal-prepopulates-word-at-cursor/test3-6-text" - 627 check-background-color-in-screen-row screen, 0xf/bg=modal, 6/y, " ................................................................ ", "F - test-go-modal-prepopulates-word-at-cursor/test3-6" - 628 check-background-color-in-screen-row screen, 0xf/bg=modal, 7/y, " ................................................................ ", "F - test-go-modal-prepopulates-word-at-cursor/test3-7" + 620 check-background-color-in-screen-row screen, 0xf/bg=modal, 0/y, " ", "F - test-go-modal-prepopulates-word-at-cursor/test3-0" + 621 check-background-color-in-screen-row screen, 0xf/bg=modal, 1/y, " ", "F - test-go-modal-prepopulates-word-at-cursor/test3-1" + 622 check-background-color-in-screen-row screen, 0xf/bg=modal, 2/y, " ", "F - test-go-modal-prepopulates-word-at-cursor/test3-2" + 623 check-background-color-in-screen-row screen, 0xf/bg=modal, 3/y, " ", "F - test-go-modal-prepopulates-word-at-cursor/test3-3" + 624 check-background-color-in-screen-row screen, 0xf/bg=modal, 4/y, " ", "F - test-go-modal-prepopulates-word-at-cursor/test3-4" + 625 check-background-color-in-screen-row screen, 0xf/bg=modal, 5/y, " ", "F - test-go-modal-prepopulates-word-at-cursor/test3-5" + 626 check-screen-row screen, 6/y, " go to global (or leave blank to go to REPL) ", "F - test-go-modal-prepopulates-word-at-cursor/test3-6-text" + 627 check-background-color-in-screen-row screen, 0xf/bg=modal, 6/y, " ................................................................ ", "F - test-go-modal-prepopulates-word-at-cursor/test3-6" + 628 check-background-color-in-screen-row screen, 0xf/bg=modal, 7/y, " ................................................................ ", "F - test-go-modal-prepopulates-word-at-cursor/test3-7" 629 # word at cursor - 630 check-screen-row screen, 8/y, " fn1 ", "F - test-go-modal-prepopulates-word-at-cursor/test3-8-text" + 630 check-screen-row screen, 8/y, " fn1 ", "F - test-go-modal-prepopulates-word-at-cursor/test3-8-text" 631 # new cursor position - 632 check-background-color-in-screen-row screen, 0/bg=cursor, 8/y, " | ", "F - test-go-modal-prepopulates-word-at-cursor/test3-8-cursor" - 633 check-background-color-in-screen-row screen, 0xf/bg=modal, 8/y, " ... ............................................................ ", "F - test-go-modal-prepopulates-word-at-cursor/test3-8" - 634 check-background-color-in-screen-row screen, 0xf/bg=modal, 9/y, " ", "F - test-go-modal-prepopulates-word-at-cursor/test3-9" - 635 check-background-color-in-screen-row screen, 0xf/bg=modal, 0xa/y, " ", "F - test-go-modal-prepopulates-word-at-cursor/test3-10" - 636 check-background-color-in-screen-row screen, 0xf/bg=modal, 0xb/y, " ", "F - test-go-modal-prepopulates-word-at-cursor/test3-11" - 637 check-background-color-in-screen-row screen, 0xf/bg=modal, 0xc/y, " ", "F - test-go-modal-prepopulates-word-at-cursor/test3-12" - 638 check-background-color-in-screen-row screen, 0xf/bg=modal, 0xd/y, " ", "F - test-go-modal-prepopulates-word-at-cursor/test3-13" - 639 check-background-color-in-screen-row screen, 0xf/bg=modal, 0xe/y, " ", "F - test-go-modal-prepopulates-word-at-cursor/test3-14" - 640 check-background-color-in-screen-row screen, 0xf/bg=modal, 0xf/y, " ", "F - test-go-modal-prepopulates-word-at-cursor/test3-15" + 632 check-background-color-in-screen-row screen, 0/bg=cursor, 8/y, " | ", "F - test-go-modal-prepopulates-word-at-cursor/test3-8-cursor" + 633 check-background-color-in-screen-row screen, 0xf/bg=modal, 8/y, " ... ............................................................ ", "F - test-go-modal-prepopulates-word-at-cursor/test3-8" + 634 check-background-color-in-screen-row screen, 0xf/bg=modal, 9/y, " ", "F - test-go-modal-prepopulates-word-at-cursor/test3-9" + 635 check-background-color-in-screen-row screen, 0xf/bg=modal, 0xa/y, " ", "F - test-go-modal-prepopulates-word-at-cursor/test3-10" + 636 check-background-color-in-screen-row screen, 0xf/bg=modal, 0xb/y, " ", "F - test-go-modal-prepopulates-word-at-cursor/test3-11" + 637 check-background-color-in-screen-row screen, 0xf/bg=modal, 0xc/y, " ", "F - test-go-modal-prepopulates-word-at-cursor/test3-12" + 638 check-background-color-in-screen-row screen, 0xf/bg=modal, 0xd/y, " ", "F - test-go-modal-prepopulates-word-at-cursor/test3-13" + 639 check-background-color-in-screen-row screen, 0xf/bg=modal, 0xe/y, " ", "F - test-go-modal-prepopulates-word-at-cursor/test3-14" + 640 check-background-color-in-screen-row screen, 0xf/bg=modal, 0xf/y, " ", "F - test-go-modal-prepopulates-word-at-cursor/test3-15" 641 } 642 643 fn test-jump-to-nonexistent-global { @@ -710,70 +710,70 @@ if ('onhashchange' in window) { 645 var env/esi: (addr environment) <- address env-storage 646 initialize-environment env, 8/fake-screen-width, 3/fake-screen-height 647 # setup: screen - 648 var screen-on-stack: screen - 649 var screen/edi: (addr screen) <- address screen-on-stack - 650 initialize-screen screen, 0x80/width, 0x10/height, 0/no-pixel-graphics + 648 var screen-on-stack: screen + 649 var screen/edi: (addr screen) <- address screen-on-stack + 650 initialize-screen screen, 0x80/width, 0x10/height, 0/no-pixel-graphics 651 # type in any (nonexistent) global name - 652 type-in env, screen, "f" + 652 type-in env, screen, "f" 653 # hit ctrl-g 654 edit-environment env, 7/ctrl-g, 0/no-disk - 655 render-environment screen, env + 655 render-environment screen, env 656 # submit 657 edit-environment env, 0xa/newline, 0/no-disk - 658 render-environment screen, env + 658 render-environment screen, env 659 # modal now shows an error 660 # | global definitions | sandbox - 661 check-background-color-in-screen-row screen, 0xf/bg=modal, 0/y, " ", "F - test-jump-to-nonexistent-global/0" - 662 check-background-color-in-screen-row screen, 0xf/bg=modal, 1/y, " ", "F - test-jump-to-nonexistent-global/1" - 663 check-background-color-in-screen-row screen, 0xf/bg=modal, 2/y, " ", "F - test-jump-to-nonexistent-global/2" - 664 check-background-color-in-screen-row screen, 0xf/bg=modal, 3/y, " ", "F - test-jump-to-nonexistent-global/3" - 665 check-background-color-in-screen-row screen, 0xf/bg=modal, 4/y, " ", "F - test-jump-to-nonexistent-global/4" - 666 check-background-color-in-screen-row screen, 0xf/bg=modal, 5/y, " ", "F - test-jump-to-nonexistent-global/5" - 667 check-screen-row screen, 6/y, " go to global (or leave blank to go to REPL) ", "F - test-jump-to-nonexistent-global/6-text" - 668 check-background-color-in-screen-row screen, 0xf/bg=modal, 6/y, " ................................................................ ", "F - test-jump-to-nonexistent-global/6" - 669 check-screen-row-in-color screen, 4/fg=error, 7/y, " no such global ", "F - test-jump-to-nonexistent-global/7-text" - 670 check-background-color-in-screen-row screen, 0xf/bg=modal, 7/y, " ................................................................ ", "F - test-jump-to-nonexistent-global/7" - 671 check-screen-row screen, 8/y, " f ", "F - test-jump-to-nonexistent-global/8-text" - 672 check-background-color-in-screen-row screen, 0/bg=cursor, 8/y, " | ", "F - test-jump-to-nonexistent-global/8-cursor" - 673 check-background-color-in-screen-row screen, 0xf/bg=modal, 8/y, " . .............................................................. ", "F - test-jump-to-nonexistent-global/8" - 674 check-background-color-in-screen-row screen, 0xf/bg=modal, 9/y, " ", "F - test-jump-to-nonexistent-global/9" - 675 check-background-color-in-screen-row screen, 0xf/bg=modal, 0xa/y, " ", "F - test-jump-to-nonexistent-global/10" - 676 check-background-color-in-screen-row screen, 0xf/bg=modal, 0xb/y, " ", "F - test-jump-to-nonexistent-global/11" - 677 check-background-color-in-screen-row screen, 0xf/bg=modal, 0xc/y, " ", "F - test-jump-to-nonexistent-global/12" - 678 check-background-color-in-screen-row screen, 0xf/bg=modal, 0xd/y, " ", "F - test-jump-to-nonexistent-global/13" - 679 check-background-color-in-screen-row screen, 0xf/bg=modal, 0xe/y, " ", "F - test-jump-to-nonexistent-global/14" + 661 check-background-color-in-screen-row screen, 0xf/bg=modal, 0/y, " ", "F - test-jump-to-nonexistent-global/0" + 662 check-background-color-in-screen-row screen, 0xf/bg=modal, 1/y, " ", "F - test-jump-to-nonexistent-global/1" + 663 check-background-color-in-screen-row screen, 0xf/bg=modal, 2/y, " ", "F - test-jump-to-nonexistent-global/2" + 664 check-background-color-in-screen-row screen, 0xf/bg=modal, 3/y, " ", "F - test-jump-to-nonexistent-global/3" + 665 check-background-color-in-screen-row screen, 0xf/bg=modal, 4/y, " ", "F - test-jump-to-nonexistent-global/4" + 666 check-background-color-in-screen-row screen, 0xf/bg=modal, 5/y, " ", "F - test-jump-to-nonexistent-global/5" + 667 check-screen-row screen, 6/y, " go to global (or leave blank to go to REPL) ", "F - test-jump-to-nonexistent-global/6-text" + 668 check-background-color-in-screen-row screen, 0xf/bg=modal, 6/y, " ................................................................ ", "F - test-jump-to-nonexistent-global/6" + 669 check-screen-row-in-color screen, 4/fg=error, 7/y, " no such global ", "F - test-jump-to-nonexistent-global/7-text" + 670 check-background-color-in-screen-row screen, 0xf/bg=modal, 7/y, " ................................................................ ", "F - test-jump-to-nonexistent-global/7" + 671 check-screen-row screen, 8/y, " f ", "F - test-jump-to-nonexistent-global/8-text" + 672 check-background-color-in-screen-row screen, 0/bg=cursor, 8/y, " | ", "F - test-jump-to-nonexistent-global/8-cursor" + 673 check-background-color-in-screen-row screen, 0xf/bg=modal, 8/y, " . .............................................................. ", "F - test-jump-to-nonexistent-global/8" + 674 check-background-color-in-screen-row screen, 0xf/bg=modal, 9/y, " ", "F - test-jump-to-nonexistent-global/9" + 675 check-background-color-in-screen-row screen, 0xf/bg=modal, 0xa/y, " ", "F - test-jump-to-nonexistent-global/10" + 676 check-background-color-in-screen-row screen, 0xf/bg=modal, 0xb/y, " ", "F - test-jump-to-nonexistent-global/11" + 677 check-background-color-in-screen-row screen, 0xf/bg=modal, 0xc/y, " ", "F - test-jump-to-nonexistent-global/12" + 678 check-background-color-in-screen-row screen, 0xf/bg=modal, 0xd/y, " ", "F - test-jump-to-nonexistent-global/13" + 679 check-background-color-in-screen-row screen, 0xf/bg=modal, 0xe/y, " ", "F - test-jump-to-nonexistent-global/14" 680 # menu at bottom is correct in context - 681 check-screen-row screen, 0xf/y, " ^r run main enter go ^m create esc cancel ^a << ^b <word ^f word> ^e >> ", "F - test-jump-to-nonexistent-global/15-text" - 682 check-background-color-in-screen-row screen, 0xf/bg=modal, 0xf/y, " ", "F - test-jump-to-nonexistent-global/15" + 681 check-screen-row screen, 0xf/y, " ^r run main enter go ^m create esc cancel ^a << ^b <word ^f word> ^e >> ", "F - test-jump-to-nonexistent-global/15-text" + 682 check-background-color-in-screen-row screen, 0xf/bg=modal, 0xf/y, " ", "F - test-jump-to-nonexistent-global/15" 683 # cancel 684 edit-environment env, 0x1b/escape, 0/no-disk - 685 render-environment screen, env + 685 render-environment screen, env 686 # hit ctrl-g again 687 edit-environment env, 7/ctrl-g, 0/no-disk - 688 render-environment screen, env + 688 render-environment screen, env 689 # word prepopulated like before, but no error - 690 check-background-color-in-screen-row screen, 0xf/bg=modal, 0/y, " ", "F - test-jump-to-nonexistent-global/test2-0" - 691 check-background-color-in-screen-row screen, 0xf/bg=modal, 1/y, " ", "F - test-jump-to-nonexistent-global/test2-1" - 692 check-background-color-in-screen-row screen, 0xf/bg=modal, 2/y, " ", "F - test-jump-to-nonexistent-global/test2-2" - 693 check-background-color-in-screen-row screen, 0xf/bg=modal, 3/y, " ", "F - test-jump-to-nonexistent-global/test2-3" - 694 check-background-color-in-screen-row screen, 0xf/bg=modal, 4/y, " ", "F - test-jump-to-nonexistent-global/test2-4" - 695 check-background-color-in-screen-row screen, 0xf/bg=modal, 5/y, " ", "F - test-jump-to-nonexistent-global/test2-5" - 696 check-screen-row screen, 6/y, " go to global (or leave blank to go to REPL) ", "F - test-jump-to-nonexistent-global/test2-6-text" - 697 check-background-color-in-screen-row screen, 0xf/bg=modal, 6/y, " ................................................................ ", "F - test-jump-to-nonexistent-global/test2-6" - 698 check-screen-row-in-color screen, 4/fg=error, 7/y, " ", "F - test-jump-to-nonexistent-global/test2-7-text" - 699 check-background-color-in-screen-row screen, 0xf/bg=modal, 7/y, " ................................................................ ", "F - test-jump-to-nonexistent-global/test2-7" + 690 check-background-color-in-screen-row screen, 0xf/bg=modal, 0/y, " ", "F - test-jump-to-nonexistent-global/test2-0" + 691 check-background-color-in-screen-row screen, 0xf/bg=modal, 1/y, " ", "F - test-jump-to-nonexistent-global/test2-1" + 692 check-background-color-in-screen-row screen, 0xf/bg=modal, 2/y, " ", "F - test-jump-to-nonexistent-global/test2-2" + 693 check-background-color-in-screen-row screen, 0xf/bg=modal, 3/y, " ", "F - test-jump-to-nonexistent-global/test2-3" + 694 check-background-color-in-screen-row screen, 0xf/bg=modal, 4/y, " ", "F - test-jump-to-nonexistent-global/test2-4" + 695 check-background-color-in-screen-row screen, 0xf/bg=modal, 5/y, " ", "F - test-jump-to-nonexistent-global/test2-5" + 696 check-screen-row screen, 6/y, " go to global (or leave blank to go to REPL) ", "F - test-jump-to-nonexistent-global/test2-6-text" + 697 check-background-color-in-screen-row screen, 0xf/bg=modal, 6/y, " ................................................................ ", "F - test-jump-to-nonexistent-global/test2-6" + 698 check-screen-row-in-color screen, 4/fg=error, 7/y, " ", "F - test-jump-to-nonexistent-global/test2-7-text" + 699 check-background-color-in-screen-row screen, 0xf/bg=modal, 7/y, " ................................................................ ", "F - test-jump-to-nonexistent-global/test2-7" 700 # same word at cursor - 701 check-screen-row screen, 8/y, " f ", "F - test-jump-to-nonexistent-global/test2-8-text" + 701 check-screen-row screen, 8/y, " f ", "F - test-jump-to-nonexistent-global/test2-8-text" 702 # new cursor position - 703 check-background-color-in-screen-row screen, 0/bg=cursor, 8/y, " | ", "F - test-jump-to-nonexistent-global/test2-8-cursor" - 704 check-background-color-in-screen-row screen, 0xf/bg=modal, 8/y, " . .............................................................. ", "F - test-jump-to-nonexistent-global/test2-8" - 705 check-background-color-in-screen-row screen, 0xf/bg=modal, 9/y, " ", "F - test-jump-to-nonexistent-global/test2-9" - 706 check-background-color-in-screen-row screen, 0xf/bg=modal, 0xa/y, " ", "F - test-jump-to-nonexistent-global/test2-10" - 707 check-background-color-in-screen-row screen, 0xf/bg=modal, 0xb/y, " ", "F - test-jump-to-nonexistent-global/test2-11" - 708 check-background-color-in-screen-row screen, 0xf/bg=modal, 0xc/y, " ", "F - test-jump-to-nonexistent-global/test2-12" - 709 check-background-color-in-screen-row screen, 0xf/bg=modal, 0xd/y, " ", "F - test-jump-to-nonexistent-global/test2-13" - 710 check-background-color-in-screen-row screen, 0xf/bg=modal, 0xe/y, " ", "F - test-jump-to-nonexistent-global/test2-14" - 711 check-background-color-in-screen-row screen, 0xf/bg=modal, 0xf/y, " ", "F - test-jump-to-nonexistent-global/test2-15" + 703 check-background-color-in-screen-row screen, 0/bg=cursor, 8/y, " | ", "F - test-jump-to-nonexistent-global/test2-8-cursor" + 704 check-background-color-in-screen-row screen, 0xf/bg=modal, 8/y, " . .............................................................. ", "F - test-jump-to-nonexistent-global/test2-8" + 705 check-background-color-in-screen-row screen, 0xf/bg=modal, 9/y, " ", "F - test-jump-to-nonexistent-global/test2-9" + 706 check-background-color-in-screen-row screen, 0xf/bg=modal, 0xa/y, " ", "F - test-jump-to-nonexistent-global/test2-10" + 707 check-background-color-in-screen-row screen, 0xf/bg=modal, 0xb/y, " ", "F - test-jump-to-nonexistent-global/test2-11" + 708 check-background-color-in-screen-row screen, 0xf/bg=modal, 0xc/y, " ", "F - test-jump-to-nonexistent-global/test2-12" + 709 check-background-color-in-screen-row screen, 0xf/bg=modal, 0xd/y, " ", "F - test-jump-to-nonexistent-global/test2-13" + 710 check-background-color-in-screen-row screen, 0xf/bg=modal, 0xe/y, " ", "F - test-jump-to-nonexistent-global/test2-14" + 711 check-background-color-in-screen-row screen, 0xf/bg=modal, 0xf/y, " ", "F - test-jump-to-nonexistent-global/test2-15" 712 } 713 714 fn test-create-global { @@ -781,37 +781,37 @@ if ('onhashchange' in window) { 716 var env/esi: (addr environment) <- address env-storage 717 initialize-environment env, 8/fake-screen-width, 3/fake-screen-height 718 # setup: screen - 719 var screen-on-stack: screen - 720 var screen/edi: (addr screen) <- address screen-on-stack - 721 initialize-screen screen, 0x80/width, 0x30/height, 0/no-pixel-graphics + 719 var screen-on-stack: screen + 720 var screen/edi: (addr screen) <- address screen-on-stack + 721 initialize-screen screen, 0x80/width, 0x30/height, 0/no-pixel-graphics 722 # hit ctrl-g 723 edit-environment env, 7/ctrl-g, 0/no-disk - 724 render-environment screen, env + 724 render-environment screen, env 725 # type global name - 726 type-in env, screen, "fn1" + 726 type-in env, screen, "fn1" 727 # create 728 edit-environment env, 0xd/ctrl-m, 0/no-disk - 729 render-environment screen, env + 729 render-environment screen, env 730 # | global definitions | sandbox 731 # cursor now on global side - 732 check-background-color-in-screen-row screen, 7/bg=cursor, 1/y, " | ", "F - test-create-global/1-cursor" + 732 check-background-color-in-screen-row screen, 7/bg=cursor, 1/y, " | ", "F - test-create-global/1-cursor" 733 # no modal - 734 check-background-color-in-screen-row screen, 0xf/bg=modal, 0/y, " ", "F - test-create-global/bg0" - 735 check-background-color-in-screen-row screen, 0xf/bg=modal, 1/y, " ", "F - test-create-global/bg1" - 736 check-background-color-in-screen-row screen, 0xf/bg=modal, 2/y, " ", "F - test-create-global/bg2" - 737 check-background-color-in-screen-row screen, 0xf/bg=modal, 3/y, " ", "F - test-create-global/bg3" - 738 check-background-color-in-screen-row screen, 0xf/bg=modal, 4/y, " ", "F - test-create-global/bg4" - 739 check-background-color-in-screen-row screen, 0xf/bg=modal, 5/y, " ", "F - test-create-global/bg5" - 740 check-background-color-in-screen-row screen, 0xf/bg=modal, 6/y, " ", "F - test-create-global/bg6" - 741 check-background-color-in-screen-row screen, 0xf/bg=modal, 7/y, " ", "F - test-create-global/bg7" - 742 check-background-color-in-screen-row screen, 0xf/bg=modal, 8/y, " ", "F - test-create-global/bg8" - 743 check-background-color-in-screen-row screen, 0xf/bg=modal, 9/y, " ", "F - test-create-global/bg9" - 744 check-background-color-in-screen-row screen, 0xf/bg=modal, 0xa/y, " ", "F - test-create-global/bg10" - 745 check-background-color-in-screen-row screen, 0xf/bg=modal, 0xb/y, " ", "F - test-create-global/bg11" - 746 check-background-color-in-screen-row screen, 0xf/bg=modal, 0xc/y, " ", "F - test-create-global/bg12" - 747 check-background-color-in-screen-row screen, 0xf/bg=modal, 0xd/y, " ", "F - test-create-global/bg13" - 748 check-background-color-in-screen-row screen, 0xf/bg=modal, 0xe/y, " ", "F - test-create-global/bg14" - 749 check-background-color-in-screen-row screen, 0xf/bg=modal, 0xf/y, " ", "F - test-create-global/bg15" + 734 check-background-color-in-screen-row screen, 0xf/bg=modal, 0/y, " ", "F - test-create-global/bg0" + 735 check-background-color-in-screen-row screen, 0xf/bg=modal, 1/y, " ", "F - test-create-global/bg1" + 736 check-background-color-in-screen-row screen, 0xf/bg=modal, 2/y, " ", "F - test-create-global/bg2" + 737 check-background-color-in-screen-row screen, 0xf/bg=modal, 3/y, " ", "F - test-create-global/bg3" + 738 check-background-color-in-screen-row screen, 0xf/bg=modal, 4/y, " ", "F - test-create-global/bg4" + 739 check-background-color-in-screen-row screen, 0xf/bg=modal, 5/y, " ", "F - test-create-global/bg5" + 740 check-background-color-in-screen-row screen, 0xf/bg=modal, 6/y, " ", "F - test-create-global/bg6" + 741 check-background-color-in-screen-row screen, 0xf/bg=modal, 7/y, " ", "F - test-create-global/bg7" + 742 check-background-color-in-screen-row screen, 0xf/bg=modal, 8/y, " ", "F - test-create-global/bg8" + 743 check-background-color-in-screen-row screen, 0xf/bg=modal, 9/y, " ", "F - test-create-global/bg9" + 744 check-background-color-in-screen-row screen, 0xf/bg=modal, 0xa/y, " ", "F - test-create-global/bg10" + 745 check-background-color-in-screen-row screen, 0xf/bg=modal, 0xb/y, " ", "F - test-create-global/bg11" + 746 check-background-color-in-screen-row screen, 0xf/bg=modal, 0xc/y, " ", "F - test-create-global/bg12" + 747 check-background-color-in-screen-row screen, 0xf/bg=modal, 0xd/y, " ", "F - test-create-global/bg13" + 748 check-background-color-in-screen-row screen, 0xf/bg=modal, 0xe/y, " ", "F - test-create-global/bg14" + 749 check-background-color-in-screen-row screen, 0xf/bg=modal, 0xf/y, " ", "F - test-create-global/bg15" 750 } 751 752 fn test-create-nonexistent-global { @@ -819,81 +819,81 @@ if ('onhashchange' in window) { 754 var env/esi: (addr environment) <- address env-storage 755 initialize-environment env, 8/fake-screen-width, 3/fake-screen-height 756 # setup: screen - 757 var screen-on-stack: screen - 758 var screen/edi: (addr screen) <- address screen-on-stack - 759 initialize-screen screen, 0x80/width, 0x10/height, 0/no-pixel-graphics + 757 var screen-on-stack: screen + 758 var screen/edi: (addr screen) <- address screen-on-stack + 759 initialize-screen screen, 0x80/width, 0x10/height, 0/no-pixel-graphics 760 # define a global - 761 type-in env, screen, "(define f 42)" + 761 type-in env, screen, "(define f 42)" 762 edit-environment env, 0x13/ctrl-s, 0/no-disk - 763 render-environment screen, env + 763 render-environment screen, env 764 # type in its name - 765 type-in env, screen, "f" + 765 type-in env, screen, "f" 766 # hit ctrl-g 767 edit-environment env, 7/ctrl-g, 0/no-disk - 768 render-environment screen, env + 768 render-environment screen, env 769 # submit 770 edit-environment env, 0xd/ctrl-m, 0/no-disk - 771 render-environment screen, env + 771 render-environment screen, env 772 # modal now shows an error 773 # | global definitions | sandbox - 774 check-background-color-in-screen-row screen, 0xf/bg=modal, 0/y, " ", "F - test-create-nonexistent-global/0" - 775 check-background-color-in-screen-row screen, 0xf/bg=modal, 1/y, " ", "F - test-create-nonexistent-global/1" - 776 check-background-color-in-screen-row screen, 0xf/bg=modal, 2/y, " ", "F - test-create-nonexistent-global/2" - 777 check-background-color-in-screen-row screen, 0xf/bg=modal, 3/y, " ", "F - test-create-nonexistent-global/3" - 778 check-background-color-in-screen-row screen, 0xf/bg=modal, 4/y, " ", "F - test-create-nonexistent-global/4" - 779 check-background-color-in-screen-row screen, 0xf/bg=modal, 5/y, " ", "F - test-create-nonexistent-global/5" - 780 check-screen-row screen, 6/y, " go to global (or leave blank to go to REPL) ", "F - test-create-nonexistent-global/6-text" - 781 check-background-color-in-screen-row screen, 0xf/bg=modal, 6/y, " ................................................................ ", "F - test-create-nonexistent-global/6" - 782 check-screen-row-in-color screen, 4/fg=error, 7/y, " already exists ", "F - test-create-nonexistent-global/7-text" - 783 check-background-color-in-screen-row screen, 0xf/bg=modal, 7/y, " ................................................................ ", "F - test-create-nonexistent-global/7" - 784 check-screen-row-in-color screen, 0/fg, 8/y, " f ", "F - test-create-nonexistent-global/8-text" - 785 check-background-color-in-screen-row screen, 0/bg=cursor, 8/y, " | ", "F - test-create-nonexistent-global/8-cursor" - 786 check-background-color-in-screen-row screen, 0xf/bg=modal, 8/y, " . .............................................................. ", "F - test-create-nonexistent-global/8" - 787 check-background-color-in-screen-row screen, 0xf/bg=modal, 9/y, " ", "F - test-create-nonexistent-global/9" - 788 check-background-color-in-screen-row screen, 0xf/bg=modal, 0xa/y, " ", "F - test-create-nonexistent-global/10" - 789 check-background-color-in-screen-row screen, 0xf/bg=modal, 0xb/y, " ", "F - test-create-nonexistent-global/11" - 790 check-background-color-in-screen-row screen, 0xf/bg=modal, 0xc/y, " ", "F - test-create-nonexistent-global/12" - 791 check-background-color-in-screen-row screen, 0xf/bg=modal, 0xd/y, " ", "F - test-create-nonexistent-global/13" - 792 check-background-color-in-screen-row screen, 0xf/bg=modal, 0xe/y, " ", "F - test-create-nonexistent-global/14" + 774 check-background-color-in-screen-row screen, 0xf/bg=modal, 0/y, " ", "F - test-create-nonexistent-global/0" + 775 check-background-color-in-screen-row screen, 0xf/bg=modal, 1/y, " ", "F - test-create-nonexistent-global/1" + 776 check-background-color-in-screen-row screen, 0xf/bg=modal, 2/y, " ", "F - test-create-nonexistent-global/2" + 777 check-background-color-in-screen-row screen, 0xf/bg=modal, 3/y, " ", "F - test-create-nonexistent-global/3" + 778 check-background-color-in-screen-row screen, 0xf/bg=modal, 4/y, " ", "F - test-create-nonexistent-global/4" + 779 check-background-color-in-screen-row screen, 0xf/bg=modal, 5/y, " ", "F - test-create-nonexistent-global/5" + 780 check-screen-row screen, 6/y, " go to global (or leave blank to go to REPL) ", "F - test-create-nonexistent-global/6-text" + 781 check-background-color-in-screen-row screen, 0xf/bg=modal, 6/y, " ................................................................ ", "F - test-create-nonexistent-global/6" + 782 check-screen-row-in-color screen, 4/fg=error, 7/y, " already exists ", "F - test-create-nonexistent-global/7-text" + 783 check-background-color-in-screen-row screen, 0xf/bg=modal, 7/y, " ................................................................ ", "F - test-create-nonexistent-global/7" + 784 check-screen-row-in-color screen, 0/fg, 8/y, " f ", "F - test-create-nonexistent-global/8-text" + 785 check-background-color-in-screen-row screen, 0/bg=cursor, 8/y, " | ", "F - test-create-nonexistent-global/8-cursor" + 786 check-background-color-in-screen-row screen, 0xf/bg=modal, 8/y, " . .............................................................. ", "F - test-create-nonexistent-global/8" + 787 check-background-color-in-screen-row screen, 0xf/bg=modal, 9/y, " ", "F - test-create-nonexistent-global/9" + 788 check-background-color-in-screen-row screen, 0xf/bg=modal, 0xa/y, " ", "F - test-create-nonexistent-global/10" + 789 check-background-color-in-screen-row screen, 0xf/bg=modal, 0xb/y, " ", "F - test-create-nonexistent-global/11" + 790 check-background-color-in-screen-row screen, 0xf/bg=modal, 0xc/y, " ", "F - test-create-nonexistent-global/12" + 791 check-background-color-in-screen-row screen, 0xf/bg=modal, 0xd/y, " ", "F - test-create-nonexistent-global/13" + 792 check-background-color-in-screen-row screen, 0xf/bg=modal, 0xe/y, " ", "F - test-create-nonexistent-global/14" 793 # menu at bottom is correct in context - 794 check-screen-row screen, 0xf/y, " ^r run main enter go ^m create esc cancel ^a << ^b <word ^f word> ^e >> ", "F - test-create-nonexistent-global/15-text" - 795 check-background-color-in-screen-row screen, 0xf/bg=modal, 0xf/y, " ", "F - test-create-nonexistent-global/15" + 794 check-screen-row screen, 0xf/y, " ^r run main enter go ^m create esc cancel ^a << ^b <word ^f word> ^e >> ", "F - test-create-nonexistent-global/15-text" + 795 check-background-color-in-screen-row screen, 0xf/bg=modal, 0xf/y, " ", "F - test-create-nonexistent-global/15" 796 # cancel 797 edit-environment env, 0x1b/escape, 0/no-disk - 798 render-environment screen, env + 798 render-environment screen, env 799 # hit ctrl-g again 800 edit-environment env, 7/ctrl-g, 0/no-disk - 801 render-environment screen, env + 801 render-environment screen, env 802 # word prepopulated like before, but no error - 803 check-background-color-in-screen-row screen, 0xf/bg=modal, 0/y, " ", "F - test-create-nonexistent-global/test2-0" - 804 check-background-color-in-screen-row screen, 0xf/bg=modal, 1/y, " ", "F - test-create-nonexistent-global/test2-1" - 805 check-background-color-in-screen-row screen, 0xf/bg=modal, 2/y, " ", "F - test-create-nonexistent-global/test2-2" - 806 check-background-color-in-screen-row screen, 0xf/bg=modal, 3/y, " ", "F - test-create-nonexistent-global/test2-3" - 807 check-background-color-in-screen-row screen, 0xf/bg=modal, 4/y, " ", "F - test-create-nonexistent-global/test2-4" - 808 check-background-color-in-screen-row screen, 0xf/bg=modal, 5/y, " ", "F - test-create-nonexistent-global/test2-5" - 809 check-screen-row screen, 6/y, " go to global (or leave blank to go to REPL) ", "F - test-create-nonexistent-global/test2-6-text" - 810 check-background-color-in-screen-row screen, 0xf/bg=modal, 6/y, " ................................................................ ", "F - test-create-nonexistent-global/test2-6" - 811 check-screen-row-in-color screen, 4/fg=error, 7/y, " ", "F - test-create-nonexistent-global/test2-7-text" - 812 check-background-color-in-screen-row screen, 0xf/bg=modal, 7/y, " ................................................................ ", "F - test-create-nonexistent-global/test2-7" + 803 check-background-color-in-screen-row screen, 0xf/bg=modal, 0/y, " ", "F - test-create-nonexistent-global/test2-0" + 804 check-background-color-in-screen-row screen, 0xf/bg=modal, 1/y, " ", "F - test-create-nonexistent-global/test2-1" + 805 check-background-color-in-screen-row screen, 0xf/bg=modal, 2/y, " ", "F - test-create-nonexistent-global/test2-2" + 806 check-background-color-in-screen-row screen, 0xf/bg=modal, 3/y, " ", "F - test-create-nonexistent-global/test2-3" + 807 check-background-color-in-screen-row screen, 0xf/bg=modal, 4/y, " ", "F - test-create-nonexistent-global/test2-4" + 808 check-background-color-in-screen-row screen, 0xf/bg=modal, 5/y, " ", "F - test-create-nonexistent-global/test2-5" + 809 check-screen-row screen, 6/y, " go to global (or leave blank to go to REPL) ", "F - test-create-nonexistent-global/test2-6-text" + 810 check-background-color-in-screen-row screen, 0xf/bg=modal, 6/y, " ................................................................ ", "F - test-create-nonexistent-global/test2-6" + 811 check-screen-row-in-color screen, 4/fg=error, 7/y, " ", "F - test-create-nonexistent-global/test2-7-text" + 812 check-background-color-in-screen-row screen, 0xf/bg=modal, 7/y, " ................................................................ ", "F - test-create-nonexistent-global/test2-7" 813 # same word at cursor - 814 check-screen-row-in-color screen, 0/fg, 8/y, " f ", "F - test-create-nonexistent-global/test2-8-text" + 814 check-screen-row-in-color screen, 0/fg, 8/y, " f ", "F - test-create-nonexistent-global/test2-8-text" 815 # new cursor position - 816 check-background-color-in-screen-row screen, 0/bg=cursor, 8/y, " | ", "F - test-create-nonexistent-global/test2-8-cursor" - 817 check-background-color-in-screen-row screen, 0xf/bg=modal, 8/y, " . .............................................................. ", "F - test-create-nonexistent-global/test2-8" - 818 check-background-color-in-screen-row screen, 0xf/bg=modal, 9/y, " ", "F - test-create-nonexistent-global/test2-9" - 819 check-background-color-in-screen-row screen, 0xf/bg=modal, 0xa/y, " ", "F - test-create-nonexistent-global/test2-10" - 820 check-background-color-in-screen-row screen, 0xf/bg=modal, 0xb/y, " ", "F - test-create-nonexistent-global/test2-11" - 821 check-background-color-in-screen-row screen, 0xf/bg=modal, 0xc/y, " ", "F - test-create-nonexistent-global/test2-12" - 822 check-background-color-in-screen-row screen, 0xf/bg=modal, 0xd/y, " ", "F - test-create-nonexistent-global/test2-13" - 823 check-background-color-in-screen-row screen, 0xf/bg=modal, 0xe/y, " ", "F - test-create-nonexistent-global/test2-14" - 824 check-background-color-in-screen-row screen, 0xf/bg=modal, 0xf/y, " ", "F - test-create-nonexistent-global/test2-15" + 816 check-background-color-in-screen-row screen, 0/bg=cursor, 8/y, " | ", "F - test-create-nonexistent-global/test2-8-cursor" + 817 check-background-color-in-screen-row screen, 0xf/bg=modal, 8/y, " . .............................................................. ", "F - test-create-nonexistent-global/test2-8" + 818 check-background-color-in-screen-row screen, 0xf/bg=modal, 9/y, " ", "F - test-create-nonexistent-global/test2-9" + 819 check-background-color-in-screen-row screen, 0xf/bg=modal, 0xa/y, " ", "F - test-create-nonexistent-global/test2-10" + 820 check-background-color-in-screen-row screen, 0xf/bg=modal, 0xb/y, " ", "F - test-create-nonexistent-global/test2-11" + 821 check-background-color-in-screen-row screen, 0xf/bg=modal, 0xc/y, " ", "F - test-create-nonexistent-global/test2-12" + 822 check-background-color-in-screen-row screen, 0xf/bg=modal, 0xd/y, " ", "F - test-create-nonexistent-global/test2-13" + 823 check-background-color-in-screen-row screen, 0xf/bg=modal, 0xe/y, " ", "F - test-create-nonexistent-global/test2-14" + 824 check-background-color-in-screen-row screen, 0xf/bg=modal, 0xf/y, " ", "F - test-create-nonexistent-global/test2-15" 825 } 826 - 827 fn render-go-modal screen: (addr screen), _self: (addr environment) { + 827 fn render-go-modal screen: (addr screen), _self: (addr environment) { 828 var self/esi: (addr environment) <- copy _self 829 var width/eax: int <- copy 0 830 var height/ecx: int <- copy 0 - 831 width, height <- screen-size screen + 831 width, height <- screen-size screen 832 # xmin = max(0, width/2 - 0x20) 833 var xmin: int 834 var tmp/edx: int <- copy width @@ -927,10 +927,10 @@ if ('onhashchange' in window) { 862 tmp <- add 3 863 copy-to ymax, tmp 864 # - 865 clear-rect screen, xmin, ymin, xmax, ymax, 0xf/bg=modal + 865 clear-rect screen, xmin, ymin, xmax, ymax, 0xf/bg=modal 866 add-to xmin, 4 - 867 set-cursor-position screen, xmin, ymin - 868 draw-text-rightward-from-cursor screen, "go to global (or leave blank to go to REPL)", xmax, 8/fg=dark-grey, 0xf/bg=modal + 867 set-cursor-position screen, xmin, ymin + 868 draw-text-rightward-from-cursor screen, "go to global (or leave blank to go to REPL)", xmax, 8/fg=dark-grey, 0xf/bg=modal 869 var partial-global-name-ah/eax: (addr handle gap-buffer) <- get self, partial-global-name 870 var _partial-global-name/eax: (addr gap-buffer) <- lookup *partial-global-name-ah 871 var partial-global-name/edx: (addr gap-buffer) <- copy _partial-global-name @@ -941,42 +941,42 @@ if ('onhashchange' in window) { 876 var go-modal-error/eax: (addr array byte) <- lookup *go-modal-error-ah 877 compare go-modal-error, 0 878 break-if-= - 879 var dummy/eax: int <- draw-text-rightward screen, go-modal-error, xmin, xmax, ymin, 4/fg=error, 0xf/bg=modal + 879 var dummy/eax: int <- draw-text-rightward screen, go-modal-error, xmin, xmax, ymin, 4/fg=error, 0xf/bg=modal 880 } 881 increment ymin 882 var dummy/eax: int <- copy 0 883 var dummy2/ecx: int <- copy 0 - 884 dummy, dummy2 <- render-gap-buffer-wrapping-right-then-down screen, partial-global-name, xmin, ymin, xmax, ymax, 1/always-render-cursor, 0/fg=black, 0xf/bg=modal + 884 dummy, dummy2 <- render-gap-buffer-wrapping-right-then-down screen, partial-global-name, xmin, ymin, xmax, ymax, 1/always-render-cursor, 0/fg=black, 0xf/bg=modal 885 } 886 - 887 fn render-go-modal-menu screen: (addr screen), _self: (addr environment) { + 887 fn render-go-modal-menu screen: (addr screen), _self: (addr environment) { 888 var self/esi: (addr environment) <- copy _self 889 var _width/eax: int <- copy 0 890 var height/ecx: int <- copy 0 - 891 _width, height <- screen-size screen + 891 _width, height <- screen-size screen 892 var width/edx: int <- copy _width 893 var y/ecx: int <- copy height 894 y <- decrement 895 var height/ebx: int <- copy y 896 height <- increment - 897 clear-rect screen, 0/x, y, width, height, 0xc5/bg=blue-bg - 898 set-cursor-position screen, 0/x, y - 899 draw-text-rightward-from-cursor screen, " ^r ", width, 0/fg, 0x5c/bg=menu-highlight - 900 draw-text-rightward-from-cursor screen, " run main ", width, 7/fg, 0xc5/bg=blue-bg - 901 draw-text-rightward-from-cursor screen, " enter ", width, 0/fg, 0xc/bg=menu-really-highlight - 902 draw-text-rightward-from-cursor screen, " go ", width, 7/fg, 0xc5/bg=blue-bg - 903 draw-text-rightward-from-cursor screen, " ^m ", width, 0/fg, 0xc/bg=menu-really-highlight - 904 draw-text-rightward-from-cursor screen, " create ", width, 7/fg, 0xc5/bg=blue-bg - 905 draw-text-rightward-from-cursor screen, " esc ", width, 0/fg, 0x5c/bg=menu-highlight - 906 draw-text-rightward-from-cursor screen, " cancel ", width, 7/fg, 0xc5/bg=blue-bg - 907 draw-text-rightward-from-cursor screen, " ^a ", width, 0/fg, 0x5c/bg=menu-highlight - 908 draw-text-rightward-from-cursor screen, " << ", width, 7/fg, 0xc5/bg=blue-bg - 909 draw-text-rightward-from-cursor screen, " ^b ", width, 0/fg, 0x5c/bg=menu-highlight - 910 draw-text-rightward-from-cursor screen, " <word ", width, 7/fg, 0xc5/bg=blue-bg - 911 draw-text-rightward-from-cursor screen, " ^f ", width, 0/fg, 0x5c/bg=menu-highlight - 912 draw-text-rightward-from-cursor screen, " word> ", width, 7/fg, 0xc5/bg=blue-bg - 913 draw-text-rightward-from-cursor screen, " ^e ", width, 0/fg, 0x5c/bg=menu-highlight - 914 draw-text-rightward-from-cursor screen, " >> ", width, 7/fg, 0xc5/bg=blue-bg + 897 clear-rect screen, 0/x, y, width, height, 0xc5/bg=blue-bg + 898 set-cursor-position screen, 0/x, y + 899 draw-text-rightward-from-cursor screen, " ^r ", width, 0/fg, 0x5c/bg=menu-highlight + 900 draw-text-rightward-from-cursor screen, " run main ", width, 7/fg, 0xc5/bg=blue-bg + 901 draw-text-rightward-from-cursor screen, " enter ", width, 0/fg, 0xc/bg=menu-really-highlight + 902 draw-text-rightward-from-cursor screen, " go ", width, 7/fg, 0xc5/bg=blue-bg + 903 draw-text-rightward-from-cursor screen, " ^m ", width, 0/fg, 0xc/bg=menu-really-highlight + 904 draw-text-rightward-from-cursor screen, " create ", width, 7/fg, 0xc5/bg=blue-bg + 905 draw-text-rightward-from-cursor screen, " esc ", width, 0/fg, 0x5c/bg=menu-highlight + 906 draw-text-rightward-from-cursor screen, " cancel ", width, 7/fg, 0xc5/bg=blue-bg + 907 draw-text-rightward-from-cursor screen, " ^a ", width, 0/fg, 0x5c/bg=menu-highlight + 908 draw-text-rightward-from-cursor screen, " << ", width, 7/fg, 0xc5/bg=blue-bg + 909 draw-text-rightward-from-cursor screen, " ^b ", width, 0/fg, 0x5c/bg=menu-highlight + 910 draw-text-rightward-from-cursor screen, " <word ", width, 7/fg, 0xc5/bg=blue-bg + 911 draw-text-rightward-from-cursor screen, " ^f ", width, 0/fg, 0x5c/bg=menu-highlight + 912 draw-text-rightward-from-cursor screen, " word> ", width, 7/fg, 0xc5/bg=blue-bg + 913 draw-text-rightward-from-cursor screen, " ^e ", width, 0/fg, 0x5c/bg=menu-highlight + 914 draw-text-rightward-from-cursor screen, " >> ", width, 7/fg, 0xc5/bg=blue-bg 915 } 916 917 fn word-at-cursor _self: (addr environment), out: (addr stream byte) { diff --git a/html/shell/evaluate.mu.html b/html/shell/evaluate.mu.html index 898593d0..2e20c8b9 100644 --- a/html/shell/evaluate.mu.html +++ b/html/shell/evaluate.mu.html @@ -83,9 +83,9 @@ if ('onhashchange' in window) { 17 break-if-!= 18 var old-x/eax: int <- copy 0 19 var old-y/ecx: int <- copy 0 - 20 old-x, old-y <- cursor-position 0/screen + 20 old-x, old-y <- cursor-position 0/screen 21 show-stack-state - 22 set-cursor-position 0/screen, old-x, old-y + 22 set-cursor-position 0/screen, old-x, old-y 23 } 24 # show intermediate progress on screen if necessary 25 # treat input at the real keyboard as interrupting @@ -104,8 +104,8 @@ if ('onhashchange' in window) { 38 var inner-screen-var-addr/eax: (addr cell) <- lookup *inner-screen-var 39 compare inner-screen-var-addr, 0 40 break-if-= - 41 var screen-obj-ah/eax: (addr handle screen) <- get inner-screen-var-addr, screen-data - 42 var screen-obj/eax: (addr screen) <- lookup *screen-obj-ah + 41 var screen-obj-ah/eax: (addr handle screen) <- get inner-screen-var-addr, screen-data + 42 var screen-obj/eax: (addr screen) <- lookup *screen-obj-ah 43 compare screen-obj, 0 44 break-if-= 45 render-screen 0/screen, screen-obj, 0x58/xmin, 2/ymin @@ -1295,8 +1295,8 @@ if ('onhashchange' in window) { 1404 compare b-type, 5/screen 1405 { 1406 break-if-!= -1407 var a-val-ah/eax: (addr handle screen) <- get a, screen-data -1408 var b-val-ah/ecx: (addr handle screen) <- get b, screen-data +1407 var a-val-ah/eax: (addr handle screen) <- get a, screen-data +1408 var b-val-ah/ecx: (addr handle screen) <- get b, screen-data 1409 var result/eax: boolean <- handle-equal? *a-val-ah, *b-val-ah 1410 compare result, 0/false 1411 return result diff --git a/html/shell/global.mu.html b/html/shell/global.mu.html index 71d3db10..4e24dccb 100644 --- a/html/shell/global.mu.html +++ b/html/shell/global.mu.html @@ -178,8 +178,8 @@ if ('onhashchange' in window) { 115 } 116 117 # globals layout: 1 char padding, 41 code, 1 padding, 41 code, 1 padding = 85 chars -118 fn render-globals screen: (addr screen), _self: (addr global-table), show-cursor?: boolean { -119 clear-rect screen, 0/xmin, 0/ymin, 0x55/xmax, 0x2f/ymax=screen-height-without-menu, 0xdc/bg=green-bg +118 fn render-globals screen: (addr screen), _self: (addr global-table), show-cursor?: boolean { +119 clear-rect screen, 0/xmin, 0/ymin, 0x55/xmax, 0x2f/ymax=screen-height-without-menu, 0xdc/bg=green-bg 120 var self/esi: (addr global-table) <- copy _self 121 compare self, 0 122 { @@ -226,7 +226,7 @@ if ('onhashchange' in window) { 163 var render-image?/eax: boolean <- render-image? curr, cursor-in-current-line? 164 compare render-image?, 0/false 165 break-if-= -166 var y/ecx: int <- render-image-definition screen, curr, 0/x y1 +166 var y/ecx: int <- render-image-definition screen, curr, 0/x y1 167 y <- increment # padding 168 copy-to y1, y 169 break $render-globals:iter @@ -245,16 +245,16 @@ if ('onhashchange' in window) { 182 compare y, y2 183 { 184 break-if->= -185 x, y <- render-gap-buffer-wrapping-right-then-down screen, curr-input, 1/padding-left, y1, 0x2a/xmax, 0x2f/ymax, cursor-in-current-line?, 7/fg=definition, 0xc5/bg=blue-bg +185 x, y <- render-gap-buffer-wrapping-right-then-down screen, curr-input, 1/padding-left, y1, 0x2a/xmax, 0x2f/ymax, cursor-in-current-line?, 7/fg=definition, 0xc5/bg=blue-bg 186 y <- increment -187 y <- render-trace screen, curr-trace, 1/padding-left, y, 0x2a/xmax, 0x2f/ymax, 0/no-cursor +187 y <- render-trace screen, curr-trace, 1/padding-left, y, 0x2a/xmax, 0x2f/ymax, 0/no-cursor 188 y <- increment 189 copy-to y1, y 190 break $render-globals:render-global 191 } -192 x, y <- render-gap-buffer-wrapping-right-then-down screen, curr-input, 0x2b/xmin, y2, 0x54/xmax, 0x2f/ymax, cursor-in-current-line?, 7/fg=definition, 0xc5/bg=blue-bg +192 x, y <- render-gap-buffer-wrapping-right-then-down screen, curr-input, 0x2b/xmin, y2, 0x54/xmax, 0x2f/ymax, cursor-in-current-line?, 7/fg=definition, 0xc5/bg=blue-bg 193 y <- increment -194 y <- render-trace screen, curr-trace, 0x2b/xmin, y, 0x54/xmax, 0x2f/ymax, 0/no-cursor +194 y <- render-trace screen, curr-trace, 0x2b/xmin, y, 0x54/xmax, 0x2f/ymax, 0/no-cursor 195 y <- increment 196 copy-to y2, y 197 } @@ -263,34 +263,34 @@ if ('onhashchange' in window) { 200 loop 201 } 202 # render primitives on top -203 render-primitives screen, 1/xmin=padding-left, 0x55/xmax, 0x2f/ymax +203 render-primitives screen, 1/xmin=padding-left, 0x55/xmax, 0x2f/ymax 204 } 205 -206 fn render-globals-menu screen: (addr screen), _self: (addr global-table) { +206 fn render-globals-menu screen: (addr screen), _self: (addr global-table) { 207 var _width/eax: int <- copy 0 208 var height/ecx: int <- copy 0 -209 _width, height <- screen-size screen +209 _width, height <- screen-size screen 210 var width/edx: int <- copy _width 211 var y/ecx: int <- copy height 212 y <- decrement 213 var height/ebx: int <- copy y 214 height <- increment -215 clear-rect screen, 0/x, y, width, height, 0xc5/bg=blue-bg -216 set-cursor-position screen, 0/x, y -217 draw-text-rightward-from-cursor screen, " ^r ", width, 0/fg, 0x5c/bg=menu-highlight -218 draw-text-rightward-from-cursor screen, " run main ", width, 7/fg, 0xc5/bg=blue-bg -219 draw-text-rightward-from-cursor screen, " ^s ", width, 0/fg, 0x5c/bg=menu-highlight -220 draw-text-rightward-from-cursor screen, " run sandbox ", width, 7/fg, 0xc5/bg=blue-bg -221 draw-text-rightward-from-cursor screen, " ^g ", width, 0/fg, 0x5c/bg=menu-highlight -222 draw-text-rightward-from-cursor screen, " go to ", width, 7/fg, 0xc5/bg=blue-bg -223 draw-text-rightward-from-cursor screen, " ^a ", width, 0/fg, 0x5c/bg=menu-highlight -224 draw-text-rightward-from-cursor screen, " << ", width, 7/fg, 0xc5/bg=blue-bg -225 draw-text-rightward-from-cursor screen, " ^b ", width, 0/fg, 0x5c/bg=menu-highlight -226 draw-text-rightward-from-cursor screen, " <word ", width, 7/fg, 0xc5/bg=blue-bg -227 draw-text-rightward-from-cursor screen, " ^f ", width, 0/fg, 0x5c/bg=menu-highlight -228 draw-text-rightward-from-cursor screen, " word> ", width, 7/fg, 0xc5/bg=blue-bg -229 draw-text-rightward-from-cursor screen, " ^e ", width, 0/fg, 0x5c/bg=menu-highlight -230 draw-text-rightward-from-cursor screen, " >> ", width, 7/fg, 0xc5/bg=blue-bg +215 clear-rect screen, 0/x, y, width, height, 0xc5/bg=blue-bg +216 set-cursor-position screen, 0/x, y +217 draw-text-rightward-from-cursor screen, " ^r ", width, 0/fg, 0x5c/bg=menu-highlight +218 draw-text-rightward-from-cursor screen, " run main ", width, 7/fg, 0xc5/bg=blue-bg +219 draw-text-rightward-from-cursor screen, " ^s ", width, 0/fg, 0x5c/bg=menu-highlight +220 draw-text-rightward-from-cursor screen, " run sandbox ", width, 7/fg, 0xc5/bg=blue-bg +221 draw-text-rightward-from-cursor screen, " ^g ", width, 0/fg, 0x5c/bg=menu-highlight +222 draw-text-rightward-from-cursor screen, " go to ", width, 7/fg, 0xc5/bg=blue-bg +223 draw-text-rightward-from-cursor screen, " ^a ", width, 0/fg, 0x5c/bg=menu-highlight +224 draw-text-rightward-from-cursor screen, " << ", width, 7/fg, 0xc5/bg=blue-bg +225 draw-text-rightward-from-cursor screen, " ^b ", width, 0/fg, 0x5c/bg=menu-highlight +226 draw-text-rightward-from-cursor screen, " <word ", width, 7/fg, 0xc5/bg=blue-bg +227 draw-text-rightward-from-cursor screen, " ^f ", width, 0/fg, 0x5c/bg=menu-highlight +228 draw-text-rightward-from-cursor screen, " word> ", width, 7/fg, 0xc5/bg=blue-bg +229 draw-text-rightward-from-cursor screen, " ^e ", width, 0/fg, 0x5c/bg=menu-highlight +230 draw-text-rightward-from-cursor screen, " >> ", width, 7/fg, 0xc5/bg=blue-bg 231 } 232 233 fn edit-globals _self: (addr global-table), key: grapheme { @@ -680,17 +680,17 @@ if ('onhashchange' in window) { 617 return litimg? 618 } 619 -620 fn render-image-definition screen: (addr screen), _self: (addr global), x: int, _y: int -> _/ecx: int { +620 fn render-image-definition screen: (addr screen), _self: (addr global), x: int, _y: int -> _/ecx: int { 621 var self/esi: (addr global) <- copy _self 622 var y/ecx: int <- copy _y -623 set-cursor-position 0/screen, 0x20 0x20 +623 set-cursor-position 0/screen, 0x20 0x20 624 draw-int32-decimal-wrapping-right-then-down-from-cursor-over-full-screen 0/screen, y, 4/fg 0/bg 625 { 626 var name-ah/eax: (addr handle array byte) <- get self, name 627 var _name/eax: (addr array byte) <- lookup *name-ah 628 var name/edx: (addr array byte) <- copy _name -629 var x/eax: int <- draw-text-rightward-over-full-screen screen, "define ", x y, 7/fg=definition, 0xc5/bg=blue-bg -630 x <- draw-text-rightward-over-full-screen screen, name, x y, 7/fg=definition, 0xc5/bg=blue-bg +629 var x/eax: int <- draw-text-rightward-over-full-screen screen, "define ", x y, 7/fg=definition, 0xc5/bg=blue-bg +630 x <- draw-text-rightward-over-full-screen screen, name, x y, 7/fg=definition, 0xc5/bg=blue-bg 631 } 632 y <- increment # skip definition line 633 # y is now in pixels @@ -712,7 +712,7 @@ if ('onhashchange' in window) { 649 var img-ah/eax: (addr handle image) <- get img-cell, image-data 650 var img/eax: (addr image) <- lookup *img-ah 651 var height/ebx: int <- scale-image-height img, 0x80/width -652 render-image screen, img, x y, 0x80/width height +652 render-image screen, img, x y, 0x80/width height 653 y <- add height 654 # switch y back to characters 655 y <- scale-down-and-round-up y, 0x10/font-height diff --git a/html/shell/main.mu.html b/html/shell/main.mu.html index 585b5f87..069feab7 100644 --- a/html/shell/main.mu.html +++ b/html/shell/main.mu.html @@ -60,13 +60,13 @@ if ('onhashchange' in window) { 1 # Experimental Mu shell 2 # Currently based on Lisp. 3 - 4 fn main screen: (addr screen), keyboard: (addr keyboard), data-disk: (addr disk) { + 4 fn main screen: (addr screen), keyboard: (addr keyboard), data-disk: (addr disk) { 5 var env-storage: environment 6 var env/esi: (addr environment) <- address env-storage 7 initialize-environment env, 0x20/fake-screen-width, 8/fake-screen-height 8 load-state env, data-disk 9 { -10 render-environment screen, env +10 render-environment screen, env 11 # no way to quit right now; just reboot 12 { 13 var key/eax: byte <- read-key keyboard diff --git a/html/shell/primitives.mu.html b/html/shell/primitives.mu.html index 8a761270..a885204d 100644 --- a/html/shell/primitives.mu.html +++ b/html/shell/primitives.mu.html @@ -134,59 +134,59 @@ if ('onhashchange' in window) { 69 70 # Slightly misnamed; renders primitives as well as special forms that don't 71 # evaluate all their arguments. - 72 fn render-primitives screen: (addr screen), xmin: int, xmax: int, ymax: int { + 72 fn render-primitives screen: (addr screen), xmin: int, xmax: int, ymax: int { 73 var y/ecx: int <- copy ymax 74 y <- subtract 0x11/primitives-border - 75 clear-rect screen, xmin, y, xmax, ymax, 0xdc/bg=green-bg + 75 clear-rect screen, xmin, y, xmax, ymax, 0xdc/bg=green-bg 76 y <- increment 77 var right-min/edx: int <- copy xmax 78 right-min <- subtract 0x1e/primitives-divider - 79 set-cursor-position screen, right-min, y - 80 draw-text-wrapping-right-then-down-from-cursor screen, "primitives", right-min, y, xmax, ymax, 7/fg=grey, 0xdc/bg=green-bg + 79 set-cursor-position screen, right-min, y + 80 draw-text-wrapping-right-then-down-from-cursor screen, "primitives", right-min, y, xmax, ymax, 7/fg=grey, 0xdc/bg=green-bg 81 y <- increment - 82 set-cursor-position screen, right-min, y - 83 draw-text-wrapping-right-then-down-from-cursor screen, " fn apply set if while", right-min, y, xmax, ymax, 0x2a/fg=orange, 0xdc/bg=green-bg + 82 set-cursor-position screen, right-min, y + 83 draw-text-wrapping-right-then-down-from-cursor screen, " fn apply set if while", right-min, y, xmax, ymax, 0x2a/fg=orange, 0xdc/bg=green-bg 84 y <- increment - 85 set-cursor-position screen, right-min, y - 86 draw-text-wrapping-right-then-down-from-cursor screen, "booleans", right-min, y, xmax, ymax, 7/fg=grey, 0xdc/bg=green-bg + 85 set-cursor-position screen, right-min, y + 86 draw-text-wrapping-right-then-down-from-cursor screen, "booleans", right-min, y, xmax, ymax, 7/fg=grey, 0xdc/bg=green-bg 87 y <- increment - 88 set-cursor-position screen, right-min, y - 89 draw-text-wrapping-right-then-down-from-cursor screen, " = and or not", right-min, y, xmax, ymax, 0x2a/fg=orange, 0xdc/bg=green-bg + 88 set-cursor-position screen, right-min, y + 89 draw-text-wrapping-right-then-down-from-cursor screen, " = and or not", right-min, y, xmax, ymax, 0x2a/fg=orange, 0xdc/bg=green-bg 90 y <- increment - 91 set-cursor-position screen, right-min, y - 92 draw-text-wrapping-right-then-down-from-cursor screen, "lists", right-min, y, xmax, ymax, 7/fg=grey, 0xdc/bg=green-bg + 91 set-cursor-position screen, right-min, y + 92 draw-text-wrapping-right-then-down-from-cursor screen, "lists", right-min, y, xmax, ymax, 7/fg=grey, 0xdc/bg=green-bg 93 y <- increment - 94 set-cursor-position screen, right-min, y - 95 draw-text-wrapping-right-then-down-from-cursor screen, " cons car cdr no cons? len", right-min, y, xmax, ymax, 0x2a/fg=orange, 0xdc/bg=green-bg + 94 set-cursor-position screen, right-min, y + 95 draw-text-wrapping-right-then-down-from-cursor screen, " cons car cdr no cons? len", right-min, y, xmax, ymax, 0x2a/fg=orange, 0xdc/bg=green-bg 96 y <- increment - 97 set-cursor-position screen, right-min, y - 98 draw-text-wrapping-right-then-down-from-cursor screen, "numbers", right-min, y, xmax, ymax, 7/fg=grey, 0xdc/bg=green-bg + 97 set-cursor-position screen, right-min, y + 98 draw-text-wrapping-right-then-down-from-cursor screen, "numbers", right-min, y, xmax, ymax, 7/fg=grey, 0xdc/bg=green-bg 99 y <- increment - 100 set-cursor-position screen, right-min, y - 101 draw-text-wrapping-right-then-down-from-cursor screen, " + - * / %", right-min, y, xmax, ymax, 0x2a/fg=orange, 0xdc/bg=green-bg + 100 set-cursor-position screen, right-min, y + 101 draw-text-wrapping-right-then-down-from-cursor screen, " + - * / %", right-min, y, xmax, ymax, 0x2a/fg=orange, 0xdc/bg=green-bg 102 y <- increment - 103 set-cursor-position screen, right-min, y - 104 draw-text-wrapping-right-then-down-from-cursor screen, " < > <= >=", right-min, y, xmax, ymax, 0x2a/fg=orange, 0xdc/bg=green-bg + 103 set-cursor-position screen, right-min, y + 104 draw-text-wrapping-right-then-down-from-cursor screen, " < > <= >=", right-min, y, xmax, ymax, 0x2a/fg=orange, 0xdc/bg=green-bg 105 y <- increment - 106 set-cursor-position screen, right-min, y - 107 draw-text-wrapping-right-then-down-from-cursor screen, " sqrt abs sgn", right-min, y, xmax, ymax, 0x2a/fg=orange, 0xdc/bg=green-bg + 106 set-cursor-position screen, right-min, y + 107 draw-text-wrapping-right-then-down-from-cursor screen, " sqrt abs sgn", right-min, y, xmax, ymax, 0x2a/fg=orange, 0xdc/bg=green-bg 108 y <- increment - 109 set-cursor-position screen, right-min, y - 110 draw-text-wrapping-right-then-down-from-cursor screen, "arrays", right-min, y, xmax, ymax, 7/fg=grey, 0xdc/bg=green-bg + 109 set-cursor-position screen, right-min, y + 110 draw-text-wrapping-right-then-down-from-cursor screen, "arrays", right-min, y, xmax, ymax, 7/fg=grey, 0xdc/bg=green-bg 111 y <- increment - 112 set-cursor-position screen, right-min, y - 113 draw-text-wrapping-right-then-down-from-cursor screen, " array index iset len", right-min, y, xmax, ymax, 0x2a/fg=orange, 0xdc/bg=green-bg + 112 set-cursor-position screen, right-min, y + 113 draw-text-wrapping-right-then-down-from-cursor screen, " array index iset len", right-min, y, xmax, ymax, 0x2a/fg=orange, 0xdc/bg=green-bg 114 y <- increment 115 var tmpx/eax: int <- copy right-min - 116 tmpx <- draw-text-rightward screen, " populate", tmpx, xmax, y, 0x2a/fg=orange, 0xdc/bg=green-bg - 117 tmpx <- draw-text-rightward screen, ": int _ -> array", tmpx, xmax, y, 7/fg=grey, 0xdc/bg=green-bg + 116 tmpx <- draw-text-rightward screen, " populate", tmpx, xmax, y, 0x2a/fg=orange, 0xdc/bg=green-bg + 117 tmpx <- draw-text-rightward screen, ": int _ -> array", tmpx, xmax, y, 7/fg=grey, 0xdc/bg=green-bg 118 y <- increment - 119 set-cursor-position screen, right-min, y - 120 draw-text-wrapping-right-then-down-from-cursor screen, "images", right-min, y, xmax, ymax, 7/fg=grey, 0xdc/bg=green-bg + 119 set-cursor-position screen, right-min, y + 120 draw-text-wrapping-right-then-down-from-cursor screen, "images", right-min, y, xmax, ymax, 7/fg=grey, 0xdc/bg=green-bg 121 y <- increment 122 var tmpx/eax: int <- copy right-min - 123 tmpx <- draw-text-rightward screen, " img", tmpx, xmax, y, 0x2a/fg=orange, 0xdc/bg=green-bg - 124 tmpx <- draw-text-rightward screen, ": screen stream x y w h", tmpx, xmax, y, 7/fg=grey, 0xdc/bg=green-bg + 123 tmpx <- draw-text-rightward screen, " img", tmpx, xmax, y, 0x2a/fg=orange, 0xdc/bg=green-bg + 124 tmpx <- draw-text-rightward screen, ": screen stream x y w h", tmpx, xmax, y, 7/fg=grey, 0xdc/bg=green-bg 125 #? { 126 #? compare screen, 0 127 #? break-if-!= @@ -199,64 +199,64 @@ if ('onhashchange' in window) { 134 var left-max/edx: int <- copy xmax 135 left-max <- subtract 0x20/primitives-divider 136 var tmpx/eax: int <- copy xmin - 137 tmpx <- draw-text-rightward screen, "cursor graphics", tmpx, left-max, y, 7/fg=grey, 0xdc/bg=green-bg + 137 tmpx <- draw-text-rightward screen, "cursor graphics", tmpx, left-max, y, 7/fg=grey, 0xdc/bg=green-bg 138 y <- increment 139 var tmpx/eax: int <- copy xmin - 140 tmpx <- draw-text-rightward screen, " print", tmpx, left-max, y, 0x2a/fg=orange, 0xdc/bg=green-bg - 141 tmpx <- draw-text-rightward screen, ": screen _ -> _", tmpx, left-max, y, 7/fg=grey, 0xdc/bg=green-bg + 140 tmpx <- draw-text-rightward screen, " print", tmpx, left-max, y, 0x2a/fg=orange, 0xdc/bg=green-bg + 141 tmpx <- draw-text-rightward screen, ": screen _ -> _", tmpx, left-max, y, 7/fg=grey, 0xdc/bg=green-bg 142 y <- increment 143 var tmpx/eax: int <- copy xmin - 144 tmpx <- draw-text-rightward screen, " lines columns", tmpx, left-max, y, 0x2a/fg=orange, 0xdc/bg=green-bg - 145 tmpx <- draw-text-rightward screen, ": screen -> number", tmpx, left-max, y, 7/fg=grey, 0xdc/bg=green-bg + 144 tmpx <- draw-text-rightward screen, " lines columns", tmpx, left-max, y, 0x2a/fg=orange, 0xdc/bg=green-bg + 145 tmpx <- draw-text-rightward screen, ": screen -> number", tmpx, left-max, y, 7/fg=grey, 0xdc/bg=green-bg 146 y <- increment 147 var tmpx/eax: int <- copy xmin - 148 tmpx <- draw-text-rightward screen, " up down left right", tmpx, left-max, y, 0x2a/fg=orange, 0xdc/bg=green-bg - 149 tmpx <- draw-text-rightward screen, ": screen", tmpx, left-max, y, 7/fg=grey, 0xdc/bg=green-bg + 148 tmpx <- draw-text-rightward screen, " up down left right", tmpx, left-max, y, 0x2a/fg=orange, 0xdc/bg=green-bg + 149 tmpx <- draw-text-rightward screen, ": screen", tmpx, left-max, y, 7/fg=grey, 0xdc/bg=green-bg 150 y <- increment 151 var tmpx/eax: int <- copy xmin - 152 tmpx <- draw-text-rightward screen, " cr", tmpx, left-max, y, 0x2a/fg=orange, 0xdc/bg=green-bg - 153 tmpx <- draw-text-rightward screen, ": screen ", tmpx, left-max, y, 7/fg=grey, 0xdc/bg=green-bg - 154 tmpx <- draw-text-rightward screen, "# move cursor down and to left margin", tmpx, left-max, y, 0x38/fg=trace, 0xdc/bg=green-bg + 152 tmpx <- draw-text-rightward screen, " cr", tmpx, left-max, y, 0x2a/fg=orange, 0xdc/bg=green-bg + 153 tmpx <- draw-text-rightward screen, ": screen ", tmpx, left-max, y, 7/fg=grey, 0xdc/bg=green-bg + 154 tmpx <- draw-text-rightward screen, "# move cursor down and to left margin", tmpx, left-max, y, 0x38/fg=trace, 0xdc/bg=green-bg 155 y <- increment 156 var tmpx/eax: int <- copy xmin - 157 tmpx <- draw-text-rightward screen, "pixel graphics", tmpx, left-max, y, 7/fg=grey, 0xdc/bg=green-bg + 157 tmpx <- draw-text-rightward screen, "pixel graphics", tmpx, left-max, y, 7/fg=grey, 0xdc/bg=green-bg 158 y <- increment 159 var tmpx/eax: int <- copy xmin - 160 tmpx <- draw-text-rightward screen, " circle bezier line hline vline pixel", tmpx, left-max, y, 0x2a/fg=orange, 0xdc/bg=green-bg + 160 tmpx <- draw-text-rightward screen, " circle bezier line hline vline pixel", tmpx, left-max, y, 0x2a/fg=orange, 0xdc/bg=green-bg 161 y <- increment 162 var tmpx/eax: int <- copy xmin - 163 tmpx <- draw-text-rightward screen, " width height", tmpx, left-max, y, 0x2a/fg=orange, 0xdc/bg=green-bg - 164 tmpx <- draw-text-rightward screen, ": screen -> number", tmpx, left-max, y, 7/fg=grey, 0xdc/bg=green-bg + 163 tmpx <- draw-text-rightward screen, " width height", tmpx, left-max, y, 0x2a/fg=orange, 0xdc/bg=green-bg + 164 tmpx <- draw-text-rightward screen, ": screen -> number", tmpx, left-max, y, 7/fg=grey, 0xdc/bg=green-bg 165 y <- increment 166 var tmpx/eax: int <- copy xmin - 167 tmpx <- draw-text-rightward screen, " clear", tmpx, left-max, y, 0x2a/fg=orange, 0xdc/bg=green-bg - 168 tmpx <- draw-text-rightward screen, ": screen", tmpx, left-max, y, 7/fg=grey, 0xdc/bg=green-bg + 167 tmpx <- draw-text-rightward screen, " clear", tmpx, left-max, y, 0x2a/fg=orange, 0xdc/bg=green-bg + 168 tmpx <- draw-text-rightward screen, ": screen", tmpx, left-max, y, 7/fg=grey, 0xdc/bg=green-bg 169 y <- increment 170 var tmpx/eax: int <- copy xmin - 171 tmpx <- draw-text-rightward screen, "input", tmpx, left-max, y, 7/fg=grey, 0xdc/bg=green-bg + 171 tmpx <- draw-text-rightward screen, "input", tmpx, left-max, y, 7/fg=grey, 0xdc/bg=green-bg 172 y <- increment 173 var tmpx/eax: int <- copy xmin - 174 tmpx <- draw-text-rightward screen, " key", tmpx, left-max, y, 0x2a/fg=orange, 0xdc/bg=green-bg - 175 tmpx <- draw-text-rightward screen, ": keyboard -> grapheme?", tmpx, left-max, y, 7/fg=grey, 0xdc/bg=green-bg + 174 tmpx <- draw-text-rightward screen, " key", tmpx, left-max, y, 0x2a/fg=orange, 0xdc/bg=green-bg + 175 tmpx <- draw-text-rightward screen, ": keyboard -> grapheme?", tmpx, left-max, y, 7/fg=grey, 0xdc/bg=green-bg 176 y <- increment 177 var tmpx/eax: int <- copy xmin - 178 tmpx <- draw-text-rightward screen, "streams", tmpx, left-max, y, 7/fg=grey, 0xdc/bg=green-bg + 178 tmpx <- draw-text-rightward screen, "streams", tmpx, left-max, y, 7/fg=grey, 0xdc/bg=green-bg 179 y <- increment 180 var tmpx/eax: int <- copy xmin - 181 tmpx <- draw-text-rightward screen, " stream", tmpx, left-max, y, 0x2a/fg=orange, 0xdc/bg=green-bg - 182 tmpx <- draw-text-rightward screen, ": -> stream ", tmpx, left-max, y, 7/fg=grey, 0xdc/bg=green-bg + 181 tmpx <- draw-text-rightward screen, " stream", tmpx, left-max, y, 0x2a/fg=orange, 0xdc/bg=green-bg + 182 tmpx <- draw-text-rightward screen, ": -> stream ", tmpx, left-max, y, 7/fg=grey, 0xdc/bg=green-bg 183 y <- increment 184 var tmpx/eax: int <- copy xmin - 185 tmpx <- draw-text-rightward screen, " write", tmpx, left-max, y, 0x2a/fg=orange, 0xdc/bg=green-bg - 186 tmpx <- draw-text-rightward screen, ": stream grapheme -> stream", tmpx, left-max, y, 7/fg=grey, 0xdc/bg=green-bg + 185 tmpx <- draw-text-rightward screen, " write", tmpx, left-max, y, 0x2a/fg=orange, 0xdc/bg=green-bg + 186 tmpx <- draw-text-rightward screen, ": stream grapheme -> stream", tmpx, left-max, y, 7/fg=grey, 0xdc/bg=green-bg 187 y <- increment 188 var tmpx/eax: int <- copy xmin - 189 tmpx <- draw-text-rightward screen, " rewind clear", tmpx, left-max, y, 0x2a/fg=orange, 0xdc/bg=green-bg - 190 tmpx <- draw-text-rightward screen, ": stream", tmpx, left-max, y, 7/fg=grey, 0xdc/bg=green-bg + 189 tmpx <- draw-text-rightward screen, " rewind clear", tmpx, left-max, y, 0x2a/fg=orange, 0xdc/bg=green-bg + 190 tmpx <- draw-text-rightward screen, ": stream", tmpx, left-max, y, 7/fg=grey, 0xdc/bg=green-bg 191 y <- increment 192 var tmpx/eax: int <- copy xmin - 193 tmpx <- draw-text-rightward screen, " read", tmpx, left-max, y, 0x2a/fg=orange, 0xdc/bg=green-bg - 194 tmpx <- draw-text-rightward screen, ": stream -> grapheme", tmpx, left-max, y, 7/fg=grey, 0xdc/bg=green-bg + 193 tmpx <- draw-text-rightward screen, " read", tmpx, left-max, y, 0x2a/fg=orange, 0xdc/bg=green-bg + 194 tmpx <- draw-text-rightward screen, ": stream -> grapheme", tmpx, left-max, y, 7/fg=grey, 0xdc/bg=green-bg 195 } 196 197 fn primitive-global? _x: (addr global) -> _/eax: boolean { @@ -1812,9 +1812,9 @@ if ('onhashchange' in window) { 1747 error trace, "first arg for 'print' is not a screen" 1748 return 1749 } -1750 var screen-ah/eax: (addr handle screen) <- get first, screen-data -1751 var _screen/eax: (addr screen) <- lookup *screen-ah -1752 var screen/ecx: (addr screen) <- copy _screen +1750 var screen-ah/eax: (addr handle screen) <- get first, screen-data +1751 var _screen/eax: (addr screen) <- lookup *screen-ah +1752 var screen/ecx: (addr screen) <- copy _screen 1753 # args->right->left 1754 var right-ah/eax: (addr handle cell) <- get args, right 1755 var right/eax: (addr cell) <- lookup *right-ah @@ -1836,7 +1836,7 @@ if ('onhashchange' in window) { 1771 var stream-storage: (stream byte 0x100) 1772 var stream/edi: (addr stream byte) <- address stream-storage 1773 print-cell second-ah, stream, trace -1774 draw-stream-wrapping-right-then-down-from-cursor-over-full-screen screen, stream, 7/fg, 0/bg +1774 draw-stream-wrapping-right-then-down-from-cursor-over-full-screen screen, stream, 7/fg, 0/bg 1775 # return what was printed 1776 copy-object second-ah, out 1777 } @@ -1876,13 +1876,13 @@ if ('onhashchange' in window) { 1811 compare *first-type, 5/screen 1812 { 1813 break-if-!= -1814 var screen-ah/eax: (addr handle screen) <- get first, screen-data -1815 var _screen/eax: (addr screen) <- lookup *screen-ah -1816 var screen/ecx: (addr screen) <- copy _screen -1817 clear-screen screen +1814 var screen-ah/eax: (addr handle screen) <- get first, screen-data +1815 var _screen/eax: (addr screen) <- lookup *screen-ah +1816 var screen/ecx: (addr screen) <- copy _screen +1817 clear-screen screen 1818 return 1819 } -1820 error trace, "first arg for 'clear' is not a screen or a stream" +1820 error trace, "first arg for 'clear' is not a screen or a stream" 1821 } 1822 1823 fn apply-up _args-ah: (addr handle cell), out: (addr handle cell), trace: (addr trace) { @@ -1914,11 +1914,11 @@ if ('onhashchange' in window) { 1849 error trace, "first arg for 'up' is not a screen" 1850 return 1851 } -1852 var screen-ah/eax: (addr handle screen) <- get first, screen-data -1853 var _screen/eax: (addr screen) <- lookup *screen-ah -1854 var screen/ecx: (addr screen) <- copy _screen +1852 var screen-ah/eax: (addr handle screen) <- get first, screen-data +1853 var _screen/eax: (addr screen) <- lookup *screen-ah +1854 var screen/ecx: (addr screen) <- copy _screen 1855 # -1856 move-cursor-up screen +1856 move-cursor-up screen 1857 } 1858 1859 fn apply-down _args-ah: (addr handle cell), out: (addr handle cell), trace: (addr trace) { @@ -1950,11 +1950,11 @@ if ('onhashchange' in window) { 1885 error trace, "first arg for 'down' is not a screen" 1886 return 1887 } -1888 var screen-ah/eax: (addr handle screen) <- get first, screen-data -1889 var _screen/eax: (addr screen) <- lookup *screen-ah -1890 var screen/ecx: (addr screen) <- copy _screen +1888 var screen-ah/eax: (addr handle screen) <- get first, screen-data +1889 var _screen/eax: (addr screen) <- lookup *screen-ah +1890 var screen/ecx: (addr screen) <- copy _screen 1891 # -1892 move-cursor-down screen +1892 move-cursor-down screen 1893 } 1894 1895 fn apply-left _args-ah: (addr handle cell), out: (addr handle cell), trace: (addr trace) { @@ -1986,11 +1986,11 @@ if ('onhashchange' in window) { 1921 error trace, "first arg for 'left' is not a screen" 1922 return 1923 } -1924 var screen-ah/eax: (addr handle screen) <- get first, screen-data -1925 var _screen/eax: (addr screen) <- lookup *screen-ah -1926 var screen/ecx: (addr screen) <- copy _screen +1924 var screen-ah/eax: (addr handle screen) <- get first, screen-data +1925 var _screen/eax: (addr screen) <- lookup *screen-ah +1926 var screen/ecx: (addr screen) <- copy _screen 1927 # -1928 move-cursor-left screen +1928 move-cursor-left screen 1929 } 1930 1931 fn apply-right _args-ah: (addr handle cell), out: (addr handle cell), trace: (addr trace) { @@ -2022,11 +2022,11 @@ if ('onhashchange' in window) { 1957 error trace, "first arg for 'right' is not a screen" 1958 return 1959 } -1960 var screen-ah/eax: (addr handle screen) <- get first, screen-data -1961 var _screen/eax: (addr screen) <- lookup *screen-ah -1962 var screen/ecx: (addr screen) <- copy _screen +1960 var screen-ah/eax: (addr handle screen) <- get first, screen-data +1961 var _screen/eax: (addr screen) <- lookup *screen-ah +1962 var screen/ecx: (addr screen) <- copy _screen 1963 # -1964 move-cursor-right screen +1964 move-cursor-right screen 1965 } 1966 1967 fn apply-cr _args-ah: (addr handle cell), out: (addr handle cell), trace: (addr trace) { @@ -2058,11 +2058,11 @@ if ('onhashchange' in window) { 1993 error trace, "first arg for 'cr' is not a screen" 1994 return 1995 } -1996 var screen-ah/eax: (addr handle screen) <- get first, screen-data -1997 var _screen/eax: (addr screen) <- lookup *screen-ah -1998 var screen/ecx: (addr screen) <- copy _screen +1996 var screen-ah/eax: (addr handle screen) <- get first, screen-data +1997 var _screen/eax: (addr screen) <- lookup *screen-ah +1998 var screen/ecx: (addr screen) <- copy _screen 1999 # -2000 move-cursor-to-left-margin-of-next-line screen +2000 move-cursor-to-left-margin-of-next-line screen 2001 } 2002 2003 fn apply-pixel _args-ah: (addr handle cell), out: (addr handle cell), trace: (addr trace) { @@ -2094,9 +2094,9 @@ if ('onhashchange' in window) { 2029 error trace, "first arg for 'pixel' is not a screen" 2030 return 2031 } -2032 var screen-ah/eax: (addr handle screen) <- get first, screen-data -2033 var _screen/eax: (addr screen) <- lookup *screen-ah -2034 var screen/edi: (addr screen) <- copy _screen +2032 var screen-ah/eax: (addr handle screen) <- get first, screen-data +2033 var _screen/eax: (addr screen) <- lookup *screen-ah +2034 var screen/edi: (addr screen) <- copy _screen 2035 # x = args->right->left->value 2036 var rest-ah/eax: (addr handle cell) <- get args, right 2037 var _rest/eax: (addr cell) <- lookup *rest-ah @@ -2184,7 +2184,7 @@ if ('onhashchange' in window) { 2119 } 2120 var fourth-value/eax: (addr float) <- get fourth, number-data 2121 var color/eax: int <- convert *fourth-value -2122 pixel screen, x, y, color +2122 pixel screen, x, y, color 2123 # return nothing 2124 } 2125 @@ -2217,9 +2217,9 @@ if ('onhashchange' in window) { 2152 error trace, "first arg for 'line' is not a screen" 2153 return 2154 } -2155 var screen-ah/eax: (addr handle screen) <- get first, screen-data -2156 var _screen/eax: (addr screen) <- lookup *screen-ah -2157 var screen/edi: (addr screen) <- copy _screen +2155 var screen-ah/eax: (addr handle screen) <- get first, screen-data +2156 var _screen/eax: (addr screen) <- lookup *screen-ah +2157 var screen/edi: (addr screen) <- copy _screen 2158 # x1 = args->right->left->value 2159 var rest-ah/eax: (addr handle cell) <- get args, right 2160 var _rest/eax: (addr cell) <- lookup *rest-ah @@ -2244,7 +2244,7 @@ if ('onhashchange' in window) { 2179 var second-type/eax: (addr int) <- get second, type 2180 compare *second-type, 1/number 2181 break-if-= -2182 error trace, "second arg for 'line' is not a number (screen x coordinate of start point)" +2182 error trace, "second arg for 'line' is not a number (screen x coordinate of start point)" 2183 return 2184 } 2185 var second-value/eax: (addr float) <- get second, number-data @@ -2273,7 +2273,7 @@ if ('onhashchange' in window) { 2208 var third-type/eax: (addr int) <- get third, type 2209 compare *third-type, 1/number 2210 break-if-= -2211 error trace, "third arg for 'line' is not a number (screen y coordinate of start point)" +2211 error trace, "third arg for 'line' is not a number (screen y coordinate of start point)" 2212 return 2213 } 2214 var third-value/eax: (addr float) <- get third, number-data @@ -2302,7 +2302,7 @@ if ('onhashchange' in window) { 2237 var fourth-type/eax: (addr int) <- get fourth, type 2238 compare *fourth-type, 1/number 2239 break-if-= -2240 error trace, "fourth arg for 'line' is not a number (screen x coordinate of end point)" +2240 error trace, "fourth arg for 'line' is not a number (screen x coordinate of end point)" 2241 return 2242 } 2243 var fourth-value/eax: (addr float) <- get fourth, number-data @@ -2331,7 +2331,7 @@ if ('onhashchange' in window) { 2266 var fifth-type/eax: (addr int) <- get fifth, type 2267 compare *fifth-type, 1/number 2268 break-if-= -2269 error trace, "fifth arg for 'line' is not a number (screen y coordinate of end point)" +2269 error trace, "fifth arg for 'line' is not a number (screen y coordinate of end point)" 2270 return 2271 } 2272 var fifth-value/eax: (addr float) <- get fifth, number-data @@ -2367,7 +2367,7 @@ if ('onhashchange' in window) { 2302 } 2303 var sixth-value/eax: (addr float) <- get sixth, number-data 2304 var color/eax: int <- convert *sixth-value -2305 draw-line screen, x1, y1, x2, y2, color +2305 draw-line screen, x1, y1, x2, y2, color 2306 # return nothing 2307 } 2308 @@ -2400,9 +2400,9 @@ if ('onhashchange' in window) { 2335 error trace, "first arg for 'hline' is not a screen" 2336 return 2337 } -2338 var screen-ah/eax: (addr handle screen) <- get first, screen-data -2339 var _screen/eax: (addr screen) <- lookup *screen-ah -2340 var screen/edi: (addr screen) <- copy _screen +2338 var screen-ah/eax: (addr handle screen) <- get first, screen-data +2339 var _screen/eax: (addr screen) <- lookup *screen-ah +2340 var screen/edi: (addr screen) <- copy _screen 2341 # y = args->right->left->value 2342 var rest-ah/eax: (addr handle cell) <- get args, right 2343 var _rest/eax: (addr cell) <- lookup *rest-ah @@ -2427,7 +2427,7 @@ if ('onhashchange' in window) { 2362 var second-type/eax: (addr int) <- get second, type 2363 compare *second-type, 1/number 2364 break-if-= -2365 error trace, "second arg for 'hline' is not a number (screen y coordinate)" +2365 error trace, "second arg for 'hline' is not a number (screen y coordinate)" 2366 return 2367 } 2368 var second-value/eax: (addr float) <- get second, number-data @@ -2456,7 +2456,7 @@ if ('onhashchange' in window) { 2391 var third-type/eax: (addr int) <- get third, type 2392 compare *third-type, 1/number 2393 break-if-= -2394 error trace, "third arg for 'hline' is not a number (screen x coordinate of start point)" +2394 error trace, "third arg for 'hline' is not a number (screen x coordinate of start point)" 2395 return 2396 } 2397 var third-value/eax: (addr float) <- get third, number-data @@ -2485,7 +2485,7 @@ if ('onhashchange' in window) { 2420 var fourth-type/eax: (addr int) <- get fourth, type 2421 compare *fourth-type, 1/number 2422 break-if-= -2423 error trace, "fourth arg for 'hline' is not a number (screen x coordinate of end point)" +2423 error trace, "fourth arg for 'hline' is not a number (screen x coordinate of end point)" 2424 return 2425 } 2426 var fourth-value/eax: (addr float) <- get fourth, number-data @@ -2519,7 +2519,7 @@ if ('onhashchange' in window) { 2454 } 2455 var fifth-value/eax: (addr float) <- get fifth, number-data 2456 var color/eax: int <- convert *fifth-value -2457 draw-horizontal-line screen, y, x1, x2, color +2457 draw-horizontal-line screen, y, x1, x2, color 2458 # return nothing 2459 } 2460 @@ -2552,9 +2552,9 @@ if ('onhashchange' in window) { 2487 error trace, "first arg for 'vline' is not a screen" 2488 return 2489 } -2490 var screen-ah/eax: (addr handle screen) <- get first, screen-data -2491 var _screen/eax: (addr screen) <- lookup *screen-ah -2492 var screen/edi: (addr screen) <- copy _screen +2490 var screen-ah/eax: (addr handle screen) <- get first, screen-data +2491 var _screen/eax: (addr screen) <- lookup *screen-ah +2492 var screen/edi: (addr screen) <- copy _screen 2493 # x = args->right->left->value 2494 var rest-ah/eax: (addr handle cell) <- get args, right 2495 var _rest/eax: (addr cell) <- lookup *rest-ah @@ -2579,7 +2579,7 @@ if ('onhashchange' in window) { 2514 var second-type/eax: (addr int) <- get second, type 2515 compare *second-type, 1/number 2516 break-if-= -2517 error trace, "second arg for 'vline' is not a number (screen x coordinate)" +2517 error trace, "second arg for 'vline' is not a number (screen x coordinate)" 2518 return 2519 } 2520 var second-value/eax: (addr float) <- get second, number-data @@ -2608,7 +2608,7 @@ if ('onhashchange' in window) { 2543 var third-type/eax: (addr int) <- get third, type 2544 compare *third-type, 1/number 2545 break-if-= -2546 error trace, "third arg for 'vline' is not a number (screen y coordinate of start point)" +2546 error trace, "third arg for 'vline' is not a number (screen y coordinate of start point)" 2547 return 2548 } 2549 var third-value/eax: (addr float) <- get third, number-data @@ -2637,7 +2637,7 @@ if ('onhashchange' in window) { 2572 var fourth-type/eax: (addr int) <- get fourth, type 2573 compare *fourth-type, 1/number 2574 break-if-= -2575 error trace, "fourth arg for 'vline' is not a number (screen y coordinate of end point)" +2575 error trace, "fourth arg for 'vline' is not a number (screen y coordinate of end point)" 2576 return 2577 } 2578 var fourth-value/eax: (addr float) <- get fourth, number-data @@ -2671,7 +2671,7 @@ if ('onhashchange' in window) { 2606 } 2607 var fifth-value/eax: (addr float) <- get fifth, number-data 2608 var color/eax: int <- convert *fifth-value -2609 draw-vertical-line screen, x, y1, y2, color +2609 draw-vertical-line screen, x, y1, y2, color 2610 # return nothing 2611 } 2612 @@ -2704,9 +2704,9 @@ if ('onhashchange' in window) { 2639 error trace, "first arg for 'circle' is not a screen" 2640 return 2641 } -2642 var screen-ah/eax: (addr handle screen) <- get first, screen-data -2643 var _screen/eax: (addr screen) <- lookup *screen-ah -2644 var screen/edi: (addr screen) <- copy _screen +2642 var screen-ah/eax: (addr handle screen) <- get first, screen-data +2643 var _screen/eax: (addr screen) <- lookup *screen-ah +2644 var screen/edi: (addr screen) <- copy _screen 2645 # cx = args->right->left->value 2646 var rest-ah/eax: (addr handle cell) <- get args, right 2647 var _rest/eax: (addr cell) <- lookup *rest-ah @@ -2731,7 +2731,7 @@ if ('onhashchange' in window) { 2666 var second-type/eax: (addr int) <- get second, type 2667 compare *second-type, 1/number 2668 break-if-= -2669 error trace, "second arg for 'circle' is not a number (screen x coordinate of center)" +2669 error trace, "second arg for 'circle' is not a number (screen x coordinate of center)" 2670 return 2671 } 2672 var second-value/eax: (addr float) <- get second, number-data @@ -2760,7 +2760,7 @@ if ('onhashchange' in window) { 2695 var third-type/eax: (addr int) <- get third, type 2696 compare *third-type, 1/number 2697 break-if-= -2698 error trace, "third arg for 'circle' is not a number (screen y coordinate of center)" +2698 error trace, "third arg for 'circle' is not a number (screen y coordinate of center)" 2699 return 2700 } 2701 var third-value/eax: (addr float) <- get third, number-data @@ -2789,7 +2789,7 @@ if ('onhashchange' in window) { 2724 var fourth-type/eax: (addr int) <- get fourth, type 2725 compare *fourth-type, 1/number 2726 break-if-= -2727 error trace, "fourth arg for 'circle' is not a number (screen radius)" +2727 error trace, "fourth arg for 'circle' is not a number (screen radius)" 2728 return 2729 } 2730 var fourth-value/eax: (addr float) <- get fourth, number-data @@ -2823,7 +2823,7 @@ if ('onhashchange' in window) { 2758 } 2759 var fifth-value/eax: (addr float) <- get fifth, number-data 2760 var color/eax: int <- convert *fifth-value -2761 draw-circle screen, cx, cy, r, color +2761 draw-circle screen, cx, cy, r, color 2762 # return nothing 2763 } 2764 @@ -2856,9 +2856,9 @@ if ('onhashchange' in window) { 2791 error trace, "first arg for 'bezier' is not a screen" 2792 return 2793 } -2794 var screen-ah/eax: (addr handle screen) <- get first, screen-data -2795 var _screen/eax: (addr screen) <- lookup *screen-ah -2796 var screen/edi: (addr screen) <- copy _screen +2794 var screen-ah/eax: (addr handle screen) <- get first, screen-data +2795 var _screen/eax: (addr screen) <- lookup *screen-ah +2796 var screen/edi: (addr screen) <- copy _screen 2797 # x0 = args->right->left->value 2798 var rest-ah/eax: (addr handle cell) <- get args, right 2799 var _rest/eax: (addr cell) <- lookup *rest-ah @@ -2883,7 +2883,7 @@ if ('onhashchange' in window) { 2818 var second-type/eax: (addr int) <- get second, type 2819 compare *second-type, 1/number 2820 break-if-= -2821 error trace, "second arg for 'bezier' is not a number (screen x coordinate of start point)" +2821 error trace, "second arg for 'bezier' is not a number (screen x coordinate of start point)" 2822 return 2823 } 2824 var second-value/eax: (addr float) <- get second, number-data @@ -2912,7 +2912,7 @@ if ('onhashchange' in window) { 2847 var third-type/eax: (addr int) <- get third, type 2848 compare *third-type, 1/number 2849 break-if-= -2850 error trace, "third arg for 'bezier' is not a number (screen y coordinate of start point)" +2850 error trace, "third arg for 'bezier' is not a number (screen y coordinate of start point)" 2851 return 2852 } 2853 var third-value/eax: (addr float) <- get third, number-data @@ -2941,7 +2941,7 @@ if ('onhashchange' in window) { 2876 var fourth-type/eax: (addr int) <- get fourth, type 2877 compare *fourth-type, 1/number 2878 break-if-= -2879 error trace, "fourth arg for 'bezier' is not a number (screen x coordinate of control point)" +2879 error trace, "fourth arg for 'bezier' is not a number (screen x coordinate of control point)" 2880 return 2881 } 2882 var fourth-value/eax: (addr float) <- get fourth, number-data @@ -2972,7 +2972,7 @@ if ('onhashchange' in window) { 2907 var fifth-type/eax: (addr int) <- get fifth, type 2908 compare *fifth-type, 1/number 2909 break-if-= -2910 error trace, "fifth arg for 'bezier' is not a number (screen y coordinate of control point)" +2910 error trace, "fifth arg for 'bezier' is not a number (screen y coordinate of control point)" 2911 return 2912 } 2913 var fifth-value/eax: (addr float) <- get fifth, number-data @@ -3003,7 +3003,7 @@ if ('onhashchange' in window) { 2938 var sixth-type/eax: (addr int) <- get sixth, type 2939 compare *sixth-type, 1/number 2940 break-if-= -2941 error trace, "sixth arg for 'bezier' is not a number (screen x coordinate of end point)" +2941 error trace, "sixth arg for 'bezier' is not a number (screen x coordinate of end point)" 2942 return 2943 } 2944 var sixth-value/eax: (addr float) <- get sixth, number-data @@ -3034,7 +3034,7 @@ if ('onhashchange' in window) { 2969 var seventh-type/eax: (addr int) <- get seventh, type 2970 compare *seventh-type, 1/number 2971 break-if-= -2972 error trace, "seventh arg for 'bezier' is not a number (screen y coordinate of end point)" +2972 error trace, "seventh arg for 'bezier' is not a number (screen y coordinate of end point)" 2973 return 2974 } 2975 var seventh-value/eax: (addr float) <- get seventh, number-data @@ -3070,7 +3070,7 @@ if ('onhashchange' in window) { 3005 } 3006 var eighth-value/eax: (addr float) <- get eighth, number-data 3007 var color/eax: int <- convert *eighth-value -3008 draw-monotonic-bezier screen, x0, y0, x1, y1, x2, y2, color +3008 draw-monotonic-bezier screen, x0, y0, x1, y1, x2, y2, color 3009 # return nothing 3010 } 3011 @@ -3301,13 +3301,13 @@ if ('onhashchange' in window) { 3236 error trace, "first arg for 'lines' is not a screen" 3237 return 3238 } -3239 var screen-ah/eax: (addr handle screen) <- get first, screen-data -3240 var _screen/eax: (addr screen) <- lookup *screen-ah -3241 var screen/edx: (addr screen) <- copy _screen +3239 var screen-ah/eax: (addr handle screen) <- get first, screen-data +3240 var _screen/eax: (addr screen) <- lookup *screen-ah +3241 var screen/edx: (addr screen) <- copy _screen 3242 # compute dimensions 3243 var dummy/eax: int <- copy 0 3244 var height/ecx: int <- copy 0 -3245 dummy, height <- screen-size screen +3245 dummy, height <- screen-size screen 3246 var result/xmm0: float <- convert height 3247 new-float out, result 3248 } @@ -3341,13 +3341,13 @@ if ('onhashchange' in window) { 3276 error trace, "first arg for 'columns' is not a screen" 3277 return 3278 } -3279 var screen-ah/eax: (addr handle screen) <- get first, screen-data -3280 var _screen/eax: (addr screen) <- lookup *screen-ah -3281 var screen/edx: (addr screen) <- copy _screen +3279 var screen-ah/eax: (addr handle screen) <- get first, screen-data +3280 var _screen/eax: (addr screen) <- lookup *screen-ah +3281 var screen/edx: (addr screen) <- copy _screen 3282 # compute dimensions 3283 var width/eax: int <- copy 0 3284 var dummy/ecx: int <- copy 0 -3285 width, dummy <- screen-size screen +3285 width, dummy <- screen-size screen 3286 var result/xmm0: float <- convert width 3287 new-float out, result 3288 } @@ -3381,13 +3381,13 @@ if ('onhashchange' in window) { 3316 error trace, "first arg for 'width' is not a screen" 3317 return 3318 } -3319 var screen-ah/eax: (addr handle screen) <- get first, screen-data -3320 var _screen/eax: (addr screen) <- lookup *screen-ah -3321 var screen/edx: (addr screen) <- copy _screen +3319 var screen-ah/eax: (addr handle screen) <- get first, screen-data +3320 var _screen/eax: (addr screen) <- lookup *screen-ah +3321 var screen/edx: (addr screen) <- copy _screen 3322 # compute dimensions 3323 var width/eax: int <- copy 0 3324 var dummy/ecx: int <- copy 0 -3325 width, dummy <- screen-size screen +3325 width, dummy <- screen-size screen 3326 width <- shift-left 3/log2-font-width 3327 var result/xmm0: float <- convert width 3328 new-float out, result @@ -3422,13 +3422,13 @@ if ('onhashchange' in window) { 3357 error trace, "first arg for 'height' is not a screen" 3358 return 3359 } -3360 var screen-ah/eax: (addr handle screen) <- get first, screen-data -3361 var _screen/eax: (addr screen) <- lookup *screen-ah -3362 var screen/edx: (addr screen) <- copy _screen +3360 var screen-ah/eax: (addr handle screen) <- get first, screen-data +3361 var _screen/eax: (addr screen) <- lookup *screen-ah +3362 var screen/edx: (addr screen) <- copy _screen 3363 # compute dimensions 3364 var dummy/eax: int <- copy 0 3365 var height/ecx: int <- copy 0 -3366 dummy, height <- screen-size screen +3366 dummy, height <- screen-size screen 3367 height <- shift-left 4/log2-font-height 3368 var result/xmm0: float <- convert height 3369 new-float out, result @@ -3460,7 +3460,7 @@ if ('onhashchange' in window) { 3395 var first-type/eax: (addr int) <- get first, type 3396 compare *first-type, 1/number 3397 break-if-= -3398 error trace, "first arg for 'screen' is not a number (screen width in pixels)" +3398 error trace, "first arg for 'screen' is not a number (screen width in pixels)" 3399 return 3400 } 3401 var first-value-a/ecx: (addr float) <- get first, number-data @@ -3488,7 +3488,7 @@ if ('onhashchange' in window) { 3423 var second-type/eax: (addr int) <- get second, type 3424 compare *second-type, 1/number 3425 break-if-= -3426 error trace, "second arg for 'screen' is not a number (screen height in pixels)" +3426 error trace, "second arg for 'screen' is not a number (screen height in pixels)" 3427 return 3428 } 3429 var second-value-a/edx: (addr float) <- get second, number-data @@ -3526,9 +3526,9 @@ if ('onhashchange' in window) { 3461 error trace, "first arg for 'blit' is not a screen" 3462 return 3463 } -3464 var src-ah/eax: (addr handle screen) <- get first, screen-data -3465 var _src/eax: (addr screen) <- lookup *src-ah -3466 var src/ecx: (addr screen) <- copy _src +3464 var src-ah/eax: (addr handle screen) <- get first, screen-data +3465 var _src/eax: (addr screen) <- lookup *src-ah +3466 var src/ecx: (addr screen) <- copy _src 3467 # args->right->left 3468 var right-ah/eax: (addr handle cell) <- get args, right 3469 var right/eax: (addr cell) <- lookup *right-ah @@ -3555,11 +3555,11 @@ if ('onhashchange' in window) { 3490 error trace, "second arg for 'blit' is not a screen" 3491 return 3492 } -3493 var dest-ah/eax: (addr handle screen) <- get second, screen-data -3494 var dest/eax: (addr screen) <- lookup *dest-ah +3493 var dest-ah/eax: (addr handle screen) <- get second, screen-data +3494 var dest/eax: (addr screen) <- lookup *dest-ah 3495 # -3496 convert-screen-cells-to-pixels src -3497 copy-pixels src, dest +3496 convert-screen-cells-to-pixels src +3497 copy-pixels src, dest 3498 } 3499 3500 fn apply-array _args-ah: (addr handle cell), _out-ah: (addr handle cell), trace: (addr trace) { @@ -3866,9 +3866,9 @@ if ('onhashchange' in window) { 3801 error trace, "first arg for 'img' is not a screen" 3802 return 3803 } -3804 var screen-ah/eax: (addr handle screen) <- get first, screen-data -3805 var _screen/eax: (addr screen) <- lookup *screen-ah -3806 var screen/edi: (addr screen) <- copy _screen +3804 var screen-ah/eax: (addr handle screen) <- get first, screen-data +3805 var _screen/eax: (addr screen) <- lookup *screen-ah +3806 var screen/edi: (addr screen) <- copy _screen 3807 # x1 = args->right->left->value 3808 var rest-ah/eax: (addr handle cell) <- get args, right 3809 var _rest/eax: (addr cell) <- lookup *rest-ah @@ -3925,7 +3925,7 @@ if ('onhashchange' in window) { 3860 var third-type/eax: (addr int) <- get third, type 3861 compare *third-type, 1/number 3862 break-if-= -3863 error trace, "third arg for 'img' is not a number (screen x coordinate of top left)" +3863 error trace, "third arg for 'img' is not a number (screen x coordinate of top left)" 3864 return 3865 } 3866 var third-value/eax: (addr float) <- get third, number-data @@ -3954,7 +3954,7 @@ if ('onhashchange' in window) { 3889 var fourth-type/eax: (addr int) <- get fourth, type 3890 compare *fourth-type, 1/number 3891 break-if-= -3892 error trace, "fourth arg for 'img' is not a number (screen x coordinate of end point)" +3892 error trace, "fourth arg for 'img' is not a number (screen x coordinate of end point)" 3893 return 3894 } 3895 var fourth-value/eax: (addr float) <- get fourth, number-data @@ -3983,7 +3983,7 @@ if ('onhashchange' in window) { 3918 var fifth-type/eax: (addr int) <- get fifth, type 3919 compare *fifth-type, 1/number 3920 break-if-= -3921 error trace, "fifth arg for 'img' is not a number (screen y coordinate of end point)" +3921 error trace, "fifth arg for 'img' is not a number (screen y coordinate of end point)" 3922 return 3923 } 3924 var fifth-value/eax: (addr float) <- get fifth, number-data @@ -4026,7 +4026,7 @@ if ('onhashchange' in window) { 3961 var img-cell/eax: (addr cell) <- lookup *img-cell-ah 3962 var img-ah/eax: (addr handle image) <- get img-cell, image-data 3963 var img/eax: (addr image) <- lookup *img-ah -3964 render-image screen, img, x y, w h +3964 render-image screen, img, x y, w h 3965 # return nothing 3966 } 3967 diff --git a/html/shell/print.mu.html b/html/shell/print.mu.html index ddeb6ac4..7be992ea 100644 --- a/html/shell/print.mu.html +++ b/html/shell/print.mu.html @@ -153,9 +153,9 @@ if ('onhashchange' in window) { 90 return 91 } 92 write out, "{screen " - 93 var screen-ah/eax: (addr handle screen) <- get in-addr, screen-data - 94 var screen/eax: (addr screen) <- lookup *screen-ah - 95 var screen-addr/eax: int <- copy screen + 93 var screen-ah/eax: (addr handle screen) <- get in-addr, screen-data + 94 var screen/eax: (addr screen) <- lookup *screen-ah + 95 var screen-addr/eax: int <- copy screen 96 write-int32-hex out, screen-addr 97 write out, "}" 98 trace-higher trace diff --git a/html/shell/sandbox.mu.html b/html/shell/sandbox.mu.html index f4b4cb4e..b5401bba 100644 --- a/html/shell/sandbox.mu.html +++ b/html/shell/sandbox.mu.html @@ -143,8 +143,8 @@ if ('onhashchange' in window) { 78 79 ## 80 - 81 fn render-sandbox screen: (addr screen), _self: (addr sandbox), xmin: int, ymin: int, xmax: int, ymax: int, show-cursor?: boolean { - 82 clear-rect screen, xmin, ymin, xmax, ymax, 0xc5/bg=blue-bg + 81 fn render-sandbox screen: (addr screen), _self: (addr sandbox), xmin: int, ymin: int, xmax: int, ymax: int, show-cursor?: boolean { + 82 clear-rect screen, xmin, ymin, xmax, ymax, 0xc5/bg=blue-bg 83 add-to xmin, 1/padding-left 84 add-to ymin, 1/padding-top 85 subtract-from xmax, 1/padding-right @@ -155,8 +155,8 @@ if ('onhashchange' in window) { 90 var data/edx: (addr gap-buffer) <- copy _data 91 var x/eax: int <- copy xmin 92 var y/ecx: int <- copy ymin - 93 y <- maybe-render-empty-screen screen, self, xmin, y - 94 y <- maybe-render-keyboard screen, self, xmin, y + 93 y <- maybe-render-empty-screen screen, self, xmin, y + 94 y <- maybe-render-keyboard screen, self, xmin, y 95 var cursor-in-editor?/ebx: boolean <- copy show-cursor? 96 { 97 compare cursor-in-editor?, 0/false @@ -164,14 +164,14 @@ if ('onhashchange' in window) { 99 var cursor-in-data-a/eax: (addr boolean) <- get self, cursor-in-data? 100 cursor-in-editor? <- copy *cursor-in-data-a 101 } - 102 x, y <- render-gap-buffer-wrapping-right-then-down screen, data, x, y, xmax, ymax, cursor-in-editor?, 7/fg, 0xc5/bg=blue-bg + 102 x, y <- render-gap-buffer-wrapping-right-then-down screen, data, x, y, xmax, ymax, cursor-in-editor?, 7/fg, 0xc5/bg=blue-bg 103 y <- increment 104 # trace 105 var trace-ah/eax: (addr handle trace) <- get self, trace 106 var _trace/eax: (addr trace) <- lookup *trace-ah 107 var trace/edx: (addr trace) <- copy _trace 108 var cursor-in-trace?/eax: (addr boolean) <- get self, cursor-in-trace? - 109 y <- render-trace screen, trace, xmin, y, xmax, ymax, *cursor-in-trace? + 109 y <- render-trace screen, trace, xmin, y, xmax, ymax, *cursor-in-trace? 110 # value 111 $render-sandbox:value: { 112 compare y, ymax @@ -184,40 +184,40 @@ if ('onhashchange' in window) { 119 compare done?, 0/false 120 break-if-!= 121 var x/eax: int <- copy 0 - 122 x, y <- draw-text-wrapping-right-then-down screen, "=> ", xmin, y, xmax, ymax, xmin, y, 7/fg, 0xc5/bg=blue-bg + 122 x, y <- draw-text-wrapping-right-then-down screen, "=> ", xmin, y, xmax, ymax, xmin, y, 7/fg, 0xc5/bg=blue-bg 123 var x2/edx: int <- copy x - 124 var dummy/eax: int <- draw-stream-rightward screen, value, x2, xmax, y, 7/fg=grey, 0xc5/bg=blue-bg + 124 var dummy/eax: int <- draw-stream-rightward screen, value, x2, xmax, y, 7/fg=grey, 0xc5/bg=blue-bg 125 } 126 y <- add 2 # padding - 127 maybe-render-screen screen, self, xmin, y + 127 maybe-render-screen screen, self, xmin, y 128 } 129 - 130 fn render-sandbox-menu screen: (addr screen), _self: (addr sandbox) { + 130 fn render-sandbox-menu screen: (addr screen), _self: (addr sandbox) { 131 var self/esi: (addr sandbox) <- copy _self 132 var cursor-in-data?/eax: (addr boolean) <- get self, cursor-in-data? 133 compare *cursor-in-data?, 0/false 134 { 135 break-if-= - 136 render-sandbox-edit-menu screen, self + 136 render-sandbox-edit-menu screen, self 137 return 138 } 139 var cursor-in-trace?/eax: (addr boolean) <- get self, cursor-in-trace? 140 compare *cursor-in-trace?, 0/false 141 { 142 break-if-= - 143 render-trace-menu screen + 143 render-trace-menu screen 144 return 145 } 146 var cursor-in-keyboard?/eax: (addr boolean) <- get self, cursor-in-keyboard? 147 compare *cursor-in-keyboard?, 0/false 148 { 149 break-if-= - 150 render-keyboard-menu screen + 150 render-keyboard-menu screen 151 return 152 } 153 } 154 - 155 fn clear-sandbox-output screen: (addr screen), _self: (addr sandbox), xmin: int, ymin: int, xmax: int, ymax: int { + 155 fn clear-sandbox-output screen: (addr screen), _self: (addr sandbox), xmin: int, ymin: int, xmax: int, ymax: int { 156 # render just enough of the sandbox to figure out what to erase 157 var self/esi: (addr sandbox) <- copy _self 158 var data-ah/eax: (addr handle gap-buffer) <- get self, data @@ -225,15 +225,15 @@ if ('onhashchange' in window) { 160 var data/edx: (addr gap-buffer) <- copy _data 161 var x/eax: int <- copy xmin 162 var y/ecx: int <- copy ymin - 163 y <- maybe-render-empty-screen screen, self, xmin, y - 164 y <- maybe-render-keyboard screen, self, xmin, y + 163 y <- maybe-render-empty-screen screen, self, xmin, y + 164 y <- maybe-render-keyboard screen, self, xmin, y 165 var cursor-in-sandbox?/ebx: (addr boolean) <- get self, cursor-in-data? - 166 x, y <- render-gap-buffer-wrapping-right-then-down screen, data, x, y, xmax, ymax, *cursor-in-sandbox?, 3/fg, 0xc5/bg=blue-bg + 166 x, y <- render-gap-buffer-wrapping-right-then-down screen, data, x, y, xmax, ymax, *cursor-in-sandbox?, 3/fg, 0xc5/bg=blue-bg 167 y <- increment - 168 clear-rect screen, xmin, y, xmax, ymax, 0xc5/bg=blue-bg + 168 clear-rect screen, xmin, y, xmax, ymax, 0xc5/bg=blue-bg 169 } 170 - 171 fn maybe-render-empty-screen screen: (addr screen), _self: (addr sandbox), xmin: int, ymin: int -> _/ecx: int { + 171 fn maybe-render-empty-screen screen: (addr screen), _self: (addr sandbox), xmin: int, ymin: int -> _/ecx: int { 172 var self/esi: (addr sandbox) <- copy _self 173 var screen-obj-cell-ah/eax: (addr handle cell) <- get self, screen-var 174 var screen-obj-cell/eax: (addr cell) <- lookup *screen-obj-cell-ah @@ -249,18 +249,18 @@ if ('onhashchange' in window) { 184 return ymin # silently give up on rendering the screen 185 } 186 var y/ecx: int <- copy ymin - 187 var screen-obj-ah/eax: (addr handle screen) <- get screen-obj-cell, screen-data - 188 var _screen-obj/eax: (addr screen) <- lookup *screen-obj-ah - 189 var screen-obj/edx: (addr screen) <- copy _screen-obj - 190 var x/eax: int <- draw-text-rightward screen, "screen: ", xmin, 0x99/xmax, y, 0x17/fg, 0xc5/bg=blue-bg + 187 var screen-obj-ah/eax: (addr handle screen) <- get screen-obj-cell, screen-data + 188 var _screen-obj/eax: (addr screen) <- lookup *screen-obj-ah + 189 var screen-obj/edx: (addr screen) <- copy _screen-obj + 190 var x/eax: int <- draw-text-rightward screen, "screen: ", xmin, 0x99/xmax, y, 0x17/fg, 0xc5/bg=blue-bg 191 x <- copy xmin 192 x <- add 2 193 y <- increment - 194 y <- render-empty-screen screen, screen-obj, x, y + 194 y <- render-empty-screen screen, screen-obj, x, y 195 return y 196 } 197 - 198 fn maybe-render-screen screen: (addr screen), _self: (addr sandbox), xmin: int, ymin: int { + 198 fn maybe-render-screen screen: (addr screen), _self: (addr sandbox), xmin: int, ymin: int { 199 var self/esi: (addr sandbox) <- copy _self 200 var screen-obj-cell-ah/eax: (addr handle cell) <- get self, screen-var 201 var screen-obj-cell/eax: (addr cell) <- lookup *screen-obj-cell-ah @@ -275,25 +275,25 @@ if ('onhashchange' in window) { 210 break-if-= 211 return # silently give up on rendering the screen 212 } - 213 var screen-obj-ah/eax: (addr handle screen) <- get screen-obj-cell, screen-data - 214 var _screen-obj/eax: (addr screen) <- lookup *screen-obj-ah - 215 var screen-obj/edx: (addr screen) <- copy _screen-obj + 213 var screen-obj-ah/eax: (addr handle screen) <- get screen-obj-cell, screen-data + 214 var _screen-obj/eax: (addr screen) <- lookup *screen-obj-ah + 215 var screen-obj/edx: (addr screen) <- copy _screen-obj 216 { - 217 var screen-empty?/eax: boolean <- fake-screen-empty? screen-obj + 217 var screen-empty?/eax: boolean <- fake-screen-empty? screen-obj 218 compare screen-empty?, 0/false 219 break-if-= 220 return 221 } - 222 var x/eax: int <- draw-text-rightward screen, "screen: ", xmin, 0x99/xmax, ymin, 0x17/fg, 0xc5/bg=blue-bg + 222 var x/eax: int <- draw-text-rightward screen, "screen: ", xmin, 0x99/xmax, ymin, 0x17/fg, 0xc5/bg=blue-bg 223 x <- copy xmin 224 x <- add 2 225 var y/ecx: int <- copy ymin 226 y <- increment - 227 render-screen screen, screen-obj, x, y + 227 render-screen screen, screen-obj, x, y 228 } 229 - 230 fn render-empty-screen screen: (addr screen), _target-screen: (addr screen), xmin: int, ymin: int -> _/ecx: int { - 231 var target-screen/esi: (addr screen) <- copy _target-screen + 230 fn render-empty-screen screen: (addr screen), _target-screen: (addr screen), xmin: int, ymin: int -> _/ecx: int { + 231 var target-screen/esi: (addr screen) <- copy _target-screen 232 var screen-y/edi: int <- copy ymin 233 # screen 234 var height/edx: (addr int) <- get target-screen, height @@ -301,13 +301,13 @@ if ('onhashchange' in window) { 236 { 237 compare y, *height 238 break-if->= - 239 set-cursor-position screen, xmin, screen-y + 239 set-cursor-position screen, xmin, screen-y 240 var width/edx: (addr int) <- get target-screen, width 241 var x/ebx: int <- copy 0 242 { 243 compare x, *width 244 break-if->= - 245 draw-code-point-at-cursor-over-full-screen screen, 0x20/space, 0x18/fg, 0/bg + 245 draw-code-point-at-cursor-over-full-screen screen, 0x20/space, 0x18/fg, 0/bg 246 x <- increment 247 loop 248 } @@ -318,9 +318,9 @@ if ('onhashchange' in window) { 253 return screen-y 254 } 255 - 256 fn render-screen screen: (addr screen), _target-screen: (addr screen), xmin: int, ymin: int { - 257 var target-screen/esi: (addr screen) <- copy _target-screen - 258 convert-screen-cells-to-pixels target-screen # might overwrite existing pixel data with screen cells + 256 fn render-screen screen: (addr screen), _target-screen: (addr screen), xmin: int, ymin: int { + 257 var target-screen/esi: (addr screen) <- copy _target-screen + 258 convert-screen-cells-to-pixels target-screen # might overwrite existing pixel data with screen cells 259 # overlapping the two is not supported 260 # pixel data 261 { @@ -353,7 +353,7 @@ if ('onhashchange' in window) { 288 compare x, width 289 break-if->= 290 { - 291 var idx/ecx: int <- pixel-index target-screen, x, y + 291 var idx/ecx: int <- pixel-index target-screen, x, y 292 var color-addr/ecx: (addr byte) <- index pixels, idx 293 var color/ecx: byte <- copy-byte *color-addr 294 var color2/ecx: int <- copy color @@ -361,7 +361,7 @@ if ('onhashchange' in window) { 296 x2 <- add left 297 var y2/ebx: int <- copy y 298 y2 <- add top - 299 pixel screen, x2, y2, color2 + 299 pixel screen, x2, y2, color2 300 } 301 x <- increment 302 loop @@ -398,7 +398,7 @@ if ('onhashchange' in window) { 333 return 1/true 334 } 335 - 336 fn maybe-render-keyboard screen: (addr screen), _self: (addr sandbox), xmin: int, ymin: int -> _/ecx: int { + 336 fn maybe-render-keyboard screen: (addr screen), _self: (addr sandbox), xmin: int, ymin: int -> _/ecx: int { 337 var self/esi: (addr sandbox) <- copy _self 338 var keyboard-obj-cell-ah/eax: (addr handle cell) <- get self, keyboard-var 339 var keyboard-obj-cell/eax: (addr cell) <- lookup *keyboard-obj-cell-ah @@ -418,14 +418,14 @@ if ('onhashchange' in window) { 353 var keyboard-obj/edx: (addr gap-buffer) <- copy _keyboard-obj 354 var y/ecx: int <- copy ymin 355 y <- increment # padding - 356 var x/eax: int <- draw-text-rightward screen, "keyboard: ", xmin, 0x99/xmax, y, 0x17/fg, 0xc5/bg=blue-bg + 356 var x/eax: int <- draw-text-rightward screen, "keyboard: ", xmin, 0x99/xmax, y, 0x17/fg, 0xc5/bg=blue-bg 357 var cursor-in-keyboard?/esi: (addr boolean) <- get self, cursor-in-keyboard? - 358 y <- render-keyboard screen, keyboard-obj, x, y, *cursor-in-keyboard? + 358 y <- render-keyboard screen, keyboard-obj, x, y, *cursor-in-keyboard? 359 y <- increment # padding 360 return y 361 } 362 - 363 fn render-keyboard screen: (addr screen), _keyboard: (addr gap-buffer), xmin: int, ymin: int, render-cursor?: boolean -> _/ecx: int { + 363 fn render-keyboard screen: (addr screen), _keyboard: (addr gap-buffer), xmin: int, ymin: int, render-cursor?: boolean -> _/ecx: int { 364 var keyboard/esi: (addr gap-buffer) <- copy _keyboard 365 var width/edx: int <- copy 0x10/keyboard-capacity 366 var y/edi: int <- copy ymin @@ -435,83 +435,83 @@ if ('onhashchange' in window) { 370 xmax <- add 0x10 371 var ymax/edx: int <- copy ymin 372 ymax <- add 1 - 373 clear-rect screen, x, y, xmax, ymax, 0/bg - 374 x <- render-gap-buffer screen, keyboard, x, y, render-cursor?, 3/fg, 0/bg + 373 clear-rect screen, x, y, xmax, ymax, 0/bg + 374 x <- render-gap-buffer screen, keyboard, x, y, render-cursor?, 3/fg, 0/bg 375 y <- increment 376 return y 377 } 378 - 379 fn print-screen-cell-of-fake-screen screen: (addr screen), _target: (addr screen), x: int, y: int { - 380 var target/ecx: (addr screen) <- copy _target - 381 var data-ah/eax: (addr handle array screen-cell) <- get target, data - 382 var data/eax: (addr array screen-cell) <- lookup *data-ah - 383 var index/ecx: int <- screen-cell-index target, x, y - 384 var offset/ecx: (offset screen-cell) <- compute-offset data, index - 385 var src-cell/esi: (addr screen-cell) <- index data, offset + 379 fn print-screen-cell-of-fake-screen screen: (addr screen), _target: (addr screen), x: int, y: int { + 380 var target/ecx: (addr screen) <- copy _target + 381 var data-ah/eax: (addr handle array screen-cell) <- get target, data + 382 var data/eax: (addr array screen-cell) <- lookup *data-ah + 383 var index/ecx: int <- screen-cell-index target, x, y + 384 var offset/ecx: (offset screen-cell) <- compute-offset data, index + 385 var src-cell/esi: (addr screen-cell) <- index data, offset 386 var src-code-point/eax: (addr code-point) <- get src-cell, data 387 var src-color/ecx: (addr int) <- get src-cell, color 388 var src-background-color/edx: (addr int) <- get src-cell, background-color - 389 draw-code-point-at-cursor-over-full-screen screen, *src-code-point, *src-color, *src-background-color + 389 draw-code-point-at-cursor-over-full-screen screen, *src-code-point, *src-color, *src-background-color 390 } 391 - 392 fn render-sandbox-edit-menu screen: (addr screen), _self: (addr sandbox) { + 392 fn render-sandbox-edit-menu screen: (addr screen), _self: (addr sandbox) { 393 var _width/eax: int <- copy 0 394 var height/ecx: int <- copy 0 - 395 _width, height <- screen-size screen + 395 _width, height <- screen-size screen 396 var width/edx: int <- copy _width 397 var y/ecx: int <- copy height 398 y <- decrement 399 var height/ebx: int <- copy y 400 height <- increment - 401 clear-rect screen, 0/x, y, width, height, 0xc5/bg=blue-bg - 402 set-cursor-position screen, 0/x, y - 403 draw-text-rightward-from-cursor screen, " ^r ", width, 0/fg, 0x5c/bg=menu-highlight - 404 draw-text-rightward-from-cursor screen, " run main ", width, 7/fg, 0xc5/bg=blue-bg - 405 draw-text-rightward-from-cursor screen, " ^s ", width, 0/fg, 0x5c/bg=menu-highlight - 406 draw-text-rightward-from-cursor screen, " run sandbox ", width, 7/fg, 0xc5/bg=blue-bg - 407 draw-text-rightward-from-cursor screen, " ^g ", width, 0/fg, 0x5c/bg=menu-highlight - 408 draw-text-rightward-from-cursor screen, " go to ", width, 7/fg, 0xc5/bg=blue-bg + 401 clear-rect screen, 0/x, y, width, height, 0xc5/bg=blue-bg + 402 set-cursor-position screen, 0/x, y + 403 draw-text-rightward-from-cursor screen, " ^r ", width, 0/fg, 0x5c/bg=menu-highlight + 404 draw-text-rightward-from-cursor screen, " run main ", width, 7/fg, 0xc5/bg=blue-bg + 405 draw-text-rightward-from-cursor screen, " ^s ", width, 0/fg, 0x5c/bg=menu-highlight + 406 draw-text-rightward-from-cursor screen, " run sandbox ", width, 7/fg, 0xc5/bg=blue-bg + 407 draw-text-rightward-from-cursor screen, " ^g ", width, 0/fg, 0x5c/bg=menu-highlight + 408 draw-text-rightward-from-cursor screen, " go to ", width, 7/fg, 0xc5/bg=blue-bg 409 $render-sandbox-edit-menu:render-ctrl-m: { 410 var self/eax: (addr sandbox) <- copy _self 411 var has-trace?/eax: boolean <- has-trace? self 412 compare has-trace?, 0/false 413 { 414 break-if-= - 415 draw-text-rightward-from-cursor screen, " ^m ", width, 0/fg, 0x38/bg=trace - 416 draw-text-rightward-from-cursor screen, " to trace ", width, 7/fg, 0xc5/bg=blue-bg + 415 draw-text-rightward-from-cursor screen, " ^m ", width, 0/fg, 0x38/bg=trace + 416 draw-text-rightward-from-cursor screen, " to trace ", width, 7/fg, 0xc5/bg=blue-bg 417 break $render-sandbox-edit-menu:render-ctrl-m 418 } - 419 draw-text-rightward-from-cursor screen, " ^m ", width, 0/fg, 3/bg=keyboard - 420 draw-text-rightward-from-cursor screen, " to keyboard ", width, 7/fg, 0xc5/bg=blue-bg + 419 draw-text-rightward-from-cursor screen, " ^m ", width, 0/fg, 3/bg=keyboard + 420 draw-text-rightward-from-cursor screen, " to keyboard ", width, 7/fg, 0xc5/bg=blue-bg 421 } - 422 draw-text-rightward-from-cursor screen, " ^a ", width, 0/fg, 0x5c/bg=menu-highlight - 423 draw-text-rightward-from-cursor screen, " << ", width, 7/fg, 0xc5/bg=blue-bg - 424 draw-text-rightward-from-cursor screen, " ^b ", width, 0/fg, 0x5c/bg=menu-highlight - 425 draw-text-rightward-from-cursor screen, " <word ", width, 7/fg, 0xc5/bg=blue-bg - 426 draw-text-rightward-from-cursor screen, " ^f ", width, 0/fg, 0x5c/bg=menu-highlight - 427 draw-text-rightward-from-cursor screen, " word> ", width, 7/fg, 0xc5/bg=blue-bg - 428 draw-text-rightward-from-cursor screen, " ^e ", width, 0/fg, 0x5c/bg=menu-highlight - 429 draw-text-rightward-from-cursor screen, " >> ", width, 7/fg, 0xc5/bg=blue-bg + 422 draw-text-rightward-from-cursor screen, " ^a ", width, 0/fg, 0x5c/bg=menu-highlight + 423 draw-text-rightward-from-cursor screen, " << ", width, 7/fg, 0xc5/bg=blue-bg + 424 draw-text-rightward-from-cursor screen, " ^b ", width, 0/fg, 0x5c/bg=menu-highlight + 425 draw-text-rightward-from-cursor screen, " <word ", width, 7/fg, 0xc5/bg=blue-bg + 426 draw-text-rightward-from-cursor screen, " ^f ", width, 0/fg, 0x5c/bg=menu-highlight + 427 draw-text-rightward-from-cursor screen, " word> ", width, 7/fg, 0xc5/bg=blue-bg + 428 draw-text-rightward-from-cursor screen, " ^e ", width, 0/fg, 0x5c/bg=menu-highlight + 429 draw-text-rightward-from-cursor screen, " >> ", width, 7/fg, 0xc5/bg=blue-bg 430 } 431 - 432 fn render-keyboard-menu screen: (addr screen) { + 432 fn render-keyboard-menu screen: (addr screen) { 433 var width/eax: int <- copy 0 434 var height/ecx: int <- copy 0 - 435 width, height <- screen-size screen + 435 width, height <- screen-size screen 436 var y/ecx: int <- copy height 437 y <- decrement 438 var height/edx: int <- copy y 439 height <- increment - 440 clear-rect screen, 0/x, y, width, height, 0xc5/bg=blue-bg - 441 set-cursor-position screen, 0/x, y - 442 draw-text-rightward-from-cursor screen, " ^r ", width, 0/fg, 0x5c/bg=menu-highlight - 443 draw-text-rightward-from-cursor screen, " run main ", width, 7/fg, 0xc5/bg=blue-bg - 444 draw-text-rightward-from-cursor screen, " ^s ", width, 0/fg, 0x5c/bg=menu-highlight - 445 draw-text-rightward-from-cursor screen, " run sandbox ", width, 7/fg, 0xc5/bg=blue-bg - 446 draw-text-rightward-from-cursor screen, " ^g ", width, 0/fg, 0x5c/bg=menu-highlight - 447 draw-text-rightward-from-cursor screen, " go to ", width, 7/fg, 0xc5/bg=blue-bg - 448 draw-text-rightward-from-cursor screen, " ^m ", width, 0/fg, 7/bg - 449 draw-text-rightward-from-cursor screen, " to sandbox ", width, 7/fg, 0xc5/bg=blue-bg + 440 clear-rect screen, 0/x, y, width, height, 0xc5/bg=blue-bg + 441 set-cursor-position screen, 0/x, y + 442 draw-text-rightward-from-cursor screen, " ^r ", width, 0/fg, 0x5c/bg=menu-highlight + 443 draw-text-rightward-from-cursor screen, " run main ", width, 7/fg, 0xc5/bg=blue-bg + 444 draw-text-rightward-from-cursor screen, " ^s ", width, 0/fg, 0x5c/bg=menu-highlight + 445 draw-text-rightward-from-cursor screen, " run sandbox ", width, 7/fg, 0xc5/bg=blue-bg + 446 draw-text-rightward-from-cursor screen, " ^g ", width, 0/fg, 0x5c/bg=menu-highlight + 447 draw-text-rightward-from-cursor screen, " go to ", width, 7/fg, 0xc5/bg=blue-bg + 448 draw-text-rightward-from-cursor screen, " ^m ", width, 0/fg, 7/bg + 449 draw-text-rightward-from-cursor screen, " to sandbox ", width, 7/fg, 0xc5/bg=blue-bg 450 } 451 452 fn edit-sandbox _self: (addr sandbox), key: grapheme, globals: (addr global-table), data-disk: (addr disk) { @@ -713,15 +713,15 @@ if ('onhashchange' in window) { 648 # eval 649 edit-sandbox sandbox, 0x13/ctrl-s, 0/no-globals, 0/no-disk 650 # setup: screen - 651 var screen-on-stack: screen - 652 var screen/edi: (addr screen) <- address screen-on-stack - 653 initialize-screen screen, 0x80/width, 0x10/height, 0/no-pixel-graphics + 651 var screen-on-stack: screen + 652 var screen/edi: (addr screen) <- address screen-on-stack + 653 initialize-screen screen, 0x80/width, 0x10/height, 0/no-pixel-graphics 654 # - 655 render-sandbox screen, sandbox, 0/x, 0/y, 0x80/width, 0x10/height, 1/show-cursor + 655 render-sandbox screen, sandbox, 0/x, 0/y, 0x80/width, 0x10/height, 1/show-cursor 656 # skip one line of padding - 657 check-screen-row screen, 1/y, " 1 ", "F - test-run-integer/0" - 658 check-screen-row screen, 2/y, " ... ", "F - test-run-integer/1" - 659 check-screen-row screen, 3/y, " => 1 ", "F - test-run-integer/2" + 657 check-screen-row screen, 1/y, " 1 ", "F - test-run-integer/0" + 658 check-screen-row screen, 2/y, " ... ", "F - test-run-integer/1" + 659 check-screen-row screen, 3/y, " => 1 ", "F - test-run-integer/2" 660 } 661 662 fn test-run-negative-integer { @@ -731,15 +731,15 @@ if ('onhashchange' in window) { 666 # eval 667 edit-sandbox sandbox, 0x13/ctrl-s, 0/no-globals, 0/no-disk 668 # setup: screen - 669 var screen-on-stack: screen - 670 var screen/edi: (addr screen) <- address screen-on-stack - 671 initialize-screen screen, 0x80/width, 0x10/height, 0/no-pixel-graphics + 669 var screen-on-stack: screen + 670 var screen/edi: (addr screen) <- address screen-on-stack + 671 initialize-screen screen, 0x80/width, 0x10/height, 0/no-pixel-graphics 672 # - 673 render-sandbox screen, sandbox, 0/x, 0/y, 0x80/width, 0x10/height, 1/show-cursor + 673 render-sandbox screen, sandbox, 0/x, 0/y, 0x80/width, 0x10/height, 1/show-cursor 674 # skip one line of padding - 675 check-screen-row screen, 1/y, " -1 ", "F - test-run-negative-integer/0" - 676 check-screen-row screen, 2/y, " ... ", "F - test-run-negative-integer/1" - 677 check-screen-row screen, 3/y, " => -1 ", "F - test-run-negative-integer/2" + 675 check-screen-row screen, 1/y, " -1 ", "F - test-run-negative-integer/0" + 676 check-screen-row screen, 2/y, " ... ", "F - test-run-negative-integer/1" + 677 check-screen-row screen, 3/y, " => -1 ", "F - test-run-negative-integer/2" 678 } 679 680 fn test-run-error-invalid-integer { @@ -749,15 +749,15 @@ if ('onhashchange' in window) { 684 # eval 685 edit-sandbox sandbox, 0x13/ctrl-s, 0/no-globals, 0/no-disk 686 # setup: screen - 687 var screen-on-stack: screen - 688 var screen/edi: (addr screen) <- address screen-on-stack - 689 initialize-screen screen, 0x80/width, 0x10/height, 0/no-pixel-graphics + 687 var screen-on-stack: screen + 688 var screen/edi: (addr screen) <- address screen-on-stack + 689 initialize-screen screen, 0x80/width, 0x10/height, 0/no-pixel-graphics 690 # - 691 render-sandbox screen, sandbox, 0/x, 0/y, 0x80/width, 0x10/height, 1/show-cursor + 691 render-sandbox screen, sandbox, 0/x, 0/y, 0x80/width, 0x10/height, 1/show-cursor 692 # skip one line of padding - 693 check-screen-row screen, 1/y, " 1a ", "F - test-run-error-invalid-integer/0" - 694 check-screen-row screen, 2/y, " ... ", "F - test-run-error-invalid-integer/1" - 695 check-screen-row-in-color screen, 0xc/fg=error, 3/y, " unbound symbol: 1a ", "F - test-run-error-invalid-integer/2" + 693 check-screen-row screen, 1/y, " 1a ", "F - test-run-error-invalid-integer/0" + 694 check-screen-row screen, 2/y, " ... ", "F - test-run-error-invalid-integer/1" + 695 check-screen-row-in-color screen, 0xc/fg=error, 3/y, " unbound symbol: 1a ", "F - test-run-error-invalid-integer/2" 696 } 697 698 fn test-run-error-unknown-symbol { @@ -767,15 +767,15 @@ if ('onhashchange' in window) { 702 # eval 703 edit-sandbox sandbox, 0x13/ctrl-s, 0/no-globals, 0/no-disk 704 # setup: screen - 705 var screen-on-stack: screen - 706 var screen/edi: (addr screen) <- address screen-on-stack - 707 initialize-screen screen, 0x80/width, 0x10/height, 0/no-pixel-graphics + 705 var screen-on-stack: screen + 706 var screen/edi: (addr screen) <- address screen-on-stack + 707 initialize-screen screen, 0x80/width, 0x10/height, 0/no-pixel-graphics 708 # - 709 render-sandbox screen, sandbox, 0/x, 0/y, 0x80/width, 0x10/height, 1/show-cursor + 709 render-sandbox screen, sandbox, 0/x, 0/y, 0x80/width, 0x10/height, 1/show-cursor 710 # skip one line of padding - 711 check-screen-row screen, 1/y, " a ", "F - test-run-error-unknown-symbol/0" - 712 check-screen-row screen, 2/y, " ... ", "F - test-run-error-unknown-symbol/1" - 713 check-screen-row-in-color screen, 0xc/fg=error, 3/y, " unbound symbol: a ", "F - test-run-error-unknown-symbol/2" + 711 check-screen-row screen, 1/y, " a ", "F - test-run-error-unknown-symbol/0" + 712 check-screen-row screen, 2/y, " ... ", "F - test-run-error-unknown-symbol/1" + 713 check-screen-row-in-color screen, 0xc/fg=error, 3/y, " unbound symbol: a ", "F - test-run-error-unknown-symbol/2" 714 } 715 716 fn test-run-with-spaces { @@ -785,16 +785,16 @@ if ('onhashchange' in window) { 720 # eval 721 edit-sandbox sandbox, 0x13/ctrl-s, 0/no-globals, 0/no-disk 722 # setup: screen - 723 var screen-on-stack: screen - 724 var screen/edi: (addr screen) <- address screen-on-stack - 725 initialize-screen screen, 0x80/width, 0x10/height, 0/no-pixel-graphics + 723 var screen-on-stack: screen + 724 var screen/edi: (addr screen) <- address screen-on-stack + 725 initialize-screen screen, 0x80/width, 0x10/height, 0/no-pixel-graphics 726 # - 727 render-sandbox screen, sandbox, 0/x, 0/y, 0x80/width, 0x10/height, 1/show-cursor + 727 render-sandbox screen, sandbox, 0/x, 0/y, 0x80/width, 0x10/height, 1/show-cursor 728 # skip one line of padding - 729 check-screen-row screen, 1/y, " 1 ", "F - test-run-with-spaces/0" - 730 check-screen-row screen, 2/y, " ", "F - test-run-with-spaces/1" - 731 check-screen-row screen, 3/y, " ... ", "F - test-run-with-spaces/2" - 732 check-screen-row screen, 4/y, " => 1 ", "F - test-run-with-spaces/3" + 729 check-screen-row screen, 1/y, " 1 ", "F - test-run-with-spaces/0" + 730 check-screen-row screen, 2/y, " ", "F - test-run-with-spaces/1" + 731 check-screen-row screen, 3/y, " ... ", "F - test-run-with-spaces/2" + 732 check-screen-row screen, 4/y, " => 1 ", "F - test-run-with-spaces/3" 733 } 734 735 fn test-run-quote { @@ -804,15 +804,15 @@ if ('onhashchange' in window) { 739 # eval 740 edit-sandbox sandbox, 0x13/ctrl-s, 0/no-globals, 0/no-disk 741 # setup: screen - 742 var screen-on-stack: screen - 743 var screen/edi: (addr screen) <- address screen-on-stack - 744 initialize-screen screen, 0x80/width, 0x10/height, 0/no-pixel-graphics + 742 var screen-on-stack: screen + 743 var screen/edi: (addr screen) <- address screen-on-stack + 744 initialize-screen screen, 0x80/width, 0x10/height, 0/no-pixel-graphics 745 # - 746 render-sandbox screen, sandbox, 0/x, 0/y, 0x80/width, 0x10/height, 1/show-cursor + 746 render-sandbox screen, sandbox, 0/x, 0/y, 0x80/width, 0x10/height, 1/show-cursor 747 # skip one line of padding - 748 check-screen-row screen, 1/y, " 'a ", "F - test-run-quote/0" - 749 check-screen-row screen, 2/y, " ... ", "F - test-run-quote/1" - 750 check-screen-row screen, 3/y, " => a ", "F - test-run-quote/2" + 748 check-screen-row screen, 1/y, " 'a ", "F - test-run-quote/0" + 749 check-screen-row screen, 2/y, " ... ", "F - test-run-quote/1" + 750 check-screen-row screen, 3/y, " => a ", "F - test-run-quote/2" 751 } 752 753 fn test-run-dotted-list { @@ -822,15 +822,15 @@ if ('onhashchange' in window) { 757 # eval 758 edit-sandbox sandbox, 0x13/ctrl-s, 0/no-globals, 0/no-disk 759 # setup: screen - 760 var screen-on-stack: screen - 761 var screen/edi: (addr screen) <- address screen-on-stack - 762 initialize-screen screen, 0x80/width, 0x10/height, 0/no-pixel-graphics + 760 var screen-on-stack: screen + 761 var screen/edi: (addr screen) <- address screen-on-stack + 762 initialize-screen screen, 0x80/width, 0x10/height, 0/no-pixel-graphics 763 # - 764 render-sandbox screen, sandbox, 0/x, 0/y, 0x80/width, 0x10/height, 1/show-cursor + 764 render-sandbox screen, sandbox, 0/x, 0/y, 0x80/width, 0x10/height, 1/show-cursor 765 # skip one line of padding - 766 check-screen-row screen, 1/y, " '(a . b) ", "F - test-run-dotted-list/0" - 767 check-screen-row screen, 2/y, " ... ", "F - test-run-dotted-list/1" - 768 check-screen-row screen, 3/y, " => (a . b) ", "F - test-run-dotted-list/2" + 766 check-screen-row screen, 1/y, " '(a . b) ", "F - test-run-dotted-list/0" + 767 check-screen-row screen, 2/y, " ... ", "F - test-run-dotted-list/1" + 768 check-screen-row screen, 3/y, " => (a . b) ", "F - test-run-dotted-list/2" 769 } 770 771 fn test-run-dot-and-list { @@ -840,15 +840,15 @@ if ('onhashchange' in window) { 775 # eval 776 edit-sandbox sandbox, 0x13/ctrl-s, 0/no-globals, 0/no-disk 777 # setup: screen - 778 var screen-on-stack: screen - 779 var screen/edi: (addr screen) <- address screen-on-stack - 780 initialize-screen screen, 0x80/width, 0x10/height, 0/no-pixel-graphics + 778 var screen-on-stack: screen + 779 var screen/edi: (addr screen) <- address screen-on-stack + 780 initialize-screen screen, 0x80/width, 0x10/height, 0/no-pixel-graphics 781 # - 782 render-sandbox screen, sandbox, 0/x, 0/y, 0x80/width, 0x10/height, 1/show-cursor + 782 render-sandbox screen, sandbox, 0/x, 0/y, 0x80/width, 0x10/height, 1/show-cursor 783 # skip one line of padding - 784 check-screen-row screen, 1/y, " '(a . (b)) ", "F - test-run-dot-and-list/0" - 785 check-screen-row screen, 2/y, " ... ", "F - test-run-dot-and-list/1" - 786 check-screen-row screen, 3/y, " => (a b) ", "F - test-run-dot-and-list/2" + 784 check-screen-row screen, 1/y, " '(a . (b)) ", "F - test-run-dot-and-list/0" + 785 check-screen-row screen, 2/y, " ... ", "F - test-run-dot-and-list/1" + 786 check-screen-row screen, 3/y, " => (a b) ", "F - test-run-dot-and-list/2" 787 } 788 789 fn test-run-final-dot { @@ -858,15 +858,15 @@ if ('onhashchange' in window) { 793 # eval 794 edit-sandbox sandbox, 0x13/ctrl-s, 0/no-globals, 0/no-disk 795 # setup: screen - 796 var screen-on-stack: screen - 797 var screen/edi: (addr screen) <- address screen-on-stack - 798 initialize-screen screen, 0x80/width, 0x10/height, 0/no-pixel-graphics + 796 var screen-on-stack: screen + 797 var screen/edi: (addr screen) <- address screen-on-stack + 798 initialize-screen screen, 0x80/width, 0x10/height, 0/no-pixel-graphics 799 # - 800 render-sandbox screen, sandbox, 0/x, 0/y, 0x80/width, 0x10/height, 1/show-cursor + 800 render-sandbox screen, sandbox, 0/x, 0/y, 0x80/width, 0x10/height, 1/show-cursor 801 # skip one line of padding - 802 check-screen-row screen, 1/y, " '(a .) ", "F - test-run-final-dot/0" - 803 check-screen-row screen, 2/y, " ... ", "F - test-run-final-dot/1" - 804 check-screen-row screen, 3/y, " '. )' makes no sense ", "F - test-run-final-dot/2" + 802 check-screen-row screen, 1/y, " '(a .) ", "F - test-run-final-dot/0" + 803 check-screen-row screen, 2/y, " ... ", "F - test-run-final-dot/1" + 804 check-screen-row screen, 3/y, " '. )' makes no sense ", "F - test-run-final-dot/2" 805 # further errors may occur 806 } 807 @@ -877,15 +877,15 @@ if ('onhashchange' in window) { 812 # eval 813 edit-sandbox sandbox, 0x13/ctrl-s, 0/no-globals, 0/no-disk 814 # setup: screen - 815 var screen-on-stack: screen - 816 var screen/edi: (addr screen) <- address screen-on-stack - 817 initialize-screen screen, 0x80/width, 0x10/height, 0/no-pixel-graphics + 815 var screen-on-stack: screen + 816 var screen/edi: (addr screen) <- address screen-on-stack + 817 initialize-screen screen, 0x80/width, 0x10/height, 0/no-pixel-graphics 818 # - 819 render-sandbox screen, sandbox, 0/x, 0/y, 0x80/width, 0x10/height, 1/show-cursor + 819 render-sandbox screen, sandbox, 0/x, 0/y, 0x80/width, 0x10/height, 1/show-cursor 820 # skip one line of padding - 821 check-screen-row screen, 1/y, " '(a . .) ", "F - test-run-double-dot/0" - 822 check-screen-row screen, 2/y, " ... ", "F - test-run-double-dot/1" - 823 check-screen-row screen, 3/y, " '. .' makes no sense ", "F - test-run-double-dot/2" + 821 check-screen-row screen, 1/y, " '(a . .) ", "F - test-run-double-dot/0" + 822 check-screen-row screen, 2/y, " ... ", "F - test-run-double-dot/1" + 823 check-screen-row screen, 3/y, " '. .' makes no sense ", "F - test-run-double-dot/2" 824 # further errors may occur 825 } 826 @@ -896,15 +896,15 @@ if ('onhashchange' in window) { 831 # eval 832 edit-sandbox sandbox, 0x13/ctrl-s, 0/no-globals, 0/no-disk 833 # setup: screen - 834 var screen-on-stack: screen - 835 var screen/edi: (addr screen) <- address screen-on-stack - 836 initialize-screen screen, 0x80/width, 0x10/height, 0/no-pixel-graphics + 834 var screen-on-stack: screen + 835 var screen/edi: (addr screen) <- address screen-on-stack + 836 initialize-screen screen, 0x80/width, 0x10/height, 0/no-pixel-graphics 837 # - 838 render-sandbox screen, sandbox, 0/x, 0/y, 0x80/width, 0x10/height, 1/show-cursor + 838 render-sandbox screen, sandbox, 0/x, 0/y, 0x80/width, 0x10/height, 1/show-cursor 839 # skip one line of padding - 840 check-screen-row screen, 1/y, " '(a . b c) ", "F - test-run-multiple-expressions-after-dot/0" - 841 check-screen-row screen, 2/y, " ... ", "F - test-run-multiple-expressions-after-dot/1" - 842 check-screen-row screen, 3/y, " cannot have multiple expressions between '.' and ')' ", "F - test-run-multiple-expressions-after-dot/2" + 840 check-screen-row screen, 1/y, " '(a . b c) ", "F - test-run-multiple-expressions-after-dot/0" + 841 check-screen-row screen, 2/y, " ... ", "F - test-run-multiple-expressions-after-dot/1" + 842 check-screen-row screen, 3/y, " cannot have multiple expressions between '.' and ')' ", "F - test-run-multiple-expressions-after-dot/2" 843 # further errors may occur 844 } 845 @@ -915,15 +915,15 @@ if ('onhashchange' in window) { 850 # eval 851 edit-sandbox sandbox, 0x13/ctrl-s, 0/no-globals, 0/no-disk 852 # setup: screen - 853 var screen-on-stack: screen - 854 var screen/edi: (addr screen) <- address screen-on-stack - 855 initialize-screen screen, 0x80/width, 0x10/height, 0/no-pixel-graphics + 853 var screen-on-stack: screen + 854 var screen/edi: (addr screen) <- address screen-on-stack + 855 initialize-screen screen, 0x80/width, 0x10/height, 0/no-pixel-graphics 856 # - 857 render-sandbox screen, sandbox, 0/x, 0/y, 0x80/width, 0x10/height, 1/show-cursor + 857 render-sandbox screen, sandbox, 0/x, 0/y, 0x80/width, 0x10/height, 1/show-cursor 858 # skip one line of padding - 859 check-screen-row screen, 1/y, " [a b] ", "F - test-run-stream/0" - 860 check-screen-row screen, 2/y, " ... ", "F - test-run-stream/1" - 861 check-screen-row screen, 3/y, " => [a b] ", "F - test-run-stream/2" + 859 check-screen-row screen, 1/y, " [a b] ", "F - test-run-stream/0" + 860 check-screen-row screen, 2/y, " ... ", "F - test-run-stream/1" + 861 check-screen-row screen, 3/y, " => [a b] ", "F - test-run-stream/2" 862 } 863 864 fn test-run-move-cursor-into-trace { @@ -933,40 +933,40 @@ if ('onhashchange' in window) { 868 # eval 869 edit-sandbox sandbox, 0x13/ctrl-s, 0/no-globals, 0/no-disk 870 # setup: screen - 871 var screen-on-stack: screen - 872 var screen/edi: (addr screen) <- address screen-on-stack - 873 initialize-screen screen, 0x80/width, 0x10/height, 0/no-pixel-graphics + 871 var screen-on-stack: screen + 872 var screen/edi: (addr screen) <- address screen-on-stack + 873 initialize-screen screen, 0x80/width, 0x10/height, 0/no-pixel-graphics 874 # - 875 render-sandbox screen, sandbox, 0/x, 0/y, 0x80/width, 0x10/height, 1/show-cursor + 875 render-sandbox screen, sandbox, 0/x, 0/y, 0x80/width, 0x10/height, 1/show-cursor 876 # skip one line of padding - 877 check-screen-row screen, 1/y, " 12 ", "F - test-run-move-cursor-into-trace/pre-0" - 878 check-background-color-in-screen-row screen, 7/bg=cursor, 1/y, " | ", "F - test-run-move-cursor-into-trace/pre-0/cursor" - 879 check-screen-row screen, 2/y, " ... ", "F - test-run-move-cursor-into-trace/pre-1" - 880 check-background-color-in-screen-row screen, 7/bg=cursor, 2/y, " ", "F - test-run-move-cursor-into-trace/pre-1/cursor" - 881 check-screen-row screen, 3/y, " => 12 ", "F - test-run-move-cursor-into-trace/pre-2" - 882 check-background-color-in-screen-row screen, 7/bg=cursor, 3/y, " ", "F - test-run-move-cursor-into-trace/pre-2/cursor" + 877 check-screen-row screen, 1/y, " 12 ", "F - test-run-move-cursor-into-trace/pre-0" + 878 check-background-color-in-screen-row screen, 7/bg=cursor, 1/y, " | ", "F - test-run-move-cursor-into-trace/pre-0/cursor" + 879 check-screen-row screen, 2/y, " ... ", "F - test-run-move-cursor-into-trace/pre-1" + 880 check-background-color-in-screen-row screen, 7/bg=cursor, 2/y, " ", "F - test-run-move-cursor-into-trace/pre-1/cursor" + 881 check-screen-row screen, 3/y, " => 12 ", "F - test-run-move-cursor-into-trace/pre-2" + 882 check-background-color-in-screen-row screen, 7/bg=cursor, 3/y, " ", "F - test-run-move-cursor-into-trace/pre-2/cursor" 883 # move cursor into trace 884 edit-sandbox sandbox, 0xd/ctrl-m, 0/no-globals, 0/no-disk 885 # - 886 render-sandbox screen, sandbox, 0/x, 0/y, 0x80/width, 0x10/height, 1/show-cursor + 886 render-sandbox screen, sandbox, 0/x, 0/y, 0x80/width, 0x10/height, 1/show-cursor 887 # skip one line of padding - 888 check-screen-row screen, 1/y, " 12 ", "F - test-run-move-cursor-into-trace/trace-0" - 889 check-background-color-in-screen-row screen, 7/bg=cursor, 1/y, " ", "F - test-run-move-cursor-into-trace/trace-0/cursor" - 890 check-screen-row screen, 2/y, " ... ", "F - test-run-move-cursor-into-trace/trace-1" - 891 check-background-color-in-screen-row screen, 7/bg=cursor, 2/y, " ||| ", "F - test-run-move-cursor-into-trace/trace-1/cursor" - 892 check-screen-row screen, 3/y, " => 12 ", "F - test-run-move-cursor-into-trace/trace-2" - 893 check-background-color-in-screen-row screen, 7/bg=cursor, 3/y, " ", "F - test-run-move-cursor-into-trace/trace-2/cursor" + 888 check-screen-row screen, 1/y, " 12 ", "F - test-run-move-cursor-into-trace/trace-0" + 889 check-background-color-in-screen-row screen, 7/bg=cursor, 1/y, " ", "F - test-run-move-cursor-into-trace/trace-0/cursor" + 890 check-screen-row screen, 2/y, " ... ", "F - test-run-move-cursor-into-trace/trace-1" + 891 check-background-color-in-screen-row screen, 7/bg=cursor, 2/y, " ||| ", "F - test-run-move-cursor-into-trace/trace-1/cursor" + 892 check-screen-row screen, 3/y, " => 12 ", "F - test-run-move-cursor-into-trace/trace-2" + 893 check-background-color-in-screen-row screen, 7/bg=cursor, 3/y, " ", "F - test-run-move-cursor-into-trace/trace-2/cursor" 894 # move cursor into input 895 edit-sandbox sandbox, 0xd/ctrl-m, 0/no-globals, 0/no-disk 896 # - 897 render-sandbox screen, sandbox, 0/x, 0/y, 0x80/width, 0x10/height, 1/show-cursor + 897 render-sandbox screen, sandbox, 0/x, 0/y, 0x80/width, 0x10/height, 1/show-cursor 898 # skip one line of padding - 899 check-screen-row screen, 1/y, " 12 ", "F - test-run-move-cursor-into-trace/input-0" - 900 check-background-color-in-screen-row screen, 7/bg=cursor, 1/y, " | ", "F - test-run-move-cursor-into-trace/input-0/cursor" - 901 check-screen-row screen, 2/y, " ... ", "F - test-run-move-cursor-into-trace/input-1" - 902 check-background-color-in-screen-row screen, 7/bg=cursor, 2/y, " ", "F - test-run-move-cursor-into-trace/input-1/cursor" - 903 check-screen-row screen, 3/y, " => 12 ", "F - test-run-move-cursor-into-trace/input-2" - 904 check-background-color-in-screen-row screen, 7/bg=cursor, 3/y, " ", "F - test-run-move-cursor-into-trace/input-2/cursor" + 899 check-screen-row screen, 1/y, " 12 ", "F - test-run-move-cursor-into-trace/input-0" + 900 check-background-color-in-screen-row screen, 7/bg=cursor, 1/y, " | ", "F - test-run-move-cursor-into-trace/input-0/cursor" + 901 check-screen-row screen, 2/y, " ... ", "F - test-run-move-cursor-into-trace/input-1" + 902 check-background-color-in-screen-row screen, 7/bg=cursor, 2/y, " ", "F - test-run-move-cursor-into-trace/input-1/cursor" + 903 check-screen-row screen, 3/y, " => 12 ", "F - test-run-move-cursor-into-trace/input-2" + 904 check-background-color-in-screen-row screen, 7/bg=cursor, 3/y, " ", "F - test-run-move-cursor-into-trace/input-2/cursor" 905 } 906 907 fn has-trace? _self: (addr sandbox) -> _/eax: boolean { @@ -995,43 +995,43 @@ if ('onhashchange' in window) { 930 # eval 931 edit-sandbox sandbox, 0x13/ctrl-s, 0/no-globals, 0/no-disk 932 # setup: screen - 933 var screen-on-stack: screen - 934 var screen/edi: (addr screen) <- address screen-on-stack - 935 initialize-screen screen, 0x80/width, 0x10/height, 0/no-pixel-graphics + 933 var screen-on-stack: screen + 934 var screen/edi: (addr screen) <- address screen-on-stack + 935 initialize-screen screen, 0x80/width, 0x10/height, 0/no-pixel-graphics 936 # - 937 render-sandbox screen, sandbox, 0/x, 0/y, 0x80/width, 0x10/height, 1/show-cursor + 937 render-sandbox screen, sandbox, 0/x, 0/y, 0x80/width, 0x10/height, 1/show-cursor 938 # skip one line of padding - 939 check-screen-row screen, 1/y, " 12 ", "F - test-run-expand-trace/pre0-0" - 940 check-background-color-in-screen-row screen, 7/bg=cursor, 1/y, " | ", "F - test-run-expand-trace/pre0-0/cursor" - 941 check-screen-row screen, 2/y, " ... ", "F - test-run-expand-trace/pre0-1" - 942 check-background-color-in-screen-row screen, 7/bg=cursor, 2/y, " ", "F - test-run-expand-trace/pre0-1/cursor" - 943 check-screen-row screen, 3/y, " => 12 ", "F - test-run-expand-trace/pre0-2" - 944 check-background-color-in-screen-row screen, 7/bg=cursor, 3/y, " ", "F - test-run-expand-trace/pre0-2/cursor" + 939 check-screen-row screen, 1/y, " 12 ", "F - test-run-expand-trace/pre0-0" + 940 check-background-color-in-screen-row screen, 7/bg=cursor, 1/y, " | ", "F - test-run-expand-trace/pre0-0/cursor" + 941 check-screen-row screen, 2/y, " ... ", "F - test-run-expand-trace/pre0-1" + 942 check-background-color-in-screen-row screen, 7/bg=cursor, 2/y, " ", "F - test-run-expand-trace/pre0-1/cursor" + 943 check-screen-row screen, 3/y, " => 12 ", "F - test-run-expand-trace/pre0-2" + 944 check-background-color-in-screen-row screen, 7/bg=cursor, 3/y, " ", "F - test-run-expand-trace/pre0-2/cursor" 945 # move cursor into trace 946 edit-sandbox sandbox, 0xd/ctrl-m, 0/no-globals, 0/no-disk 947 # - 948 render-sandbox screen, sandbox, 0/x, 0/y, 0x80/width, 0x10/height, 1/show-cursor + 948 render-sandbox screen, sandbox, 0/x, 0/y, 0x80/width, 0x10/height, 1/show-cursor 949 # skip one line of padding - 950 check-screen-row screen, 1/y, " 12 ", "F - test-run-expand-trace/pre1-0" - 951 check-background-color-in-screen-row screen, 7/bg=cursor, 1/y, " ", "F - test-run-expand-trace/pre1-0/cursor" - 952 check-screen-row screen, 2/y, " ... ", "F - test-run-expand-trace/pre1-1" - 953 check-background-color-in-screen-row screen, 7/bg=cursor, 2/y, " ||| ", "F - test-run-expand-trace/pre1-1/cursor" - 954 check-screen-row screen, 3/y, " => 12 ", "F - test-run-expand-trace/pre1-2" - 955 check-background-color-in-screen-row screen, 7/bg=cursor, 3/y, " ", "F - test-run-expand-trace/pre1-2/cursor" + 950 check-screen-row screen, 1/y, " 12 ", "F - test-run-expand-trace/pre1-0" + 951 check-background-color-in-screen-row screen, 7/bg=cursor, 1/y, " ", "F - test-run-expand-trace/pre1-0/cursor" + 952 check-screen-row screen, 2/y, " ... ", "F - test-run-expand-trace/pre1-1" + 953 check-background-color-in-screen-row screen, 7/bg=cursor, 2/y, " ||| ", "F - test-run-expand-trace/pre1-1/cursor" + 954 check-screen-row screen, 3/y, " => 12 ", "F - test-run-expand-trace/pre1-2" + 955 check-background-color-in-screen-row screen, 7/bg=cursor, 3/y, " ", "F - test-run-expand-trace/pre1-2/cursor" 956 # expand 957 edit-sandbox sandbox, 0xa/newline, 0/no-globals, 0/no-disk 958 # - 959 clear-screen screen - 960 render-sandbox screen, sandbox, 0/x, 0/y, 0x80/width, 0x10/height, 1/show-cursor + 959 clear-screen screen + 960 render-sandbox screen, sandbox, 0/x, 0/y, 0x80/width, 0x10/height, 1/show-cursor 961 # skip one line of padding - 962 check-screen-row screen, 1/y, " 12 ", "F - test-run-expand-trace/expand-0" - 963 check-background-color-in-screen-row screen, 7/bg=cursor, 1/y, " ", "F - test-run-expand-trace/expand-0/cursor" - 964 check-screen-row screen, 2/y, " 1 toke", "F - test-run-expand-trace/expand-1" - 965 check-background-color-in-screen-row screen, 7/bg=cursor, 2/y, " ||||||", "F - test-run-expand-trace/expand-1/cursor" - 966 check-screen-row screen, 3/y, " ... ", "F - test-run-expand-trace/expand-2" - 967 check-background-color-in-screen-row screen, 7/bg=cursor, 3/y, " ", "F - test-run-expand-trace/expand-2/cursor" - 968 check-screen-row screen, 4/y, " 1 inse", "F - test-run-expand-trace/expand-3" - 969 check-background-color-in-screen-row screen, 7/bg=cursor, 4/y, " ", "F - test-run-expand-trace/expand-3/cursor" + 962 check-screen-row screen, 1/y, " 12 ", "F - test-run-expand-trace/expand-0" + 963 check-background-color-in-screen-row screen, 7/bg=cursor, 1/y, " ", "F - test-run-expand-trace/expand-0/cursor" + 964 check-screen-row screen, 2/y, " 1 toke", "F - test-run-expand-trace/expand-1" + 965 check-background-color-in-screen-row screen, 7/bg=cursor, 2/y, " ||||||", "F - test-run-expand-trace/expand-1/cursor" + 966 check-screen-row screen, 3/y, " ... ", "F - test-run-expand-trace/expand-2" + 967 check-background-color-in-screen-row screen, 7/bg=cursor, 3/y, " ", "F - test-run-expand-trace/expand-2/cursor" + 968 check-screen-row screen, 4/y, " 1 inse", "F - test-run-expand-trace/expand-3" + 969 check-background-color-in-screen-row screen, 7/bg=cursor, 4/y, " ", "F - test-run-expand-trace/expand-3/cursor" 970 } 971 972 fn test-run-can-rerun-when-expanding-trace { @@ -1042,65 +1042,65 @@ if ('onhashchange' in window) { 977 # eval 978 edit-sandbox sandbox, 0x13/ctrl-s, 0/no-globals, 0/no-disk 979 # setup: screen - 980 var screen-on-stack: screen - 981 var screen/edi: (addr screen) <- address screen-on-stack - 982 initialize-screen screen, 0x80/width, 0x10/height, 0/no-pixel-graphics + 980 var screen-on-stack: screen + 981 var screen/edi: (addr screen) <- address screen-on-stack + 982 initialize-screen screen, 0x80/width, 0x10/height, 0/no-pixel-graphics 983 # - 984 render-sandbox screen, sandbox, 0/x, 0/y, 0x80/width, 0x10/height, 1/show-cursor + 984 render-sandbox screen, sandbox, 0/x, 0/y, 0x80/width, 0x10/height, 1/show-cursor 985 # skip one line of padding - 986 check-screen-row screen, 1/y, " 12 ", "F - test-run-can-rerun-when-expanding-trace/pre0-0" - 987 check-background-color-in-screen-row screen, 7/bg=cursor, 1/y, " | ", "F - test-run-can-rerun-when-expanding-trace/pre0-0/cursor" - 988 check-screen-row screen, 2/y, " ... ", "F - test-run-can-rerun-when-expanding-trace/pre0-1" - 989 check-background-color-in-screen-row screen, 7/bg=cursor, 2/y, " ", "F - test-run-can-rerun-when-expanding-trace/pre0-1/cursor" - 990 check-screen-row screen, 3/y, " => 12 ", "F - test-run-can-rerun-when-expanding-trace/pre0-2" - 991 check-background-color-in-screen-row screen, 7/bg=cursor, 3/y, " ", "F - test-run-can-rerun-when-expanding-trace/pre0-2/cursor" + 986 check-screen-row screen, 1/y, " 12 ", "F - test-run-can-rerun-when-expanding-trace/pre0-0" + 987 check-background-color-in-screen-row screen, 7/bg=cursor, 1/y, " | ", "F - test-run-can-rerun-when-expanding-trace/pre0-0/cursor" + 988 check-screen-row screen, 2/y, " ... ", "F - test-run-can-rerun-when-expanding-trace/pre0-1" + 989 check-background-color-in-screen-row screen, 7/bg=cursor, 2/y, " ", "F - test-run-can-rerun-when-expanding-trace/pre0-1/cursor" + 990 check-screen-row screen, 3/y, " => 12 ", "F - test-run-can-rerun-when-expanding-trace/pre0-2" + 991 check-background-color-in-screen-row screen, 7/bg=cursor, 3/y, " ", "F - test-run-can-rerun-when-expanding-trace/pre0-2/cursor" 992 # move cursor into trace 993 edit-sandbox sandbox, 0xd/ctrl-m, 0/no-globals, 0/no-disk 994 # - 995 render-sandbox screen, sandbox, 0/x, 0/y, 0x80/width, 0x10/height, 1/show-cursor + 995 render-sandbox screen, sandbox, 0/x, 0/y, 0x80/width, 0x10/height, 1/show-cursor 996 # skip one line of padding - 997 check-screen-row screen, 1/y, " 12 ", "F - test-run-can-rerun-when-expanding-trace/pre1-0" - 998 check-background-color-in-screen-row screen, 7/bg=cursor, 1/y, " ", "F - test-run-can-rerun-when-expanding-trace/pre1-0/cursor" - 999 check-screen-row screen, 2/y, " ... ", "F - test-run-can-rerun-when-expanding-trace/pre1-1" -1000 check-background-color-in-screen-row screen, 7/bg=cursor, 2/y, " ||| ", "F - test-run-can-rerun-when-expanding-trace/pre1-1/cursor" -1001 check-screen-row screen, 3/y, " => 12 ", "F - test-run-can-rerun-when-expanding-trace/pre1-2" -1002 check-background-color-in-screen-row screen, 7/bg=cursor, 3/y, " ", "F - test-run-can-rerun-when-expanding-trace/pre1-2/cursor" + 997 check-screen-row screen, 1/y, " 12 ", "F - test-run-can-rerun-when-expanding-trace/pre1-0" + 998 check-background-color-in-screen-row screen, 7/bg=cursor, 1/y, " ", "F - test-run-can-rerun-when-expanding-trace/pre1-0/cursor" + 999 check-screen-row screen, 2/y, " ... ", "F - test-run-can-rerun-when-expanding-trace/pre1-1" +1000 check-background-color-in-screen-row screen, 7/bg=cursor, 2/y, " ||| ", "F - test-run-can-rerun-when-expanding-trace/pre1-1/cursor" +1001 check-screen-row screen, 3/y, " => 12 ", "F - test-run-can-rerun-when-expanding-trace/pre1-2" +1002 check-background-color-in-screen-row screen, 7/bg=cursor, 3/y, " ", "F - test-run-can-rerun-when-expanding-trace/pre1-2/cursor" 1003 # expand 1004 edit-sandbox sandbox, 0xa/newline, 0/no-globals, 0/no-disk 1005 # -1006 clear-screen screen -1007 render-sandbox screen, sandbox, 0/x, 0/y, 0x80/width, 0x10/height, 1/show-cursor +1006 clear-screen screen +1007 render-sandbox screen, sandbox, 0/x, 0/y, 0x80/width, 0x10/height, 1/show-cursor 1008 # skip one line of padding -1009 check-screen-row screen, 1/y, " 12 ", "F - test-run-can-rerun-when-expanding-trace/pre2-0" -1010 check-background-color-in-screen-row screen, 7/bg=cursor, 1/y, " ", "F - test-run-can-rerun-when-expanding-trace/pre2-0/cursor" -1011 check-screen-row screen, 2/y, " 1 toke", "F - test-run-can-rerun-when-expanding-trace/pre2-1" -1012 check-background-color-in-screen-row screen, 7/bg=cursor, 2/y, " ||||||", "F - test-run-can-rerun-when-expanding-trace/pre2-1/cursor" -1013 check-screen-row screen, 3/y, " ... ", "F - test-run-can-rerun-when-expanding-trace/pre2-2" -1014 check-background-color-in-screen-row screen, 7/bg=cursor, 3/y, " ", "F - test-run-can-rerun-when-expanding-trace/pre2-2/cursor" -1015 check-screen-row screen, 4/y, " 1 inse", "F - test-run-can-rerun-when-expanding-trace/pre2-2" -1016 check-background-color-in-screen-row screen, 7/bg=cursor, 4/y, " ", "F - test-run-can-rerun-when-expanding-trace/pre2-2/cursor" +1009 check-screen-row screen, 1/y, " 12 ", "F - test-run-can-rerun-when-expanding-trace/pre2-0" +1010 check-background-color-in-screen-row screen, 7/bg=cursor, 1/y, " ", "F - test-run-can-rerun-when-expanding-trace/pre2-0/cursor" +1011 check-screen-row screen, 2/y, " 1 toke", "F - test-run-can-rerun-when-expanding-trace/pre2-1" +1012 check-background-color-in-screen-row screen, 7/bg=cursor, 2/y, " ||||||", "F - test-run-can-rerun-when-expanding-trace/pre2-1/cursor" +1013 check-screen-row screen, 3/y, " ... ", "F - test-run-can-rerun-when-expanding-trace/pre2-2" +1014 check-background-color-in-screen-row screen, 7/bg=cursor, 3/y, " ", "F - test-run-can-rerun-when-expanding-trace/pre2-2/cursor" +1015 check-screen-row screen, 4/y, " 1 inse", "F - test-run-can-rerun-when-expanding-trace/pre2-2" +1016 check-background-color-in-screen-row screen, 7/bg=cursor, 4/y, " ", "F - test-run-can-rerun-when-expanding-trace/pre2-2/cursor" 1017 # move cursor down and expand 1018 edit-sandbox sandbox, 0x6a/j, 0/no-globals, 0/no-disk -1019 render-sandbox screen, sandbox, 0/x, 0/y, 0x80/width, 0x10/height, 1/show-cursor +1019 render-sandbox screen, sandbox, 0/x, 0/y, 0x80/width, 0x10/height, 1/show-cursor 1020 edit-sandbox sandbox, 0xa/newline, 0/no-globals, 0/no-disk 1021 # -1022 clear-screen screen -1023 render-sandbox screen, sandbox, 0/x, 0/y, 0x80/width, 0x10/height, 1/show-cursor +1022 clear-screen screen +1023 render-sandbox screen, sandbox, 0/x, 0/y, 0x80/width, 0x10/height, 1/show-cursor 1024 # screen looks same as if trace max-depth was really high -1025 check-screen-row screen, 1/y, " 12 ", "F - test-run-can-rerun-when-expanding-trace/expand-0" -1026 check-background-color-in-screen-row screen, 7/bg=cursor, 1/y, " ", "F - test-run-can-rerun-when-expanding-trace/expand-0/cursor" -1027 check-screen-row screen, 2/y, " 1 toke", "F - test-run-can-rerun-when-expanding-trace/expand-1" -1028 check-background-color-in-screen-row screen, 7/bg=cursor, 2/y, " ", "F - test-run-can-rerun-when-expanding-trace/expand-1/cursor" -1029 check-screen-row screen, 3/y, " 2 next", "F - test-run-can-rerun-when-expanding-trace/expand-2" -1030 check-background-color-in-screen-row screen, 7/bg=cursor, 3/y, " ||||||", "F - test-run-can-rerun-when-expanding-trace/expand-2/cursor" -1031 check-screen-row screen, 4/y, " ... ", "F - test-run-can-rerun-when-expanding-trace/expand-3" -1032 check-background-color-in-screen-row screen, 7/bg=cursor, 4/y, " ", "F - test-run-can-rerun-when-expanding-trace/expand-3/cursor" -1033 check-screen-row screen, 5/y, " 2 next", "F - test-run-can-rerun-when-expanding-trace/expand-4" -1034 check-background-color-in-screen-row screen, 7/bg=cursor, 5/y, " ", "F - test-run-can-rerun-when-expanding-trace/expand-4/cursor" -1035 check-screen-row screen, 6/y, " ... ", "F - test-run-can-rerun-when-expanding-trace/expand-5" -1036 check-background-color-in-screen-row screen, 7/bg=cursor, 6/y, " ", "F - test-run-can-rerun-when-expanding-trace/expand-5/cursor" -1037 check-screen-row screen, 7/y, " 2 => 1", "F - test-run-can-rerun-when-expanding-trace/expand-6" -1038 check-background-color-in-screen-row screen, 7/bg=cursor, 7/y, " ", "F - test-run-can-rerun-when-expanding-trace/expand-6/cursor" +1025 check-screen-row screen, 1/y, " 12 ", "F - test-run-can-rerun-when-expanding-trace/expand-0" +1026 check-background-color-in-screen-row screen, 7/bg=cursor, 1/y, " ", "F - test-run-can-rerun-when-expanding-trace/expand-0/cursor" +1027 check-screen-row screen, 2/y, " 1 toke", "F - test-run-can-rerun-when-expanding-trace/expand-1" +1028 check-background-color-in-screen-row screen, 7/bg=cursor, 2/y, " ", "F - test-run-can-rerun-when-expanding-trace/expand-1/cursor" +1029 check-screen-row screen, 3/y, " 2 next", "F - test-run-can-rerun-when-expanding-trace/expand-2" +1030 check-background-color-in-screen-row screen, 7/bg=cursor, 3/y, " ||||||", "F - test-run-can-rerun-when-expanding-trace/expand-2/cursor" +1031 check-screen-row screen, 4/y, " ... ", "F - test-run-can-rerun-when-expanding-trace/expand-3" +1032 check-background-color-in-screen-row screen, 7/bg=cursor, 4/y, " ", "F - test-run-can-rerun-when-expanding-trace/expand-3/cursor" +1033 check-screen-row screen, 5/y, " 2 next", "F - test-run-can-rerun-when-expanding-trace/expand-4" +1034 check-background-color-in-screen-row screen, 7/bg=cursor, 5/y, " ", "F - test-run-can-rerun-when-expanding-trace/expand-4/cursor" +1035 check-screen-row screen, 6/y, " ... ", "F - test-run-can-rerun-when-expanding-trace/expand-5" +1036 check-background-color-in-screen-row screen, 7/bg=cursor, 6/y, " ", "F - test-run-can-rerun-when-expanding-trace/expand-5/cursor" +1037 check-screen-row screen, 7/y, " 2 => 1", "F - test-run-can-rerun-when-expanding-trace/expand-6" +1038 check-background-color-in-screen-row screen, 7/bg=cursor, 7/y, " ", "F - test-run-can-rerun-when-expanding-trace/expand-6/cursor" 1039 } 1040 1041 fn test-run-preserves-trace-view-on-rerun { @@ -1111,122 +1111,122 @@ if ('onhashchange' in window) { 1046 # eval 1047 edit-sandbox sandbox, 0x13/ctrl-s, 0/no-globals, 0/no-disk 1048 # setup: screen -1049 var screen-on-stack: screen -1050 var screen/edi: (addr screen) <- address screen-on-stack -1051 initialize-screen screen, 0x80/width, 0x10/height, 0/no-pixel-graphics +1049 var screen-on-stack: screen +1050 var screen/edi: (addr screen) <- address screen-on-stack +1051 initialize-screen screen, 0x80/width, 0x10/height, 0/no-pixel-graphics 1052 # -1053 render-sandbox screen, sandbox, 0/x, 0/y, 0x80/width, 0x10/height, 1/show-cursor +1053 render-sandbox screen, sandbox, 0/x, 0/y, 0x80/width, 0x10/height, 1/show-cursor 1054 # skip one line of padding -1055 check-screen-row screen, 1/y, " 7 ", "F - test-run-preserves-trace-view-on-rerun/pre0-0" -1056 check-background-color-in-screen-row screen, 7/bg=cursor, 1/y, " | ", "F - test-run-preserves-trace-view-on-rerun/pre0-0/cursor" -1057 check-screen-row screen, 2/y, " ... ", "F - test-run-preserves-trace-view-on-rerun/pre0-1" -1058 check-background-color-in-screen-row screen, 7/bg=cursor, 2/y, " ", "F - test-run-preserves-trace-view-on-rerun/pre0-1/cursor" -1059 check-screen-row screen, 3/y, " => 7 ", "F - test-run-preserves-trace-view-on-rerun/pre0-2" -1060 check-background-color-in-screen-row screen, 7/bg=cursor, 3/y, " ", "F - test-run-preserves-trace-view-on-rerun/pre0-2/cursor" +1055 check-screen-row screen, 1/y, " 7 ", "F - test-run-preserves-trace-view-on-rerun/pre0-0" +1056 check-background-color-in-screen-row screen, 7/bg=cursor, 1/y, " | ", "F - test-run-preserves-trace-view-on-rerun/pre0-0/cursor" +1057 check-screen-row screen, 2/y, " ... ", "F - test-run-preserves-trace-view-on-rerun/pre0-1" +1058 check-background-color-in-screen-row screen, 7/bg=cursor, 2/y, " ", "F - test-run-preserves-trace-view-on-rerun/pre0-1/cursor" +1059 check-screen-row screen, 3/y, " => 7 ", "F - test-run-preserves-trace-view-on-rerun/pre0-2" +1060 check-background-color-in-screen-row screen, 7/bg=cursor, 3/y, " ", "F - test-run-preserves-trace-view-on-rerun/pre0-2/cursor" 1061 # move cursor into trace 1062 edit-sandbox sandbox, 0xd/ctrl-m, 0/no-globals, 0/no-disk -1063 render-sandbox screen, sandbox, 0/x, 0/y, 0x80/width, 0x10/height, 1/show-cursor +1063 render-sandbox screen, sandbox, 0/x, 0/y, 0x80/width, 0x10/height, 1/show-cursor 1064 # -1065 check-screen-row screen, 1/y, " 7 ", "F - test-run-preserves-trace-view-on-rerun/pre1-0" -1066 check-background-color-in-screen-row screen, 7/bg=cursor, 1/y, " ", "F - test-run-preserves-trace-view-on-rerun/pre1-0/cursor" -1067 check-screen-row screen, 2/y, " ... ", "F - test-run-preserves-trace-view-on-rerun/pre1-1" -1068 check-background-color-in-screen-row screen, 7/bg=cursor, 2/y, " ||| ", "F - test-run-preserves-trace-view-on-rerun/pre1-1/cursor" -1069 check-screen-row screen, 3/y, " => 7 ", "F - test-run-preserves-trace-view-on-rerun/pre1-2" -1070 check-background-color-in-screen-row screen, 7/bg=cursor, 3/y, " ", "F - test-run-preserves-trace-view-on-rerun/pre1-2/cursor" +1065 check-screen-row screen, 1/y, " 7 ", "F - test-run-preserves-trace-view-on-rerun/pre1-0" +1066 check-background-color-in-screen-row screen, 7/bg=cursor, 1/y, " ", "F - test-run-preserves-trace-view-on-rerun/pre1-0/cursor" +1067 check-screen-row screen, 2/y, " ... ", "F - test-run-preserves-trace-view-on-rerun/pre1-1" +1068 check-background-color-in-screen-row screen, 7/bg=cursor, 2/y, " ||| ", "F - test-run-preserves-trace-view-on-rerun/pre1-1/cursor" +1069 check-screen-row screen, 3/y, " => 7 ", "F - test-run-preserves-trace-view-on-rerun/pre1-2" +1070 check-background-color-in-screen-row screen, 7/bg=cursor, 3/y, " ", "F - test-run-preserves-trace-view-on-rerun/pre1-2/cursor" 1071 # expand 1072 edit-sandbox sandbox, 0xa/newline, 0/no-globals, 0/no-disk -1073 clear-screen screen -1074 render-sandbox screen, sandbox, 0/x, 0/y, 0x80/width, 0x10/height, 1/show-cursor +1073 clear-screen screen +1074 render-sandbox screen, sandbox, 0/x, 0/y, 0x80/width, 0x10/height, 1/show-cursor 1075 # -1076 check-screen-row screen, 1/y, " 7 ", "F - test-run-preserves-trace-view-on-rerun/pre2-0" -1077 check-background-color-in-screen-row screen, 7/bg=cursor, 1/y, " ", "F - test-run-preserves-trace-view-on-rerun/pre2-0/cursor" -1078 check-screen-row screen, 2/y, " 1 tokenize ", "F - test-run-preserves-trace-view-on-rerun/pre2-1" -1079 check-background-color-in-screen-row screen, 7/bg=cursor, 2/y, " |||||||||| ", "F - test-run-preserves-trace-view-on-rerun/pre2-1/cursor" -1080 check-screen-row screen, 3/y, " ... ", "F - test-run-preserves-trace-view-on-rerun/pre2-2" -1081 check-background-color-in-screen-row screen, 7/bg=cursor, 3/y, " ", "F - test-run-preserves-trace-view-on-rerun/pre2-2/cursor" -1082 check-screen-row screen, 4/y, " 1 insert parens ", "F - test-run-preserves-trace-view-on-rerun/pre2-3" -1083 check-background-color-in-screen-row screen, 7/bg=cursor, 4/y, " ", "F - test-run-preserves-trace-view-on-rerun/pre2-3/cursor" -1084 check-screen-row screen, 5/y, " 1 parse ", "F - test-run-preserves-trace-view-on-rerun/pre2-4" -1085 check-background-color-in-screen-row screen, 7/bg=cursor, 5/y, " ", "F - test-run-preserves-trace-view-on-rerun/pre2-4/cursor" -1086 check-screen-row screen, 6/y, " ... ", "F - test-run-preserves-trace-view-on-rerun/pre2-5" -1087 check-background-color-in-screen-row screen, 7/bg=cursor, 6/y, " ", "F - test-run-preserves-trace-view-on-rerun/pre2-5/cursor" -1088 check-screen-row screen, 7/y, " 1 transform infix ", "F - test-run-preserves-trace-view-on-rerun/pre2-6" -1089 check-background-color-in-screen-row screen, 7/bg=cursor, 7/y, " ", "F - test-run-preserves-trace-view-on-rerun/pre2-6/cursor" -1090 check-screen-row screen, 8/y, " ... ", "F - test-run-preserves-trace-view-on-rerun/pre2-7" -1091 check-background-color-in-screen-row screen, 7/bg=cursor, 8/y, " ", "F - test-run-preserves-trace-view-on-rerun/pre2-7/cursor" -1092 check-screen-row screen, 9/y, " 1 macroexpand 7 ", "F - test-run-preserves-trace-view-on-rerun/pre2-8" -1093 check-background-color-in-screen-row screen, 7/bg=cursor, 9/y, " ", "F - test-run-preserves-trace-view-on-rerun/pre2-8/cursor" -1094 check-screen-row screen, 0xa/y, " ... ", "F - test-run-preserves-trace-view-on-rerun/pre2-9" -1095 check-background-color-in-screen-row screen, 7/bg=cursor, 0xa/y, " ", "F - test-run-preserves-trace-view-on-rerun/pre2-9/cursor" -1096 check-screen-row screen, 0xb/y, " 1 => 7 ", "F - test-run-preserves-trace-view-on-rerun/pre2-10" -1097 check-background-color-in-screen-row screen, 7/bg=cursor, 0xb/y, " ", "F - test-run-preserves-trace-view-on-rerun/pre2-10/cursor" +1076 check-screen-row screen, 1/y, " 7 ", "F - test-run-preserves-trace-view-on-rerun/pre2-0" +1077 check-background-color-in-screen-row screen, 7/bg=cursor, 1/y, " ", "F - test-run-preserves-trace-view-on-rerun/pre2-0/cursor" +1078 check-screen-row screen, 2/y, " 1 tokenize ", "F - test-run-preserves-trace-view-on-rerun/pre2-1" +1079 check-background-color-in-screen-row screen, 7/bg=cursor, 2/y, " |||||||||| ", "F - test-run-preserves-trace-view-on-rerun/pre2-1/cursor" +1080 check-screen-row screen, 3/y, " ... ", "F - test-run-preserves-trace-view-on-rerun/pre2-2" +1081 check-background-color-in-screen-row screen, 7/bg=cursor, 3/y, " ", "F - test-run-preserves-trace-view-on-rerun/pre2-2/cursor" +1082 check-screen-row screen, 4/y, " 1 insert parens ", "F - test-run-preserves-trace-view-on-rerun/pre2-3" +1083 check-background-color-in-screen-row screen, 7/bg=cursor, 4/y, " ", "F - test-run-preserves-trace-view-on-rerun/pre2-3/cursor" +1084 check-screen-row screen, 5/y, " 1 parse ", "F - test-run-preserves-trace-view-on-rerun/pre2-4" +1085 check-background-color-in-screen-row screen, 7/bg=cursor, 5/y, " ", "F - test-run-preserves-trace-view-on-rerun/pre2-4/cursor" +1086 check-screen-row screen, 6/y, " ... ", "F - test-run-preserves-trace-view-on-rerun/pre2-5" +1087 check-background-color-in-screen-row screen, 7/bg=cursor, 6/y, " ", "F - test-run-preserves-trace-view-on-rerun/pre2-5/cursor" +1088 check-screen-row screen, 7/y, " 1 transform infix ", "F - test-run-preserves-trace-view-on-rerun/pre2-6" +1089 check-background-color-in-screen-row screen, 7/bg=cursor, 7/y, " ", "F - test-run-preserves-trace-view-on-rerun/pre2-6/cursor" +1090 check-screen-row screen, 8/y, " ... ", "F - test-run-preserves-trace-view-on-rerun/pre2-7" +1091 check-background-color-in-screen-row screen, 7/bg=cursor, 8/y, " ", "F - test-run-preserves-trace-view-on-rerun/pre2-7/cursor" +1092 check-screen-row screen, 9/y, " 1 macroexpand 7 ", "F - test-run-preserves-trace-view-on-rerun/pre2-8" +1093 check-background-color-in-screen-row screen, 7/bg=cursor, 9/y, " ", "F - test-run-preserves-trace-view-on-rerun/pre2-8/cursor" +1094 check-screen-row screen, 0xa/y, " ... ", "F - test-run-preserves-trace-view-on-rerun/pre2-9" +1095 check-background-color-in-screen-row screen, 7/bg=cursor, 0xa/y, " ", "F - test-run-preserves-trace-view-on-rerun/pre2-9/cursor" +1096 check-screen-row screen, 0xb/y, " 1 => 7 ", "F - test-run-preserves-trace-view-on-rerun/pre2-10" +1097 check-background-color-in-screen-row screen, 7/bg=cursor, 0xb/y, " ", "F - test-run-preserves-trace-view-on-rerun/pre2-10/cursor" 1098 # move cursor down below the macroexpand line and expand 1099 edit-sandbox sandbox, 0x6a/j, 0/no-globals, 0/no-disk -1100 render-sandbox screen, sandbox, 0/x, 0/y, 0x80/width, 0x10/height, 1/show-cursor +1100 render-sandbox screen, sandbox, 0/x, 0/y, 0x80/width, 0x10/height, 1/show-cursor 1101 edit-sandbox sandbox, 0x6a/j, 0/no-globals, 0/no-disk -1102 render-sandbox screen, sandbox, 0/x, 0/y, 0x80/width, 0x10/height, 1/show-cursor +1102 render-sandbox screen, sandbox, 0/x, 0/y, 0x80/width, 0x10/height, 1/show-cursor 1103 edit-sandbox sandbox, 0x6a/j, 0/no-globals, 0/no-disk -1104 render-sandbox screen, sandbox, 0/x, 0/y, 0x80/width, 0x10/height, 1/show-cursor +1104 render-sandbox screen, sandbox, 0/x, 0/y, 0x80/width, 0x10/height, 1/show-cursor 1105 edit-sandbox sandbox, 0x6a/j, 0/no-globals, 0/no-disk -1106 render-sandbox screen, sandbox, 0/x, 0/y, 0x80/width, 0x10/height, 1/show-cursor +1106 render-sandbox screen, sandbox, 0/x, 0/y, 0x80/width, 0x10/height, 1/show-cursor 1107 edit-sandbox sandbox, 0x6a/j, 0/no-globals, 0/no-disk -1108 render-sandbox screen, sandbox, 0/x, 0/y, 0x80/width, 0x10/height, 1/show-cursor +1108 render-sandbox screen, sandbox, 0/x, 0/y, 0x80/width, 0x10/height, 1/show-cursor 1109 edit-sandbox sandbox, 0x6a/j, 0/no-globals, 0/no-disk -1110 render-sandbox screen, sandbox, 0/x, 0/y, 0x80/width, 0x10/height, 1/show-cursor +1110 render-sandbox screen, sandbox, 0/x, 0/y, 0x80/width, 0x10/height, 1/show-cursor 1111 edit-sandbox sandbox, 0x6a/j, 0/no-globals, 0/no-disk -1112 render-sandbox screen, sandbox, 0/x, 0/y, 0x80/width, 0x10/height, 1/show-cursor +1112 render-sandbox screen, sandbox, 0/x, 0/y, 0x80/width, 0x10/height, 1/show-cursor 1113 edit-sandbox sandbox, 0x6a/j, 0/no-globals, 0/no-disk -1114 render-sandbox screen, sandbox, 0/x, 0/y, 0x80/width, 0x10/height, 1/show-cursor +1114 render-sandbox screen, sandbox, 0/x, 0/y, 0x80/width, 0x10/height, 1/show-cursor 1115 # -1116 check-screen-row screen, 1/y, " 7 ", "F - test-run-preserves-trace-view-on-rerun/pre3-0" -1117 check-background-color-in-screen-row screen, 7/bg=cursor, 1/y, " ", "F - test-run-preserves-trace-view-on-rerun/pre3-0/cursor" -1118 check-screen-row screen, 2/y, " 1 tokenize ", "F - test-run-preserves-trace-view-on-rerun/pre3-1" -1119 check-background-color-in-screen-row screen, 7/bg=cursor, 2/y, " ", "F - test-run-preserves-trace-view-on-rerun/pre3-1/cursor" -1120 check-screen-row screen, 3/y, " ... ", "F - test-run-preserves-trace-view-on-rerun/pre3-2" -1121 check-background-color-in-screen-row screen, 7/bg=cursor, 3/y, " ", "F - test-run-preserves-trace-view-on-rerun/pre3-2/cursor" -1122 check-screen-row screen, 4/y, " 1 insert parens ", "F - test-run-preserves-trace-view-on-rerun/pre3-3" -1123 check-background-color-in-screen-row screen, 7/bg=cursor, 4/y, " ", "F - test-run-preserves-trace-view-on-rerun/pre3-3/cursor" -1124 check-screen-row screen, 5/y, " 1 parse ", "F - test-run-preserves-trace-view-on-rerun/pre3-4" -1125 check-background-color-in-screen-row screen, 7/bg=cursor, 5/y, " ", "F - test-run-preserves-trace-view-on-rerun/pre3-4/cursor" -1126 check-screen-row screen, 6/y, " ... ", "F - test-run-preserves-trace-view-on-rerun/pre3-5" -1127 check-background-color-in-screen-row screen, 7/bg=cursor, 6/y, " ", "F - test-run-preserves-trace-view-on-rerun/pre3-5/cursor" -1128 check-screen-row screen, 7/y, " 1 transform infix ", "F - test-run-preserves-trace-view-on-rerun/pre3-6" -1129 check-background-color-in-screen-row screen, 7/bg=cursor, 7/y, " ", "F - test-run-preserves-trace-view-on-rerun/pre3-6/cursor" -1130 check-screen-row screen, 8/y, " ... ", "F - test-run-preserves-trace-view-on-rerun/pre3-7" -1131 check-background-color-in-screen-row screen, 7/bg=cursor, 8/y, " ", "F - test-run-preserves-trace-view-on-rerun/pre3-7/cursor" -1132 check-screen-row screen, 9/y, " 1 macroexpand 7 ", "F - test-run-preserves-trace-view-on-rerun/pre3-8" -1133 check-background-color-in-screen-row screen, 7/bg=cursor, 9/y, " ", "F - test-run-preserves-trace-view-on-rerun/pre3-8/cursor" -1134 check-screen-row screen, 0xa/y, " ... ", "F - test-run-preserves-trace-view-on-rerun/pre3-9" -1135 check-background-color-in-screen-row screen, 7/bg=cursor, 0xa/y, " ||| ", "F - test-run-preserves-trace-view-on-rerun/pre3-9/cursor" -1136 check-screen-row screen, 0xb/y, " 1 => 7 ", "F - test-run-preserves-trace-view-on-rerun/pre3-10" -1137 check-background-color-in-screen-row screen, 7/bg=cursor, 0xb/y, " ", "F - test-run-preserves-trace-view-on-rerun/pre3-10/cursor" +1116 check-screen-row screen, 1/y, " 7 ", "F - test-run-preserves-trace-view-on-rerun/pre3-0" +1117 check-background-color-in-screen-row screen, 7/bg=cursor, 1/y, " ", "F - test-run-preserves-trace-view-on-rerun/pre3-0/cursor" +1118 check-screen-row screen, 2/y, " 1 tokenize ", "F - test-run-preserves-trace-view-on-rerun/pre3-1" +1119 check-background-color-in-screen-row screen, 7/bg=cursor, 2/y, " ", "F - test-run-preserves-trace-view-on-rerun/pre3-1/cursor" +1120 check-screen-row screen, 3/y, " ... ", "F - test-run-preserves-trace-view-on-rerun/pre3-2" +1121 check-background-color-in-screen-row screen, 7/bg=cursor, 3/y, " ", "F - test-run-preserves-trace-view-on-rerun/pre3-2/cursor" +1122 check-screen-row screen, 4/y, " 1 insert parens ", "F - test-run-preserves-trace-view-on-rerun/pre3-3" +1123 check-background-color-in-screen-row screen, 7/bg=cursor, 4/y, " ", "F - test-run-preserves-trace-view-on-rerun/pre3-3/cursor" +1124 check-screen-row screen, 5/y, " 1 parse ", "F - test-run-preserves-trace-view-on-rerun/pre3-4" +1125 check-background-color-in-screen-row screen, 7/bg=cursor, 5/y, " ", "F - test-run-preserves-trace-view-on-rerun/pre3-4/cursor" +1126 check-screen-row screen, 6/y, " ... ", "F - test-run-preserves-trace-view-on-rerun/pre3-5" +1127 check-background-color-in-screen-row screen, 7/bg=cursor, 6/y, " ", "F - test-run-preserves-trace-view-on-rerun/pre3-5/cursor" +1128 check-screen-row screen, 7/y, " 1 transform infix ", "F - test-run-preserves-trace-view-on-rerun/pre3-6" +1129 check-background-color-in-screen-row screen, 7/bg=cursor, 7/y, " ", "F - test-run-preserves-trace-view-on-rerun/pre3-6/cursor" +1130 check-screen-row screen, 8/y, " ... ", "F - test-run-preserves-trace-view-on-rerun/pre3-7" +1131 check-background-color-in-screen-row screen, 7/bg=cursor, 8/y, " ", "F - test-run-preserves-trace-view-on-rerun/pre3-7/cursor" +1132 check-screen-row screen, 9/y, " 1 macroexpand 7 ", "F - test-run-preserves-trace-view-on-rerun/pre3-8" +1133 check-background-color-in-screen-row screen, 7/bg=cursor, 9/y, " ", "F - test-run-preserves-trace-view-on-rerun/pre3-8/cursor" +1134 check-screen-row screen, 0xa/y, " ... ", "F - test-run-preserves-trace-view-on-rerun/pre3-9" +1135 check-background-color-in-screen-row screen, 7/bg=cursor, 0xa/y, " ||| ", "F - test-run-preserves-trace-view-on-rerun/pre3-9/cursor" +1136 check-screen-row screen, 0xb/y, " 1 => 7 ", "F - test-run-preserves-trace-view-on-rerun/pre3-10" +1137 check-background-color-in-screen-row screen, 7/bg=cursor, 0xb/y, " ", "F - test-run-preserves-trace-view-on-rerun/pre3-10/cursor" 1138 # expand 1139 edit-sandbox sandbox, 0xa/newline, 0/no-globals, 0/no-disk -1140 clear-screen screen -1141 render-sandbox screen, sandbox, 0/x, 0/y, 0x80/width, 0x10/height, 1/show-cursor +1140 clear-screen screen +1141 render-sandbox screen, sandbox, 0/x, 0/y, 0x80/width, 0x10/height, 1/show-cursor 1142 # cursor line is expanded -1143 check-screen-row screen, 1/y, " 7 ", "F - test-run-preserves-trace-view-on-rerun/expand-0" -1144 check-background-color-in-screen-row screen, 7/bg=cursor, 1/y, " ", "F - test-run-preserves-trace-view-on-rerun/expand-0/cursor" -1145 check-screen-row screen, 2/y, " 1 tokenize ", "F - test-run-preserves-trace-view-on-rerun/expand-1" -1146 check-background-color-in-screen-row screen, 7/bg=cursor, 2/y, " ", "F - test-run-preserves-trace-view-on-rerun/expand-1/cursor" -1147 check-screen-row screen, 3/y, " ... ", "F - test-run-preserves-trace-view-on-rerun/expand-2" -1148 check-background-color-in-screen-row screen, 7/bg=cursor, 3/y, " ", "F - test-run-preserves-trace-view-on-rerun/expand-2/cursor" -1149 check-screen-row screen, 4/y, " 1 insert parens ", "F - test-run-preserves-trace-view-on-rerun/expand-3" -1150 check-background-color-in-screen-row screen, 7/bg=cursor, 4/y, " ", "F - test-run-preserves-trace-view-on-rerun/expand-3/cursor" -1151 check-screen-row screen, 5/y, " 1 parse ", "F - test-run-preserves-trace-view-on-rerun/expand-4" -1152 check-background-color-in-screen-row screen, 7/bg=cursor, 5/y, " ", "F - test-run-preserves-trace-view-on-rerun/expand-4/cursor" -1153 check-screen-row screen, 6/y, " ... ", "F - test-run-preserves-trace-view-on-rerun/expand-5" -1154 check-background-color-in-screen-row screen, 7/bg=cursor, 6/y, " ", "F - test-run-preserves-trace-view-on-rerun/expand-5/cursor" -1155 check-screen-row screen, 7/y, " 1 transform infix ", "F - test-run-preserves-trace-view-on-rerun/expand-6" -1156 check-background-color-in-screen-row screen, 7/bg=cursor, 7/y, " ", "F - test-run-preserves-trace-view-on-rerun/expand-6/cursor" -1157 check-screen-row screen, 8/y, " ... ", "F - test-run-preserves-trace-view-on-rerun/expand-7" -1158 check-background-color-in-screen-row screen, 7/bg=cursor, 8/y, " ", "F - test-run-preserves-trace-view-on-rerun/expand-7/cursor" -1159 check-screen-row screen, 9/y, " 1 macroexpand 7 ", "F - test-run-preserves-trace-view-on-rerun/expand-8" -1160 check-background-color-in-screen-row screen, 7/bg=cursor, 9/y, " ", "F - test-run-preserves-trace-view-on-rerun/expand-8/cursor" -1161 check-screen-row screen, 0xa/y, " 2 macroexpand-iter 7 ", "F - test-run-preserves-trace-view-on-rerun/expand-9" -1162 check-background-color-in-screen-row screen, 7/bg=cursor, 0xa/y, " |||||||||||||||||||| ", "F - test-run-preserves-trace-view-on-rerun/expand-9/cursor" -1163 check-screen-row screen, 0xb/y, " ... ", "F - test-run-preserves-trace-view-on-rerun/expand-10" -1164 check-background-color-in-screen-row screen, 7/bg=cursor, 0xb/y, " ", "F - test-run-preserves-trace-view-on-rerun/expand-10/cursor" +1143 check-screen-row screen, 1/y, " 7 ", "F - test-run-preserves-trace-view-on-rerun/expand-0" +1144 check-background-color-in-screen-row screen, 7/bg=cursor, 1/y, " ", "F - test-run-preserves-trace-view-on-rerun/expand-0/cursor" +1145 check-screen-row screen, 2/y, " 1 tokenize ", "F - test-run-preserves-trace-view-on-rerun/expand-1" +1146 check-background-color-in-screen-row screen, 7/bg=cursor, 2/y, " ", "F - test-run-preserves-trace-view-on-rerun/expand-1/cursor" +1147 check-screen-row screen, 3/y, " ... ", "F - test-run-preserves-trace-view-on-rerun/expand-2" +1148 check-background-color-in-screen-row screen, 7/bg=cursor, 3/y, " ", "F - test-run-preserves-trace-view-on-rerun/expand-2/cursor" +1149 check-screen-row screen, 4/y, " 1 insert parens ", "F - test-run-preserves-trace-view-on-rerun/expand-3" +1150 check-background-color-in-screen-row screen, 7/bg=cursor, 4/y, " ", "F - test-run-preserves-trace-view-on-rerun/expand-3/cursor" +1151 check-screen-row screen, 5/y, " 1 parse ", "F - test-run-preserves-trace-view-on-rerun/expand-4" +1152 check-background-color-in-screen-row screen, 7/bg=cursor, 5/y, " ", "F - test-run-preserves-trace-view-on-rerun/expand-4/cursor" +1153 check-screen-row screen, 6/y, " ... ", "F - test-run-preserves-trace-view-on-rerun/expand-5" +1154 check-background-color-in-screen-row screen, 7/bg=cursor, 6/y, " ", "F - test-run-preserves-trace-view-on-rerun/expand-5/cursor" +1155 check-screen-row screen, 7/y, " 1 transform infix ", "F - test-run-preserves-trace-view-on-rerun/expand-6" +1156 check-background-color-in-screen-row screen, 7/bg=cursor, 7/y, " ", "F - test-run-preserves-trace-view-on-rerun/expand-6/cursor" +1157 check-screen-row screen, 8/y, " ... ", "F - test-run-preserves-trace-view-on-rerun/expand-7" +1158 check-background-color-in-screen-row screen, 7/bg=cursor, 8/y, " ", "F - test-run-preserves-trace-view-on-rerun/expand-7/cursor" +1159 check-screen-row screen, 9/y, " 1 macroexpand 7 ", "F - test-run-preserves-trace-view-on-rerun/expand-8" +1160 check-background-color-in-screen-row screen, 7/bg=cursor, 9/y, " ", "F - test-run-preserves-trace-view-on-rerun/expand-8/cursor" +1161 check-screen-row screen, 0xa/y, " 2 macroexpand-iter 7 ", "F - test-run-preserves-trace-view-on-rerun/expand-9" +1162 check-background-color-in-screen-row screen, 7/bg=cursor, 0xa/y, " |||||||||||||||||||| ", "F - test-run-preserves-trace-view-on-rerun/expand-9/cursor" +1163 check-screen-row screen, 0xb/y, " ... ", "F - test-run-preserves-trace-view-on-rerun/expand-10" +1164 check-background-color-in-screen-row screen, 7/bg=cursor, 0xb/y, " ", "F - test-run-preserves-trace-view-on-rerun/expand-10/cursor" 1165 } diff --git a/html/shell/tokenize.mu.html b/html/shell/tokenize.mu.html index 69d0391d..39478971 100644 --- a/html/shell/tokenize.mu.html +++ b/html/shell/tokenize.mu.html @@ -612,7 +612,7 @@ if ('onhashchange' in window) { 548 initialize-token out, "," 549 break $next-token:case 550 } - 551 set-cursor-position 0/screen, 0x40 0x20 + 551 set-cursor-position 0/screen, 0x40 0x20 552 { 553 var foo/eax: int <- copy g 554 draw-int32-decimal-wrapping-right-then-down-from-cursor-over-full-screen 0/screen, foo, 7/fg 0/bg diff --git a/html/shell/trace.mu.html b/html/shell/trace.mu.html index c6ef024e..863f622e 100644 --- a/html/shell/trace.mu.html +++ b/html/shell/trace.mu.html @@ -514,7 +514,7 @@ if ('onhashchange' in window) { 449 copy-to *dest, 0/false 450 } 451 - 452 fn render-trace screen: (addr screen), _self: (addr trace), xmin: int, ymin: int, xmax: int, ymax: int, show-cursor?: boolean -> _/ecx: int { + 452 fn render-trace screen: (addr screen), _self: (addr trace), xmin: int, ymin: int, xmax: int, ymax: int, show-cursor?: boolean -> _/ecx: int { 453 var already-hiding-lines?: boolean 454 var self/esi: (addr trace) <- copy _self 455 compare self, 0 @@ -553,13 +553,13 @@ if ('onhashchange' in window) { 488 { 489 var width/eax: int <- copy 0 490 var height/ecx: int <- copy 0 - 491 width, height <- screen-size screen + 491 width, height <- screen-size screen 492 compare width, 0x80 493 break-if-< $render-trace:render-depth 494 } - 495 set-cursor-position screen, 0x70/x, y - 496 draw-text-rightward-from-cursor-over-full-screen screen, "trace depth: ", 0x17/fg, 0xc5/bg=blue-bg - 497 draw-int32-decimal-wrapping-right-then-down-from-cursor-over-full-screen screen, *max-depth, 0x7/fg, 0xc5/bg=blue-bg + 495 set-cursor-position screen, 0x70/x, y + 496 draw-text-rightward-from-cursor-over-full-screen screen, "trace depth: ", 0x17/fg, 0xc5/bg=blue-bg + 497 draw-int32-decimal-wrapping-right-then-down-from-cursor-over-full-screen screen, *max-depth, 0x7/fg, 0xc5/bg=blue-bg 498 } 499 var top-line-addr/edx: (addr int) <- get self, top-line-index 500 var i/edx: int <- copy *top-line-addr @@ -593,7 +593,7 @@ if ('onhashchange' in window) { 528 var curr-depth/eax: (addr int) <- get curr, depth 529 compare *curr-depth, 0/error 530 break-if-!= - 531 y <- render-trace-line screen, curr, xmin, y, xmax, ymax, 0xc/fg=trace-error, bg, 0/clip + 531 y <- render-trace-line screen, curr, xmin, y, xmax, ymax, 0xc/fg=trace-error, bg, 0/clip 532 copy-to already-hiding-lines?, 0/false 533 break $render-trace:iter 534 } @@ -603,7 +603,7 @@ if ('onhashchange' in window) { 538 compare display?, 0/false 539 break-if-= 540 var unclip-cursor-line?/eax: boolean <- unclip-cursor-line? self, i - 541 y <- render-trace-line screen, curr, xmin, y, xmax, ymax, fg, bg, unclip-cursor-line? + 541 y <- render-trace-line screen, curr, xmin, y, xmax, ymax, fg, bg, unclip-cursor-line? 542 copy-to already-hiding-lines?, 0/false 543 break $render-trace:iter 544 } @@ -612,7 +612,7 @@ if ('onhashchange' in window) { 547 { 548 break-if-!= 549 var x/eax: int <- copy xmin - 550 x, y <- draw-text-wrapping-right-then-down screen, "...", xmin, ymin, xmax, ymax, x, y, fg, bg + 550 x, y <- draw-text-wrapping-right-then-down screen, "...", xmin, ymin, xmax, ymax, x, y, fg, bg 551 y <- increment 552 copy-to already-hiding-lines?, 1/true 553 } @@ -621,7 +621,7 @@ if ('onhashchange' in window) { 556 loop 557 } 558 # prevent cursor from going too far down - 559 clamp-cursor-to-bottom self, y, screen, xmin, ymin, xmax, ymax + 559 clamp-cursor-to-bottom self, y, screen, xmin, ymin, xmax, ymax 560 return y 561 } 562 @@ -644,7 +644,7 @@ if ('onhashchange' in window) { 579 return 1/true 580 } 581 - 582 fn render-trace-line screen: (addr screen), _self: (addr trace-line), xmin: int, ymin: int, xmax: int, ymax: int, fg: int, bg: int, unclip?: boolean -> _/ecx: int { + 582 fn render-trace-line screen: (addr screen), _self: (addr trace-line), xmin: int, ymin: int, xmax: int, ymax: int, fg: int, bg: int, unclip?: boolean -> _/ecx: int { 583 var self/esi: (addr trace-line) <- copy _self 584 var xsave/edx: int <- copy xmin 585 var y/ecx: int <- copy ymin @@ -655,8 +655,8 @@ if ('onhashchange' in window) { 590 break-if-= 591 var x/eax: int <- copy xsave 592 { - 593 x, y <- draw-int32-decimal-wrapping-right-then-down screen, *depth-a, xmin, ymin, xmax, ymax, x, y, fg, bg - 594 x, y <- draw-text-wrapping-right-then-down screen, " ", xmin, ymin, xmax, ymax, x, y, fg, bg + 593 x, y <- draw-int32-decimal-wrapping-right-then-down screen, *depth-a, xmin, ymin, xmax, ymax, x, y, fg, bg + 594 x, y <- draw-text-wrapping-right-then-down screen, " ", xmin, ymin, xmax, ymax, x, y, fg, bg 595 # don't show label in UI; it's just for tests 596 } 597 xsave <- copy x @@ -668,12 +668,12 @@ if ('onhashchange' in window) { 603 compare unclip?, 0/false 604 { 605 break-if-= - 606 x, y <- draw-text-wrapping-right-then-down screen, data, xmin, ymin, xmax, ymax, x, y, fg, bg + 606 x, y <- draw-text-wrapping-right-then-down screen, data, xmin, ymin, xmax, ymax, x, y, fg, bg 607 } 608 compare unclip?, 0/false 609 { 610 break-if-!= - 611 x <- draw-text-rightward screen, data, x, xmax, y, fg, bg + 611 x <- draw-text-rightward screen, data, x, xmax, y, fg, bg 612 } 613 y <- increment 614 return y @@ -745,7 +745,7 @@ if ('onhashchange' in window) { 680 681 # extremely hacky; consider deleting test-render-trace-empty-3 when you clean this up 682 # TODO: duplicates logic for rendering a line - 683 fn clamp-cursor-to-bottom _self: (addr trace), _y: int, screen: (addr screen), xmin: int, ymin: int, xmax: int, ymax: int { + 683 fn clamp-cursor-to-bottom _self: (addr trace), _y: int, screen: (addr screen), xmin: int, ymin: int, xmax: int, ymax: int { 684 var y/ebx: int <- copy _y 685 compare y, ymin 686 { @@ -775,12 +775,12 @@ if ('onhashchange' in window) { 710 { 711 compare display?, 0/false 712 break-if-= - 713 var dummy/ecx: int <- render-trace-line screen, cursor-line, xmin, y, xmax, ymax, 0x38/fg=trace, 7/cursor-line-bg, 0/clip + 713 var dummy/ecx: int <- render-trace-line screen, cursor-line, xmin, y, xmax, ymax, 0x38/fg=trace, 7/cursor-line-bg, 0/clip 714 return 715 } 716 var dummy1/eax: int <- copy 0 717 var dummy2/ecx: int <- copy 0 - 718 dummy1, dummy2 <- draw-text-wrapping-right-then-down screen, "...", xmin, ymin, xmax, ymax, xmin, y, 9/fg=trace, 7/cursor-line-bg + 718 dummy1, dummy2 <- draw-text-wrapping-right-then-down screen, "...", xmin, ymin, xmax, ymax, xmin, y, 9/fg=trace, 7/cursor-line-bg 719 } 720 721 fn test-render-trace-empty { @@ -788,15 +788,15 @@ if ('onhashchange' in window) { 723 var t/esi: (addr trace) <- address t-storage 724 initialize-trace t, 0x100/max-depth, 0x10, 0x10 725 # setup: screen - 726 var screen-on-stack: screen - 727 var screen/edi: (addr screen) <- address screen-on-stack - 728 initialize-screen screen, 5/width, 4/height, 0/no-pixel-graphics + 726 var screen-on-stack: screen + 727 var screen/edi: (addr screen) <- address screen-on-stack + 728 initialize-screen screen, 5/width, 4/height, 0/no-pixel-graphics 729 # - 730 var y/ecx: int <- render-trace screen, t, 0/xmin, 0/ymin, 5/xmax, 4/ymax, 0/no-cursor + 730 var y/ecx: int <- render-trace screen, t, 0/xmin, 0/ymin, 5/xmax, 4/ymax, 0/no-cursor 731 # 732 check-ints-equal y, 0, "F - test-render-trace-empty/cursor" - 733 check-screen-row screen, 0/y, " ", "F - test-render-trace-empty" - 734 check-background-color-in-screen-row screen, 7/bg=cursor, 0/y, " ", "F - test-render-trace-empty/bg" + 733 check-screen-row screen, 0/y, " ", "F - test-render-trace-empty" + 734 check-background-color-in-screen-row screen, 7/bg=cursor, 0/y, " ", "F - test-render-trace-empty/bg" 735 } 736 737 fn test-render-trace-empty-2 { @@ -804,15 +804,15 @@ if ('onhashchange' in window) { 739 var t/esi: (addr trace) <- address t-storage 740 initialize-trace t, 0x100/max-depth, 0x10, 0x10 741 # setup: screen - 742 var screen-on-stack: screen - 743 var screen/edi: (addr screen) <- address screen-on-stack - 744 initialize-screen screen, 5/width, 4/height, 0/no-pixel-graphics + 742 var screen-on-stack: screen + 743 var screen/edi: (addr screen) <- address screen-on-stack + 744 initialize-screen screen, 5/width, 4/height, 0/no-pixel-graphics 745 # - 746 var y/ecx: int <- render-trace screen, t, 0/xmin, 2/ymin, 5/xmax, 4/ymax, 0/no-cursor # cursor below top row + 746 var y/ecx: int <- render-trace screen, t, 0/xmin, 2/ymin, 5/xmax, 4/ymax, 0/no-cursor # cursor below top row 747 # 748 check-ints-equal y, 2, "F - test-render-trace-empty-2/cursor" - 749 check-screen-row screen, 2/y, " ", "F - test-render-trace-empty-2" - 750 check-background-color-in-screen-row screen, 7/bg=cursor, 2/y, " ", "F - test-render-trace-empty-2/bg" + 749 check-screen-row screen, 2/y, " ", "F - test-render-trace-empty-2" + 750 check-background-color-in-screen-row screen, 7/bg=cursor, 2/y, " ", "F - test-render-trace-empty-2/bg" 751 } 752 753 fn test-render-trace-empty-3 { @@ -820,17 +820,17 @@ if ('onhashchange' in window) { 755 var t/esi: (addr trace) <- address t-storage 756 initialize-trace t, 0x100/max-depth, 0x10, 0x10 757 # setup: screen - 758 var screen-on-stack: screen - 759 var screen/edi: (addr screen) <- address screen-on-stack - 760 initialize-screen screen, 5/width, 4/height, 0/no-pixel-graphics + 758 var screen-on-stack: screen + 759 var screen/edi: (addr screen) <- address screen-on-stack + 760 initialize-screen screen, 5/width, 4/height, 0/no-pixel-graphics 761 # - 762 var y/ecx: int <- render-trace screen, t, 0/xmin, 2/ymin, 5/xmax, 4/ymax, 1/show-cursor # try show cursor + 762 var y/ecx: int <- render-trace screen, t, 0/xmin, 2/ymin, 5/xmax, 4/ymax, 1/show-cursor # try show cursor 763 # still no cursor to show 764 check-ints-equal y, 2, "F - test-render-trace-empty-3/cursor" - 765 check-screen-row screen, 1/y, " ", "F - test-render-trace-empty-3/line-above-cursor" - 766 check-background-color-in-screen-row screen, 7/bg=cursor, 1/y, " ", "F - test-render-trace-empty-3/bg-for-line-above-cursor" - 767 check-screen-row screen, 2/y, " ", "F - test-render-trace-empty-3" - 768 check-background-color-in-screen-row screen, 7/bg=cursor, 2/y, " ", "F - test-render-trace-empty-3/bg" + 765 check-screen-row screen, 1/y, " ", "F - test-render-trace-empty-3/line-above-cursor" + 766 check-background-color-in-screen-row screen, 7/bg=cursor, 1/y, " ", "F - test-render-trace-empty-3/bg-for-line-above-cursor" + 767 check-screen-row screen, 2/y, " ", "F - test-render-trace-empty-3" + 768 check-background-color-in-screen-row screen, 7/bg=cursor, 2/y, " ", "F - test-render-trace-empty-3/bg" 769 } 770 771 fn test-render-trace-collapsed-by-default { @@ -839,14 +839,14 @@ if ('onhashchange' in window) { 774 initialize-trace t, 0x100/max-depth, 0x10, 0x10 775 trace-text t, "l", "data" 776 # setup: screen - 777 var screen-on-stack: screen - 778 var screen/edi: (addr screen) <- address screen-on-stack - 779 initialize-screen screen, 5/width, 4/height, 0/no-pixel-graphics + 777 var screen-on-stack: screen + 778 var screen/edi: (addr screen) <- address screen-on-stack + 779 initialize-screen screen, 5/width, 4/height, 0/no-pixel-graphics 780 # - 781 var y/ecx: int <- render-trace screen, t, 0/xmin, 0/ymin, 5/xmax, 4/ymax, 0/no-cursor + 781 var y/ecx: int <- render-trace screen, t, 0/xmin, 0/ymin, 5/xmax, 4/ymax, 0/no-cursor 782 # 783 check-ints-equal y, 1, "F - test-render-trace-collapsed-by-default/cursor" - 784 check-screen-row screen, 0/y, "... ", "F - test-render-trace-collapsed-by-default" + 784 check-screen-row screen, 0/y, "... ", "F - test-render-trace-collapsed-by-default" 785 } 786 787 fn test-render-trace-error { @@ -855,14 +855,14 @@ if ('onhashchange' in window) { 790 initialize-trace t, 0x100/max-depth, 0x10, 0x10 791 error t, "error" 792 # setup: screen - 793 var screen-on-stack: screen - 794 var screen/edi: (addr screen) <- address screen-on-stack - 795 initialize-screen screen, 0xa/width, 4/height, 0/no-pixel-graphics + 793 var screen-on-stack: screen + 794 var screen/edi: (addr screen) <- address screen-on-stack + 795 initialize-screen screen, 0xa/width, 4/height, 0/no-pixel-graphics 796 # - 797 var y/ecx: int <- render-trace screen, t, 0/xmin, 0/ymin, 0xa/xmax, 4/ymax, 0/no-cursor + 797 var y/ecx: int <- render-trace screen, t, 0/xmin, 0/ymin, 0xa/xmax, 4/ymax, 0/no-cursor 798 # 799 check-ints-equal y, 1, "F - test-render-trace-error/cursor" - 800 check-screen-row screen, 0/y, "error", "F - test-render-trace-error" + 800 check-screen-row screen, 0/y, "error", "F - test-render-trace-error" 801 } 802 803 fn test-render-trace-error-at-start { @@ -873,15 +873,15 @@ if ('onhashchange' in window) { 808 error t, "error" 809 trace-text t, "l", "data" 810 # setup: screen - 811 var screen-on-stack: screen - 812 var screen/edi: (addr screen) <- address screen-on-stack - 813 initialize-screen screen, 0xa/width, 4/height, 0/no-pixel-graphics + 811 var screen-on-stack: screen + 812 var screen/edi: (addr screen) <- address screen-on-stack + 813 initialize-screen screen, 0xa/width, 4/height, 0/no-pixel-graphics 814 # - 815 var y/ecx: int <- render-trace screen, t, 0/xmin, 0/ymin, 0xa/xmax, 4/ymax, 0/no-cursor + 815 var y/ecx: int <- render-trace screen, t, 0/xmin, 0/ymin, 0xa/xmax, 4/ymax, 0/no-cursor 816 # 817 check-ints-equal y, 2, "F - test-render-trace-error-at-start/cursor" - 818 check-screen-row screen, 0/y, "error", "F - test-render-trace-error-at-start/0" - 819 check-screen-row screen, 1/y, "... ", "F - test-render-trace-error-at-start/1" + 818 check-screen-row screen, 0/y, "error", "F - test-render-trace-error-at-start/0" + 819 check-screen-row screen, 1/y, "... ", "F - test-render-trace-error-at-start/1" 820 } 821 822 fn test-render-trace-error-at-end { @@ -892,15 +892,15 @@ if ('onhashchange' in window) { 827 trace-text t, "l", "data" 828 error t, "error" 829 # setup: screen - 830 var screen-on-stack: screen - 831 var screen/edi: (addr screen) <- address screen-on-stack - 832 initialize-screen screen, 0xa/width, 4/height, 0/no-pixel-graphics + 830 var screen-on-stack: screen + 831 var screen/edi: (addr screen) <- address screen-on-stack + 832 initialize-screen screen, 0xa/width, 4/height, 0/no-pixel-graphics 833 # - 834 var y/ecx: int <- render-trace screen, t, 0/xmin, 0/ymin, 0xa/xmax, 4/ymax, 0/no-cursor + 834 var y/ecx: int <- render-trace screen, t, 0/xmin, 0/ymin, 0xa/xmax, 4/ymax, 0/no-cursor 835 # 836 check-ints-equal y, 2, "F - test-render-trace-error-at-end/cursor" - 837 check-screen-row screen, 0/y, "... ", "F - test-render-trace-error-at-end/0" - 838 check-screen-row screen, 1/y, "error", "F - test-render-trace-error-at-end/1" + 837 check-screen-row screen, 0/y, "... ", "F - test-render-trace-error-at-end/0" + 838 check-screen-row screen, 1/y, "error", "F - test-render-trace-error-at-end/1" 839 } 840 841 fn test-render-trace-error-in-the-middle { @@ -912,16 +912,16 @@ if ('onhashchange' in window) { 847 error t, "error" 848 trace-text t, "l", "line 3" 849 # setup: screen - 850 var screen-on-stack: screen - 851 var screen/edi: (addr screen) <- address screen-on-stack - 852 initialize-screen screen, 0xa/width, 4/height, 0/no-pixel-graphics + 850 var screen-on-stack: screen + 851 var screen/edi: (addr screen) <- address screen-on-stack + 852 initialize-screen screen, 0xa/width, 4/height, 0/no-pixel-graphics 853 # - 854 var y/ecx: int <- render-trace screen, t, 0/xmin, 0/ymin, 0xa/xmax, 4/ymax, 0/no-cursor + 854 var y/ecx: int <- render-trace screen, t, 0/xmin, 0/ymin, 0xa/xmax, 4/ymax, 0/no-cursor 855 # 856 check-ints-equal y, 3, "F - test-render-trace-error-in-the-middle/cursor" - 857 check-screen-row screen, 0/y, "... ", "F - test-render-trace-error-in-the-middle/0" - 858 check-screen-row screen, 1/y, "error", "F - test-render-trace-error-in-the-middle/1" - 859 check-screen-row screen, 2/y, "... ", "F - test-render-trace-error-in-the-middle/2" + 857 check-screen-row screen, 0/y, "... ", "F - test-render-trace-error-in-the-middle/0" + 858 check-screen-row screen, 1/y, "error", "F - test-render-trace-error-in-the-middle/1" + 859 check-screen-row screen, 2/y, "... ", "F - test-render-trace-error-in-the-middle/2" 860 } 861 862 fn test-render-trace-cursor-in-single-line { @@ -933,40 +933,40 @@ if ('onhashchange' in window) { 868 error t, "error" 869 trace-text t, "l", "line 3" 870 # setup: screen - 871 var screen-on-stack: screen - 872 var screen/edi: (addr screen) <- address screen-on-stack - 873 initialize-screen screen, 0xa/width, 4/height, 0/no-pixel-graphics + 871 var screen-on-stack: screen + 872 var screen/edi: (addr screen) <- address screen-on-stack + 873 initialize-screen screen, 0xa/width, 4/height, 0/no-pixel-graphics 874 # - 875 var y/ecx: int <- render-trace screen, t, 0/xmin, 0/ymin, 0xa/xmax, 4/ymax, 1/show-cursor + 875 var y/ecx: int <- render-trace screen, t, 0/xmin, 0/ymin, 0xa/xmax, 4/ymax, 1/show-cursor 876 # - 877 check-screen-row screen, 0/y, "... ", "F - test-render-trace-cursor-in-single-line/0" - 878 check-background-color-in-screen-row screen, 7/bg=cursor, 0/y, "||| ", "F - test-render-trace-cursor-in-single-line/0/cursor" - 879 check-screen-row screen, 1/y, "error ", "F - test-render-trace-cursor-in-single-line/1" - 880 check-background-color-in-screen-row screen, 7/bg=cursor, 1/y, " ", "F - test-render-trace-cursor-in-single-line/1/cursor" - 881 check-screen-row screen, 2/y, "... ", "F - test-render-trace-cursor-in-single-line/2" - 882 check-background-color-in-screen-row screen, 7/bg=cursor, 2/y, " ", "F - test-render-trace-cursor-in-single-line/2/cursor" + 877 check-screen-row screen, 0/y, "... ", "F - test-render-trace-cursor-in-single-line/0" + 878 check-background-color-in-screen-row screen, 7/bg=cursor, 0/y, "||| ", "F - test-render-trace-cursor-in-single-line/0/cursor" + 879 check-screen-row screen, 1/y, "error ", "F - test-render-trace-cursor-in-single-line/1" + 880 check-background-color-in-screen-row screen, 7/bg=cursor, 1/y, " ", "F - test-render-trace-cursor-in-single-line/1/cursor" + 881 check-screen-row screen, 2/y, "... ", "F - test-render-trace-cursor-in-single-line/2" + 882 check-background-color-in-screen-row screen, 7/bg=cursor, 2/y, " ", "F - test-render-trace-cursor-in-single-line/2/cursor" 883 } 884 - 885 fn render-trace-menu screen: (addr screen) { + 885 fn render-trace-menu screen: (addr screen) { 886 var width/eax: int <- copy 0 887 var height/ecx: int <- copy 0 - 888 width, height <- screen-size screen + 888 width, height <- screen-size screen 889 var y/ecx: int <- copy height 890 y <- decrement 891 var height/edx: int <- copy y 892 height <- increment - 893 clear-rect screen, 0/x, y, width, height, 0xc5/bg=blue-bg - 894 set-cursor-position screen, 0/x, y - 895 draw-text-rightward-from-cursor screen, " ^r ", width, 0/fg, 0x5c/bg=menu-highlight - 896 draw-text-rightward-from-cursor screen, " run main ", width, 7/fg, 0xc5/bg=blue-bg - 897 draw-text-rightward-from-cursor screen, " ^g ", width, 0/fg, 0x5c/bg=menu-highlight - 898 draw-text-rightward-from-cursor screen, " go to ", width, 7/fg, 0xc5/bg=blue-bg - 899 draw-text-rightward-from-cursor screen, " ^m ", width, 0/fg, 3/bg=keyboard - 900 draw-text-rightward-from-cursor screen, " to keyboard ", width, 7/fg, 0xc5/bg=blue-bg - 901 draw-text-rightward-from-cursor screen, " enter/bksp ", width, 0/fg, 0x5c/bg=menu-highlight - 902 draw-text-rightward-from-cursor screen, " expand/collapse ", width, 7/fg, 0xc5/bg=blue-bg - 903 draw-text-rightward-from-cursor screen, " ^s ", width, 0/fg, 0x5c/bg=menu-highlight - 904 draw-text-rightward-from-cursor screen, " show whole line ", width, 7/fg, 0xc5/bg=blue-bg + 893 clear-rect screen, 0/x, y, width, height, 0xc5/bg=blue-bg + 894 set-cursor-position screen, 0/x, y + 895 draw-text-rightward-from-cursor screen, " ^r ", width, 0/fg, 0x5c/bg=menu-highlight + 896 draw-text-rightward-from-cursor screen, " run main ", width, 7/fg, 0xc5/bg=blue-bg + 897 draw-text-rightward-from-cursor screen, " ^g ", width, 0/fg, 0x5c/bg=menu-highlight + 898 draw-text-rightward-from-cursor screen, " go to ", width, 7/fg, 0xc5/bg=blue-bg + 899 draw-text-rightward-from-cursor screen, " ^m ", width, 0/fg, 3/bg=keyboard + 900 draw-text-rightward-from-cursor screen, " to keyboard ", width, 7/fg, 0xc5/bg=blue-bg + 901 draw-text-rightward-from-cursor screen, " enter/bksp ", width, 0/fg, 0x5c/bg=menu-highlight + 902 draw-text-rightward-from-cursor screen, " expand/collapse ", width, 7/fg, 0xc5/bg=blue-bg + 903 draw-text-rightward-from-cursor screen, " ^s ", width, 0/fg, 0x5c/bg=menu-highlight + 904 draw-text-rightward-from-cursor screen, " show whole line ", width, 7/fg, 0xc5/bg=blue-bg 905 } 906 907 fn edit-trace _self: (addr trace), key: grapheme { @@ -1239,38 +1239,38 @@ if ('onhashchange' in window) { 1174 error t, "error" 1175 trace-text t, "l", "line 3" 1176 # setup: screen -1177 var screen-on-stack: screen -1178 var screen/edi: (addr screen) <- address screen-on-stack -1179 initialize-screen screen, 0xa/width, 4/height, 0/no-pixel-graphics +1177 var screen-on-stack: screen +1178 var screen/edi: (addr screen) <- address screen-on-stack +1179 initialize-screen screen, 0xa/width, 4/height, 0/no-pixel-graphics 1180 # -1181 var y/ecx: int <- render-trace screen, t, 0/xmin, 0/ymin, 0xa/xmax, 4/ymax, 1/show-cursor +1181 var y/ecx: int <- render-trace screen, t, 0/xmin, 0/ymin, 0xa/xmax, 4/ymax, 1/show-cursor 1182 # -1183 check-screen-row screen, 0/y, "... ", "F - test-cursor-down-and-up-within-trace/pre-0" -1184 check-background-color-in-screen-row screen, 7/bg=cursor, 0/y, "||| ", "F - test-cursor-down-and-up-within-trace/pre-0/cursor" -1185 check-screen-row screen, 1/y, "error ", "F - test-cursor-down-and-up-within-trace/pre-1" -1186 check-background-color-in-screen-row screen, 7/bg=cursor, 1/y, " ", "F - test-cursor-down-and-up-within-trace/pre-1/cursor" -1187 check-screen-row screen, 2/y, "... ", "F - test-cursor-down-and-up-within-trace/pre-2" -1188 check-background-color-in-screen-row screen, 7/bg=cursor, 2/y, " ", "F - test-cursor-down-and-up-within-trace/pre-2/cursor" +1183 check-screen-row screen, 0/y, "... ", "F - test-cursor-down-and-up-within-trace/pre-0" +1184 check-background-color-in-screen-row screen, 7/bg=cursor, 0/y, "||| ", "F - test-cursor-down-and-up-within-trace/pre-0/cursor" +1185 check-screen-row screen, 1/y, "error ", "F - test-cursor-down-and-up-within-trace/pre-1" +1186 check-background-color-in-screen-row screen, 7/bg=cursor, 1/y, " ", "F - test-cursor-down-and-up-within-trace/pre-1/cursor" +1187 check-screen-row screen, 2/y, "... ", "F - test-cursor-down-and-up-within-trace/pre-2" +1188 check-background-color-in-screen-row screen, 7/bg=cursor, 2/y, " ", "F - test-cursor-down-and-up-within-trace/pre-2/cursor" 1189 # cursor down 1190 edit-trace t, 0x6a/j -1191 var y/ecx: int <- render-trace screen, t, 0/xmin, 0/ymin, 0xa/xmax, 4/ymax, 1/show-cursor +1191 var y/ecx: int <- render-trace screen, t, 0/xmin, 0/ymin, 0xa/xmax, 4/ymax, 1/show-cursor 1192 # -1193 check-screen-row screen, 0/y, "... ", "F - test-cursor-down-and-up-within-trace/down-0" -1194 check-background-color-in-screen-row screen, 7/bg=cursor, 0/y, " ", "F - test-cursor-down-and-up-within-trace/down-0/cursor" -1195 check-screen-row screen, 1/y, "error ", "F - test-cursor-down-and-up-within-trace/down-1" -1196 check-background-color-in-screen-row screen, 7/bg=cursor, 1/y, "||||| ", "F - test-cursor-down-and-up-within-trace/down-1/cursor" -1197 check-screen-row screen, 2/y, "... ", "F - test-cursor-down-and-up-within-trace/down-2" -1198 check-background-color-in-screen-row screen, 7/bg=cursor, 2/y, " ", "F - test-cursor-down-and-up-within-trace/down-2/cursor" +1193 check-screen-row screen, 0/y, "... ", "F - test-cursor-down-and-up-within-trace/down-0" +1194 check-background-color-in-screen-row screen, 7/bg=cursor, 0/y, " ", "F - test-cursor-down-and-up-within-trace/down-0/cursor" +1195 check-screen-row screen, 1/y, "error ", "F - test-cursor-down-and-up-within-trace/down-1" +1196 check-background-color-in-screen-row screen, 7/bg=cursor, 1/y, "||||| ", "F - test-cursor-down-and-up-within-trace/down-1/cursor" +1197 check-screen-row screen, 2/y, "... ", "F - test-cursor-down-and-up-within-trace/down-2" +1198 check-background-color-in-screen-row screen, 7/bg=cursor, 2/y, " ", "F - test-cursor-down-and-up-within-trace/down-2/cursor" 1199 # cursor up 1200 edit-trace t, 0x6b/k -1201 var y/ecx: int <- render-trace screen, t, 0/xmin, 0/ymin, 0xa/xmax, 4/ymax, 1/show-cursor +1201 var y/ecx: int <- render-trace screen, t, 0/xmin, 0/ymin, 0xa/xmax, 4/ymax, 1/show-cursor 1202 # -1203 check-screen-row screen, 0/y, "... ", "F - test-cursor-down-and-up-within-trace/up-0" -1204 check-background-color-in-screen-row screen, 7/bg=cursor, 0/y, "||| ", "F - test-cursor-down-and-up-within-trace/up-0/cursor" -1205 check-screen-row screen, 1/y, "error ", "F - test-cursor-down-and-up-within-trace/up-1" -1206 check-background-color-in-screen-row screen, 7/bg=cursor, 1/y, " ", "F - test-cursor-down-and-up-within-trace/up-1/cursor" -1207 check-screen-row screen, 2/y, "... ", "F - test-cursor-down-and-up-within-trace/up-2" -1208 check-background-color-in-screen-row screen, 7/bg=cursor, 2/y, " ", "F - test-cursor-down-and-up-within-trace/up-2/cursor" +1203 check-screen-row screen, 0/y, "... ", "F - test-cursor-down-and-up-within-trace/up-0" +1204 check-background-color-in-screen-row screen, 7/bg=cursor, 0/y, "||| ", "F - test-cursor-down-and-up-within-trace/up-0/cursor" +1205 check-screen-row screen, 1/y, "error ", "F - test-cursor-down-and-up-within-trace/up-1" +1206 check-background-color-in-screen-row screen, 7/bg=cursor, 1/y, " ", "F - test-cursor-down-and-up-within-trace/up-1/cursor" +1207 check-screen-row screen, 2/y, "... ", "F - test-cursor-down-and-up-within-trace/up-2" +1208 check-background-color-in-screen-row screen, 7/bg=cursor, 2/y, " ", "F - test-cursor-down-and-up-within-trace/up-2/cursor" 1209 } 1210 1211 fn test-cursor-down-past-bottom-of-trace { @@ -1282,18 +1282,18 @@ if ('onhashchange' in window) { 1217 error t, "error" 1218 trace-text t, "l", "line 3" 1219 # setup: screen -1220 var screen-on-stack: screen -1221 var screen/edi: (addr screen) <- address screen-on-stack -1222 initialize-screen screen, 0xa/width, 4/height, 0/no-pixel-graphics +1220 var screen-on-stack: screen +1221 var screen/edi: (addr screen) <- address screen-on-stack +1222 initialize-screen screen, 0xa/width, 4/height, 0/no-pixel-graphics 1223 # -1224 var y/ecx: int <- render-trace screen, t, 0/xmin, 0/ymin, 0xa/xmax, 4/ymax, 1/show-cursor +1224 var y/ecx: int <- render-trace screen, t, 0/xmin, 0/ymin, 0xa/xmax, 4/ymax, 1/show-cursor 1225 # -1226 check-screen-row screen, 0/y, "... ", "F - test-cursor-down-past-bottom-of-trace/pre-0" -1227 check-background-color-in-screen-row screen, 7/bg=cursor, 0/y, "||| ", "F - test-cursor-down-past-bottom-of-trace/pre-0/cursor" -1228 check-screen-row screen, 1/y, "error ", "F - test-cursor-down-past-bottom-of-trace/pre-1" -1229 check-background-color-in-screen-row screen, 7/bg=cursor, 1/y, " ", "F - test-cursor-down-past-bottom-of-trace/pre-1/cursor" -1230 check-screen-row screen, 2/y, "... ", "F - test-cursor-down-past-bottom-of-trace/pre-2" -1231 check-background-color-in-screen-row screen, 7/bg=cursor, 2/y, " ", "F - test-cursor-down-past-bottom-of-trace/pre-2/cursor" +1226 check-screen-row screen, 0/y, "... ", "F - test-cursor-down-past-bottom-of-trace/pre-0" +1227 check-background-color-in-screen-row screen, 7/bg=cursor, 0/y, "||| ", "F - test-cursor-down-past-bottom-of-trace/pre-0/cursor" +1228 check-screen-row screen, 1/y, "error ", "F - test-cursor-down-past-bottom-of-trace/pre-1" +1229 check-background-color-in-screen-row screen, 7/bg=cursor, 1/y, " ", "F - test-cursor-down-past-bottom-of-trace/pre-1/cursor" +1230 check-screen-row screen, 2/y, "... ", "F - test-cursor-down-past-bottom-of-trace/pre-2" +1231 check-background-color-in-screen-row screen, 7/bg=cursor, 2/y, " ", "F - test-cursor-down-past-bottom-of-trace/pre-2/cursor" 1232 # cursor down several times 1233 edit-trace t, 0x6a/j 1234 edit-trace t, 0x6a/j @@ -1301,14 +1301,14 @@ if ('onhashchange' in window) { 1236 edit-trace t, 0x6a/j 1237 edit-trace t, 0x6a/j 1238 # hack: we do need to render to make this test pass; we're mixing state management with rendering -1239 var y/ecx: int <- render-trace screen, t, 0/xmin, 0/ymin, 0xa/xmax, 4/ymax, 1/show-cursor +1239 var y/ecx: int <- render-trace screen, t, 0/xmin, 0/ymin, 0xa/xmax, 4/ymax, 1/show-cursor 1240 # cursor clamps at bottom -1241 check-screen-row screen, 0/y, "... ", "F - test-cursor-down-past-bottom-of-trace/down-0" -1242 check-background-color-in-screen-row screen, 7/bg=cursor, 0/y, " ", "F - test-cursor-down-past-bottom-of-trace/down-0/cursor" -1243 check-screen-row screen, 1/y, "error ", "F - test-cursor-down-past-bottom-of-trace/down-1" -1244 check-background-color-in-screen-row screen, 7/bg=cursor, 1/y, " ", "F - test-cursor-down-past-bottom-of-trace/down-1/cursor" -1245 check-screen-row screen, 2/y, "... ", "F - test-cursor-down-past-bottom-of-trace/down-2" -1246 check-background-color-in-screen-row screen, 7/bg=cursor, 2/y, "||| ", "F - test-cursor-down-past-bottom-of-trace/down-2/cursor" +1241 check-screen-row screen, 0/y, "... ", "F - test-cursor-down-past-bottom-of-trace/down-0" +1242 check-background-color-in-screen-row screen, 7/bg=cursor, 0/y, " ", "F - test-cursor-down-past-bottom-of-trace/down-0/cursor" +1243 check-screen-row screen, 1/y, "error ", "F - test-cursor-down-past-bottom-of-trace/down-1" +1244 check-background-color-in-screen-row screen, 7/bg=cursor, 1/y, " ", "F - test-cursor-down-past-bottom-of-trace/down-1/cursor" +1245 check-screen-row screen, 2/y, "... ", "F - test-cursor-down-past-bottom-of-trace/down-2" +1246 check-background-color-in-screen-row screen, 7/bg=cursor, 2/y, "||| ", "F - test-cursor-down-past-bottom-of-trace/down-2/cursor" 1247 } 1248 1249 fn test-expand-within-trace { @@ -1319,26 +1319,26 @@ if ('onhashchange' in window) { 1254 trace-text t, "l", "line 1" 1255 trace-text t, "l", "line 2" 1256 # setup: screen -1257 var screen-on-stack: screen -1258 var screen/edi: (addr screen) <- address screen-on-stack -1259 initialize-screen screen, 0x10/width, 4/height, 0/no-pixel-graphics +1257 var screen-on-stack: screen +1258 var screen/edi: (addr screen) <- address screen-on-stack +1259 initialize-screen screen, 0x10/width, 4/height, 0/no-pixel-graphics 1260 # -1261 var y/ecx: int <- render-trace screen, t, 0/xmin, 0/ymin, 0x10/xmax, 4/ymax, 1/show-cursor +1261 var y/ecx: int <- render-trace screen, t, 0/xmin, 0/ymin, 0x10/xmax, 4/ymax, 1/show-cursor 1262 # -1263 check-screen-row screen, 0/y, "... ", "F - test-expand-within-trace/pre-0" -1264 check-background-color-in-screen-row screen, 7/bg=cursor, 0/y, "||| ", "F - test-expand-within-trace/pre-0/cursor" -1265 check-screen-row screen, 1/y, " ", "F - test-expand-within-trace/pre-1" -1266 check-background-color-in-screen-row screen, 7/bg=cursor, 1/y, " ", "F - test-expand-within-trace/pre-1/cursor" +1263 check-screen-row screen, 0/y, "... ", "F - test-expand-within-trace/pre-0" +1264 check-background-color-in-screen-row screen, 7/bg=cursor, 0/y, "||| ", "F - test-expand-within-trace/pre-0/cursor" +1265 check-screen-row screen, 1/y, " ", "F - test-expand-within-trace/pre-1" +1266 check-background-color-in-screen-row screen, 7/bg=cursor, 1/y, " ", "F - test-expand-within-trace/pre-1/cursor" 1267 # expand 1268 edit-trace t, 0xa/enter -1269 var y/ecx: int <- render-trace screen, t, 0/xmin, 0/ymin, 0x10/xmax, 4/ymax, 1/show-cursor +1269 var y/ecx: int <- render-trace screen, t, 0/xmin, 0/ymin, 0x10/xmax, 4/ymax, 1/show-cursor 1270 # -1271 check-screen-row screen, 0/y, "1 line 1 ", "F - test-expand-within-trace/expand-0" -1272 check-background-color-in-screen-row screen, 7/bg=cursor, 0/y, "|||||||| ", "F - test-expand-within-trace/expand-0/cursor" -1273 check-screen-row screen, 1/y, "1 line 2 ", "F - test-expand-within-trace/expand-1" -1274 check-background-color-in-screen-row screen, 7/bg=cursor, 1/y, " ", "F - test-expand-within-trace/expand-1/cursor" -1275 check-screen-row screen, 2/y, " ", "F - test-expand-within-trace/expand-2" -1276 check-background-color-in-screen-row screen, 7/bg=cursor, 2/y, " ", "F - test-expand-within-trace/expand-2/cursor" +1271 check-screen-row screen, 0/y, "1 line 1 ", "F - test-expand-within-trace/expand-0" +1272 check-background-color-in-screen-row screen, 7/bg=cursor, 0/y, "|||||||| ", "F - test-expand-within-trace/expand-0/cursor" +1273 check-screen-row screen, 1/y, "1 line 2 ", "F - test-expand-within-trace/expand-1" +1274 check-background-color-in-screen-row screen, 7/bg=cursor, 1/y, " ", "F - test-expand-within-trace/expand-1/cursor" +1275 check-screen-row screen, 2/y, " ", "F - test-expand-within-trace/expand-2" +1276 check-background-color-in-screen-row screen, 7/bg=cursor, 2/y, " ", "F - test-expand-within-trace/expand-2/cursor" 1277 } 1278 1279 fn test-trace-expand-skips-lower-depth { @@ -1350,26 +1350,26 @@ if ('onhashchange' in window) { 1285 trace-lower t 1286 trace-text t, "l", "line 2" 1287 # setup: screen -1288 var screen-on-stack: screen -1289 var screen/edi: (addr screen) <- address screen-on-stack -1290 initialize-screen screen, 0x10/width, 4/height, 0/no-pixel-graphics +1288 var screen-on-stack: screen +1289 var screen/edi: (addr screen) <- address screen-on-stack +1290 initialize-screen screen, 0x10/width, 4/height, 0/no-pixel-graphics 1291 # -1292 var y/ecx: int <- render-trace screen, t, 0/xmin, 0/ymin, 0x10/xmax, 4/ymax, 1/show-cursor +1292 var y/ecx: int <- render-trace screen, t, 0/xmin, 0/ymin, 0x10/xmax, 4/ymax, 1/show-cursor 1293 # -1294 check-screen-row screen, 0/y, "... ", "F - test-trace-expand-skips-lower-depth/pre-0" -1295 check-background-color-in-screen-row screen, 7/bg=cursor, 0/y, "||| ", "F - test-trace-expand-skips-lower-depth/pre-0/cursor" -1296 check-screen-row screen, 1/y, " ", "F - test-trace-expand-skips-lower-depth/pre-1" -1297 check-background-color-in-screen-row screen, 7/bg=cursor, 1/y, " ", "F - test-trace-expand-skips-lower-depth/pre-1/cursor" +1294 check-screen-row screen, 0/y, "... ", "F - test-trace-expand-skips-lower-depth/pre-0" +1295 check-background-color-in-screen-row screen, 7/bg=cursor, 0/y, "||| ", "F - test-trace-expand-skips-lower-depth/pre-0/cursor" +1296 check-screen-row screen, 1/y, " ", "F - test-trace-expand-skips-lower-depth/pre-1" +1297 check-background-color-in-screen-row screen, 7/bg=cursor, 1/y, " ", "F - test-trace-expand-skips-lower-depth/pre-1/cursor" 1298 # expand 1299 edit-trace t, 0xa/enter -1300 var y/ecx: int <- render-trace screen, t, 0/xmin, 0/ymin, 0x10/xmax, 4/ymax, 1/show-cursor +1300 var y/ecx: int <- render-trace screen, t, 0/xmin, 0/ymin, 0x10/xmax, 4/ymax, 1/show-cursor 1301 # -1302 check-screen-row screen, 0/y, "1 line 1 ", "F - test-trace-expand-skips-lower-depth/expand-0" -1303 check-background-color-in-screen-row screen, 7/bg=cursor, 0/y, "|||||||| ", "F - test-trace-expand-skips-lower-depth/expand-0/cursor" -1304 check-screen-row screen, 1/y, "... ", "F - test-trace-expand-skips-lower-depth/expand-1" -1305 check-background-color-in-screen-row screen, 7/bg=cursor, 1/y, " ", "F - test-trace-expand-skips-lower-depth/expand-1/cursor" -1306 check-screen-row screen, 2/y, " ", "F - test-trace-expand-skips-lower-depth/expand-2" -1307 check-background-color-in-screen-row screen, 7/bg=cursor, 2/y, " ", "F - test-trace-expand-skips-lower-depth/expand-2/cursor" +1302 check-screen-row screen, 0/y, "1 line 1 ", "F - test-trace-expand-skips-lower-depth/expand-0" +1303 check-background-color-in-screen-row screen, 7/bg=cursor, 0/y, "|||||||| ", "F - test-trace-expand-skips-lower-depth/expand-0/cursor" +1304 check-screen-row screen, 1/y, "... ", "F - test-trace-expand-skips-lower-depth/expand-1" +1305 check-background-color-in-screen-row screen, 7/bg=cursor, 1/y, " ", "F - test-trace-expand-skips-lower-depth/expand-1/cursor" +1306 check-screen-row screen, 2/y, " ", "F - test-trace-expand-skips-lower-depth/expand-2" +1307 check-background-color-in-screen-row screen, 7/bg=cursor, 2/y, " ", "F - test-trace-expand-skips-lower-depth/expand-2/cursor" 1308 } 1309 1310 fn test-trace-expand-continues-past-lower-depth { @@ -1383,27 +1383,27 @@ if ('onhashchange' in window) { 1318 trace-higher t 1319 trace-text t, "l", "line 2" 1320 # setup: screen -1321 var screen-on-stack: screen -1322 var screen/edi: (addr screen) <- address screen-on-stack -1323 initialize-screen screen, 0x10/width, 4/height, 0/no-pixel-graphics +1321 var screen-on-stack: screen +1322 var screen/edi: (addr screen) <- address screen-on-stack +1323 initialize-screen screen, 0x10/width, 4/height, 0/no-pixel-graphics 1324 # -1325 var y/ecx: int <- render-trace screen, t, 0/xmin, 0/ymin, 0x10/xmax, 4/ymax, 1/show-cursor +1325 var y/ecx: int <- render-trace screen, t, 0/xmin, 0/ymin, 0x10/xmax, 4/ymax, 1/show-cursor 1326 # -1327 check-screen-row screen, 0/y, "... ", "F - test-trace-expand-continues-past-lower-depth/pre-0" -1328 check-background-color-in-screen-row screen, 7/bg=cursor, 0/y, "||| ", "F - test-trace-expand-continues-past-lower-depth/pre-0/cursor" -1329 check-screen-row screen, 1/y, " ", "F - test-trace-expand-continues-past-lower-depth/pre-1" -1330 check-background-color-in-screen-row screen, 7/bg=cursor, 1/y, " ", "F - test-trace-expand-continues-past-lower-depth/pre-1/cursor" +1327 check-screen-row screen, 0/y, "... ", "F - test-trace-expand-continues-past-lower-depth/pre-0" +1328 check-background-color-in-screen-row screen, 7/bg=cursor, 0/y, "||| ", "F - test-trace-expand-continues-past-lower-depth/pre-0/cursor" +1329 check-screen-row screen, 1/y, " ", "F - test-trace-expand-continues-past-lower-depth/pre-1" +1330 check-background-color-in-screen-row screen, 7/bg=cursor, 1/y, " ", "F - test-trace-expand-continues-past-lower-depth/pre-1/cursor" 1331 # expand 1332 edit-trace t, 0xa/enter -1333 var y/ecx: int <- render-trace screen, t, 0/xmin, 0/ymin, 0x10/xmax, 4/ymax, 1/show-cursor +1333 var y/ecx: int <- render-trace screen, t, 0/xmin, 0/ymin, 0x10/xmax, 4/ymax, 1/show-cursor 1334 # -1335 check-screen-row screen, 0/y, "1 line 1 ", "F - test-trace-expand-continues-past-lower-depth/expand-0" -1336 check-background-color-in-screen-row screen, 7/bg=cursor, 0/y, "|||||||| ", "F - test-trace-expand-continues-past-lower-depth/expand-0/cursor" +1335 check-screen-row screen, 0/y, "1 line 1 ", "F - test-trace-expand-continues-past-lower-depth/expand-0" +1336 check-background-color-in-screen-row screen, 7/bg=cursor, 0/y, "|||||||| ", "F - test-trace-expand-continues-past-lower-depth/expand-0/cursor" 1337 # TODO: might be too wasteful to show every place where lines are hidden -1338 check-screen-row screen, 1/y, "... ", "F - test-trace-expand-continues-past-lower-depth/expand-1" -1339 check-background-color-in-screen-row screen, 7/bg=cursor, 1/y, " ", "F - test-trace-expand-continues-past-lower-depth/expand-1/cursor" -1340 check-screen-row screen, 2/y, "1 line 2 ", "F - test-trace-expand-continues-past-lower-depth/expand-2" -1341 check-background-color-in-screen-row screen, 7/bg=cursor, 2/y, " ", "F - test-trace-expand-continues-past-lower-depth/expand-2/cursor" +1338 check-screen-row screen, 1/y, "... ", "F - test-trace-expand-continues-past-lower-depth/expand-1" +1339 check-background-color-in-screen-row screen, 7/bg=cursor, 1/y, " ", "F - test-trace-expand-continues-past-lower-depth/expand-1/cursor" +1340 check-screen-row screen, 2/y, "1 line 2 ", "F - test-trace-expand-continues-past-lower-depth/expand-2" +1341 check-background-color-in-screen-row screen, 7/bg=cursor, 2/y, " ", "F - test-trace-expand-continues-past-lower-depth/expand-2/cursor" 1342 } 1343 1344 fn test-trace-expand-stops-at-higher-depth { @@ -1422,30 +1422,30 @@ if ('onhashchange' in window) { 1357 trace-lower t 1358 trace-text t, "l", "line 2.1" 1359 # setup: screen -1360 var screen-on-stack: screen -1361 var screen/edi: (addr screen) <- address screen-on-stack -1362 initialize-screen screen, 0x10/width, 8/height, 0/no-pixel-graphics +1360 var screen-on-stack: screen +1361 var screen/edi: (addr screen) <- address screen-on-stack +1362 initialize-screen screen, 0x10/width, 8/height, 0/no-pixel-graphics 1363 # -1364 var y/ecx: int <- render-trace screen, t, 0/xmin, 0/ymin, 0x10/xmax, 8/ymax, 1/show-cursor +1364 var y/ecx: int <- render-trace screen, t, 0/xmin, 0/ymin, 0x10/xmax, 8/ymax, 1/show-cursor 1365 # -1366 check-screen-row screen, 0/y, "... ", "F - test-trace-expand-stops-at-higher-depth/pre-0" -1367 check-background-color-in-screen-row screen, 7/bg=cursor, 0/y, "||| ", "F - test-trace-expand-stops-at-higher-depth/pre-0/cursor" -1368 check-screen-row screen, 1/y, " ", "F - test-trace-expand-stops-at-higher-depth/pre-1" -1369 check-background-color-in-screen-row screen, 7/bg=cursor, 1/y, " ", "F - test-trace-expand-stops-at-higher-depth/pre-1/cursor" +1366 check-screen-row screen, 0/y, "... ", "F - test-trace-expand-stops-at-higher-depth/pre-0" +1367 check-background-color-in-screen-row screen, 7/bg=cursor, 0/y, "||| ", "F - test-trace-expand-stops-at-higher-depth/pre-0/cursor" +1368 check-screen-row screen, 1/y, " ", "F - test-trace-expand-stops-at-higher-depth/pre-1" +1369 check-background-color-in-screen-row screen, 7/bg=cursor, 1/y, " ", "F - test-trace-expand-stops-at-higher-depth/pre-1/cursor" 1370 # expand 1371 edit-trace t, 0xa/enter -1372 var y/ecx: int <- render-trace screen, t, 0/xmin, 0/ymin, 0x10/xmax, 8/ymax, 1/show-cursor +1372 var y/ecx: int <- render-trace screen, t, 0/xmin, 0/ymin, 0x10/xmax, 8/ymax, 1/show-cursor 1373 # -1374 check-screen-row screen, 0/y, "2 line 1.1 ", "F - test-trace-expand-stops-at-higher-depth/expand-0" -1375 check-background-color-in-screen-row screen, 7/bg=cursor, 0/y, "|||||||||| ", "F - test-trace-expand-stops-at-higher-depth/expand-0/cursor" -1376 check-screen-row screen, 1/y, "... ", "F - test-trace-expand-stops-at-higher-depth/expand-1" -1377 check-background-color-in-screen-row screen, 7/bg=cursor, 1/y, " ", "F - test-trace-expand-stops-at-higher-depth/expand-1/cursor" -1378 check-screen-row screen, 2/y, "2 line 1.2 ", "F - test-trace-expand-stops-at-higher-depth/expand-2" -1379 check-background-color-in-screen-row screen, 7/bg=cursor, 2/y, " ", "F - test-trace-expand-stops-at-higher-depth/expand-2/cursor" -1380 check-screen-row screen, 3/y, "... ", "F - test-trace-expand-stops-at-higher-depth/expand-3" -1381 check-background-color-in-screen-row screen, 7/bg=cursor, 3/y, " ", "F - test-trace-expand-stops-at-higher-depth/expand-3/cursor" -1382 check-screen-row screen, 4/y, " ", "F - test-trace-expand-stops-at-higher-depth/expand-4" -1383 check-background-color-in-screen-row screen, 7/bg=cursor, 4/y, " ", "F - test-trace-expand-stops-at-higher-depth/expand-4/cursor" +1374 check-screen-row screen, 0/y, "2 line 1.1 ", "F - test-trace-expand-stops-at-higher-depth/expand-0" +1375 check-background-color-in-screen-row screen, 7/bg=cursor, 0/y, "|||||||||| ", "F - test-trace-expand-stops-at-higher-depth/expand-0/cursor" +1376 check-screen-row screen, 1/y, "... ", "F - test-trace-expand-stops-at-higher-depth/expand-1" +1377 check-background-color-in-screen-row screen, 7/bg=cursor, 1/y, " ", "F - test-trace-expand-stops-at-higher-depth/expand-1/cursor" +1378 check-screen-row screen, 2/y, "2 line 1.2 ", "F - test-trace-expand-stops-at-higher-depth/expand-2" +1379 check-background-color-in-screen-row screen, 7/bg=cursor, 2/y, " ", "F - test-trace-expand-stops-at-higher-depth/expand-2/cursor" +1380 check-screen-row screen, 3/y, "... ", "F - test-trace-expand-stops-at-higher-depth/expand-3" +1381 check-background-color-in-screen-row screen, 7/bg=cursor, 3/y, " ", "F - test-trace-expand-stops-at-higher-depth/expand-3/cursor" +1382 check-screen-row screen, 4/y, " ", "F - test-trace-expand-stops-at-higher-depth/expand-4" +1383 check-background-color-in-screen-row screen, 7/bg=cursor, 4/y, " ", "F - test-trace-expand-stops-at-higher-depth/expand-4/cursor" 1384 } 1385 1386 fn test-trace-expand-twice { @@ -1459,47 +1459,47 @@ if ('onhashchange' in window) { 1394 trace-higher t 1395 trace-text t, "l", "line 2" 1396 # setup: screen -1397 var screen-on-stack: screen -1398 var screen/edi: (addr screen) <- address screen-on-stack -1399 initialize-screen screen, 0x10/width, 4/height, 0/no-pixel-graphics +1397 var screen-on-stack: screen +1398 var screen/edi: (addr screen) <- address screen-on-stack +1399 initialize-screen screen, 0x10/width, 4/height, 0/no-pixel-graphics 1400 # -1401 var y/ecx: int <- render-trace screen, t, 0/xmin, 0/ymin, 0x10/xmax, 4/ymax, 1/show-cursor +1401 var y/ecx: int <- render-trace screen, t, 0/xmin, 0/ymin, 0x10/xmax, 4/ymax, 1/show-cursor 1402 # -1403 check-screen-row screen, 0/y, "... ", "F - test-trace-expand-twice/pre-0" -1404 check-background-color-in-screen-row screen, 7/bg=cursor, 0/y, "||| ", "F - test-trace-expand-twice/pre-0/cursor" -1405 check-screen-row screen, 1/y, " ", "F - test-trace-expand-twice/pre-1" -1406 check-background-color-in-screen-row screen, 7/bg=cursor, 1/y, " ", "F - test-trace-expand-twice/pre-1/cursor" +1403 check-screen-row screen, 0/y, "... ", "F - test-trace-expand-twice/pre-0" +1404 check-background-color-in-screen-row screen, 7/bg=cursor, 0/y, "||| ", "F - test-trace-expand-twice/pre-0/cursor" +1405 check-screen-row screen, 1/y, " ", "F - test-trace-expand-twice/pre-1" +1406 check-background-color-in-screen-row screen, 7/bg=cursor, 1/y, " ", "F - test-trace-expand-twice/pre-1/cursor" 1407 # expand 1408 edit-trace t, 0xa/enter -1409 var y/ecx: int <- render-trace screen, t, 0/xmin, 0/ymin, 0x10/xmax, 4/ymax, 1/show-cursor +1409 var y/ecx: int <- render-trace screen, t, 0/xmin, 0/ymin, 0x10/xmax, 4/ymax, 1/show-cursor 1410 # -1411 check-screen-row screen, 0/y, "1 line 1 ", "F - test-trace-expand-twice/expand-0" -1412 check-background-color-in-screen-row screen, 7/bg=cursor, 0/y, "|||||||| ", "F - test-trace-expand-twice/expand-0/cursor" -1413 check-screen-row screen, 1/y, "... ", "F - test-trace-expand-twice/expand-1" -1414 check-background-color-in-screen-row screen, 7/bg=cursor, 1/y, " ", "F - test-trace-expand-twice/expand-1/cursor" -1415 check-screen-row screen, 2/y, "1 line 2 ", "F - test-trace-expand-twice/expand-2" -1416 check-background-color-in-screen-row screen, 7/bg=cursor, 2/y, " ", "F - test-trace-expand-twice/expand-2/cursor" +1411 check-screen-row screen, 0/y, "1 line 1 ", "F - test-trace-expand-twice/expand-0" +1412 check-background-color-in-screen-row screen, 7/bg=cursor, 0/y, "|||||||| ", "F - test-trace-expand-twice/expand-0/cursor" +1413 check-screen-row screen, 1/y, "... ", "F - test-trace-expand-twice/expand-1" +1414 check-background-color-in-screen-row screen, 7/bg=cursor, 1/y, " ", "F - test-trace-expand-twice/expand-1/cursor" +1415 check-screen-row screen, 2/y, "1 line 2 ", "F - test-trace-expand-twice/expand-2" +1416 check-background-color-in-screen-row screen, 7/bg=cursor, 2/y, " ", "F - test-trace-expand-twice/expand-2/cursor" 1417 # cursor down 1418 edit-trace t, 0x6a/j 1419 # hack: we need to render here to make this test pass; we're mixing state management with rendering -1420 var y/ecx: int <- render-trace screen, t, 0/xmin, 0/ymin, 0x10/xmax, 4/ymax, 1/show-cursor +1420 var y/ecx: int <- render-trace screen, t, 0/xmin, 0/ymin, 0x10/xmax, 4/ymax, 1/show-cursor 1421 # -1422 check-screen-row screen, 0/y, "1 line 1 ", "F - test-trace-expand-twice/down-0" -1423 check-background-color-in-screen-row screen, 7/bg=cursor, 0/y, " ", "F - test-trace-expand-twice/down-0/cursor" -1424 check-screen-row screen, 1/y, "... ", "F - test-trace-expand-twice/down-1" -1425 check-background-color-in-screen-row screen, 7/bg=cursor, 1/y, "||| ", "F - test-trace-expand-twice/down-1/cursor" -1426 check-screen-row screen, 2/y, "1 line 2 ", "F - test-trace-expand-twice/down-2" -1427 check-background-color-in-screen-row screen, 7/bg=cursor, 2/y, " ", "F - test-trace-expand-twice/down-2/cursor" +1422 check-screen-row screen, 0/y, "1 line 1 ", "F - test-trace-expand-twice/down-0" +1423 check-background-color-in-screen-row screen, 7/bg=cursor, 0/y, " ", "F - test-trace-expand-twice/down-0/cursor" +1424 check-screen-row screen, 1/y, "... ", "F - test-trace-expand-twice/down-1" +1425 check-background-color-in-screen-row screen, 7/bg=cursor, 1/y, "||| ", "F - test-trace-expand-twice/down-1/cursor" +1426 check-screen-row screen, 2/y, "1 line 2 ", "F - test-trace-expand-twice/down-2" +1427 check-background-color-in-screen-row screen, 7/bg=cursor, 2/y, " ", "F - test-trace-expand-twice/down-2/cursor" 1428 # expand again 1429 edit-trace t, 0xa/enter -1430 var y/ecx: int <- render-trace screen, t, 0/xmin, 0/ymin, 0x10/xmax, 4/ymax, 1/show-cursor +1430 var y/ecx: int <- render-trace screen, t, 0/xmin, 0/ymin, 0x10/xmax, 4/ymax, 1/show-cursor 1431 # -1432 check-screen-row screen, 0/y, "1 line 1 ", "F - test-trace-expand-twice/expand2-0" -1433 check-background-color-in-screen-row screen, 7/bg=cursor, 0/y, " ", "F - test-trace-expand-twice/expand2-0/cursor" -1434 check-screen-row screen, 1/y, "2 line 1.1 ", "F - test-trace-expand-twice/expand2-1" -1435 check-background-color-in-screen-row screen, 7/bg=cursor, 1/y, "|||||||||| ", "F - test-trace-expand-twice/expand2-1/cursor" -1436 check-screen-row screen, 2/y, "1 line 2 ", "F - test-trace-expand-twice/expand2-2" -1437 check-background-color-in-screen-row screen, 7/bg=cursor, 2/y, " ", "F - test-trace-expand-twice/expand2-2/cursor" +1432 check-screen-row screen, 0/y, "1 line 1 ", "F - test-trace-expand-twice/expand2-0" +1433 check-background-color-in-screen-row screen, 7/bg=cursor, 0/y, " ", "F - test-trace-expand-twice/expand2-0/cursor" +1434 check-screen-row screen, 1/y, "2 line 1.1 ", "F - test-trace-expand-twice/expand2-1" +1435 check-background-color-in-screen-row screen, 7/bg=cursor, 1/y, "|||||||||| ", "F - test-trace-expand-twice/expand2-1/cursor" +1436 check-screen-row screen, 2/y, "1 line 2 ", "F - test-trace-expand-twice/expand2-2" +1437 check-background-color-in-screen-row screen, 7/bg=cursor, 2/y, " ", "F - test-trace-expand-twice/expand2-2/cursor" 1438 } 1439 1440 fn test-trace-refresh-cursor { @@ -1511,50 +1511,50 @@ if ('onhashchange' in window) { 1446 trace-text t, "l", "line 2" 1447 trace-text t, "l", "line 3" 1448 # setup: screen -1449 var screen-on-stack: screen -1450 var screen/edi: (addr screen) <- address screen-on-stack -1451 initialize-screen screen, 0x10/width, 4/height, 0/no-pixel-graphics +1449 var screen-on-stack: screen +1450 var screen/edi: (addr screen) <- address screen-on-stack +1451 initialize-screen screen, 0x10/width, 4/height, 0/no-pixel-graphics 1452 # -1453 var y/ecx: int <- render-trace screen, t, 0/xmin, 0/ymin, 0x10/xmax, 4/ymax, 1/show-cursor +1453 var y/ecx: int <- render-trace screen, t, 0/xmin, 0/ymin, 0x10/xmax, 4/ymax, 1/show-cursor 1454 # -1455 check-screen-row screen, 0/y, "... ", "F - test-trace-refresh-cursor/pre-0" -1456 check-background-color-in-screen-row screen, 7/bg=cursor, 0/y, "||| ", "F - test-trace-refresh-cursor/pre-0/cursor" -1457 check-screen-row screen, 1/y, " ", "F - test-trace-refresh-cursor/pre-1" -1458 check-background-color-in-screen-row screen, 7/bg=cursor, 1/y, " ", "F - test-trace-refresh-cursor/pre-1/cursor" +1455 check-screen-row screen, 0/y, "... ", "F - test-trace-refresh-cursor/pre-0" +1456 check-background-color-in-screen-row screen, 7/bg=cursor, 0/y, "||| ", "F - test-trace-refresh-cursor/pre-0/cursor" +1457 check-screen-row screen, 1/y, " ", "F - test-trace-refresh-cursor/pre-1" +1458 check-background-color-in-screen-row screen, 7/bg=cursor, 1/y, " ", "F - test-trace-refresh-cursor/pre-1/cursor" 1459 # expand 1460 edit-trace t, 0xa/enter -1461 var y/ecx: int <- render-trace screen, t, 0/xmin, 0/ymin, 0x10/xmax, 4/ymax, 1/show-cursor +1461 var y/ecx: int <- render-trace screen, t, 0/xmin, 0/ymin, 0x10/xmax, 4/ymax, 1/show-cursor 1462 # -1463 check-screen-row screen, 0/y, "1 line 1 ", "F - test-trace-refresh-cursor/expand-0" -1464 check-background-color-in-screen-row screen, 7/bg=cursor, 0/y, "|||||||| ", "F - test-trace-refresh-cursor/expand-0/cursor" -1465 check-screen-row screen, 1/y, "1 line 2 ", "F - test-trace-refresh-cursor/expand-1" -1466 check-background-color-in-screen-row screen, 7/bg=cursor, 1/y, " ", "F - test-trace-refresh-cursor/expand-1/cursor" -1467 check-screen-row screen, 2/y, "1 line 3 ", "F - test-trace-refresh-cursor/expand-2" -1468 check-background-color-in-screen-row screen, 7/bg=cursor, 2/y, " ", "F - test-trace-refresh-cursor/expand-2/cursor" +1463 check-screen-row screen, 0/y, "1 line 1 ", "F - test-trace-refresh-cursor/expand-0" +1464 check-background-color-in-screen-row screen, 7/bg=cursor, 0/y, "|||||||| ", "F - test-trace-refresh-cursor/expand-0/cursor" +1465 check-screen-row screen, 1/y, "1 line 2 ", "F - test-trace-refresh-cursor/expand-1" +1466 check-background-color-in-screen-row screen, 7/bg=cursor, 1/y, " ", "F - test-trace-refresh-cursor/expand-1/cursor" +1467 check-screen-row screen, 2/y, "1 line 3 ", "F - test-trace-refresh-cursor/expand-2" +1468 check-background-color-in-screen-row screen, 7/bg=cursor, 2/y, " ", "F - test-trace-refresh-cursor/expand-2/cursor" 1469 # cursor down 1470 edit-trace t, 0x6a/j 1471 edit-trace t, 0x6a/j -1472 var y/ecx: int <- render-trace screen, t, 0/xmin, 0/ymin, 0x10/xmax, 4/ymax, 1/show-cursor +1472 var y/ecx: int <- render-trace screen, t, 0/xmin, 0/ymin, 0x10/xmax, 4/ymax, 1/show-cursor 1473 # -1474 check-screen-row screen, 0/y, "1 line 1 ", "F - test-trace-refresh-cursor/down-0" -1475 check-background-color-in-screen-row screen, 7/bg=cursor, 0/y, " ", "F - test-trace-refresh-cursor/down-0/cursor" -1476 check-screen-row screen, 1/y, "1 line 2 ", "F - test-trace-refresh-cursor/down-1" -1477 check-background-color-in-screen-row screen, 7/bg=cursor, 1/y, " ", "F - test-trace-refresh-cursor/down-1/cursor" -1478 check-screen-row screen, 2/y, "1 line 3 ", "F - test-trace-refresh-cursor/down-2" -1479 check-background-color-in-screen-row screen, 7/bg=cursor, 2/y, "|||||||| ", "F - test-trace-refresh-cursor/down-2/cursor" +1474 check-screen-row screen, 0/y, "1 line 1 ", "F - test-trace-refresh-cursor/down-0" +1475 check-background-color-in-screen-row screen, 7/bg=cursor, 0/y, " ", "F - test-trace-refresh-cursor/down-0/cursor" +1476 check-screen-row screen, 1/y, "1 line 2 ", "F - test-trace-refresh-cursor/down-1" +1477 check-background-color-in-screen-row screen, 7/bg=cursor, 1/y, " ", "F - test-trace-refresh-cursor/down-1/cursor" +1478 check-screen-row screen, 2/y, "1 line 3 ", "F - test-trace-refresh-cursor/down-2" +1479 check-background-color-in-screen-row screen, 7/bg=cursor, 2/y, "|||||||| ", "F - test-trace-refresh-cursor/down-2/cursor" 1480 # recreate trace 1481 clear-trace t 1482 trace-text t, "l", "line 1" 1483 trace-text t, "l", "line 2" 1484 trace-text t, "l", "line 3" -1485 var y/ecx: int <- render-trace screen, t, 0/xmin, 0/ymin, 0x10/xmax, 4/ymax, 1/show-cursor +1485 var y/ecx: int <- render-trace screen, t, 0/xmin, 0/ymin, 0x10/xmax, 4/ymax, 1/show-cursor 1486 # cursor remains unchanged -1487 check-screen-row screen, 0/y, "1 line 1 ", "F - test-trace-refresh-cursor/refresh-0" -1488 check-background-color-in-screen-row screen, 7/bg=cursor, 0/y, " ", "F - test-trace-refresh-cursor/refresh-0/cursor" -1489 check-screen-row screen, 1/y, "1 line 2 ", "F - test-trace-refresh-cursor/refresh-1" -1490 check-background-color-in-screen-row screen, 7/bg=cursor, 1/y, " ", "F - test-trace-refresh-cursor/refresh-1/cursor" -1491 check-screen-row screen, 2/y, "1 line 3 ", "F - test-trace-refresh-cursor/refresh-2" -1492 check-background-color-in-screen-row screen, 7/bg=cursor, 2/y, "|||||||| ", "F - test-trace-refresh-cursor/refresh-2/cursor" +1487 check-screen-row screen, 0/y, "1 line 1 ", "F - test-trace-refresh-cursor/refresh-0" +1488 check-background-color-in-screen-row screen, 7/bg=cursor, 0/y, " ", "F - test-trace-refresh-cursor/refresh-0/cursor" +1489 check-screen-row screen, 1/y, "1 line 2 ", "F - test-trace-refresh-cursor/refresh-1" +1490 check-background-color-in-screen-row screen, 7/bg=cursor, 1/y, " ", "F - test-trace-refresh-cursor/refresh-1/cursor" +1491 check-screen-row screen, 2/y, "1 line 3 ", "F - test-trace-refresh-cursor/refresh-2" +1492 check-background-color-in-screen-row screen, 7/bg=cursor, 2/y, "|||||||| ", "F - test-trace-refresh-cursor/refresh-2/cursor" 1493 } 1494 1495 fn test-trace-preserve-cursor-on-refresh { @@ -1566,50 +1566,50 @@ if ('onhashchange' in window) { 1501 trace-text t, "l", "line 2" 1502 trace-text t, "l", "line 3" 1503 # setup: screen -1504 var screen-on-stack: screen -1505 var screen/edi: (addr screen) <- address screen-on-stack -1506 initialize-screen screen, 0x10/width, 4/height, 0/no-pixel-graphics +1504 var screen-on-stack: screen +1505 var screen/edi: (addr screen) <- address screen-on-stack +1506 initialize-screen screen, 0x10/width, 4/height, 0/no-pixel-graphics 1507 # -1508 var y/ecx: int <- render-trace screen, t, 0/xmin, 0/ymin, 0x10/xmax, 4/ymax, 1/show-cursor +1508 var y/ecx: int <- render-trace screen, t, 0/xmin, 0/ymin, 0x10/xmax, 4/ymax, 1/show-cursor 1509 # -1510 check-screen-row screen, 0/y, "... ", "F - test-trace-preserve-cursor-on-refresh/pre-0" -1511 check-background-color-in-screen-row screen, 7/bg=cursor, 0/y, "||| ", "F - test-trace-preserve-cursor-on-refresh/pre-0/cursor" -1512 check-screen-row screen, 1/y, " ", "F - test-trace-preserve-cursor-on-refresh/pre-1" -1513 check-background-color-in-screen-row screen, 7/bg=cursor, 1/y, " ", "F - test-trace-preserve-cursor-on-refresh/pre-1/cursor" +1510 check-screen-row screen, 0/y, "... ", "F - test-trace-preserve-cursor-on-refresh/pre-0" +1511 check-background-color-in-screen-row screen, 7/bg=cursor, 0/y, "||| ", "F - test-trace-preserve-cursor-on-refresh/pre-0/cursor" +1512 check-screen-row screen, 1/y, " ", "F - test-trace-preserve-cursor-on-refresh/pre-1" +1513 check-background-color-in-screen-row screen, 7/bg=cursor, 1/y, " ", "F - test-trace-preserve-cursor-on-refresh/pre-1/cursor" 1514 # expand 1515 edit-trace t, 0xa/enter -1516 var y/ecx: int <- render-trace screen, t, 0/xmin, 0/ymin, 0x10/xmax, 4/ymax, 1/show-cursor +1516 var y/ecx: int <- render-trace screen, t, 0/xmin, 0/ymin, 0x10/xmax, 4/ymax, 1/show-cursor 1517 # -1518 check-screen-row screen, 0/y, "1 line 1 ", "F - test-trace-preserve-cursor-on-refresh/expand-0" -1519 check-background-color-in-screen-row screen, 7/bg=cursor, 0/y, "|||||||| ", "F - test-trace-preserve-cursor-on-refresh/expand-0/cursor" -1520 check-screen-row screen, 1/y, "1 line 2 ", "F - test-trace-preserve-cursor-on-refresh/expand-1" -1521 check-background-color-in-screen-row screen, 7/bg=cursor, 1/y, " ", "F - test-trace-preserve-cursor-on-refresh/expand-1/cursor" -1522 check-screen-row screen, 2/y, "1 line 3 ", "F - test-trace-preserve-cursor-on-refresh/expand-2" -1523 check-background-color-in-screen-row screen, 7/bg=cursor, 2/y, " ", "F - test-trace-preserve-cursor-on-refresh/expand-2/cursor" +1518 check-screen-row screen, 0/y, "1 line 1 ", "F - test-trace-preserve-cursor-on-refresh/expand-0" +1519 check-background-color-in-screen-row screen, 7/bg=cursor, 0/y, "|||||||| ", "F - test-trace-preserve-cursor-on-refresh/expand-0/cursor" +1520 check-screen-row screen, 1/y, "1 line 2 ", "F - test-trace-preserve-cursor-on-refresh/expand-1" +1521 check-background-color-in-screen-row screen, 7/bg=cursor, 1/y, " ", "F - test-trace-preserve-cursor-on-refresh/expand-1/cursor" +1522 check-screen-row screen, 2/y, "1 line 3 ", "F - test-trace-preserve-cursor-on-refresh/expand-2" +1523 check-background-color-in-screen-row screen, 7/bg=cursor, 2/y, " ", "F - test-trace-preserve-cursor-on-refresh/expand-2/cursor" 1524 # cursor down 1525 edit-trace t, 0x6a/j 1526 edit-trace t, 0x6a/j -1527 var y/ecx: int <- render-trace screen, t, 0/xmin, 0/ymin, 0x10/xmax, 4/ymax, 1/show-cursor +1527 var y/ecx: int <- render-trace screen, t, 0/xmin, 0/ymin, 0x10/xmax, 4/ymax, 1/show-cursor 1528 # -1529 check-screen-row screen, 0/y, "1 line 1 ", "F - test-trace-preserve-cursor-on-refresh/down-0" -1530 check-background-color-in-screen-row screen, 7/bg=cursor, 0/y, " ", "F - test-trace-preserve-cursor-on-refresh/down-0/cursor" -1531 check-screen-row screen, 1/y, "1 line 2 ", "F - test-trace-preserve-cursor-on-refresh/down-1" -1532 check-background-color-in-screen-row screen, 7/bg=cursor, 1/y, " ", "F - test-trace-preserve-cursor-on-refresh/down-1/cursor" -1533 check-screen-row screen, 2/y, "1 line 3 ", "F - test-trace-preserve-cursor-on-refresh/down-2" -1534 check-background-color-in-screen-row screen, 7/bg=cursor, 2/y, "|||||||| ", "F - test-trace-preserve-cursor-on-refresh/down-2/cursor" +1529 check-screen-row screen, 0/y, "1 line 1 ", "F - test-trace-preserve-cursor-on-refresh/down-0" +1530 check-background-color-in-screen-row screen, 7/bg=cursor, 0/y, " ", "F - test-trace-preserve-cursor-on-refresh/down-0/cursor" +1531 check-screen-row screen, 1/y, "1 line 2 ", "F - test-trace-preserve-cursor-on-refresh/down-1" +1532 check-background-color-in-screen-row screen, 7/bg=cursor, 1/y, " ", "F - test-trace-preserve-cursor-on-refresh/down-1/cursor" +1533 check-screen-row screen, 2/y, "1 line 3 ", "F - test-trace-preserve-cursor-on-refresh/down-2" +1534 check-background-color-in-screen-row screen, 7/bg=cursor, 2/y, "|||||||| ", "F - test-trace-preserve-cursor-on-refresh/down-2/cursor" 1535 # recreate trace with slightly different lines 1536 clear-trace t 1537 trace-text t, "l", "line 4" 1538 trace-text t, "l", "line 5" 1539 trace-text t, "l", "line 3" # cursor line is unchanged -1540 var y/ecx: int <- render-trace screen, t, 0/xmin, 0/ymin, 0x10/xmax, 4/ymax, 1/show-cursor +1540 var y/ecx: int <- render-trace screen, t, 0/xmin, 0/ymin, 0x10/xmax, 4/ymax, 1/show-cursor 1541 # cursor remains unchanged -1542 check-screen-row screen, 0/y, "1 line 4 ", "F - test-trace-preserve-cursor-on-refresh/refresh-0" -1543 check-background-color-in-screen-row screen, 7/bg=cursor, 0/y, " ", "F - test-trace-preserve-cursor-on-refresh/refresh-0/cursor" -1544 check-screen-row screen, 1/y, "1 line 5 ", "F - test-trace-preserve-cursor-on-refresh/refresh-1" -1545 check-background-color-in-screen-row screen, 7/bg=cursor, 1/y, " ", "F - test-trace-preserve-cursor-on-refresh/refresh-1/cursor" -1546 check-screen-row screen, 2/y, "1 line 3 ", "F - test-trace-preserve-cursor-on-refresh/refresh-2" -1547 check-background-color-in-screen-row screen, 7/bg=cursor, 2/y, "|||||||| ", "F - test-trace-preserve-cursor-on-refresh/refresh-2/cursor" +1542 check-screen-row screen, 0/y, "1 line 4 ", "F - test-trace-preserve-cursor-on-refresh/refresh-0" +1543 check-background-color-in-screen-row screen, 7/bg=cursor, 0/y, " ", "F - test-trace-preserve-cursor-on-refresh/refresh-0/cursor" +1544 check-screen-row screen, 1/y, "1 line 5 ", "F - test-trace-preserve-cursor-on-refresh/refresh-1" +1545 check-background-color-in-screen-row screen, 7/bg=cursor, 1/y, " ", "F - test-trace-preserve-cursor-on-refresh/refresh-1/cursor" +1546 check-screen-row screen, 2/y, "1 line 3 ", "F - test-trace-preserve-cursor-on-refresh/refresh-2" +1547 check-background-color-in-screen-row screen, 7/bg=cursor, 2/y, "|||||||| ", "F - test-trace-preserve-cursor-on-refresh/refresh-2/cursor" 1548 } 1549 1550 fn test-trace-keep-cursor-visible-on-refresh { @@ -1621,52 +1621,52 @@ if ('onhashchange' in window) { 1556 trace-text t, "l", "line 2" 1557 trace-text t, "l", "line 3" 1558 # setup: screen -1559 var screen-on-stack: screen -1560 var screen/edi: (addr screen) <- address screen-on-stack -1561 initialize-screen screen, 0x10/width, 4/height, 0/no-pixel-graphics +1559 var screen-on-stack: screen +1560 var screen/edi: (addr screen) <- address screen-on-stack +1561 initialize-screen screen, 0x10/width, 4/height, 0/no-pixel-graphics 1562 # -1563 var y/ecx: int <- render-trace screen, t, 0/xmin, 0/ymin, 0x10/xmax, 4/ymax, 1/show-cursor +1563 var y/ecx: int <- render-trace screen, t, 0/xmin, 0/ymin, 0x10/xmax, 4/ymax, 1/show-cursor 1564 # -1565 check-screen-row screen, 0/y, "... ", "F - test-trace-keep-cursor-visible-on-refresh/pre-0" -1566 check-background-color-in-screen-row screen, 7/bg=cursor, 0/y, "||| ", "F - test-trace-keep-cursor-visible-on-refresh/pre-0/cursor" -1567 check-screen-row screen, 1/y, " ", "F - test-trace-keep-cursor-visible-on-refresh/pre-1" -1568 check-background-color-in-screen-row screen, 7/bg=cursor, 1/y, " ", "F - test-trace-keep-cursor-visible-on-refresh/pre-1/cursor" +1565 check-screen-row screen, 0/y, "... ", "F - test-trace-keep-cursor-visible-on-refresh/pre-0" +1566 check-background-color-in-screen-row screen, 7/bg=cursor, 0/y, "||| ", "F - test-trace-keep-cursor-visible-on-refresh/pre-0/cursor" +1567 check-screen-row screen, 1/y, " ", "F - test-trace-keep-cursor-visible-on-refresh/pre-1" +1568 check-background-color-in-screen-row screen, 7/bg=cursor, 1/y, " ", "F - test-trace-keep-cursor-visible-on-refresh/pre-1/cursor" 1569 # expand 1570 edit-trace t, 0xa/enter -1571 var y/ecx: int <- render-trace screen, t, 0/xmin, 0/ymin, 0x10/xmax, 4/ymax, 1/show-cursor +1571 var y/ecx: int <- render-trace screen, t, 0/xmin, 0/ymin, 0x10/xmax, 4/ymax, 1/show-cursor 1572 # -1573 check-screen-row screen, 0/y, "1 line 1 ", "F - test-trace-keep-cursor-visible-on-refresh/expand-0" -1574 check-background-color-in-screen-row screen, 7/bg=cursor, 0/y, "|||||||| ", "F - test-trace-keep-cursor-visible-on-refresh/expand-0/cursor" -1575 check-screen-row screen, 1/y, "1 line 2 ", "F - test-trace-keep-cursor-visible-on-refresh/expand-1" -1576 check-background-color-in-screen-row screen, 7/bg=cursor, 1/y, " ", "F - test-trace-keep-cursor-visible-on-refresh/expand-1/cursor" -1577 check-screen-row screen, 2/y, "1 line 3 ", "F - test-trace-keep-cursor-visible-on-refresh/expand-2" -1578 check-background-color-in-screen-row screen, 7/bg=cursor, 2/y, " ", "F - test-trace-keep-cursor-visible-on-refresh/expand-2/cursor" +1573 check-screen-row screen, 0/y, "1 line 1 ", "F - test-trace-keep-cursor-visible-on-refresh/expand-0" +1574 check-background-color-in-screen-row screen, 7/bg=cursor, 0/y, "|||||||| ", "F - test-trace-keep-cursor-visible-on-refresh/expand-0/cursor" +1575 check-screen-row screen, 1/y, "1 line 2 ", "F - test-trace-keep-cursor-visible-on-refresh/expand-1" +1576 check-background-color-in-screen-row screen, 7/bg=cursor, 1/y, " ", "F - test-trace-keep-cursor-visible-on-refresh/expand-1/cursor" +1577 check-screen-row screen, 2/y, "1 line 3 ", "F - test-trace-keep-cursor-visible-on-refresh/expand-2" +1578 check-background-color-in-screen-row screen, 7/bg=cursor, 2/y, " ", "F - test-trace-keep-cursor-visible-on-refresh/expand-2/cursor" 1579 # cursor down 1580 edit-trace t, 0x6a/j 1581 edit-trace t, 0x6a/j -1582 var y/ecx: int <- render-trace screen, t, 0/xmin, 0/ymin, 0x10/xmax, 4/ymax, 1/show-cursor +1582 var y/ecx: int <- render-trace screen, t, 0/xmin, 0/ymin, 0x10/xmax, 4/ymax, 1/show-cursor 1583 # -1584 check-screen-row screen, 0/y, "1 line 1 ", "F - test-trace-keep-cursor-visible-on-refresh/down-0" -1585 check-background-color-in-screen-row screen, 7/bg=cursor, 0/y, " ", "F - test-trace-keep-cursor-visible-on-refresh/down-0/cursor" -1586 check-screen-row screen, 1/y, "1 line 2 ", "F - test-trace-keep-cursor-visible-on-refresh/down-1" -1587 check-background-color-in-screen-row screen, 7/bg=cursor, 1/y, " ", "F - test-trace-keep-cursor-visible-on-refresh/down-1/cursor" -1588 check-screen-row screen, 2/y, "1 line 3 ", "F - test-trace-keep-cursor-visible-on-refresh/down-2" -1589 check-background-color-in-screen-row screen, 7/bg=cursor, 2/y, "|||||||| ", "F - test-trace-keep-cursor-visible-on-refresh/down-2/cursor" +1584 check-screen-row screen, 0/y, "1 line 1 ", "F - test-trace-keep-cursor-visible-on-refresh/down-0" +1585 check-background-color-in-screen-row screen, 7/bg=cursor, 0/y, " ", "F - test-trace-keep-cursor-visible-on-refresh/down-0/cursor" +1586 check-screen-row screen, 1/y, "1 line 2 ", "F - test-trace-keep-cursor-visible-on-refresh/down-1" +1587 check-background-color-in-screen-row screen, 7/bg=cursor, 1/y, " ", "F - test-trace-keep-cursor-visible-on-refresh/down-1/cursor" +1588 check-screen-row screen, 2/y, "1 line 3 ", "F - test-trace-keep-cursor-visible-on-refresh/down-2" +1589 check-background-color-in-screen-row screen, 7/bg=cursor, 2/y, "|||||||| ", "F - test-trace-keep-cursor-visible-on-refresh/down-2/cursor" 1590 # recreate trace with entirely different lines 1591 clear-trace t 1592 trace-text t, "l", "line 4" 1593 trace-text t, "l", "line 5" 1594 trace-text t, "l", "line 6" 1595 mark-lines-dirty t -1596 clear-screen screen -1597 var y/ecx: int <- render-trace screen, t, 0/xmin, 0/ymin, 0x10/xmax, 4/ymax, 1/show-cursor +1596 clear-screen screen +1597 var y/ecx: int <- render-trace screen, t, 0/xmin, 0/ymin, 0x10/xmax, 4/ymax, 1/show-cursor 1598 # trace collapses, and cursor bumps up -1599 check-screen-row screen, 0/y, "... ", "F - test-trace-keep-cursor-visible-on-refresh/refresh-0" -1600 check-background-color-in-screen-row screen, 7/bg=cursor, 0/y, "||| ", "F - test-trace-keep-cursor-visible-on-refresh/refresh-0/cursor" -1601 check-screen-row screen, 1/y, " ", "F - test-trace-keep-cursor-visible-on-refresh/refresh-1" -1602 check-background-color-in-screen-row screen, 7/bg=cursor, 1/y, " ", "F - test-trace-keep-cursor-visible-on-refresh/refresh-1/cursor" -1603 check-screen-row screen, 2/y, " ", "F - test-trace-keep-cursor-visible-on-refresh/refresh-2" -1604 check-background-color-in-screen-row screen, 7/bg=cursor, 2/y, " ", "F - test-trace-keep-cursor-visible-on-refresh/refresh-2/cursor" +1599 check-screen-row screen, 0/y, "... ", "F - test-trace-keep-cursor-visible-on-refresh/refresh-0" +1600 check-background-color-in-screen-row screen, 7/bg=cursor, 0/y, "||| ", "F - test-trace-keep-cursor-visible-on-refresh/refresh-0/cursor" +1601 check-screen-row screen, 1/y, " ", "F - test-trace-keep-cursor-visible-on-refresh/refresh-1" +1602 check-background-color-in-screen-row screen, 7/bg=cursor, 1/y, " ", "F - test-trace-keep-cursor-visible-on-refresh/refresh-1/cursor" +1603 check-screen-row screen, 2/y, " ", "F - test-trace-keep-cursor-visible-on-refresh/refresh-2" +1604 check-background-color-in-screen-row screen, 7/bg=cursor, 2/y, " ", "F - test-trace-keep-cursor-visible-on-refresh/refresh-2/cursor" 1605 } 1606 1607 fn test-trace-collapse-at-top { @@ -1680,37 +1680,37 @@ if ('onhashchange' in window) { 1615 trace-higher t 1616 trace-text t, "l", "line 2" 1617 # setup: screen -1618 var screen-on-stack: screen -1619 var screen/edi: (addr screen) <- address screen-on-stack -1620 initialize-screen screen, 0x10/width, 4/height, 0/no-pixel-graphics +1618 var screen-on-stack: screen +1619 var screen/edi: (addr screen) <- address screen-on-stack +1620 initialize-screen screen, 0x10/width, 4/height, 0/no-pixel-graphics 1621 # -1622 var y/ecx: int <- render-trace screen, t, 0/xmin, 0/ymin, 0x10/xmax, 4/ymax, 1/show-cursor +1622 var y/ecx: int <- render-trace screen, t, 0/xmin, 0/ymin, 0x10/xmax, 4/ymax, 1/show-cursor 1623 # -1624 check-screen-row screen, 0/y, "... ", "F - test-trace-collapse-at-top/pre-0" -1625 check-background-color-in-screen-row screen, 7/bg=cursor, 0/y, "||| ", "F - test-trace-collapse-at-top/pre-0/cursor" -1626 check-screen-row screen, 1/y, " ", "F - test-trace-collapse-at-top/pre-1" -1627 check-background-color-in-screen-row screen, 7/bg=cursor, 1/y, " ", "F - test-trace-collapse-at-top/pre-1/cursor" +1624 check-screen-row screen, 0/y, "... ", "F - test-trace-collapse-at-top/pre-0" +1625 check-background-color-in-screen-row screen, 7/bg=cursor, 0/y, "||| ", "F - test-trace-collapse-at-top/pre-0/cursor" +1626 check-screen-row screen, 1/y, " ", "F - test-trace-collapse-at-top/pre-1" +1627 check-background-color-in-screen-row screen, 7/bg=cursor, 1/y, " ", "F - test-trace-collapse-at-top/pre-1/cursor" 1628 # expand 1629 edit-trace t, 0xa/enter -1630 var y/ecx: int <- render-trace screen, t, 0/xmin, 0/ymin, 0x10/xmax, 4/ymax, 1/show-cursor +1630 var y/ecx: int <- render-trace screen, t, 0/xmin, 0/ymin, 0x10/xmax, 4/ymax, 1/show-cursor 1631 # -1632 check-screen-row screen, 0/y, "1 line 1 ", "F - test-trace-collapse-at-top/expand-0" -1633 check-background-color-in-screen-row screen, 7/bg=cursor, 0/y, "|||||||| ", "F - test-trace-collapse-at-top/expand-0/cursor" -1634 check-screen-row screen, 1/y, "... ", "F - test-trace-collapse-at-top/expand-1" -1635 check-background-color-in-screen-row screen, 7/bg=cursor, 1/y, " ", "F - test-trace-collapse-at-top/expand-1/cursor" -1636 check-screen-row screen, 2/y, "1 line 2 ", "F - test-trace-collapse-at-top/expand-2" -1637 check-background-color-in-screen-row screen, 7/bg=cursor, 2/y, " ", "F - test-trace-collapse-at-top/expand-2/cursor" +1632 check-screen-row screen, 0/y, "1 line 1 ", "F - test-trace-collapse-at-top/expand-0" +1633 check-background-color-in-screen-row screen, 7/bg=cursor, 0/y, "|||||||| ", "F - test-trace-collapse-at-top/expand-0/cursor" +1634 check-screen-row screen, 1/y, "... ", "F - test-trace-collapse-at-top/expand-1" +1635 check-background-color-in-screen-row screen, 7/bg=cursor, 1/y, " ", "F - test-trace-collapse-at-top/expand-1/cursor" +1636 check-screen-row screen, 2/y, "1 line 2 ", "F - test-trace-collapse-at-top/expand-2" +1637 check-background-color-in-screen-row screen, 7/bg=cursor, 2/y, " ", "F - test-trace-collapse-at-top/expand-2/cursor" 1638 # collapse 1639 edit-trace t, 8/backspace 1640 # hack: we need to render here to make this test pass; we're mixing state management with rendering -1641 clear-screen screen -1642 var y/ecx: int <- render-trace screen, t, 0/xmin, 0/ymin, 0x10/xmax, 4/ymax, 1/show-cursor +1641 clear-screen screen +1642 var y/ecx: int <- render-trace screen, t, 0/xmin, 0/ymin, 0x10/xmax, 4/ymax, 1/show-cursor 1643 # 1644 check-ints-equal y, 1, "F - test-trace-collapse-at-top/post-0/y" -1645 check-screen-row screen, 0/y, "... ", "F - test-trace-collapse-at-top/post-0" -1646 check-background-color-in-screen-row screen, 7/bg=cursor, 0/y, "||| ", "F - test-trace-collapse-at-top/post-0/cursor" -1647 check-screen-row screen, 1/y, " ", "F - test-trace-collapse-at-top/post-1" -1648 check-background-color-in-screen-row screen, 7/bg=cursor, 1/y, " ", "F - test-trace-collapse-at-top/post-1/cursor" +1645 check-screen-row screen, 0/y, "... ", "F - test-trace-collapse-at-top/post-0" +1646 check-background-color-in-screen-row screen, 7/bg=cursor, 0/y, "||| ", "F - test-trace-collapse-at-top/post-0/cursor" +1647 check-screen-row screen, 1/y, " ", "F - test-trace-collapse-at-top/post-1" +1648 check-background-color-in-screen-row screen, 7/bg=cursor, 1/y, " ", "F - test-trace-collapse-at-top/post-1/cursor" 1649 } 1650 1651 fn test-trace-collapse { @@ -1721,37 +1721,37 @@ if ('onhashchange' in window) { 1656 trace-text t, "l", "line 1" 1657 trace-text t, "l", "line 2" 1658 # setup: screen -1659 var screen-on-stack: screen -1660 var screen/edi: (addr screen) <- address screen-on-stack -1661 initialize-screen screen, 0x10/width, 4/height, 0/no-pixel-graphics +1659 var screen-on-stack: screen +1660 var screen/edi: (addr screen) <- address screen-on-stack +1661 initialize-screen screen, 0x10/width, 4/height, 0/no-pixel-graphics 1662 # -1663 var y/ecx: int <- render-trace screen, t, 0/xmin, 0/ymin, 0x10/xmax, 4/ymax, 1/show-cursor +1663 var y/ecx: int <- render-trace screen, t, 0/xmin, 0/ymin, 0x10/xmax, 4/ymax, 1/show-cursor 1664 # -1665 check-screen-row screen, 0/y, "... ", "F - test-trace-collapse/pre-0" -1666 check-background-color-in-screen-row screen, 7/bg=cursor, 0/y, "||| ", "F - test-trace-collapse/pre-0/cursor" -1667 check-screen-row screen, 1/y, " ", "F - test-trace-collapse/pre-1" -1668 check-background-color-in-screen-row screen, 7/bg=cursor, 1/y, " ", "F - test-trace-collapse/pre-1/cursor" +1665 check-screen-row screen, 0/y, "... ", "F - test-trace-collapse/pre-0" +1666 check-background-color-in-screen-row screen, 7/bg=cursor, 0/y, "||| ", "F - test-trace-collapse/pre-0/cursor" +1667 check-screen-row screen, 1/y, " ", "F - test-trace-collapse/pre-1" +1668 check-background-color-in-screen-row screen, 7/bg=cursor, 1/y, " ", "F - test-trace-collapse/pre-1/cursor" 1669 # expand 1670 edit-trace t, 0xa/enter -1671 var y/ecx: int <- render-trace screen, t, 0/xmin, 0/ymin, 0x10/xmax, 4/ymax, 1/show-cursor +1671 var y/ecx: int <- render-trace screen, t, 0/xmin, 0/ymin, 0x10/xmax, 4/ymax, 1/show-cursor 1672 # -1673 check-screen-row screen, 0/y, "1 line 1 ", "F - test-trace-collapse/expand-0" -1674 check-background-color-in-screen-row screen, 7/bg=cursor, 0/y, "|||||||| ", "F - test-trace-collapse/expand-0/cursor" -1675 check-screen-row screen, 1/y, "1 line 2 ", "F - test-trace-collapse/expand-1" -1676 check-background-color-in-screen-row screen, 7/bg=cursor, 1/y, " ", "F - test-trace-collapse/expand-1/cursor" +1673 check-screen-row screen, 0/y, "1 line 1 ", "F - test-trace-collapse/expand-0" +1674 check-background-color-in-screen-row screen, 7/bg=cursor, 0/y, "|||||||| ", "F - test-trace-collapse/expand-0/cursor" +1675 check-screen-row screen, 1/y, "1 line 2 ", "F - test-trace-collapse/expand-1" +1676 check-background-color-in-screen-row screen, 7/bg=cursor, 1/y, " ", "F - test-trace-collapse/expand-1/cursor" 1677 # cursor down 1678 edit-trace t, 0x6a/j -1679 var y/ecx: int <- render-trace screen, t, 0/xmin, 0/ymin, 0x10/xmax, 4/ymax, 1/show-cursor +1679 var y/ecx: int <- render-trace screen, t, 0/xmin, 0/ymin, 0x10/xmax, 4/ymax, 1/show-cursor 1680 # collapse 1681 edit-trace t, 8/backspace -1682 clear-screen screen -1683 var y/ecx: int <- render-trace screen, t, 0/xmin, 0/ymin, 0x10/xmax, 4/ymax, 1/show-cursor +1682 clear-screen screen +1683 var y/ecx: int <- render-trace screen, t, 0/xmin, 0/ymin, 0x10/xmax, 4/ymax, 1/show-cursor 1684 # 1685 check-ints-equal y, 1, "F - test-trace-collapse/post-0/y" -1686 check-screen-row screen, 0/y, "... ", "F - test-trace-collapse/post-0" -1687 check-background-color-in-screen-row screen, 7/bg=cursor, 0/y, "||| ", "F - test-trace-collapse/post-0/cursor" -1688 check-screen-row screen, 1/y, " ", "F - test-trace-collapse/post-1" -1689 check-background-color-in-screen-row screen, 7/bg=cursor, 1/y, " ", "F - test-trace-collapse/post-1/cursor" +1686 check-screen-row screen, 0/y, "... ", "F - test-trace-collapse/post-0" +1687 check-background-color-in-screen-row screen, 7/bg=cursor, 0/y, "||| ", "F - test-trace-collapse/post-0/cursor" +1688 check-screen-row screen, 1/y, " ", "F - test-trace-collapse/post-1" +1689 check-background-color-in-screen-row screen, 7/bg=cursor, 1/y, " ", "F - test-trace-collapse/post-1/cursor" 1690 } 1691 1692 fn test-trace-collapse-skips-invisible-lines { @@ -1765,43 +1765,43 @@ if ('onhashchange' in window) { 1700 trace-higher t 1701 trace-text t, "l", "line 2" 1702 # setup: screen -1703 var screen-on-stack: screen -1704 var screen/edi: (addr screen) <- address screen-on-stack -1705 initialize-screen screen, 0x10/width, 4/height, 0/no-pixel-graphics +1703 var screen-on-stack: screen +1704 var screen/edi: (addr screen) <- address screen-on-stack +1705 initialize-screen screen, 0x10/width, 4/height, 0/no-pixel-graphics 1706 # -1707 var y/ecx: int <- render-trace screen, t, 0/xmin, 0/ymin, 0x10/xmax, 4/ymax, 1/show-cursor +1707 var y/ecx: int <- render-trace screen, t, 0/xmin, 0/ymin, 0x10/xmax, 4/ymax, 1/show-cursor 1708 # -1709 check-screen-row screen, 0/y, "... ", "F - test-trace-collapse-skips-invisible-lines/pre-0" -1710 check-background-color-in-screen-row screen, 7/bg=cursor, 0/y, "||| ", "F - test-trace-collapse-skips-invisible-lines/pre-0/cursor" -1711 check-screen-row screen, 1/y, " ", "F - test-trace-collapse-skips-invisible-lines/pre-1" -1712 check-background-color-in-screen-row screen, 7/bg=cursor, 1/y, " ", "F - test-trace-collapse-skips-invisible-lines/pre-1/cursor" +1709 check-screen-row screen, 0/y, "... ", "F - test-trace-collapse-skips-invisible-lines/pre-0" +1710 check-background-color-in-screen-row screen, 7/bg=cursor, 0/y, "||| ", "F - test-trace-collapse-skips-invisible-lines/pre-0/cursor" +1711 check-screen-row screen, 1/y, " ", "F - test-trace-collapse-skips-invisible-lines/pre-1" +1712 check-background-color-in-screen-row screen, 7/bg=cursor, 1/y, " ", "F - test-trace-collapse-skips-invisible-lines/pre-1/cursor" 1713 # expand 1714 edit-trace t, 0xa/enter -1715 var y/ecx: int <- render-trace screen, t, 0/xmin, 0/ymin, 0x10/xmax, 4/ymax, 1/show-cursor +1715 var y/ecx: int <- render-trace screen, t, 0/xmin, 0/ymin, 0x10/xmax, 4/ymax, 1/show-cursor 1716 # two visible lines with an invisible line in between -1717 check-screen-row screen, 0/y, "1 line 1 ", "F - test-trace-collapse-skips-invisible-lines/expand-0" -1718 check-background-color-in-screen-row screen, 7/bg=cursor, 0/y, "|||||||| ", "F - test-trace-collapse-skips-invisible-lines/expand-0/cursor" -1719 check-screen-row screen, 1/y, "... ", "F - test-trace-collapse-skips-invisible-lines/expand-1" -1720 check-background-color-in-screen-row screen, 7/bg=cursor, 1/y, " ", "F - test-trace-collapse-skips-invisible-lines/expand-1/cursor" -1721 check-screen-row screen, 2/y, "1 line 2 ", "F - test-trace-collapse-skips-invisible-lines/expand-2" -1722 check-background-color-in-screen-row screen, 7/bg=cursor, 2/y, " ", "F - test-trace-collapse-skips-invisible-lines/expand-2/cursor" +1717 check-screen-row screen, 0/y, "1 line 1 ", "F - test-trace-collapse-skips-invisible-lines/expand-0" +1718 check-background-color-in-screen-row screen, 7/bg=cursor, 0/y, "|||||||| ", "F - test-trace-collapse-skips-invisible-lines/expand-0/cursor" +1719 check-screen-row screen, 1/y, "... ", "F - test-trace-collapse-skips-invisible-lines/expand-1" +1720 check-background-color-in-screen-row screen, 7/bg=cursor, 1/y, " ", "F - test-trace-collapse-skips-invisible-lines/expand-1/cursor" +1721 check-screen-row screen, 2/y, "1 line 2 ", "F - test-trace-collapse-skips-invisible-lines/expand-2" +1722 check-background-color-in-screen-row screen, 7/bg=cursor, 2/y, " ", "F - test-trace-collapse-skips-invisible-lines/expand-2/cursor" 1723 # cursor down to second visible line 1724 edit-trace t, 0x6a/j -1725 var y/ecx: int <- render-trace screen, t, 0/xmin, 0/ymin, 0x10/xmax, 4/ymax, 1/show-cursor +1725 var y/ecx: int <- render-trace screen, t, 0/xmin, 0/ymin, 0x10/xmax, 4/ymax, 1/show-cursor 1726 edit-trace t, 0x6a/j -1727 var y/ecx: int <- render-trace screen, t, 0/xmin, 0/ymin, 0x10/xmax, 4/ymax, 1/show-cursor +1727 var y/ecx: int <- render-trace screen, t, 0/xmin, 0/ymin, 0x10/xmax, 4/ymax, 1/show-cursor 1728 # collapse 1729 edit-trace t, 8/backspace -1730 clear-screen screen -1731 var y/ecx: int <- render-trace screen, t, 0/xmin, 0/ymin, 0x10/xmax, 4/ymax, 1/show-cursor +1730 clear-screen screen +1731 var y/ecx: int <- render-trace screen, t, 0/xmin, 0/ymin, 0x10/xmax, 4/ymax, 1/show-cursor 1732 # 1733 check-ints-equal y, 1, "F - test-trace-collapse-skips-invisible-lines/post-0/y" 1734 var cursor-y/eax: (addr int) <- get t, cursor-y 1735 check-ints-equal *cursor-y, 0, "F - test-trace-collapse-skips-invisible-lines/post-0/cursor-y" -1736 check-screen-row screen, 0/y, "... ", "F - test-trace-collapse-skips-invisible-lines/post-0" -1737 check-background-color-in-screen-row screen, 7/bg=cursor, 0/y, "||| ", "F - test-trace-collapse-skips-invisible-lines/post-0/cursor" -1738 check-screen-row screen, 1/y, " ", "F - test-trace-collapse-skips-invisible-lines/post-1" -1739 check-background-color-in-screen-row screen, 7/bg=cursor, 1/y, " ", "F - test-trace-collapse-skips-invisible-lines/post-1/cursor" +1736 check-screen-row screen, 0/y, "... ", "F - test-trace-collapse-skips-invisible-lines/post-0" +1737 check-background-color-in-screen-row screen, 7/bg=cursor, 0/y, "||| ", "F - test-trace-collapse-skips-invisible-lines/post-0/cursor" +1738 check-screen-row screen, 1/y, " ", "F - test-trace-collapse-skips-invisible-lines/post-1" +1739 check-background-color-in-screen-row screen, 7/bg=cursor, 1/y, " ", "F - test-trace-collapse-skips-invisible-lines/post-1/cursor" 1740 } 1741 1742 fn test-trace-collapse-two-levels { @@ -1815,54 +1815,54 @@ if ('onhashchange' in window) { 1750 trace-higher t 1751 trace-text t, "l", "line 2" 1752 # setup: screen -1753 var screen-on-stack: screen -1754 var screen/edi: (addr screen) <- address screen-on-stack -1755 initialize-screen screen, 0x10/width, 4/height, 0/no-pixel-graphics +1753 var screen-on-stack: screen +1754 var screen/edi: (addr screen) <- address screen-on-stack +1755 initialize-screen screen, 0x10/width, 4/height, 0/no-pixel-graphics 1756 # -1757 var y/ecx: int <- render-trace screen, t, 0/xmin, 0/ymin, 0x10/xmax, 4/ymax, 1/show-cursor +1757 var y/ecx: int <- render-trace screen, t, 0/xmin, 0/ymin, 0x10/xmax, 4/ymax, 1/show-cursor 1758 # -1759 check-screen-row screen, 0/y, "... ", "F - test-trace-collapse-two-levels/pre-0" -1760 check-background-color-in-screen-row screen, 7/bg=cursor, 0/y, "||| ", "F - test-trace-collapse-two-levels/pre-0/cursor" -1761 check-screen-row screen, 1/y, " ", "F - test-trace-collapse-two-levels/pre-1" -1762 check-background-color-in-screen-row screen, 7/bg=cursor, 1/y, " ", "F - test-trace-collapse-two-levels/pre-1/cursor" +1759 check-screen-row screen, 0/y, "... ", "F - test-trace-collapse-two-levels/pre-0" +1760 check-background-color-in-screen-row screen, 7/bg=cursor, 0/y, "||| ", "F - test-trace-collapse-two-levels/pre-0/cursor" +1761 check-screen-row screen, 1/y, " ", "F - test-trace-collapse-two-levels/pre-1" +1762 check-background-color-in-screen-row screen, 7/bg=cursor, 1/y, " ", "F - test-trace-collapse-two-levels/pre-1/cursor" 1763 # expand 1764 edit-trace t, 0xa/enter -1765 var y/ecx: int <- render-trace screen, t, 0/xmin, 0/ymin, 0x10/xmax, 4/ymax, 1/show-cursor +1765 var y/ecx: int <- render-trace screen, t, 0/xmin, 0/ymin, 0x10/xmax, 4/ymax, 1/show-cursor 1766 # two visible lines with an invisible line in between -1767 check-screen-row screen, 0/y, "1 line 1 ", "F - test-trace-collapse-two-levels/expand-0" -1768 check-background-color-in-screen-row screen, 7/bg=cursor, 0/y, "|||||||| ", "F - test-trace-collapse-two-levels/expand-0/cursor" -1769 check-screen-row screen, 1/y, "... ", "F - test-trace-collapse-two-levels/expand-1" -1770 check-background-color-in-screen-row screen, 7/bg=cursor, 1/y, " ", "F - test-trace-collapse-two-levels/expand-1/cursor" -1771 check-screen-row screen, 2/y, "1 line 2 ", "F - test-trace-collapse-two-levels/expand-2" -1772 check-background-color-in-screen-row screen, 7/bg=cursor, 2/y, " ", "F - test-trace-collapse-two-levels/expand-2/cursor" +1767 check-screen-row screen, 0/y, "1 line 1 ", "F - test-trace-collapse-two-levels/expand-0" +1768 check-background-color-in-screen-row screen, 7/bg=cursor, 0/y, "|||||||| ", "F - test-trace-collapse-two-levels/expand-0/cursor" +1769 check-screen-row screen, 1/y, "... ", "F - test-trace-collapse-two-levels/expand-1" +1770 check-background-color-in-screen-row screen, 7/bg=cursor, 1/y, " ", "F - test-trace-collapse-two-levels/expand-1/cursor" +1771 check-screen-row screen, 2/y, "1 line 2 ", "F - test-trace-collapse-two-levels/expand-2" +1772 check-background-color-in-screen-row screen, 7/bg=cursor, 2/y, " ", "F - test-trace-collapse-two-levels/expand-2/cursor" 1773 # cursor down to ellipses 1774 edit-trace t, 0x6a/j -1775 var y/ecx: int <- render-trace screen, t, 0/xmin, 0/ymin, 0x10/xmax, 4/ymax, 1/show-cursor +1775 var y/ecx: int <- render-trace screen, t, 0/xmin, 0/ymin, 0x10/xmax, 4/ymax, 1/show-cursor 1776 # expand 1777 edit-trace t, 0xa/enter -1778 var y/ecx: int <- render-trace screen, t, 0/xmin, 0/ymin, 0x10/xmax, 4/ymax, 1/show-cursor +1778 var y/ecx: int <- render-trace screen, t, 0/xmin, 0/ymin, 0x10/xmax, 4/ymax, 1/show-cursor 1779 # two visible lines with an invisible line in between -1780 check-screen-row screen, 0/y, "1 line 1 ", "F - test-trace-collapse-two-levels/expand2-0" -1781 check-background-color-in-screen-row screen, 7/bg=cursor, 0/y, " ", "F - test-trace-collapse-two-levels/expand2-0/cursor" -1782 check-screen-row screen, 1/y, "2 line 1.1 ", "F - test-trace-collapse-two-levels/expand2-1" -1783 check-background-color-in-screen-row screen, 7/bg=cursor, 1/y, "|||||||||| ", "F - test-trace-collapse-two-levels/expand2-1/cursor" -1784 check-screen-row screen, 2/y, "1 line 2 ", "F - test-trace-collapse-two-levels/expand2-2" -1785 check-background-color-in-screen-row screen, 7/bg=cursor, 2/y, " ", "F - test-trace-collapse-two-levels/expand2-2/cursor" +1780 check-screen-row screen, 0/y, "1 line 1 ", "F - test-trace-collapse-two-levels/expand2-0" +1781 check-background-color-in-screen-row screen, 7/bg=cursor, 0/y, " ", "F - test-trace-collapse-two-levels/expand2-0/cursor" +1782 check-screen-row screen, 1/y, "2 line 1.1 ", "F - test-trace-collapse-two-levels/expand2-1" +1783 check-background-color-in-screen-row screen, 7/bg=cursor, 1/y, "|||||||||| ", "F - test-trace-collapse-two-levels/expand2-1/cursor" +1784 check-screen-row screen, 2/y, "1 line 2 ", "F - test-trace-collapse-two-levels/expand2-2" +1785 check-background-color-in-screen-row screen, 7/bg=cursor, 2/y, " ", "F - test-trace-collapse-two-levels/expand2-2/cursor" 1786 # cursor down to second visible line 1787 edit-trace t, 0x6a/j -1788 var y/ecx: int <- render-trace screen, t, 0/xmin, 0/ymin, 0x10/xmax, 4/ymax, 1/show-cursor +1788 var y/ecx: int <- render-trace screen, t, 0/xmin, 0/ymin, 0x10/xmax, 4/ymax, 1/show-cursor 1789 # collapse 1790 edit-trace t, 8/backspace -1791 clear-screen screen -1792 var y/ecx: int <- render-trace screen, t, 0/xmin, 0/ymin, 0x10/xmax, 4/ymax, 1/show-cursor +1791 clear-screen screen +1792 var y/ecx: int <- render-trace screen, t, 0/xmin, 0/ymin, 0x10/xmax, 4/ymax, 1/show-cursor 1793 # 1794 check-ints-equal y, 1, "F - test-trace-collapse-two-levels/post-0/y" 1795 var cursor-y/eax: (addr int) <- get t, cursor-y 1796 check-ints-equal *cursor-y, 0, "F - test-trace-collapse-two-levels/post-0/cursor-y" -1797 check-screen-row screen, 0/y, "... ", "F - test-trace-collapse-two-levels/post-0" -1798 check-background-color-in-screen-row screen, 7/bg=cursor, 0/y, "||| ", "F - test-trace-collapse-two-levels/post-0/cursor" -1799 check-screen-row screen, 1/y, " ", "F - test-trace-collapse-two-levels/post-1" -1800 check-background-color-in-screen-row screen, 7/bg=cursor, 1/y, " ", "F - test-trace-collapse-two-levels/post-1/cursor" +1797 check-screen-row screen, 0/y, "... ", "F - test-trace-collapse-two-levels/post-0" +1798 check-background-color-in-screen-row screen, 7/bg=cursor, 0/y, "||| ", "F - test-trace-collapse-two-levels/post-0/cursor" +1799 check-screen-row screen, 1/y, " ", "F - test-trace-collapse-two-levels/post-1" +1800 check-background-color-in-screen-row screen, 7/bg=cursor, 1/y, " ", "F - test-trace-collapse-two-levels/post-1/cursor" 1801 } 1802 1803 fn test-trace-collapse-nested-level { @@ -1880,65 +1880,65 @@ if ('onhashchange' in window) { 1815 trace-text t, "l", "line 2.2" 1816 trace-higher t 1817 # setup: screen -1818 var screen-on-stack: screen -1819 var screen/edi: (addr screen) <- address screen-on-stack -1820 initialize-screen screen, 0x10/width, 8/height, 0/no-pixel-graphics +1818 var screen-on-stack: screen +1819 var screen/edi: (addr screen) <- address screen-on-stack +1820 initialize-screen screen, 0x10/width, 8/height, 0/no-pixel-graphics 1821 # -1822 var y/ecx: int <- render-trace screen, t, 0/xmin, 0/ymin, 0x10/xmax, 8/ymax, 1/show-cursor +1822 var y/ecx: int <- render-trace screen, t, 0/xmin, 0/ymin, 0x10/xmax, 8/ymax, 1/show-cursor 1823 # -1824 check-screen-row screen, 0/y, "... ", "F - test-trace-collapse-nested-level/pre-0" -1825 check-background-color-in-screen-row screen, 7/bg=cursor, 0/y, "||| ", "F - test-trace-collapse-nested-level/pre-0/cursor" -1826 check-screen-row screen, 1/y, " ", "F - test-trace-collapse-nested-level/pre-1" -1827 check-background-color-in-screen-row screen, 7/bg=cursor, 1/y, " ", "F - test-trace-collapse-nested-level/pre-1/cursor" +1824 check-screen-row screen, 0/y, "... ", "F - test-trace-collapse-nested-level/pre-0" +1825 check-background-color-in-screen-row screen, 7/bg=cursor, 0/y, "||| ", "F - test-trace-collapse-nested-level/pre-0/cursor" +1826 check-screen-row screen, 1/y, " ", "F - test-trace-collapse-nested-level/pre-1" +1827 check-background-color-in-screen-row screen, 7/bg=cursor, 1/y, " ", "F - test-trace-collapse-nested-level/pre-1/cursor" 1828 # expand 1829 edit-trace t, 0xa/enter -1830 var y/ecx: int <- render-trace screen, t, 0/xmin, 0/ymin, 0x10/xmax, 8/ymax, 1/show-cursor +1830 var y/ecx: int <- render-trace screen, t, 0/xmin, 0/ymin, 0x10/xmax, 8/ymax, 1/show-cursor 1831 # two visible lines with an invisible line in between -1832 check-screen-row screen, 0/y, "1 line 1 ", "F - test-trace-collapse-nested-level/expand-0" -1833 check-background-color-in-screen-row screen, 7/bg=cursor, 0/y, "|||||||| ", "F - test-trace-collapse-nested-level/expand-0/cursor" -1834 check-screen-row screen, 1/y, "... ", "F - test-trace-collapse-nested-level/expand-1" -1835 check-background-color-in-screen-row screen, 7/bg=cursor, 1/y, " ", "F - test-trace-collapse-nested-level/expand-1/cursor" -1836 check-screen-row screen, 2/y, "1 line 2 ", "F - test-trace-collapse-nested-level/expand-2" -1837 check-background-color-in-screen-row screen, 7/bg=cursor, 2/y, " ", "F - test-trace-collapse-nested-level/expand-2/cursor" -1838 check-screen-row screen, 3/y, "... ", "F - test-trace-collapse-nested-level/expand-3" -1839 check-background-color-in-screen-row screen, 7/bg=cursor, 3/y, " ", "F - test-trace-collapse-nested-level/expand-3/cursor" +1832 check-screen-row screen, 0/y, "1 line 1 ", "F - test-trace-collapse-nested-level/expand-0" +1833 check-background-color-in-screen-row screen, 7/bg=cursor, 0/y, "|||||||| ", "F - test-trace-collapse-nested-level/expand-0/cursor" +1834 check-screen-row screen, 1/y, "... ", "F - test-trace-collapse-nested-level/expand-1" +1835 check-background-color-in-screen-row screen, 7/bg=cursor, 1/y, " ", "F - test-trace-collapse-nested-level/expand-1/cursor" +1836 check-screen-row screen, 2/y, "1 line 2 ", "F - test-trace-collapse-nested-level/expand-2" +1837 check-background-color-in-screen-row screen, 7/bg=cursor, 2/y, " ", "F - test-trace-collapse-nested-level/expand-2/cursor" +1838 check-screen-row screen, 3/y, "... ", "F - test-trace-collapse-nested-level/expand-3" +1839 check-background-color-in-screen-row screen, 7/bg=cursor, 3/y, " ", "F - test-trace-collapse-nested-level/expand-3/cursor" 1840 # cursor down to bottom 1841 edit-trace t, 0x6a/j -1842 var y/ecx: int <- render-trace screen, t, 0/xmin, 0/ymin, 0x10/xmax, 8/ymax, 1/show-cursor +1842 var y/ecx: int <- render-trace screen, t, 0/xmin, 0/ymin, 0x10/xmax, 8/ymax, 1/show-cursor 1843 edit-trace t, 0x6a/j -1844 var y/ecx: int <- render-trace screen, t, 0/xmin, 0/ymin, 0x10/xmax, 8/ymax, 1/show-cursor +1844 var y/ecx: int <- render-trace screen, t, 0/xmin, 0/ymin, 0x10/xmax, 8/ymax, 1/show-cursor 1845 edit-trace t, 0x6a/j -1846 var y/ecx: int <- render-trace screen, t, 0/xmin, 0/ymin, 0x10/xmax, 8/ymax, 1/show-cursor +1846 var y/ecx: int <- render-trace screen, t, 0/xmin, 0/ymin, 0x10/xmax, 8/ymax, 1/show-cursor 1847 # expand 1848 edit-trace t, 0xa/enter -1849 var y/ecx: int <- render-trace screen, t, 0/xmin, 0/ymin, 0x10/xmax, 8/ymax, 1/show-cursor +1849 var y/ecx: int <- render-trace screen, t, 0/xmin, 0/ymin, 0x10/xmax, 8/ymax, 1/show-cursor 1850 # two visible lines with an invisible line in between -1851 check-screen-row screen, 0/y, "1 line 1 ", "F - test-trace-collapse-nested-level/expand2-0" -1852 check-background-color-in-screen-row screen, 7/bg=cursor, 0/y, " ", "F - test-trace-collapse-nested-level/expand2-0/cursor" -1853 check-screen-row screen, 1/y, "... ", "F - test-trace-collapse-nested-level/expand2-1" -1854 check-background-color-in-screen-row screen, 7/bg=cursor, 1/y, " ", "F - test-trace-collapse-nested-level/expand2-1/cursor" -1855 check-screen-row screen, 2/y, "1 line 2 ", "F - test-trace-collapse-nested-level/expand2-2" -1856 check-background-color-in-screen-row screen, 7/bg=cursor, 2/y, " ", "F - test-trace-collapse-nested-level/expand2-2/cursor" -1857 check-screen-row screen, 3/y, "2 line 2.1 ", "F - test-trace-collapse-nested-level/expand2-3" -1858 check-background-color-in-screen-row screen, 7/bg=cursor, 3/y, "|||||||||| ", "F - test-trace-collapse-nested-level/expand2-3/cursor" -1859 check-screen-row screen, 4/y, "2 line 2.2 ", "F - test-trace-collapse-nested-level/expand2-4" -1860 check-background-color-in-screen-row screen, 7/bg=cursor, 4/y, " ", "F - test-trace-collapse-nested-level/expand2-4/cursor" +1851 check-screen-row screen, 0/y, "1 line 1 ", "F - test-trace-collapse-nested-level/expand2-0" +1852 check-background-color-in-screen-row screen, 7/bg=cursor, 0/y, " ", "F - test-trace-collapse-nested-level/expand2-0/cursor" +1853 check-screen-row screen, 1/y, "... ", "F - test-trace-collapse-nested-level/expand2-1" +1854 check-background-color-in-screen-row screen, 7/bg=cursor, 1/y, " ", "F - test-trace-collapse-nested-level/expand2-1/cursor" +1855 check-screen-row screen, 2/y, "1 line 2 ", "F - test-trace-collapse-nested-level/expand2-2" +1856 check-background-color-in-screen-row screen, 7/bg=cursor, 2/y, " ", "F - test-trace-collapse-nested-level/expand2-2/cursor" +1857 check-screen-row screen, 3/y, "2 line 2.1 ", "F - test-trace-collapse-nested-level/expand2-3" +1858 check-background-color-in-screen-row screen, 7/bg=cursor, 3/y, "|||||||||| ", "F - test-trace-collapse-nested-level/expand2-3/cursor" +1859 check-screen-row screen, 4/y, "2 line 2.2 ", "F - test-trace-collapse-nested-level/expand2-4" +1860 check-background-color-in-screen-row screen, 7/bg=cursor, 4/y, " ", "F - test-trace-collapse-nested-level/expand2-4/cursor" 1861 # collapse 1862 edit-trace t, 8/backspace -1863 clear-screen screen -1864 var y/ecx: int <- render-trace screen, t, 0/xmin, 0/ymin, 0x10/xmax, 8/ymax, 1/show-cursor +1863 clear-screen screen +1864 var y/ecx: int <- render-trace screen, t, 0/xmin, 0/ymin, 0x10/xmax, 8/ymax, 1/show-cursor 1865 # 1866 check-ints-equal y, 4, "F - test-trace-collapse-nested-level/post-0/y" 1867 var cursor-y/eax: (addr int) <- get t, cursor-y 1868 check-ints-equal *cursor-y, 2, "F - test-trace-collapse-nested-level/post-0/cursor-y" -1869 check-screen-row screen, 0/y, "1 line 1 ", "F - test-trace-collapse-nested-level/post-0" -1870 check-background-color-in-screen-row screen, 7/bg=cursor, 0/y, " ", "F - test-trace-collapse-nested-level/post-0/cursor" -1871 check-screen-row screen, 1/y, "... ", "F - test-trace-collapse-nested-level/post-1" -1872 check-background-color-in-screen-row screen, 7/bg=cursor, 1/y, " ", "F - test-trace-collapse-nested-level/post-1/cursor" -1873 check-screen-row screen, 2/y, "1 line 2 ", "F - test-trace-collapse-nested-level/post-2" -1874 check-background-color-in-screen-row screen, 7/bg=cursor, 2/y, "|||||||| ", "F - test-trace-collapse-nested-level/post-2/cursor" -1875 check-screen-row screen, 3/y, "... ", "F - test-trace-collapse-nested-level/post-3" -1876 check-background-color-in-screen-row screen, 7/bg=cursor, 3/y, " ", "F - test-trace-collapse-nested-level/post-3/cursor" +1869 check-screen-row screen, 0/y, "1 line 1 ", "F - test-trace-collapse-nested-level/post-0" +1870 check-background-color-in-screen-row screen, 7/bg=cursor, 0/y, " ", "F - test-trace-collapse-nested-level/post-0/cursor" +1871 check-screen-row screen, 1/y, "... ", "F - test-trace-collapse-nested-level/post-1" +1872 check-background-color-in-screen-row screen, 7/bg=cursor, 1/y, " ", "F - test-trace-collapse-nested-level/post-1/cursor" +1873 check-screen-row screen, 2/y, "1 line 2 ", "F - test-trace-collapse-nested-level/post-2" +1874 check-background-color-in-screen-row screen, 7/bg=cursor, 2/y, "|||||||| ", "F - test-trace-collapse-nested-level/post-2/cursor" +1875 check-screen-row screen, 3/y, "... ", "F - test-trace-collapse-nested-level/post-3" +1876 check-background-color-in-screen-row screen, 7/bg=cursor, 3/y, " ", "F - test-trace-collapse-nested-level/post-3/cursor" 1877 } 1878 1879 fn scroll-down _self: (addr trace) { @@ -2054,108 +2054,108 @@ if ('onhashchange' in window) { 1989 trace-text t, "l", "line 8" 1990 trace-text t, "l", "line 9" 1991 # setup: screen -1992 var screen-on-stack: screen -1993 var screen/edi: (addr screen) <- address screen-on-stack -1994 initialize-screen screen, 0x10/width, 4/height, 0/no-pixel-graphics +1992 var screen-on-stack: screen +1993 var screen/edi: (addr screen) <- address screen-on-stack +1994 initialize-screen screen, 0x10/width, 4/height, 0/no-pixel-graphics 1995 # pre-render -1996 var y/ecx: int <- render-trace screen, t, 0/xmin, 0/ymin, 0x10/xmax, 4/ymax, 1/show-cursor +1996 var y/ecx: int <- render-trace screen, t, 0/xmin, 0/ymin, 0x10/xmax, 4/ymax, 1/show-cursor 1997 # -1998 check-screen-row screen, 0/y, "... ", "F - test-trace-scroll/pre-0" -1999 check-background-color-in-screen-row screen, 7/bg=cursor, 0/y, "||| ", "F - test-trace-scroll/pre-0/cursor" -2000 check-screen-row screen, 1/y, " ", "F - test-trace-scroll/pre-1" -2001 check-background-color-in-screen-row screen, 7/bg=cursor, 1/y, " ", "F - test-trace-scroll/pre-1/cursor" -2002 check-screen-row screen, 2/y, " ", "F - test-trace-scroll/pre-2" -2003 check-background-color-in-screen-row screen, 7/bg=cursor, 2/y, " ", "F - test-trace-scroll/pre-2/cursor" -2004 check-screen-row screen, 3/y, " ", "F - test-trace-scroll/pre-3" -2005 check-background-color-in-screen-row screen, 7/bg=cursor, 3/y, " ", "F - test-trace-scroll/pre-3/cursor" +1998 check-screen-row screen, 0/y, "... ", "F - test-trace-scroll/pre-0" +1999 check-background-color-in-screen-row screen, 7/bg=cursor, 0/y, "||| ", "F - test-trace-scroll/pre-0/cursor" +2000 check-screen-row screen, 1/y, " ", "F - test-trace-scroll/pre-1" +2001 check-background-color-in-screen-row screen, 7/bg=cursor, 1/y, " ", "F - test-trace-scroll/pre-1/cursor" +2002 check-screen-row screen, 2/y, " ", "F - test-trace-scroll/pre-2" +2003 check-background-color-in-screen-row screen, 7/bg=cursor, 2/y, " ", "F - test-trace-scroll/pre-2/cursor" +2004 check-screen-row screen, 3/y, " ", "F - test-trace-scroll/pre-3" +2005 check-background-color-in-screen-row screen, 7/bg=cursor, 3/y, " ", "F - test-trace-scroll/pre-3/cursor" 2006 # expand 2007 edit-trace t, 0xa/enter -2008 clear-screen screen -2009 var y/ecx: int <- render-trace screen, t, 0/xmin, 0/ymin, 0x10/xmax, 4/ymax, 1/show-cursor +2008 clear-screen screen +2009 var y/ecx: int <- render-trace screen, t, 0/xmin, 0/ymin, 0x10/xmax, 4/ymax, 1/show-cursor 2010 # -2011 check-screen-row screen, 0/y, "1 line 0 ", "F - test-trace-scroll/expand-0" -2012 check-background-color-in-screen-row screen, 7/bg=cursor, 0/y, "|||||||| ", "F - test-trace-scroll/expand-0/cursor" -2013 check-screen-row screen, 1/y, "1 line 1 ", "F - test-trace-scroll/expand-1" -2014 check-background-color-in-screen-row screen, 7/bg=cursor, 1/y, " ", "F - test-trace-scroll/expand-1/cursor" -2015 check-screen-row screen, 2/y, "1 line 2 ", "F - test-trace-scroll/expand-2" -2016 check-background-color-in-screen-row screen, 7/bg=cursor, 2/y, " ", "F - test-trace-scroll/expand-2/cursor" -2017 check-screen-row screen, 3/y, "1 line 3 ", "F - test-trace-scroll/expand-3" -2018 check-background-color-in-screen-row screen, 7/bg=cursor, 3/y, " ", "F - test-trace-scroll/expand-3/cursor" +2011 check-screen-row screen, 0/y, "1 line 0 ", "F - test-trace-scroll/expand-0" +2012 check-background-color-in-screen-row screen, 7/bg=cursor, 0/y, "|||||||| ", "F - test-trace-scroll/expand-0/cursor" +2013 check-screen-row screen, 1/y, "1 line 1 ", "F - test-trace-scroll/expand-1" +2014 check-background-color-in-screen-row screen, 7/bg=cursor, 1/y, " ", "F - test-trace-scroll/expand-1/cursor" +2015 check-screen-row screen, 2/y, "1 line 2 ", "F - test-trace-scroll/expand-2" +2016 check-background-color-in-screen-row screen, 7/bg=cursor, 2/y, " ", "F - test-trace-scroll/expand-2/cursor" +2017 check-screen-row screen, 3/y, "1 line 3 ", "F - test-trace-scroll/expand-3" +2018 check-background-color-in-screen-row screen, 7/bg=cursor, 3/y, " ", "F - test-trace-scroll/expand-3/cursor" 2019 # scroll up 2020 # hack: we must have rendered before this point; we're mixing state management with rendering 2021 edit-trace t, 2/ctrl-b -2022 clear-screen screen -2023 var y/ecx: int <- render-trace screen, t, 0/xmin, 0/ymin, 0x10/xmax, 4/ymax, 1/show-cursor +2022 clear-screen screen +2023 var y/ecx: int <- render-trace screen, t, 0/xmin, 0/ymin, 0x10/xmax, 4/ymax, 1/show-cursor 2024 # no change since we're already at the top -2025 check-screen-row screen, 0/y, "1 line 0 ", "F - test-trace-scroll/up0-0" -2026 check-background-color-in-screen-row screen, 7/bg=cursor, 0/y, "|||||||| ", "F - test-trace-scroll/up0-0/cursor" -2027 check-screen-row screen, 1/y, "1 line 1 ", "F - test-trace-scroll/up0-1" -2028 check-background-color-in-screen-row screen, 7/bg=cursor, 1/y, " ", "F - test-trace-scroll/up0-1/cursor" -2029 check-screen-row screen, 2/y, "1 line 2 ", "F - test-trace-scroll/up0-2" -2030 check-background-color-in-screen-row screen, 7/bg=cursor, 2/y, " ", "F - test-trace-scroll/up0-2/cursor" -2031 check-screen-row screen, 3/y, "1 line 3 ", "F - test-trace-scroll/up0-3" -2032 check-background-color-in-screen-row screen, 7/bg=cursor, 3/y, " ", "F - test-trace-scroll/up0-3/cursor" +2025 check-screen-row screen, 0/y, "1 line 0 ", "F - test-trace-scroll/up0-0" +2026 check-background-color-in-screen-row screen, 7/bg=cursor, 0/y, "|||||||| ", "F - test-trace-scroll/up0-0/cursor" +2027 check-screen-row screen, 1/y, "1 line 1 ", "F - test-trace-scroll/up0-1" +2028 check-background-color-in-screen-row screen, 7/bg=cursor, 1/y, " ", "F - test-trace-scroll/up0-1/cursor" +2029 check-screen-row screen, 2/y, "1 line 2 ", "F - test-trace-scroll/up0-2" +2030 check-background-color-in-screen-row screen, 7/bg=cursor, 2/y, " ", "F - test-trace-scroll/up0-2/cursor" +2031 check-screen-row screen, 3/y, "1 line 3 ", "F - test-trace-scroll/up0-3" +2032 check-background-color-in-screen-row screen, 7/bg=cursor, 3/y, " ", "F - test-trace-scroll/up0-3/cursor" 2033 # scroll down 2034 edit-trace t, 6/ctrl-f -2035 clear-screen screen -2036 var y/ecx: int <- render-trace screen, t, 0/xmin, 0/ymin, 0x10/xmax, 4/ymax, 1/show-cursor -2037 check-screen-row screen, 0/y, "1 line 4 ", "F - test-trace-scroll/down1-0" -2038 check-background-color-in-screen-row screen, 7/bg=cursor, 0/y, "|||||||| ", "F - test-trace-scroll/down1-0/cursor" -2039 check-screen-row screen, 1/y, "1 line 5 ", "F - test-trace-scroll/down1-1" -2040 check-background-color-in-screen-row screen, 7/bg=cursor, 1/y, " ", "F - test-trace-scroll/down1-1/cursor" -2041 check-screen-row screen, 2/y, "1 line 6 ", "F - test-trace-scroll/down1-2" -2042 check-background-color-in-screen-row screen, 7/bg=cursor, 2/y, " ", "F - test-trace-scroll/down1-2/cursor" -2043 check-screen-row screen, 3/y, "1 line 7 ", "F - test-trace-scroll/down1-3" -2044 check-background-color-in-screen-row screen, 7/bg=cursor, 3/y, " ", "F - test-trace-scroll/down1-3/cursor" +2035 clear-screen screen +2036 var y/ecx: int <- render-trace screen, t, 0/xmin, 0/ymin, 0x10/xmax, 4/ymax, 1/show-cursor +2037 check-screen-row screen, 0/y, "1 line 4 ", "F - test-trace-scroll/down1-0" +2038 check-background-color-in-screen-row screen, 7/bg=cursor, 0/y, "|||||||| ", "F - test-trace-scroll/down1-0/cursor" +2039 check-screen-row screen, 1/y, "1 line 5 ", "F - test-trace-scroll/down1-1" +2040 check-background-color-in-screen-row screen, 7/bg=cursor, 1/y, " ", "F - test-trace-scroll/down1-1/cursor" +2041 check-screen-row screen, 2/y, "1 line 6 ", "F - test-trace-scroll/down1-2" +2042 check-background-color-in-screen-row screen, 7/bg=cursor, 2/y, " ", "F - test-trace-scroll/down1-2/cursor" +2043 check-screen-row screen, 3/y, "1 line 7 ", "F - test-trace-scroll/down1-3" +2044 check-background-color-in-screen-row screen, 7/bg=cursor, 3/y, " ", "F - test-trace-scroll/down1-3/cursor" 2045 # scroll down 2046 edit-trace t, 6/ctrl-f -2047 clear-screen screen -2048 var y/ecx: int <- render-trace screen, t, 0/xmin, 0/ymin, 0x10/xmax, 4/ymax, 1/show-cursor -2049 check-screen-row screen, 0/y, "1 line 8 ", "F - test-trace-scroll/down2-0" -2050 check-background-color-in-screen-row screen, 7/bg=cursor, 0/y, "|||||||| ", "F - test-trace-scroll/down2-0/cursor" -2051 check-screen-row screen, 1/y, "1 line 9 ", "F - test-trace-scroll/down2-1" -2052 check-background-color-in-screen-row screen, 7/bg=cursor, 1/y, " ", "F - test-trace-scroll/down2-1/cursor" -2053 check-screen-row screen, 2/y, " ", "F - test-trace-scroll/down2-2" -2054 check-background-color-in-screen-row screen, 7/bg=cursor, 2/y, " ", "F - test-trace-scroll/down2-2/cursor" -2055 check-screen-row screen, 3/y, " ", "F - test-trace-scroll/down2-3" -2056 check-background-color-in-screen-row screen, 7/bg=cursor, 3/y, " ", "F - test-trace-scroll/down2-3/cursor" +2047 clear-screen screen +2048 var y/ecx: int <- render-trace screen, t, 0/xmin, 0/ymin, 0x10/xmax, 4/ymax, 1/show-cursor +2049 check-screen-row screen, 0/y, "1 line 8 ", "F - test-trace-scroll/down2-0" +2050 check-background-color-in-screen-row screen, 7/bg=cursor, 0/y, "|||||||| ", "F - test-trace-scroll/down2-0/cursor" +2051 check-screen-row screen, 1/y, "1 line 9 ", "F - test-trace-scroll/down2-1" +2052 check-background-color-in-screen-row screen, 7/bg=cursor, 1/y, " ", "F - test-trace-scroll/down2-1/cursor" +2053 check-screen-row screen, 2/y, " ", "F - test-trace-scroll/down2-2" +2054 check-background-color-in-screen-row screen, 7/bg=cursor, 2/y, " ", "F - test-trace-scroll/down2-2/cursor" +2055 check-screen-row screen, 3/y, " ", "F - test-trace-scroll/down2-3" +2056 check-background-color-in-screen-row screen, 7/bg=cursor, 3/y, " ", "F - test-trace-scroll/down2-3/cursor" 2057 # scroll down 2058 edit-trace t, 6/ctrl-f -2059 clear-screen screen -2060 var y/ecx: int <- render-trace screen, t, 0/xmin, 0/ymin, 0x10/xmax, 4/ymax, 1/show-cursor +2059 clear-screen screen +2060 var y/ecx: int <- render-trace screen, t, 0/xmin, 0/ymin, 0x10/xmax, 4/ymax, 1/show-cursor 2061 # no change since we're already at the bottom -2062 check-screen-row screen, 0/y, "1 line 8 ", "F - test-trace-scroll/down3-0" -2063 check-background-color-in-screen-row screen, 7/bg=cursor, 0/y, "|||||||| ", "F - test-trace-scroll/down3-0/cursor" -2064 check-screen-row screen, 1/y, "1 line 9 ", "F - test-trace-scroll/down3-1" -2065 check-background-color-in-screen-row screen, 7/bg=cursor, 1/y, " ", "F - test-trace-scroll/down3-1/cursor" -2066 check-screen-row screen, 2/y, " ", "F - test-trace-scroll/down3-2" -2067 check-background-color-in-screen-row screen, 7/bg=cursor, 2/y, " ", "F - test-trace-scroll/down3-2/cursor" -2068 check-screen-row screen, 3/y, " ", "F - test-trace-scroll/down3-3" -2069 check-background-color-in-screen-row screen, 7/bg=cursor, 3/y, " ", "F - test-trace-scroll/down3-3/cursor" +2062 check-screen-row screen, 0/y, "1 line 8 ", "F - test-trace-scroll/down3-0" +2063 check-background-color-in-screen-row screen, 7/bg=cursor, 0/y, "|||||||| ", "F - test-trace-scroll/down3-0/cursor" +2064 check-screen-row screen, 1/y, "1 line 9 ", "F - test-trace-scroll/down3-1" +2065 check-background-color-in-screen-row screen, 7/bg=cursor, 1/y, " ", "F - test-trace-scroll/down3-1/cursor" +2066 check-screen-row screen, 2/y, " ", "F - test-trace-scroll/down3-2" +2067 check-background-color-in-screen-row screen, 7/bg=cursor, 2/y, " ", "F - test-trace-scroll/down3-2/cursor" +2068 check-screen-row screen, 3/y, " ", "F - test-trace-scroll/down3-3" +2069 check-background-color-in-screen-row screen, 7/bg=cursor, 3/y, " ", "F - test-trace-scroll/down3-3/cursor" 2070 # scroll up 2071 edit-trace t, 2/ctrl-b -2072 clear-screen screen -2073 var y/ecx: int <- render-trace screen, t, 0/xmin, 0/ymin, 0x10/xmax, 4/ymax, 1/show-cursor -2074 check-screen-row screen, 0/y, "1 line 4 ", "F - test-trace-scroll/up1-0" -2075 check-background-color-in-screen-row screen, 7/bg=cursor, 0/y, "|||||||| ", "F - test-trace-scroll/up1-0/cursor" -2076 check-screen-row screen, 1/y, "1 line 5 ", "F - test-trace-scroll/up1-1" -2077 check-background-color-in-screen-row screen, 7/bg=cursor, 1/y, " ", "F - test-trace-scroll/up1-1/cursor" -2078 check-screen-row screen, 2/y, "1 line 6 ", "F - test-trace-scroll/up1-2" -2079 check-background-color-in-screen-row screen, 7/bg=cursor, 2/y, " ", "F - test-trace-scroll/up1-2/cursor" -2080 check-screen-row screen, 3/y, "1 line 7 ", "F - test-trace-scroll/up1-3" -2081 check-background-color-in-screen-row screen, 7/bg=cursor, 3/y, " ", "F - test-trace-scroll/up1-3/cursor" +2072 clear-screen screen +2073 var y/ecx: int <- render-trace screen, t, 0/xmin, 0/ymin, 0x10/xmax, 4/ymax, 1/show-cursor +2074 check-screen-row screen, 0/y, "1 line 4 ", "F - test-trace-scroll/up1-0" +2075 check-background-color-in-screen-row screen, 7/bg=cursor, 0/y, "|||||||| ", "F - test-trace-scroll/up1-0/cursor" +2076 check-screen-row screen, 1/y, "1 line 5 ", "F - test-trace-scroll/up1-1" +2077 check-background-color-in-screen-row screen, 7/bg=cursor, 1/y, " ", "F - test-trace-scroll/up1-1/cursor" +2078 check-screen-row screen, 2/y, "1 line 6 ", "F - test-trace-scroll/up1-2" +2079 check-background-color-in-screen-row screen, 7/bg=cursor, 2/y, " ", "F - test-trace-scroll/up1-2/cursor" +2080 check-screen-row screen, 3/y, "1 line 7 ", "F - test-trace-scroll/up1-3" +2081 check-background-color-in-screen-row screen, 7/bg=cursor, 3/y, " ", "F - test-trace-scroll/up1-3/cursor" 2082 # scroll up 2083 edit-trace t, 2/ctrl-b -2084 clear-screen screen -2085 var y/ecx: int <- render-trace screen, t, 0/xmin, 0/ymin, 0x10/xmax, 4/ymax, 1/show-cursor -2086 check-screen-row screen, 0/y, "1 line 0 ", "F - test-trace-scroll/up2-0" -2087 check-background-color-in-screen-row screen, 7/bg=cursor, 0/y, "|||||||| ", "F - test-trace-scroll/up2-0/cursor" -2088 check-screen-row screen, 1/y, "1 line 1 ", "F - test-trace-scroll/up2-1" -2089 check-background-color-in-screen-row screen, 7/bg=cursor, 1/y, " ", "F - test-trace-scroll/up2-1/cursor" -2090 check-screen-row screen, 2/y, "1 line 2 ", "F - test-trace-scroll/up2-2" -2091 check-background-color-in-screen-row screen, 7/bg=cursor, 2/y, " ", "F - test-trace-scroll/up2-2/cursor" -2092 check-screen-row screen, 3/y, "1 line 3 ", "F - test-trace-scroll/up2-3" -2093 check-background-color-in-screen-row screen, 7/bg=cursor, 3/y, " ", "F - test-trace-scroll/up2-3/cursor" +2084 clear-screen screen +2085 var y/ecx: int <- render-trace screen, t, 0/xmin, 0/ymin, 0x10/xmax, 4/ymax, 1/show-cursor +2086 check-screen-row screen, 0/y, "1 line 0 ", "F - test-trace-scroll/up2-0" +2087 check-background-color-in-screen-row screen, 7/bg=cursor, 0/y, "|||||||| ", "F - test-trace-scroll/up2-0/cursor" +2088 check-screen-row screen, 1/y, "1 line 1 ", "F - test-trace-scroll/up2-1" +2089 check-background-color-in-screen-row screen, 7/bg=cursor, 1/y, " ", "F - test-trace-scroll/up2-1/cursor" +2090 check-screen-row screen, 2/y, "1 line 2 ", "F - test-trace-scroll/up2-2" +2091 check-background-color-in-screen-row screen, 7/bg=cursor, 2/y, " ", "F - test-trace-scroll/up2-2/cursor" +2092 check-screen-row screen, 3/y, "1 line 3 ", "F - test-trace-scroll/up2-3" +2093 check-background-color-in-screen-row screen, 7/bg=cursor, 3/y, " ", "F - test-trace-scroll/up2-3/cursor" 2094 } 2095 2096 # saving and restoring trace indices