fb.c (731B)
1 /* $Id$ 2 ** 3 ** Copyright 1999 Brian J. Swetland. All rights reserved. 4 ** Distributed under the terms of the OpenBLT License 5 */ 6 7 #include <stdio.h> 8 #include <stdarg.h> 9 #include <blt/syscall.h> 10 #include "fb.h" 11 12 #define SERIAL_DEBUG 0 13 14 void va_snprintf(char *b, int l, char *fmt, va_list pvar); 15 16 17 void dprintf(const char *fmt, ...) 18 { 19 char buf[256]; 20 va_list ap; 21 va_start(ap,fmt); 22 va_snprintf(buf,256,fmt,ap); 23 va_end(pvar); 24 #if SERIAL_DEBUG 25 os_console(buf); 26 #else 27 printf(buf); 28 printf("\n"); 29 #endif 30 } 31 32 extern fb_info fb_mga1x64; 33 34 int main (int argc, char **argv) 35 { 36 void *cookie; 37 fb_info *fb = &fb_mga1x64; 38 39 if(fb->find(&cookie) == 0){ 40 printf("Frame Buffer \"%s\" found.\n",fb->name); 41 fb->init(cookie); 42 } 43 44 return 0; 45 } 46