From 9a91f0a84065e3b53d897a7f232ac58d36e3bb0a Mon Sep 17 00:00:00 2001 From: "Kartik K. Agaram" Date: Tue, 9 Feb 2021 21:41:58 -0800 Subject: 7702 --- baremetal/shell/gap-buffer.mu | 4 ++-- baremetal/shell/grapheme-stack.mu | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) (limited to 'baremetal/shell') diff --git a/baremetal/shell/gap-buffer.mu b/baremetal/shell/gap-buffer.mu index b0f9fb04..eb103c98 100644 --- a/baremetal/shell/gap-buffer.mu +++ b/baremetal/shell/gap-buffer.mu @@ -78,9 +78,9 @@ fn emit-stack-from-top _self: (addr grapheme-stack), out: (addr stream byte) { fn render-gap-buffer screen: (addr screen), _gap: (addr gap-buffer), x: int, y: int, render-cursor?: boolean -> _/eax: int { var gap/esi: (addr gap-buffer) <- copy _gap var left/eax: (addr grapheme-stack) <- get gap, left - var x2/eax: int <- render-stack-from-bottom left, screen, x, y + var x2/eax: int <- render-stack-from-bottom screen, left, x, y var right/ecx: (addr grapheme-stack) <- get gap, right - x2 <- render-stack-from-top right, screen, x2, y, render-cursor? + x2 <- render-stack-from-top screen, right, x2, y, render-cursor? var x3/ebx: int <- copy x2 # if we must render cursor and the right side is empty, print a grapheme anyway { diff --git a/baremetal/shell/grapheme-stack.mu b/baremetal/shell/grapheme-stack.mu index 9a4e0644..11df0345 100644 --- a/baremetal/shell/grapheme-stack.mu +++ b/baremetal/shell/grapheme-stack.mu @@ -78,7 +78,7 @@ fn copy-grapheme-stack _src: (addr grapheme-stack), dest: (addr grapheme-stack) # dump stack to screen from bottom to top # colors hardcoded -fn render-stack-from-bottom _self: (addr grapheme-stack), screen: (addr screen), x: int, y: int -> _/eax: int { +fn render-stack-from-bottom screen: (addr screen), _self: (addr grapheme-stack), x: int, y: int -> _/eax: int { var self/esi: (addr grapheme-stack) <- copy _self var data-ah/edi: (addr handle array grapheme) <- get self, data var _data/eax: (addr array grapheme) <- lookup *data-ah @@ -99,7 +99,7 @@ fn render-stack-from-bottom _self: (addr grapheme-stack), screen: (addr screen), # dump stack to screen from top to bottom # optionally render a 'cursor' with the top grapheme -fn render-stack-from-top _self: (addr grapheme-stack), screen: (addr screen), x: int, y: int, render-cursor?: boolean -> _/eax: int { +fn render-stack-from-top screen: (addr screen), _self: (addr grapheme-stack), x: int, y: int, render-cursor?: boolean -> _/eax: int { var self/esi: (addr grapheme-stack) <- copy _self var data-ah/edi: (addr handle array grapheme) <- get self, data var _data/eax: (addr array grapheme) <- lookup *data-ah @@ -147,17 +147,17 @@ fn test-render-grapheme-stack { var screen/esi: (addr screen) <- address screen-on-stack initialize-screen screen, 5, 4 # - var x/eax: int <- render-stack-from-bottom gs, screen, 0/x, 0/y + var x/eax: int <- render-stack-from-bottom screen, gs, 0/x, 0/y check-screen-row screen, 0/y, "abc ", "F - test-render-grapheme-stack from bottom" check-ints-equal x, 3, "F - test-render-grapheme-stack from bottom: result" check-background-color-in-screen-row screen, 7/bg=cursor, 0/y, " ", "F - test-render-grapheme-stack from bottom: bg" # - var x/eax: int <- render-stack-from-top gs, screen, 0/x, 1/y, 0/cursor=false + var x/eax: int <- render-stack-from-top screen, gs, 0/x, 1/y, 0/cursor=false check-screen-row screen, 1/y, "cba ", "F - test-render-grapheme-stack from top without cursor" check-ints-equal x, 3, "F - test-render-grapheme-stack from top without cursor: result" check-background-color-in-screen-row screen, 7/bg=cursor, 1/y, " ", "F - test-render-grapheme-stack from top without cursor: bg" # - var x/eax: int <- render-stack-from-top gs, screen, 0/x, 2/y, 1/cursor=true + var x/eax: int <- render-stack-from-top screen, gs, 0/x, 2/y, 1/cursor=true check-screen-row screen, 2/y, "cba ", "F - test-render-grapheme-stack from top with cursor" check-ints-equal x, 3, "F - test-render-grapheme-stack from top without cursor: result" check-background-color-in-screen-row screen, 7/bg=cursor, 2/y, "| ", "F - test-render-grapheme-stack from top with cursor: bg" -- cgit 1.4.1-2-gfad0