From 302082ab706bf97256396ae5468fa85ce903b84a Mon Sep 17 00:00:00 2001 From: Kartik Agaram Date: Sat, 17 Oct 2020 11:45:37 -0700 Subject: 7047 --- apps/tile/box.mu | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'apps/tile/box.mu') diff --git a/apps/tile/box.mu b/apps/tile/box.mu index f13eee81..c4fa4ad2 100644 --- a/apps/tile/box.mu +++ b/apps/tile/box.mu @@ -3,6 +3,10 @@ fn draw-box screen: (addr screen), row1: int, col1: int, row2: int, col2: int { draw-vertical-line screen, row1, row2, col1 draw-horizontal-line screen, row2, col1, col2 draw-vertical-line screen, row1, row2, col2 + draw-top-left-corner screen, row1, col1 + draw-top-right-corner screen, row1, col2 + draw-bottom-left-corner screen, row2, col1 + draw-bottom-right-corner screen, row2, col2 } fn draw-hatching screen: (addr screen), row1: int, col1: int, row2: int, col2: int { @@ -43,6 +47,26 @@ fn draw-vertical-line screen: (addr screen), row1: int, row2: int, col: int { } } +fn draw-top-left-corner screen: (addr screen), row: int, col: int { + move-cursor screen, row, col + print-code-point screen, 0x250c +} + +fn draw-top-right-corner screen: (addr screen), row: int, col: int { + move-cursor screen, row, col + print-code-point screen, 0x2510 +} + +fn draw-bottom-left-corner screen: (addr screen), row: int, col: int { + move-cursor screen, row, col + print-code-point screen, 0x2514 +} + +fn draw-bottom-right-corner screen: (addr screen), row: int, col: int { + move-cursor screen, row, col + print-code-point screen, 0x2518 +} + # erase parts of screen the slow way fn clear-rect screen: (addr screen), row1: int, col1: int, row2: int, col2: int { var i/eax: int <- copy row1 -- cgit 1.4.1-2-gfad0