1
0
mirror of git://projects.qi-hardware.com/ben-blinkenlights.git synced 2024-11-23 20:59:42 +02:00

ubb-vga: test image now shows detailed horizontal and vertical timing

- ubb-vga.c (CYCLES), ubb-vga.h: corrected conversion and moved to
  ubb-vga.h
- tstimg.c (printc): added characters '=' and '+'
- tstimg.c (tstimg): print detailed horizontal and vertical timing
This commit is contained in:
Werner Almesberger 2011-05-01 21:50:20 -03:00
parent 4b59dbf062
commit 9412c9debe
3 changed files with 25 additions and 4 deletions

View File

@ -415,6 +415,14 @@ static void printc(void **f, int xres, int x, int y, char c, int n,
case '-':
line45(f, xres, x, y+2*n, 1, 0, 2*n, color, side);
break;
case '=':
line45(f, xres, x, y+1*n, 1, 0, 2*n, color, side);
line45(f, xres, x, y+3*n, 1, 0, 2*n, color, side);
break;
case '+':
line45(f, xres, x, y+2*n, 1, 0, 2*n, color, side);
line45(f, xres, x+n, y+n, 0, 1, 2*n, color, side);
break;
case ' ':
break;
case '.':
@ -453,7 +461,7 @@ static void ctext(void **f, int xres, int x, int y, const char *s, int n,
void tstimg(void **f, int xres, int yres)
{
char buf[20];
char buf[40];
double line_freq_hz;
grid(f, xres, yres);
@ -471,6 +479,18 @@ void tstimg(void **f, int xres, int yres)
sprintf(buf, "LINE %5.2f KHZ", line_freq_hz/1000);
text(f, xres, xres/8, yres/8+5*6, buf, 5, WHITE, 1);
sprintf(buf, "FRAME %5.2f HZ", line_freq_hz/(mode->yres+2+32+14));
sprintf(buf, "FRAME %5.2f HZ",
line_freq_hz/(mode->vsync_lines+ mode->vfront_lines+mode->yres+
mode->vback_lines));
text(f, xres, xres/8, yres/8+5*12, buf, 5, WHITE, 1);
sprintf(buf, "VERT %d+%d+%d+%d LINES",
mode->vsync_lines, mode->vfront_lines, mode->yres,
mode->vback_lines);
text(f, xres, xres/8, yres/8+5*18, buf, 5, WHITE, 1);
sprintf(buf, "HOR %4.2f+...+%4.2f = %5.2f US",
CYCLES(mode->hsync_cycles), CYCLES(mode->hback_cycles),
CYCLES(mode->line_cycles));
text(f, xres, xres/8, yres/8+5*24, buf, 5, WHITE, 1);
}

View File

@ -452,8 +452,6 @@ int main(int argc, char *const *argv)
}
#if 0
#define CYCLES(cy) ((cy)/112.0+0.5)
printf("V: %d+%d+%d+%d\n", mode->vsync_lines, mode->vfront_lines,
mode->yres, mode->vback_lines);
printf("H: %4.1f+?+?+%4.1f (%4.1f)\n", CYCLES(mode->hsync_cycles),

View File

@ -41,6 +41,9 @@ extern const struct mode *mode;
void *map(off_t addr, size_t size);
#define CYCLES(cy) ((cy)/112.0)
/* ccube.c */
uint8_t ccube_map(uint8_t r, uint8_t g, uint8_t b);