X-Git-Url: http://git.joshuawise.com/netwatch.git/blobdiff_plain/a3033282454ea3d1e5e8a7ca91d3d67d258ba04c..cdde55f54a0880bde5694fcdea8e386ada0cd5ce:/aseg/vga-overlay.c?ds=sidebyside diff --git a/aseg/vga-overlay.c b/aseg/vga-overlay.c index cfe6ac9..7d107d7 100644 --- a/aseg/vga-overlay.c +++ b/aseg/vga-overlay.c @@ -10,6 +10,7 @@ static char logents[LOGLEN][41] = {{0}}; static int prodptr = 0; +static int flush_imm = 0; #define VRAM_BASE 0xA0000UL #define TEXT_CONSOLE_OFFSET 0x18000UL @@ -18,6 +19,11 @@ static int prodptr = 0; #define COLOR 0x1F +void vga_flush_imm(int imm) +{ + flush_imm = imm; +} + static unsigned char vga_read(unsigned char idx) { outb(CRTC_IDX_REG, idx); @@ -75,6 +81,8 @@ void dolog(const char *s) { strcpy(logents[prodptr], s); prodptr = (prodptr + 1) % LOGLEN; + if (flush_imm) + outlog(); } void (*output)(const char *s) = dolog; @@ -86,6 +94,8 @@ void dologf(const char *fmt, ...) vsnprintf(logents[prodptr], 40, fmt, va); va_end(va); prodptr = (prodptr + 1) % LOGLEN; + if (flush_imm) + outlog(); } void (*outputf)(const char *s, ...) = dologf;