From 9822a2429f549491b1c7dfa4035260bb6c44ff77 Mon Sep 17 00:00:00 2001 From: Kartik Agaram Date: Sat, 16 Jan 2021 20:56:28 -0800 Subject: 7533 Both issues of commit 7531 fixed. --- baremetal/501draw-text.mu | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'baremetal/501draw-text.mu') diff --git a/baremetal/501draw-text.mu b/baremetal/501draw-text.mu index 5ab280db..dd55d7a1 100644 --- a/baremetal/501draw-text.mu +++ b/baremetal/501draw-text.mu @@ -158,6 +158,20 @@ fn draw-text-wrapping-right-then-down screen: (addr screen), text: (addr array b return xcurr, ycurr } +fn move-cursor-rightward-and-downward screen: (addr screen), xmin: int, xmax: int { + var cursor-x/eax: int <- copy 0 + var cursor-y/ecx: int <- copy 0 + cursor-x, cursor-y <- cursor-position screen + cursor-x <- add 8 # font-width + compare cursor-x, xmax + { + break-if-< + cursor-x <- copy xmin + cursor-y <- add 0x10 # font-height + } + set-cursor-position screen, cursor-x, cursor-y +} + 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 { var cursor-x/eax: int <- copy 0 var cursor-y/ecx: int <- copy 0 -- cgit 1.4.1-2-gfad0