From dbfbaafe1c1be35f00e87a31a8d80ae9645fe9f3 Mon Sep 17 00:00:00 2001 From: "Kartik K. Agaram" Date: Sun, 21 Feb 2021 14:32:46 -0800 Subject: 7768 - baremetal/shell: assume multi-line from the start --- baremetal/shell/sandbox.mu | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'baremetal') diff --git a/baremetal/shell/sandbox.mu b/baremetal/shell/sandbox.mu index 8ee04f0a..26646cbe 100644 --- a/baremetal/shell/sandbox.mu +++ b/baremetal/shell/sandbox.mu @@ -44,16 +44,19 @@ fn delete-grapheme-before-cursor _self: (addr sandbox) { delete-before-gap data } -fn render-sandbox screen: (addr screen), _self: (addr sandbox), x: int, y: int { +fn render-sandbox screen: (addr screen), _self: (addr sandbox), _x: int, _y: int { clear-screen screen var self/esi: (addr sandbox) <- copy _self var data-ah/eax: (addr handle gap-buffer) <- get self, data - var data/eax: (addr gap-buffer) <- lookup *data-ah - var dummy/eax: int <- render-gap-buffer screen, data, x, y, 1/true - increment y + var _data/eax: (addr gap-buffer) <- lookup *data-ah + var data/edx: (addr gap-buffer) <- copy _data + 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 + y <- increment 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, _x, 0x30/xmax, y, 7/fg=grey, 0/bg } fn edit-sandbox _self: (addr sandbox), key: byte { -- cgit 1.4.1-2-gfad0