From e90b20a3a9bd5dedac96722b370a70da9c1c0d89 Mon Sep 17 00:00:00 2001 From: nhmall Date: Mon, 7 May 2018 20:20:36 -0400 Subject: [PATCH] optimization of output was ruining display effects --- sys/winnt/nttty.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/sys/winnt/nttty.c b/sys/winnt/nttty.c index 2ed5d7c14..9d1114498 100644 --- a/sys/winnt/nttty.c +++ b/sys/winnt/nttty.c @@ -252,6 +252,8 @@ cell_t undefined_cell; static boolean buffer_flipping_initialized = FALSE; +boolean do_immediate_flips = FALSE; + static void check_buffer_size(int width, int height); static cell_t * buffer_get_cell(console_buffer_t * buffer, int x, int y); @@ -367,12 +369,18 @@ static void buffer_fill_to_end(console_buffer_t * buffer, cell_t * src, cell_t * sentinel = buffer_get_cell(buffer, 0, buffer_height); while (dst != sentinel) *dst++ = clear_cell; + + if (do_immediate_flips && buffer == &back_buffer) + back_buffer_flip(); } static void back_buffer_write(cell_t * cell, int x, int y) { cell_t * dst = buffer_get_cell(&back_buffer, x, y); *dst = *cell; + + if (do_immediate_flips) + back_buffer_flip(); } static void back_buffer_clear_to_end_of_line(int x, int y) @@ -384,6 +392,9 @@ static void back_buffer_clear_to_end_of_line(int x, int y) sentinel = buffer_get_cell(&back_buffer, 0, y+1); while (cell != sentinel) *cell++ = clear_cell; + + if (do_immediate_flips) + back_buffer_flip(); } /* @@ -922,6 +933,7 @@ tty_delay_output() int k; goal = 50 + clock(); + back_buffer_flip(); while (goal > clock()) { k = junk; /* Do nothing */ }