diff --git a/ubb-vga/ubb-vga2.c b/ubb-vga/ubb-vga2.c index 11d41bc..429b8de 100644 --- a/ubb-vga/ubb-vga2.c +++ b/ubb-vga/ubb-vga2.c @@ -37,8 +37,13 @@ #include "ubb-vga.h" +#define XRES 640 +#define YRES 480 + + static int bad; + /* ----- I/O pin assignment ------------------------------------------------ */ @@ -231,7 +236,7 @@ static void until(uint16_t cycles) /* ----- Frame buffer output ----------------------------------------------- */ -static int line_words = 640/8; +static int line_words = XRES/8; //static int line_cycles = US(36); /* nominally 31.77 us, but we're too slow */ //static int line_cycles = US(32); /* nominally 31.77 us, but we're too slow */ static int line_cycles = US(29.6); /* nominally 31.77 us, but we're too fast */ @@ -379,7 +384,7 @@ static void frame(const uint32_t *f) *pddats = HSYNC; until(line_cycles-US(0.79)); - for (p = f; p != f+480*line_words; p += line_words) + for (p = f; p != f+YRES*line_words; p += line_words) line(p, p+line_words); /* Back porch */ @@ -392,12 +397,12 @@ static void frame(const uint32_t *f) static void session(void (*gen)(void *fb, int xres, int yres), int frames) { - uint32_t f[2*240*(line_words+1)]; + uint32_t f[YRES*(line_words+1)]; int i; memset(f, 0, sizeof(f)); ccube_init(); - gen(f, 640, 480); + gen(f, XRES, YRES); disable_interrupts();