diff options
author | Kartik Agaram <vc@akkartik.com> | 2021-01-11 23:37:17 -0800 |
---|---|---|
committer | Kartik Agaram <vc@akkartik.com> | 2021-01-12 00:00:20 -0800 |
commit | ebf912eb7a5da220c031d453b64f7a2d90b41dea (patch) | |
tree | 2919d4fe352f7f2f6f665152ad8bfe1bde599987 /baremetal/501draw-text.mu | |
parent | 781b7a0854ed3e37b7b1bb89bdfbed286102ac8c (diff) | |
download | mu-ebf912eb7a5da220c031d453b64f7a2d90b41dea.tar.gz |
7499
Diffstat (limited to 'baremetal/501draw-text.mu')
-rw-r--r-- | baremetal/501draw-text.mu | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/baremetal/501draw-text.mu b/baremetal/501draw-text.mu new file mode 100644 index 00000000..61b2d9ca --- /dev/null +++ b/baremetal/501draw-text.mu @@ -0,0 +1,13 @@ +fn draw-text-rightward screen: (addr screen), text: (addr array byte), x: int, y: int, color: int { + var stream-storage: (stream byte 0x100) + var stream/esi: (addr stream byte) <- address stream-storage + write stream, text + { + var g/eax: grapheme <- read-grapheme stream + compare g, 0xffffffff # end-of-file + break-if-= + draw-grapheme screen, g, x, y, color + add-to x, 8 # font-width + loop + } +} |