start truncating trace lines

This commit is contained in:
Kartik K. Agaram 2021-05-23 22:04:31 -07:00
parent 0f5b9a1534
commit b2dd7e6a91
2 changed files with 6 additions and 6 deletions

View File

@ -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

View File

@ -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
}