/* * ubb-vga.h - Output video on UBB with more or less VGA timing * * Written 2011 by Werner Almesberger * Copyright 2011 Werner Almesberger * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. */ #ifndef UBB_VGA_H #define UBB_VGA_H #include #include #define R_VAL (1 << 3) #define G_VAL (1 << 0) #define B_VAL (1 << 1) #define Y_VAL (1 << 2) struct mode { const char *name; /* NULL for end of table */ int xres, yres; int clkdiv; /* pixel clock = 336 MHz/(clkdiv+1) */ int vsync_lines; /* 2 lines, for official VGA */ int vfront_lines; /* 32 lines */ int vback_lines; /* 14 lines */ uint16_t hsync_cycles; /* 3.77 us */ uint16_t hback_cycles; /* 0.79 us */ uint16_t line_cycles; /* 31.77 us */ }; extern const struct mode *mode; void *map(off_t addr, size_t size); /* ccube.c */ uint8_t ccube_map(uint8_t r, uint8_t g, uint8_t b); void ccube_init(void); /* physmem.c */ void **calloc_phys_vec(size_t n, size_t size); unsigned long *xlat_virt(void *const *v, size_t n); /* grabfb.c */ void grabfb(void **f, int xres, int yres); /* tstimg.c */ void tstimg(void **f, int xres, int yres); /* ppmimg.c */ extern char *img_name; void ppmimg(void **f, int xres, int yres); #endif /* !UBB_VGA_H */