mirror of
git://projects.qi-hardware.com/ben-blinkenlights.git
synced 2025-04-21 12:27:27 +03: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:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user