From f4fb198af313a3a30400ba1a51e0f0425b1da0ca Mon Sep 17 00:00:00 2001 From: Kartik Agaram Date: Wed, 16 Sep 2020 15:46:36 -0700 Subject: 6790 experiment: explicit flush tile is already visibly slow (49x212 screen) :/ So programmer needs more control over performance. But this may not be the right approach. That extra flush-stdout in tui.mu suggests it's either going to be finicky, or we have to flush on every attribute change. And going through a buffered-file may be slower. May. --- apps/tile/main.mu | 1 + apps/tui.mu | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) (limited to 'apps') diff --git a/apps/tile/main.mu b/apps/tile/main.mu index 7c7065fc..a9d62bb4 100644 --- a/apps/tile/main.mu +++ b/apps/tile/main.mu @@ -75,4 +75,5 @@ fn render screen: (addr screen), buf: (addr gap-buffer) { move-cursor screen, start-row, start-col # render-gap-buffer screen, buf + flush-stdout } diff --git a/apps/tui.mu b/apps/tui.mu index a02d8fb0..4af4d405 100644 --- a/apps/tui.mu +++ b/apps/tui.mu @@ -14,6 +14,7 @@ fn main -> exit-status/ebx: int { start-blinking 0 print-string 0, "Hello world!" reset-formatting 0 + flush-stdout move-cursor 0, 6, 0x22 print-string 0, "tty dimensions: " print-int32-hex 0, nrows @@ -28,7 +29,8 @@ fn main -> exit-status/ebx: int { enable-screen-type-mode print-string 0, "You pressed " var x-int/eax: int <- copy x - print-int32-hex 0, x-int + print-int32-hex-to-real-screen x-int print-string 0, "\n" + flush-stdout exit-status <- copy 0 } -- cgit 1.4.1-2-gfad0