From f36093ecd927005ee00312defab205218b30e0d0 Mon Sep 17 00:00:00 2001 From: Kartik Agaram Date: Wed, 13 Jan 2021 19:38:14 -0800 Subject: 7512 - stale .ctags --- html/baremetal/403unicode.mu.html | 10 ++--- html/baremetal/501draw-text.mu.html | 66 ++++++++++++++++---------------- html/baremetal/502manhattan-line.mu.html | 14 +++---- html/baremetal/ex2.mu.html | 2 +- html/baremetal/ex3.mu.html | 2 +- html/baremetal/ex4.mu.html | 2 +- html/baremetal/ex5.mu.html | 6 +-- html/baremetal/ex6.mu.html | 24 ++++++------ html/baremetal/ex7.mu.html | 18 ++++----- 9 files changed, 72 insertions(+), 72 deletions(-) (limited to 'html/baremetal') diff --git a/html/baremetal/403unicode.mu.html b/html/baremetal/403unicode.mu.html index bff11ca4..b1118a7c 100644 --- a/html/baremetal/403unicode.mu.html +++ b/html/baremetal/403unicode.mu.html @@ -77,7 +77,7 @@ if ('onhashchange' in window) { 19 # 20 # The day we want to support combining characters, this function will need to 21 # take multiple code points. Or something. - 22 fn to-grapheme in: code-point -> _/eax: grapheme { + 22 fn to-grapheme in: code-point -> _/eax: grapheme { 23 var c/eax: int <- copy in 24 var num-trailers/ecx: int <- copy 0 25 var first/edx: int <- copy 0 @@ -147,7 +147,7 @@ if ('onhashchange' in window) { 89 # TODO: bring in tests once we have check-ints-equal 90 91 # read the next grapheme from a stream of bytes - 92 fn read-grapheme in: (addr stream byte) -> _/eax: grapheme { + 92 fn read-grapheme in: (addr stream byte) -> _/eax: grapheme { 93 # if at eof, return EOF 94 { 95 var eof?/eax: boolean <- stream-empty? in @@ -203,7 +203,7 @@ if ('onhashchange' in window) { 145 break-if-<= 146 var tmp/eax: byte <- read-byte in 147 var tmp2/eax: int <- copy tmp -148 tmp2 <- shift-left-bytes tmp2, num-byte-shifts +148 tmp2 <- shift-left-bytes tmp2, num-byte-shifts 149 result <- or tmp2 150 # update loop state 151 num-byte-shifts <- increment @@ -214,7 +214,7 @@ if ('onhashchange' in window) { 156 } 157 158 # needed because available primitives only shift by a literal/constant number of bits -159 fn shift-left-bytes n: int, k: int -> _/eax: int { +159 fn shift-left-bytes n: int, k: int -> _/eax: int { 160 var i/ecx: int <- copy 0 161 var result/eax: int <- copy n 162 { @@ -231,7 +231,7 @@ if ('onhashchange' in window) { 173 174 # write a grapheme to a stream of bytes 175 # this is like write-to-stream, except we skip leading 0 bytes -176 fn write-grapheme out: (addr stream byte), g: grapheme { +176 fn write-grapheme out: (addr stream byte), g: grapheme { 177 $write-grapheme:body: { 178 var c/eax: int <- copy g 179 append-byte out, c # first byte is always written diff --git a/html/baremetal/501draw-text.mu.html b/html/baremetal/501draw-text.mu.html index 91ee3d75..c877d08d 100644 --- a/html/baremetal/501draw-text.mu.html +++ b/html/baremetal/501draw-text.mu.html @@ -58,7 +58,7 @@ if ('onhashchange' in window) {
   1 # some primitives for moving the cursor without making assumptions about
   2 # raster order
-  3 fn cursor-left screen: (addr screen) {
+  3 fn 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
@@ -71,7 +71,7 @@ if ('onhashchange' in window) {
  13   set-cursor-position screen, cursor-x, cursor-y
  14 }
  15 
- 16 fn cursor-right screen: (addr screen) {
+ 16 fn cursor-right screen: (addr screen) {
  17   var cursor-x/eax: int <- copy 0
  18   var cursor-y/ecx: int <- copy 0
  19   cursor-x, cursor-y <- cursor-position screen
@@ -84,7 +84,7 @@ if ('onhashchange' in window) {
  26   set-cursor-position screen, cursor-x, cursor-y
  27 }
  28 
- 29 fn cursor-up screen: (addr screen) {
+ 29 fn cursor-up screen: (addr screen) {
  30   var cursor-x/eax: int <- copy 0
  31   var cursor-y/ecx: int <- copy 0
  32   cursor-x, cursor-y <- cursor-position screen
@@ -97,7 +97,7 @@ if ('onhashchange' in window) {
  39   set-cursor-position screen, cursor-x, cursor-y
  40 }
  41 
- 42 fn cursor-down screen: (addr screen) {
+ 42 fn cursor-down screen: (addr screen) {
  43   var cursor-x/eax: int <- copy 0
  44   var cursor-y/ecx: int <- copy 0
  45   cursor-x, cursor-y <- cursor-position screen
@@ -110,7 +110,7 @@ if ('onhashchange' in window) {
  52   set-cursor-position screen, cursor-x, cursor-y
  53 }
  54 
- 55 fn draw-grapheme-at-cursor screen: (addr screen), g: grapheme, color: int {
+ 55 fn draw-grapheme-at-cursor screen: (addr screen), g: grapheme, color: int {
  56   var cursor-x/eax: int <- copy 0
  57   var cursor-y/ecx: int <- copy 0
  58   cursor-x, cursor-y <- cursor-position screen
@@ -120,7 +120,7 @@ if ('onhashchange' in window) {
  62 # draw a single line of text from x, y to xmax
  63 # return the next 'x' coordinate
  64 # if there isn't enough space, return 0 without modifying the screen
- 65 fn draw-text-rightward screen: (addr screen), text: (addr array byte), x: int, xmax: int, y: int, color: int -> _/eax: int {
+ 65 fn draw-text-rightward screen: (addr screen), text: (addr array byte), x: int, xmax: int, y: int, color: int -> _/eax: int {
  66   var stream-storage: (stream byte 0x100)
  67   var stream/esi: (addr stream byte) <- address stream-storage
  68   write stream, text
@@ -129,7 +129,7 @@ if ('onhashchange' in window) {
  71   {
  72     compare xcurr, xmax
  73     break-if->
- 74     var g/eax: grapheme <- read-grapheme stream
+ 74     var g/eax: grapheme <- read-grapheme stream
  75     compare g, 0xffffffff  # end-of-file
  76     break-if-=
  77     xcurr <- add 8  # font-width
@@ -144,7 +144,7 @@ if ('onhashchange' in window) {
  86   rewind-stream stream
  87   xcurr <- copy x
  88   {
- 89     var g/eax: grapheme <- read-grapheme stream
+ 89     var g/eax: grapheme <- read-grapheme stream
  90     compare g, 0xffffffff  # end-of-file
  91     break-if-=
  92     draw-grapheme screen, g, xcurr, y, color
@@ -155,11 +155,11 @@ if ('onhashchange' in window) {
  97   return xcurr
  98 }
  99 
-100 fn draw-text-rightward-from-cursor screen: (addr screen), text: (addr array byte), xmax: int, color: int -> _/eax: int {
+100 fn draw-text-rightward-from-cursor screen: (addr screen), text: (addr array byte), xmax: int, color: int -> _/eax: int {
 101   var cursor-x/eax: int <- copy 0
 102   var cursor-y/ecx: int <- copy 0
 103   cursor-x, cursor-y <- cursor-position screen
-104   var result/eax: int <- draw-text-rightward screen, text, cursor-x, xmax, cursor-y, color
+104   var result/eax: int <- draw-text-rightward screen, text, cursor-x, xmax, cursor-y, color
 105   return result
 106 }
 107 
@@ -167,7 +167,7 @@ if ('onhashchange' in window) {
 109 # return the next (x, y) coordinate in raster order where drawing stopped
 110 # that way the caller can draw more if given the same min and max bounding-box.
 111 # if there isn't enough space, return 0 without modifying the screen
-112 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 -> _/eax: int, _/ecx: int {
+112 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 -> _/eax: int, _/ecx: int {
 113   var stream-storage: (stream byte 0x100)
 114   var stream/esi: (addr stream byte) <- address stream-storage
 115   write stream, text
@@ -177,7 +177,7 @@ if ('onhashchange' in window) {
 119   {
 120     compare ycurr, ymax
 121     break-if->=
-122     var g/eax: grapheme <- read-grapheme stream
+122     var g/eax: grapheme <- read-grapheme stream
 123     compare g, 0xffffffff  # end-of-file
 124     break-if-=
 125     xcurr <- add 8  # font-width
@@ -199,7 +199,7 @@ if ('onhashchange' in window) {
 141   xcurr <- copy x
 142   ycurr <- copy y
 143   {
-144     var g/eax: grapheme <- read-grapheme stream
+144     var g/eax: grapheme <- read-grapheme stream
 145     compare g, 0xffffffff  # end-of-file
 146     break-if-=
 147     draw-grapheme screen, g, xcurr, ycurr, color
@@ -216,14 +216,14 @@ if ('onhashchange' in window) {
 158   return xcurr, ycurr
 159 }
 160 
-161 fn draw-text-wrapping-right-then-down-over-full-screen screen: (addr screen), text: (addr array byte), x: int, y: int, color: int -> _/eax: int, _/ecx: int {
+161 fn draw-text-wrapping-right-then-down-over-full-screen screen: (addr screen), text: (addr array byte), x: int, y: int, color: int -> _/eax: int, _/ecx: int {
 162   var cursor-x/eax: int <- copy 0
 163   var cursor-y/ecx: int <- copy 0
-164   cursor-x, cursor-y <- draw-text-wrapping-right-then-down screen, text, 0, 0, 0x400, 0x300, x, y, color  # 1024, 768
+164   cursor-x, cursor-y <- draw-text-wrapping-right-then-down screen, text, 0, 0, 0x400, 0x300, x, y, color  # 1024, 768
 165   return cursor-x, cursor-y
 166 }
 167 
-168 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 -> _/eax: int, _/ecx: int {
+168 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 -> _/eax: int, _/ecx: int {
 169   var cursor-x/eax: int <- copy 0
 170   var cursor-y/ecx: int <- copy 0
 171   cursor-x, cursor-y <- cursor-position screen
@@ -235,14 +235,14 @@ if ('onhashchange' in window) {
 177     cursor-x <- copy xmin
 178     cursor-y <- add 0x10  # font-height
 179   }
-180   cursor-x, cursor-y <- draw-text-wrapping-right-then-down screen, text, xmin, ymin, xmax, ymax, cursor-x, cursor-y, color
+180   cursor-x, cursor-y <- draw-text-wrapping-right-then-down screen, text, xmin, ymin, xmax, ymax, cursor-x, cursor-y, color
 181   return cursor-x, cursor-y
 182 }
 183 
-184 fn draw-text-wrapping-right-then-down-from-cursor-over-full-screen screen: (addr screen), text: (addr array byte), color: int -> _/eax: int, _/ecx: int {
+184 fn draw-text-wrapping-right-then-down-from-cursor-over-full-screen screen: (addr screen), text: (addr array byte), color: int -> _/eax: int, _/ecx: int {
 185   var cursor-x/eax: int <- copy 0
 186   var cursor-y/ecx: int <- copy 0
-187   cursor-x, cursor-y <- draw-text-wrapping-right-then-down-from-cursor screen, text, 0, 0, 0x400, 0x300, color  # 1024, 768
+187   cursor-x, cursor-y <- draw-text-wrapping-right-then-down-from-cursor screen, text, 0, 0, 0x400, 0x300, color  # 1024, 768
 188   return cursor-x, cursor-y
 189 }
 190 
@@ -251,7 +251,7 @@ if ('onhashchange' in window) {
 193 # draw a single line of text vertically from x, y to ymax
 194 # return the next 'y' coordinate
 195 # if there isn't enough space, return 0 without modifying the screen
-196 fn draw-text-downward screen: (addr screen), text: (addr array byte), x: int, y: int, ymax: int, color: int -> _/eax: int {
+196 fn draw-text-downward screen: (addr screen), text: (addr array byte), x: int, y: int, ymax: int, color: int -> _/eax: int {
 197   var stream-storage: (stream byte 0x100)
 198   var stream/esi: (addr stream byte) <- address stream-storage
 199   write stream, text
@@ -260,7 +260,7 @@ if ('onhashchange' in window) {
 202   {
 203     compare ycurr, ymax
 204     break-if->
-205     var g/eax: grapheme <- read-grapheme stream
+205     var g/eax: grapheme <- read-grapheme stream
 206     compare g, 0xffffffff  # end-of-file
 207     break-if-=
 208     ycurr <- add 0x10  # font-height
@@ -275,7 +275,7 @@ if ('onhashchange' in window) {
 217   rewind-stream stream
 218   ycurr <- copy y
 219   {
-220     var g/eax: grapheme <- read-grapheme stream
+220     var g/eax: grapheme <- read-grapheme stream
 221     compare g, 0xffffffff  # end-of-file
 222     break-if-=
 223     draw-grapheme screen, g, x, ycurr, color
@@ -286,11 +286,11 @@ if ('onhashchange' in window) {
 228   return ycurr
 229 }
 230 
-231 fn draw-text-downward-from-cursor screen: (addr screen), text: (addr array byte), ymax: int, color: int -> _/eax: int {
+231 fn draw-text-downward-from-cursor screen: (addr screen), text: (addr array byte), ymax: int, color: int -> _/eax: int {
 232   var cursor-x/eax: int <- copy 0
 233   var cursor-y/ecx: int <- copy 0
 234   cursor-x, cursor-y <- cursor-position screen
-235   var result/eax: int <- draw-text-downward screen, text, cursor-x, cursor-y, ymax, color
+235   var result/eax: int <- draw-text-downward screen, text, cursor-x, cursor-y, ymax, color
 236   return result
 237 }
 238 
@@ -298,7 +298,7 @@ if ('onhashchange' in window) {
 240 # return the next (x, y) coordinate in raster order where drawing stopped
 241 # that way the caller can draw more if given the same min and max bounding-box.
 242 # if there isn't enough space, return 0 without modifying the screen
-243 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 -> _/eax: int, _/ecx: int {
+243 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 -> _/eax: int, _/ecx: int {
 244   var stream-storage: (stream byte 0x100)
 245   var stream/esi: (addr stream byte) <- address stream-storage
 246   write stream, text
@@ -308,7 +308,7 @@ if ('onhashchange' in window) {
 250   {
 251     compare xcurr, xmax
 252     break-if->=
-253     var g/eax: grapheme <- read-grapheme stream
+253     var g/eax: grapheme <- read-grapheme stream
 254     compare g, 0xffffffff  # end-of-file
 255     break-if-=
 256     ycurr <- add 0x10  # font-height
@@ -330,7 +330,7 @@ if ('onhashchange' in window) {
 272   xcurr <- copy x
 273   ycurr <- copy y
 274   {
-275     var g/eax: grapheme <- read-grapheme stream
+275     var g/eax: grapheme <- read-grapheme stream
 276     compare g, 0xffffffff  # end-of-file
 277     break-if-=
 278     draw-grapheme screen, g, xcurr, ycurr, color
@@ -347,14 +347,14 @@ if ('onhashchange' in window) {
 289   return xcurr, ycurr
 290 }
 291 
-292 fn draw-text-wrapping-down-then-right-over-full-screen screen: (addr screen), text: (addr array byte), x: int, y: int, color: int -> _/eax: int, _/ecx: int {
+292 fn draw-text-wrapping-down-then-right-over-full-screen screen: (addr screen), text: (addr array byte), x: int, y: int, color: int -> _/eax: int, _/ecx: int {
 293   var cursor-x/eax: int <- copy 0
 294   var cursor-y/ecx: int <- copy 0
-295   cursor-x, cursor-y <- draw-text-wrapping-down-then-right screen, text, 0, 0, 0x400, 0x300, x, y, color  # 1024, 768
+295   cursor-x, cursor-y <- draw-text-wrapping-down-then-right screen, text, 0, 0, 0x400, 0x300, x, y, color  # 1024, 768
 296   return cursor-x, cursor-y
 297 }
 298 
-299 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 -> _/eax: int, _/ecx: int {
+299 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 -> _/eax: int, _/ecx: int {
 300   var cursor-x/eax: int <- copy 0
 301   var cursor-y/ecx: int <- copy 0
 302   cursor-x, cursor-y <- cursor-position screen
@@ -366,14 +366,14 @@ if ('onhashchange' in window) {
 308     cursor-x <- add 8  # font-width
 309     cursor-y <- copy ymin
 310   }
-311   cursor-x, cursor-y <- draw-text-wrapping-down-then-right screen, text, xmin, ymin, xmax, ymax, cursor-x, cursor-y, color
+311   cursor-x, cursor-y <- draw-text-wrapping-down-then-right screen, text, xmin, ymin, xmax, ymax, cursor-x, cursor-y, color
 312   return cursor-x, cursor-y
 313 }
 314 
-315 fn draw-text-wrapping-down-then-right-from-cursor-over-full-screen screen: (addr screen), text: (addr array byte), color: int -> _/eax: int, _/ecx: int {
+315 fn draw-text-wrapping-down-then-right-from-cursor-over-full-screen screen: (addr screen), text: (addr array byte), color: int -> _/eax: int, _/ecx: int {
 316   var cursor-x/eax: int <- copy 0
 317   var cursor-y/ecx: int <- copy 0
-318   cursor-x, cursor-y <- draw-text-wrapping-down-then-right-from-cursor screen, text, 0, 0, 0x400, 0x300, color  # 1024, 768
+318   cursor-x, cursor-y <- draw-text-wrapping-down-then-right-from-cursor screen, text, 0, 0, 0x400, 0x300, color  # 1024, 768
 319   return cursor-x, cursor-y
 320 }
 
diff --git a/html/baremetal/502manhattan-line.mu.html b/html/baremetal/502manhattan-line.mu.html index 9d2632d1..fb41ad73 100644 --- a/html/baremetal/502manhattan-line.mu.html +++ b/html/baremetal/502manhattan-line.mu.html @@ -55,14 +55,14 @@ if ('onhashchange' in window) { https://github.com/akkartik/mu/blob/main/baremetal/502manhattan-line.mu
- 1 fn draw-box screen: (addr screen), x1: int, y1: int, x2: int, y2: int, color: int {
- 2   draw-horizontal-line screen, x1, x2, y1, color
- 3   draw-vertical-line screen, x1, y1, y2, color
- 4   draw-horizontal-line screen, x1, x2, y2, color
- 5   draw-vertical-line screen, x2, y1, y2, color
+ 1 fn draw-box screen: (addr screen), x1: int, y1: int, x2: int, y2: int, color: int {
+ 2   draw-horizontal-line screen, x1, x2, y1, color
+ 3   draw-vertical-line screen, x1, y1, y2, color
+ 4   draw-horizontal-line screen, x1, x2, y2, color
+ 5   draw-vertical-line screen, x2, y1, y2, color
  6 }
  7 
- 8 fn draw-horizontal-line screen: (addr screen), x1: int, x2: int, y: int, color: int {
+ 8 fn draw-horizontal-line screen: (addr screen), x1: int, x2: int, y: int, color: int {
  9   var x/eax: int <- copy x1
 10   {
 11     compare x, x2
@@ -73,7 +73,7 @@ if ('onhashchange' in window) {
 16   }
 17 }
 18 
-19 fn draw-vertical-line screen: (addr screen), x: int, y1: int, y2: int, color: int {
+19 fn draw-vertical-line screen: (addr screen), x: int, y1: int, y2: int, color: int {
 20   var y/eax: int <- copy y1
 21   {
 22     compare y, y2
diff --git a/html/baremetal/ex2.mu.html b/html/baremetal/ex2.mu.html
index e52e4b88..a0f4508d 100644
--- a/html/baremetal/ex2.mu.html
+++ b/html/baremetal/ex2.mu.html
@@ -68,7 +68,7 @@ if ('onhashchange' in window) {
 10 # Expected output:
 11 #   html/baremetal.png
 12 
-13 fn main {
+13 fn main {
 14   var y/eax: int <- copy 0
 15   {
 16     compare y, 0x300  # 768
diff --git a/html/baremetal/ex3.mu.html b/html/baremetal/ex3.mu.html
index 54cdea24..7d79c8c5 100644
--- a/html/baremetal/ex3.mu.html
+++ b/html/baremetal/ex3.mu.html
@@ -69,7 +69,7 @@ if ('onhashchange' in window) {
 11 # Expected output: a new green pixel starting from the top left corner of the
 12 # screen every time you press a key (letter or digit)
 13 
-14 fn main {
+14 fn main {
 15   var x/ecx: int <- copy 0
 16   var y/edx: int <- copy 0
 17   {
diff --git a/html/baremetal/ex4.mu.html b/html/baremetal/ex4.mu.html
index dc67e721..30d0063d 100644
--- a/html/baremetal/ex4.mu.html
+++ b/html/baremetal/ex4.mu.html
@@ -67,7 +67,7 @@ if ('onhashchange' in window) {
  9 #
 10 # Expected output: letter 'A' in green near the top-left corner of screen
 11 
-12 fn main {
+12 fn main {
 13   var g/eax: grapheme <- copy 0x41  # 'A'
 14   draw-grapheme 0, g, 0x10, 0x10, 0xa
 15 }
diff --git a/html/baremetal/ex5.mu.html b/html/baremetal/ex5.mu.html
index c4321e97..2d58d605 100644
--- a/html/baremetal/ex5.mu.html
+++ b/html/baremetal/ex5.mu.html
@@ -68,9 +68,9 @@ if ('onhashchange' in window) {
 10 #
 11 # Expected output: text in green near the top-left corner of screen
 12 
-13 fn main {
-14   var dummy/eax: int <- draw-text-rightward 0, "hello from baremetal Mu!", 0x10, 0x400, 0x10, 0xa  # xmax = end of screen, plenty of space
-15   dummy <- draw-text-rightward 0, "you shouldn't see this", 0x10, 0xa0, 0x30, 0x3  # xmax = 0xa0, which is too narrow
+13 fn main {
+14   var dummy/eax: int <- draw-text-rightward 0, "hello from baremetal Mu!", 0x10, 0x400, 0x10, 0xa  # xmax = end of screen, plenty of space
+15   dummy <- draw-text-rightward 0, "you shouldn't see this", 0x10, 0xa0, 0x30, 0x3  # xmax = 0xa0, which is too narrow
 16 }
 
diff --git a/html/baremetal/ex6.mu.html b/html/baremetal/ex6.mu.html index 810b729b..7d63c3fb 100644 --- a/html/baremetal/ex6.mu.html +++ b/html/baremetal/ex6.mu.html @@ -67,26 +67,26 @@ if ('onhashchange' in window) { 9 # 10 # Expected output: a box and text that doesn't overflow it 11 -12 fn main { +12 fn main { 13 # drawing text within a bounding box -14 draw-box 0, 0xf, 0x1f, 0x79, 0x51, 0x4 +14 draw-box 0, 0xf, 0x1f, 0x79, 0x51, 0x4 15 var x/eax: int <- copy 0x20 16 var y/ecx: int <- copy 0x20 -17 x, y <- draw-text-wrapping-right-then-down 0, "hello ", 0x10, 0x20, 0x78, 0x50, x, y, 0xa # (0x10, 0x20) -> (0x78, 0x50) -18 x, y <- draw-text-wrapping-right-then-down 0, "from ", 0x10, 0x20, 0x78, 0x50, x, y, 0xa -19 x, y <- draw-text-wrapping-right-then-down 0, "baremetal ", 0x10, 0x20, 0x78, 0x50, x, y, 0xa -20 x, y <- draw-text-wrapping-right-then-down 0, "Mu!", 0x10, 0x20, 0x78, 0x50, x, y, 0xa +17 x, y <- draw-text-wrapping-right-then-down 0, "hello ", 0x10, 0x20, 0x78, 0x50, x, y, 0xa # (0x10, 0x20) -> (0x78, 0x50) +18 x, y <- draw-text-wrapping-right-then-down 0, "from ", 0x10, 0x20, 0x78, 0x50, x, y, 0xa +19 x, y <- draw-text-wrapping-right-then-down 0, "baremetal ", 0x10, 0x20, 0x78, 0x50, x, y, 0xa +20 x, y <- draw-text-wrapping-right-then-down 0, "Mu!", 0x10, 0x20, 0x78, 0x50, x, y, 0xa 21 22 # drawing at the cursor in multiple directions -23 x, y <- draw-text-wrapping-down-then-right-from-cursor-over-full-screen 0, "abc", 0xa -24 x, y <- draw-text-wrapping-right-then-down-from-cursor-over-full-screen 0, "def", 0xa +23 x, y <- draw-text-wrapping-down-then-right-from-cursor-over-full-screen 0, "abc", 0xa +24 x, y <- draw-text-wrapping-right-then-down-from-cursor-over-full-screen 0, "def", 0xa 25 26 # test drawing near the edge -27 x <- draw-text-rightward 0, "R", 0x3f8, 0x400, 0x100, 0xa -28 x, y <- draw-text-wrapping-right-then-down-from-cursor-over-full-screen 0, "wrapped from R", 0xa +27 x <- draw-text-rightward 0, "R", 0x3f8, 0x400, 0x100, 0xa +28 x, y <- draw-text-wrapping-right-then-down-from-cursor-over-full-screen 0, "wrapped from R", 0xa 29 -30 x <- draw-text-downward 0, "D", 0x100, 0x2f0, 0x300, 0xa -31 x, y <- draw-text-wrapping-down-then-right-from-cursor-over-full-screen 0, "wrapped from D", 0xa +30 x <- draw-text-downward 0, "D", 0x100, 0x2f0, 0x300, 0xa +31 x, y <- draw-text-wrapping-down-then-right-from-cursor-over-full-screen 0, "wrapped from D", 0xa 32 } diff --git a/html/baremetal/ex7.mu.html b/html/baremetal/ex7.mu.html index 72ba26f4..b19f6e13 100644 --- a/html/baremetal/ex7.mu.html +++ b/html/baremetal/ex7.mu.html @@ -68,36 +68,36 @@ if ('onhashchange' in window) { 10 # Expected output: an interactive game a bit like "snakes". Try pressing h, j, 11 # k, l. 12 -13 fn main { +13 fn main { 14 { 15 var key/eax: byte <- read-key 0 16 { 17 compare key, 0x68 # 'h' 18 break-if-!= 19 var g/eax: grapheme <- copy 0x2d # '-' -20 draw-grapheme-at-cursor 0, g, 0x31 -21 cursor-left 0 +20 draw-grapheme-at-cursor 0, g, 0x31 +21 cursor-left 0 22 } 23 { 24 compare key, 0x6a # 'j' 25 break-if-!= 26 var g/eax: grapheme <- copy 0x7c # '|' -27 draw-grapheme-at-cursor 0, g, 0x31 -28 cursor-down 0 +27 draw-grapheme-at-cursor 0, g, 0x31 +28 cursor-down 0 29 } 30 { 31 compare key, 0x6b # 'k' 32 break-if-!= 33 var g/eax: grapheme <- copy 0x7c # '|' -34 draw-grapheme-at-cursor 0, g, 0x31 -35 cursor-up 0 +34 draw-grapheme-at-cursor 0, g, 0x31 +35 cursor-up 0 36 } 37 { 38 compare key, 0x6c # 'l' 39 break-if-!= 40 var g/eax: grapheme <- copy 0x2d # '-' -41 draw-grapheme-at-cursor 0, g, 0x31 -42 cursor-right 0 +41 draw-grapheme-at-cursor 0, g, 0x31 +42 cursor-right 0 43 } 44 loop 45 } -- cgit 1.4.1-2-gfad0