diff options
author | Kartik K. Agaram <vc@akkartik.com> | 2021-02-21 21:44:34 -0800 |
---|---|---|
committer | Kartik K. Agaram <vc@akkartik.com> | 2021-02-21 21:44:34 -0800 |
commit | 19f93c7457529a4dc04638eef5de878475067aa8 (patch) | |
tree | f5906a5ad71b651ffe6a7793b7d637dc504d5399 /baremetal | |
parent | 668bec391ccd7fa1f79eef554240fe4251d4dc76 (diff) | |
download | mu-19f93c7457529a4dc04638eef5de878475067aa8.tar.gz |
7776
Diffstat (limited to 'baremetal')
-rw-r--r-- | baremetal/shell/sandbox.mu | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/baremetal/shell/sandbox.mu b/baremetal/shell/sandbox.mu index dd153a9f..cdce1512 100644 --- a/baremetal/shell/sandbox.mu +++ b/baremetal/shell/sandbox.mu @@ -53,10 +53,20 @@ fn render-sandbox screen: (addr screen), _self: (addr sandbox), _x: int, _y: int var x/eax: int <- copy _x var y/ecx: int <- copy _y x, y <- render-gap-buffer-wrapping-right-then-down screen, data, x, y, 0x20/xmax, 0x20/ymax, x, y, 1/true + { + var value-ah/eax: (addr handle stream byte) <- get self, value + var value/eax: (addr stream byte) <- lookup *value-ah + var done?/eax: boolean <- stream-empty? value + compare done?, 0/false + break-if-= + return + } y <- increment + x, y <- draw-text-wrapping-right-then-down screen, "=> ", _x, y, 0x20/xmax, 0x20/ymax, _x, y, 7/fg, 0/bg + var x2/edx: int <- copy x var value-ah/eax: (addr handle stream byte) <- get self, value var value/eax: (addr stream byte) <- lookup *value-ah - var dummy/eax: int <- draw-stream-rightward screen, value, _x, 0x30/xmax, y, 7/fg=grey, 0/bg + var dummy/eax: int <- draw-stream-rightward screen, value, x2, 0x30/xmax, y, 7/fg=grey, 0/bg } fn edit-sandbox _self: (addr sandbox), key: byte { |