From fdc3df04300f20fac81792d1f5ee1e170a5644ec Mon Sep 17 00:00:00 2001 From: "Kartik K. Agaram" Date: Mon, 22 Feb 2021 22:32:12 -0800 Subject: 7788 --- baremetal/501draw-text.mu | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'baremetal/501draw-text.mu') diff --git a/baremetal/501draw-text.mu b/baremetal/501draw-text.mu index b2c2136f..b17b54a3 100644 --- a/baremetal/501draw-text.mu +++ b/baremetal/501draw-text.mu @@ -62,6 +62,25 @@ fn move-cursor-down screen: (addr screen) { set-cursor-position screen, cursor-x, cursor-y } +fn move-cursor-to-start-of-next-line screen: (addr screen) { + var dummy/eax: int <- copy 0 + var _height/ecx: int <- copy 0 + dummy, _height <- screen-size screen + var limit/edx: int <- copy _height + limit <- decrement + var cursor-x/eax: int <- copy 0 + var cursor-y/ecx: int <- copy 0 + cursor-x, cursor-y <- cursor-position screen + compare cursor-y, limit + { + break-if-< + return + } + cursor-y <- increment + cursor-x <- copy 0 + set-cursor-position screen, cursor-x, cursor-y +} + fn draw-grapheme-at-cursor screen: (addr screen), g: grapheme, color: int, background-color: int { var cursor-x/eax: int <- copy 0 var cursor-y/ecx: int <- copy 0 -- cgit 1.4.1-2-gfad0 class='tabs'> about summary refs log blame commit diff stats
path: root/transect/compiler4
blob: 8dfb8ccdb991c31bdec5ba9f8f5711ba407cb8bd (plain) (tree)