From 30079397f5f3cfa545d79973ff521feb2302ab84 Mon Sep 17 00:00:00 2001 From: Werner Almesberger Date: Sun, 1 May 2011 15:23:19 -0300 Subject: [PATCH] tstimg.c (tstimg): display timing parameters --- ubb-vga/tstimg.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/ubb-vga/tstimg.c b/ubb-vga/tstimg.c index d3f97a3..5a7aa8c 100644 --- a/ubb-vga/tstimg.c +++ b/ubb-vga/tstimg.c @@ -454,6 +454,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]; + double line_freq_hz; grid(f, xres, yres); sides(f, xres, yres); @@ -462,4 +463,14 @@ void tstimg(void **f, int xres, int yres) sprintf(buf, "UBB-VGA %dx%d", xres, yres); ctext(f, xres, xres/2, yres/2-GRID*0.75, buf, 10, WHITE, 3); ctext(f, xres, xres/2, yres*(CBAR_Y0+CBAR_Y1)/2, buf, 2, 0, 0); + + sprintf(buf, "PIXEL %5.2f MHZ", 336.0/(mode->clkdiv+1)); + text(f, xres, xres/8, yres/8, buf, 5, WHITE, 1); + + line_freq_hz = 112000000.0/(mode->line_cycles); + 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+32+14)); + text(f, xres, xres/8, yres/8+5*12, buf, 5, WHITE, 1); }