diff options
Diffstat (limited to 'baremetal/501draw-text.mu')
-rw-r--r-- | baremetal/501draw-text.mu | 33 |
1 files changed, 22 insertions, 11 deletions
diff --git a/baremetal/501draw-text.mu b/baremetal/501draw-text.mu index 0bb95dee..d7455829 100644 --- a/baremetal/501draw-text.mu +++ b/baremetal/501draw-text.mu @@ -10,7 +10,8 @@ fn cursor-left screen: (addr screen) { return } cursor-x <- decrement - set-cursor-position screen, cursor-x, cursor-y + var space/esi: grapheme <- copy 0x20 + set-cursor-position screen, cursor-x, cursor-y, space } fn cursor-right screen: (addr screen) { @@ -27,7 +28,8 @@ fn cursor-right screen: (addr screen) { return } cursor-x <- increment - set-cursor-position screen, cursor-x, cursor-y + var space/esi: grapheme <- copy 0x20 + set-cursor-position screen, cursor-x, cursor-y, space } fn cursor-up screen: (addr screen) { @@ -40,7 +42,8 @@ fn cursor-up screen: (addr screen) { return } cursor-y <- decrement - set-cursor-position screen, cursor-x, cursor-y + var space/esi: grapheme <- copy 0x20 + set-cursor-position screen, cursor-x, cursor-y, space } fn cursor-down screen: (addr screen) { @@ -57,7 +60,8 @@ fn cursor-down screen: (addr screen) { return } cursor-y <- increment - set-cursor-position screen, cursor-x, cursor-y + var space/esi: grapheme <- copy 0x20 + set-cursor-position screen, cursor-x, cursor-y, space } fn draw-grapheme-at-cursor screen: (addr screen), g: grapheme, color: int { @@ -101,7 +105,8 @@ fn draw-text-rightward screen: (addr screen), text: (addr array byte), x: int, x xcurr <- increment loop } - set-cursor-position screen, xcurr, y + var space/esi: grapheme <- copy 0x20 + set-cursor-position screen, xcurr, y, space # we'll assume it's ok to clear the next grapheme return xcurr } @@ -162,7 +167,8 @@ fn draw-text-wrapping-right-then-down screen: (addr screen), text: (addr array b } loop } - set-cursor-position screen, xcurr, ycurr + var space/esi: grapheme <- copy 0x20 + set-cursor-position screen, xcurr, ycurr, space # we'll assume it's ok to clear the next grapheme return xcurr, ycurr } @@ -177,7 +183,8 @@ fn move-cursor-rightward-and-downward screen: (addr screen), xmin: int, xmax: in cursor-x <- copy xmin cursor-y <- increment } - set-cursor-position screen, cursor-x, cursor-y + var space/esi: grapheme <- copy 0x20 + set-cursor-position screen, cursor-x, cursor-y, space # we'll assume it's ok to clear the grapheme at the cursor } 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 { @@ -255,7 +262,8 @@ fn draw-int32-hex-wrapping-right-then-down screen: (addr screen), n: int, xmin: } loop } - set-cursor-position screen, xcurr, ycurr + var space/esi: grapheme <- copy 0x20 + set-cursor-position screen, xcurr, ycurr, space # we'll assume it's ok to clear the next grapheme return xcurr, ycurr } @@ -334,7 +342,8 @@ fn draw-int32-decimal-wrapping-right-then-down screen: (addr screen), n: int, xm } loop } - set-cursor-position screen, xcurr, ycurr + var space/esi: grapheme <- copy 0x20 + set-cursor-position screen, xcurr, ycurr, space # we'll assume it's ok to clear the next grapheme return xcurr, ycurr } @@ -404,7 +413,8 @@ fn draw-text-downward screen: (addr screen), text: (addr array byte), x: int, y: ycurr <- increment loop } - set-cursor-position screen, x, ycurr + var space/esi: grapheme <- copy 0x20 + set-cursor-position screen, x, ycurr, space # we'll assume it's ok to clear the next grapheme return ycurr } @@ -464,7 +474,8 @@ fn draw-text-wrapping-down-then-right screen: (addr screen), text: (addr array b } loop } - set-cursor-position screen, xcurr, ycurr + var space/esi: grapheme <- copy 0x20 + set-cursor-position screen, xcurr, ycurr, space # we'll assume it's ok to clear the next grapheme return xcurr, ycurr } |