From b2dd7e6a91c1cd6f641e977aec2e34019619441d Mon Sep 17 00:00:00 2001 From: "Kartik K. Agaram" Date: Sun, 23 May 2021 22:04:31 -0700 Subject: [PATCH] start truncating trace lines --- 501draw-text.mu | 10 +++++----- shell/trace.mu | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/501draw-text.mu b/501draw-text.mu index 1a729c1f..ad7beecc 100644 --- a/501draw-text.mu +++ b/501draw-text.mu @@ -98,7 +98,7 @@ fn draw-code-point-at-cursor screen: (addr screen), c: code-point, color: int, b # return the next 'x' coordinate # if there isn't enough space, truncate fn draw-text-rightward screen: (addr screen), text: (addr array byte), x: int, xmax: int, y: int, color: int, background-color: int -> _/eax: int { - var stream-storage: (stream byte 0x100) + var stream-storage: (stream byte 0x200/print-buffer-size) var stream/esi: (addr stream byte) <- address stream-storage write stream, text var xcurr/eax: int <- draw-stream-rightward screen, stream, x, xmax, y, color, background-color @@ -172,10 +172,10 @@ fn render-grapheme screen: (addr screen), g: grapheme, xmin: int, ymin: int, xma # that way the caller can draw more if given the same min and max bounding-box. # if there isn't enough space, truncate fn draw-text-wrapping-right-then-down screen: (addr screen), _text: (addr array byte), xmin: int, ymin: int, xmax: int, ymax: int, _x: int, _y: int, color: int, background-color: int -> _/eax: int, _/ecx: int { - var stream-storage: (stream byte 0x200) # 4 rows of text = 1/12th of a real screen - # fake screens unlikely to be larger - # so this seems a reasonable size - # allocated on the stack, so quickly reclaimed + var stream-storage: (stream byte 0x200/print-buffer-size) # 4 rows of text = 1/12th of a real screen + # fake screens unlikely to be larger + # so this seems a reasonable size + # allocated on the stack, so quickly reclaimed var stream/edi: (addr stream byte) <- address stream-storage var text/esi: (addr array byte) <- copy _text var len/eax: int <- length text diff --git a/shell/trace.mu b/shell/trace.mu index 43b19246..ba779273 100644 --- a/shell/trace.mu +++ b/shell/trace.mu @@ -526,7 +526,7 @@ fn render-trace-line screen: (addr screen), _self: (addr trace-line), xmin: int, var _data/eax: (addr array byte) <- lookup *data-ah var data/ebx: (addr array byte) <- copy _data var x/eax: int <- copy xsave - x, y <- draw-text-wrapping-right-then-down screen, data, xmin, ymin, xmax, ymax, x, y, fg, bg + x <- draw-text-rightward screen, data, x, xmax, y, fg, bg y <- increment return y }