about summary refs log tree commit diff stats
path: root/apps/tui.mu
diff options
context:
space:
mode:
authorKartik Agaram <vc@akkartik.com>2020-09-16 15:46:36 -0700
committerKartik Agaram <vc@akkartik.com>2020-09-16 16:43:52 -0700
commitf4fb198af313a3a30400ba1a51e0f0425b1da0ca (patch)
tree7791e011af839825fec98a0aa5776c07597da268 /apps/tui.mu
parent5029dac235741025ccec7d2c3d5609724cb14525 (diff)
downloadmu-f4fb198af313a3a30400ba1a51e0f0425b1da0ca.tar.gz
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.
Diffstat (limited to 'apps/tui.mu')
-rw-r--r--apps/tui.mu4
1 files changed, 3 insertions, 1 deletions
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
 }