diff options
author | Kartik Agaram <vc@akkartik.com> | 2020-09-16 15:46:36 -0700 |
---|---|---|
committer | Kartik Agaram <vc@akkartik.com> | 2020-09-16 16:43:52 -0700 |
commit | f4fb198af313a3a30400ba1a51e0f0425b1da0ca (patch) | |
tree | 7791e011af839825fec98a0aa5776c07597da268 /apps | |
parent | 5029dac235741025ccec7d2c3d5609724cb14525 (diff) | |
download | mu-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')
-rw-r--r-- | apps/tile/main.mu | 1 | ||||
-rw-r--r-- | apps/tui.mu | 4 |
2 files changed, 4 insertions, 1 deletions
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 } |