diff options
author | Kartik Agaram <vc@akkartik.com> | 2020-10-17 11:45:37 -0700 |
---|---|---|
committer | Kartik Agaram <vc@akkartik.com> | 2020-10-17 11:45:37 -0700 |
commit | 302082ab706bf97256396ae5468fa85ce903b84a (patch) | |
tree | 9eb00e510ddaca03b1d4a7ff42be04313021de4a /apps/tile | |
parent | 5f8c473c5597bf0a21e6b416b142cb5347f7cc7b (diff) | |
download | mu-302082ab706bf97256396ae5468fa85ce903b84a.tar.gz |
7047
Diffstat (limited to 'apps/tile')
-rw-r--r-- | apps/tile/box.mu | 24 |
1 files changed, 24 insertions, 0 deletions
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 |