X-Git-Url: http://git.joshuawise.com/netwatch.git/blobdiff_plain/91a6abf7a700b750c4a9ba1f4c801a41f0bdd4b1..34205a17f715de78b7b88f8c44d0cd00885b91b6:/aseg/vga-overlay.c diff --git a/aseg/vga-overlay.c b/aseg/vga-overlay.c index e5414ca..ca0e8a5 100644 --- a/aseg/vga-overlay.c +++ b/aseg/vga-overlay.c @@ -2,6 +2,8 @@ #include #include #include +#include +#include static char logents[4][41] = {{0}}; @@ -22,8 +24,8 @@ static char * vga_base() { return (char *) ( TEXT_CONSOLE_BASE - | (((unsigned int) vga_read(CRTC_START_ADDR_LSB_IDX)) << 9) - | (((unsigned int) vga_read(CRTC_START_ADDR_MSB_IDX)) << 1) + + (((unsigned int) vga_read(CRTC_START_ADDR_MSB_IDX)) << 9) + + (((unsigned int) vga_read(CRTC_START_ADDR_LSB_IDX)) << 1) ); } @@ -60,13 +62,25 @@ void outlog() } smram_restore_state(old_state); - + for (y = 0; y < 4; y++) strblit(logents[y], y, 40); } -void dolog(char *s) +void dolog(const char *s) { memmove(logents[0], logents[1], sizeof(logents[0])*3); strcpy(logents[3], s); } +void (*output)(const char *s) = dolog; + +void dologf(const char *fmt, ...) +{ + va_list va; + + memmove(logents[0], logents[1], sizeof(logents[0])*3); + va_start(va, fmt); + vsnprintf(logents[3], 40, fmt, va); + va_end(va); +} +void (*outputf)(const char *s, ...) = dologf;