2016-02-29 21:59:52 +03:00
|
|
|
/* $NetBSD: grfconfig.c,v 1.16 2016/02/29 18:59:52 christos Exp $ */
|
1995-10-09 06:43:22 +03:00
|
|
|
|
1997-07-29 21:39:52 +04:00
|
|
|
/*-
|
|
|
|
* Copyright (c) 1997 The NetBSD Foundation, Inc.
|
1995-10-09 06:43:22 +03:00
|
|
|
* All rights reserved.
|
|
|
|
*
|
1997-07-29 21:39:52 +04:00
|
|
|
* This code is derived from software contributed to The NetBSD Foundation
|
|
|
|
* by Ezra Story and Bernd Ernesti.
|
|
|
|
*
|
1995-10-09 06:43:22 +03:00
|
|
|
* Redistribution and use in source and binary forms, with or without
|
|
|
|
* modification, are permitted provided that the following conditions
|
|
|
|
* are met:
|
|
|
|
* 1. Redistributions of source code must retain the above copyright
|
|
|
|
* notice, this list of conditions and the following disclaimer.
|
|
|
|
* 2. Redistributions in binary form must reproduce the above copyright
|
|
|
|
* notice, this list of conditions and the following disclaimer in the
|
|
|
|
* documentation and/or other materials provided with the distribution.
|
|
|
|
*
|
1997-07-29 21:39:52 +04:00
|
|
|
* THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
|
|
|
|
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
|
|
|
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
1997-10-09 02:19:18 +04:00
|
|
|
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
|
|
|
|
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
1997-07-29 21:39:52 +04:00
|
|
|
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
|
|
|
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
|
|
|
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
|
|
|
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
|
|
|
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
|
|
|
* POSSIBILITY OF SUCH DAMAGE.
|
1995-10-09 06:43:22 +03:00
|
|
|
*/
|
1997-07-29 21:39:52 +04:00
|
|
|
|
|
|
|
#include <sys/cdefs.h>
|
|
|
|
#ifndef lint
|
2008-07-21 17:36:57 +04:00
|
|
|
__COPYRIGHT("@(#) Copyright (c) 1997\
|
|
|
|
The NetBSD Foundation, Inc. All rights reserved.");
|
1997-07-29 21:39:52 +04:00
|
|
|
#endif /* not lint */
|
|
|
|
|
|
|
|
#ifndef lint
|
2016-02-29 21:59:52 +03:00
|
|
|
__RCSID("$NetBSD: grfconfig.c,v 1.16 2016/02/29 18:59:52 christos Exp $");
|
1997-07-29 21:39:52 +04:00
|
|
|
#endif /* not lint */
|
|
|
|
|
|
|
|
#include <sys/file.h>
|
|
|
|
#include <sys/ioctl.h>
|
2016-02-29 21:59:52 +03:00
|
|
|
#include <err.h>
|
1997-07-29 21:39:52 +04:00
|
|
|
#include <ctype.h>
|
|
|
|
#include <limits.h>
|
1995-10-09 06:43:22 +03:00
|
|
|
#include <stdio.h>
|
|
|
|
#include <stdlib.h>
|
|
|
|
#include <string.h>
|
1997-07-29 21:39:52 +04:00
|
|
|
#include <unistd.h>
|
1995-10-09 06:43:22 +03:00
|
|
|
|
|
|
|
#include <amiga/dev/grfioctl.h>
|
|
|
|
|
2016-02-29 21:59:52 +03:00
|
|
|
static void print_modeline(FILE *fp, struct grfvideo_mode *, int);
|
|
|
|
static void suggest(struct grfvideo_mode *, const char *, const char *);
|
1997-07-29 21:39:52 +04:00
|
|
|
|
|
|
|
static struct grf_flag {
|
|
|
|
u_short grf_flag_number;
|
2009-04-26 23:24:18 +04:00
|
|
|
const char *grf_flag_name;
|
1997-07-29 21:39:52 +04:00
|
|
|
} grf_flags[] = {
|
|
|
|
{GRF_FLAGS_DBLSCAN, "doublescan"},
|
|
|
|
{GRF_FLAGS_LACE, "interlace"},
|
|
|
|
{GRF_FLAGS_PHSYNC, "+hsync"},
|
|
|
|
{GRF_FLAGS_NHSYNC, "-hsync"},
|
|
|
|
{GRF_FLAGS_PVSYNC, "+vsync"},
|
|
|
|
{GRF_FLAGS_NVSYNC, "-vsync"},
|
|
|
|
{GRF_FLAGS_SYNC_ON_GREEN, "sync-on-green"},
|
|
|
|
{0, 0}
|
|
|
|
};
|
|
|
|
|
1995-10-09 06:43:22 +03:00
|
|
|
/*
|
|
|
|
* Dynamic mode loader for NetBSD/Amiga grf devices.
|
|
|
|
*/
|
|
|
|
int
|
2016-02-29 21:59:52 +03:00
|
|
|
main(int ac, char **av)
|
1995-10-09 06:43:22 +03:00
|
|
|
{
|
1997-07-29 21:39:52 +04:00
|
|
|
struct grfvideo_mode gv[1];
|
|
|
|
struct grf_flag *grf_flagp;
|
|
|
|
FILE *fp;
|
|
|
|
int c, y, grffd;
|
2016-02-29 21:59:52 +03:00
|
|
|
size_t i;
|
|
|
|
int lineno = 0;
|
1997-07-29 21:39:52 +04:00
|
|
|
int uplim, lowlim;
|
|
|
|
char rawdata = 0, testmode = 0;
|
2016-02-29 21:59:52 +03:00
|
|
|
char *grfdevice = 0, *ptr;
|
1997-07-29 21:39:52 +04:00
|
|
|
char *modefile = 0;
|
1997-11-20 13:35:15 +03:00
|
|
|
char buf[_POSIX2_LINE_MAX];
|
1997-07-29 21:39:52 +04:00
|
|
|
char *cps[31];
|
|
|
|
char *p;
|
2009-04-26 23:24:18 +04:00
|
|
|
const char *errortext;
|
1997-07-29 21:39:52 +04:00
|
|
|
|
|
|
|
|
|
|
|
while ((c = getopt(ac, av, "rt")) != -1) {
|
1995-10-09 06:43:22 +03:00
|
|
|
switch (c) {
|
|
|
|
case 'r': /* raw output */
|
|
|
|
rawdata = 1;
|
|
|
|
break;
|
1997-07-29 21:39:52 +04:00
|
|
|
case 't': /* test the modefile without setting it */
|
|
|
|
testmode = 1;
|
|
|
|
break;
|
1995-10-09 06:43:22 +03:00
|
|
|
default:
|
1995-10-09 07:11:18 +03:00
|
|
|
printf("grfconfig [-r] device [file]\n");
|
1995-10-09 06:43:22 +03:00
|
|
|
return (1);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
ac -= optind;
|
|
|
|
av += optind;
|
|
|
|
|
|
|
|
|
2016-02-29 21:59:52 +03:00
|
|
|
if (ac < 1)
|
|
|
|
errx(EXIT_FAILURE, "No grf device specified");
|
|
|
|
grfdevice = av[0];
|
1995-10-09 06:43:22 +03:00
|
|
|
|
|
|
|
if (ac >= 2)
|
|
|
|
modefile = av[1];
|
|
|
|
|
2016-02-29 21:59:52 +03:00
|
|
|
if ((grffd = open(grfdevice, O_RDWR)) == -1)
|
|
|
|
err(EXIT_FAILURE, "Can't open grf device `%s'", grfdevice);
|
|
|
|
|
1995-10-09 06:43:22 +03:00
|
|
|
/* If a mode file is specificied, load it in, don't display any info. */
|
|
|
|
|
|
|
|
if (modefile) {
|
2016-02-29 21:59:52 +03:00
|
|
|
if (!(fp = fopen(modefile, "r")))
|
|
|
|
err(EXIT_FAILURE,
|
|
|
|
"Cannot open mode definition file `%s'", modefile);
|
|
|
|
|
1997-07-29 21:39:52 +04:00
|
|
|
while (fgets(buf, sizeof(buf), fp)) {
|
1997-11-20 13:35:15 +03:00
|
|
|
char *obuf, tbuf[_POSIX2_LINE_MAX], *tbuf2;
|
1997-07-29 21:39:52 +04:00
|
|
|
/*
|
|
|
|
* check for end-of-section, comments, strip off trailing
|
|
|
|
* spaces and newline character.
|
|
|
|
*/
|
2004-11-13 17:32:14 +03:00
|
|
|
for (p = buf; isspace((unsigned char)*p); ++p)
|
1997-07-29 21:39:52 +04:00
|
|
|
continue;
|
|
|
|
if (*p == '\0' || *p == '#')
|
1995-10-09 06:43:22 +03:00
|
|
|
continue;
|
2004-11-13 17:32:14 +03:00
|
|
|
for (p = strchr(buf, '\0'); isspace((unsigned char)*--p);)
|
1997-07-29 21:39:52 +04:00
|
|
|
continue;
|
|
|
|
*++p = '\0';
|
1995-10-09 06:43:22 +03:00
|
|
|
|
1997-11-20 13:35:15 +03:00
|
|
|
obuf = buf;
|
|
|
|
tbuf2 = tbuf;
|
|
|
|
while ((*tbuf2 = *obuf) != '\0') {
|
|
|
|
if (*tbuf2 == '#') {
|
|
|
|
*tbuf2 = '\0';
|
|
|
|
break;
|
|
|
|
}
|
2004-11-13 17:32:14 +03:00
|
|
|
if (isupper((unsigned char)*tbuf2)) {
|
|
|
|
*tbuf2 = tolower((unsigned char)*tbuf2);
|
1997-11-20 13:35:15 +03:00
|
|
|
}
|
|
|
|
obuf++;
|
|
|
|
tbuf2++;
|
|
|
|
}
|
|
|
|
obuf = tbuf;
|
|
|
|
|
1997-07-29 21:39:52 +04:00
|
|
|
lineno = lineno + 1;
|
|
|
|
|
2016-02-29 21:59:52 +03:00
|
|
|
#define SP " \b\t\r\n"
|
|
|
|
memset(cps, 0, sizeof(cps));
|
|
|
|
for (i = 0, ptr = strtok(buf, SP);
|
|
|
|
ptr != NULL && i < __arraycount(cps);
|
|
|
|
i++, ptr = strtok(NULL, SP))
|
|
|
|
cps[i] = ptr;
|
|
|
|
|
|
|
|
|
|
|
|
if (i < 14)
|
|
|
|
errx(EXIT_FAILURE, "Too few values in mode "
|
|
|
|
"definition file: `%s'\n", obuf);
|
1997-07-29 21:39:52 +04:00
|
|
|
|
|
|
|
gv->pixel_clock = atoi(cps[1]);
|
|
|
|
gv->disp_width = atoi(cps[2]);
|
|
|
|
gv->disp_height = atoi(cps[3]);
|
|
|
|
gv->depth = atoi(cps[4]);
|
|
|
|
gv->hblank_start = atoi(cps[5]);
|
|
|
|
gv->hsync_start = atoi(cps[6]);
|
|
|
|
gv->hsync_stop = atoi(cps[7]);
|
|
|
|
gv->htotal = atoi(cps[8]);
|
|
|
|
gv->vblank_start = atoi(cps[9]);
|
|
|
|
gv->vsync_start = atoi(cps[10]);
|
|
|
|
gv->vsync_stop = atoi(cps[11]);
|
|
|
|
gv->vtotal = atoi(cps[12]);
|
|
|
|
|
|
|
|
if ((y = atoi(cps[0])))
|
|
|
|
gv->mode_num = y;
|
|
|
|
else
|
|
|
|
if (strncasecmp("c", cps[0], 1) == 0) {
|
|
|
|
gv->mode_num = 255;
|
|
|
|
gv->depth = 4;
|
|
|
|
} else {
|
2016-02-29 21:59:52 +03:00
|
|
|
errx(EXIT_FAILURE,
|
|
|
|
"Illegal mode number: %s", cps[0]);
|
1997-07-29 21:39:52 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
if ((gv->pixel_clock == 0) ||
|
|
|
|
(gv->disp_width == 0) ||
|
|
|
|
(gv->disp_height == 0) ||
|
|
|
|
(gv->depth == 0) ||
|
|
|
|
(gv->hblank_start == 0) ||
|
|
|
|
(gv->hsync_start == 0) ||
|
|
|
|
(gv->hsync_stop == 0) ||
|
|
|
|
(gv->htotal == 0) ||
|
|
|
|
(gv->vblank_start == 0) ||
|
|
|
|
(gv->vsync_start == 0) ||
|
|
|
|
(gv->vsync_stop == 0) ||
|
|
|
|
(gv->vtotal == 0)) {
|
2016-02-29 21:59:52 +03:00
|
|
|
errx(EXIT_FAILURE, "Illegal value in "
|
|
|
|
"mode #%d: `%s'", gv->mode_num, obuf);
|
1997-07-29 21:39:52 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
if (strstr(obuf, "default") != NULL) {
|
|
|
|
gv->disp_flags = GRF_FLAGS_DEFAULT;
|
|
|
|
} else {
|
|
|
|
gv->disp_flags = GRF_FLAGS_DEFAULT;
|
|
|
|
for (grf_flagp = grf_flags;
|
|
|
|
grf_flagp->grf_flag_number; grf_flagp++) {
|
|
|
|
if (strstr(obuf, grf_flagp->grf_flag_name) != NULL) {
|
|
|
|
gv->disp_flags |= grf_flagp->grf_flag_number;
|
|
|
|
}
|
|
|
|
}
|
2016-02-29 21:59:52 +03:00
|
|
|
if (gv->disp_flags == GRF_FLAGS_DEFAULT)
|
|
|
|
errx(EXIT_FAILURE, "Your are using a "
|
1997-07-29 21:39:52 +04:00
|
|
|
"mode file with an obsolete "
|
2016-02-29 21:59:52 +03:00
|
|
|
"format");
|
1997-07-29 21:39:52 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Check for impossible gv->disp_flags:
|
|
|
|
* doublescan and interlace,
|
|
|
|
* +hsync and -hsync
|
|
|
|
* +vsync and -vsync.
|
|
|
|
*/
|
|
|
|
errortext = NULL;
|
|
|
|
if ((gv->disp_flags & GRF_FLAGS_DBLSCAN) &&
|
|
|
|
(gv->disp_flags & GRF_FLAGS_LACE))
|
|
|
|
errortext = "Interlace and Doublescan";
|
|
|
|
if ((gv->disp_flags & GRF_FLAGS_PHSYNC) &&
|
|
|
|
(gv->disp_flags & GRF_FLAGS_NHSYNC))
|
|
|
|
errortext = "+hsync and -hsync";
|
|
|
|
if ((gv->disp_flags & GRF_FLAGS_PVSYNC) &&
|
|
|
|
(gv->disp_flags & GRF_FLAGS_NVSYNC))
|
|
|
|
errortext = "+vsync and -vsync";
|
|
|
|
|
2016-02-29 21:59:52 +03:00
|
|
|
if (errortext != NULL)
|
|
|
|
errx(EXIT_FAILURE, "Illegal flags in "
|
|
|
|
"mode #%d: `%s' are both defined",
|
1997-07-29 21:39:52 +04:00
|
|
|
gv->mode_num, errortext);
|
|
|
|
|
|
|
|
/* Check for old horizontal cycle values */
|
|
|
|
if ((gv->htotal < (gv->disp_width / 4))) {
|
|
|
|
gv->hblank_start *= 8;
|
|
|
|
gv->hsync_start *= 8;
|
|
|
|
gv->hsync_stop *= 8;
|
|
|
|
gv->htotal *= 8;
|
2016-02-29 21:59:52 +03:00
|
|
|
suggest(gv, "horizontal videoclock cycle "
|
|
|
|
"values", obuf);
|
|
|
|
return EXIT_FAILURE;
|
1997-07-29 21:39:52 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
/* Check for old interlace or doublescan modes */
|
|
|
|
uplim = gv->disp_height + (gv->disp_height / 4);
|
|
|
|
lowlim = gv->disp_height - (gv->disp_height / 4);
|
|
|
|
if (((gv->vtotal * 2) > lowlim) &&
|
|
|
|
((gv->vtotal * 2) < uplim)) {
|
|
|
|
gv->vblank_start *= 2;
|
|
|
|
gv->vsync_start *= 2;
|
|
|
|
gv->vsync_stop *= 2;
|
|
|
|
gv->vtotal *= 2;
|
1997-07-30 03:41:12 +04:00
|
|
|
gv->disp_flags &= ~GRF_FLAGS_DBLSCAN;
|
|
|
|
gv->disp_flags |= GRF_FLAGS_LACE;
|
2016-02-29 21:59:52 +03:00
|
|
|
suggest(gv, "vertical values for interlace "
|
|
|
|
"modes", obuf);
|
|
|
|
return EXIT_FAILURE;
|
1997-07-30 03:41:12 +04:00
|
|
|
} else if (((gv->vtotal / 2) > lowlim) &&
|
1997-07-29 21:39:52 +04:00
|
|
|
((gv->vtotal / 2) < uplim)) {
|
|
|
|
gv->vblank_start /= 2;
|
|
|
|
gv->vsync_start /= 2;
|
|
|
|
gv->vsync_stop /= 2;
|
|
|
|
gv->vtotal /= 2;
|
1997-07-30 03:41:12 +04:00
|
|
|
gv->disp_flags &= ~GRF_FLAGS_LACE;
|
|
|
|
gv->disp_flags |= GRF_FLAGS_DBLSCAN;
|
2016-02-29 21:59:52 +03:00
|
|
|
suggest(gv, "vertical values for doublescan "
|
|
|
|
"modes", obuf);
|
|
|
|
return EXIT_FAILURE;
|
1997-07-29 21:39:52 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
if (testmode == 1) {
|
|
|
|
if (lineno == 1)
|
|
|
|
printf("num clk wid hi dep hbs "
|
|
|
|
"hss hse ht vbs vss vse vt "
|
|
|
|
"flags\n");
|
2016-02-29 21:59:52 +03:00
|
|
|
print_modeline(stdout, gv, 1);
|
1997-07-29 21:39:52 +04:00
|
|
|
} else {
|
1995-10-09 06:43:22 +03:00
|
|
|
gv->mode_descr[0] = 0;
|
|
|
|
if (ioctl(grffd, GRFIOCSETMON, (char *) gv) < 0)
|
2016-02-29 21:59:52 +03:00
|
|
|
err(EXIT_FAILURE, "bad monitor "
|
|
|
|
"definition for mode #%d",
|
1996-05-19 13:02:44 +04:00
|
|
|
gv->mode_num);
|
1995-10-09 06:43:22 +03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
fclose(fp);
|
|
|
|
} else {
|
|
|
|
ioctl(grffd, GRFGETNUMVM, &y);
|
|
|
|
y += 2;
|
|
|
|
for (c = 1; c < y; c++) {
|
|
|
|
c = gv->mode_num = (c != (y - 1)) ? c : 255;
|
|
|
|
if (ioctl(grffd, GRFGETVMODE, gv) < 0)
|
|
|
|
continue;
|
|
|
|
if (rawdata) {
|
2016-02-29 21:59:52 +03:00
|
|
|
print_modeline(stdout, gv, 0);
|
1995-10-09 06:43:22 +03:00
|
|
|
continue;
|
|
|
|
}
|
|
|
|
if (c == 255)
|
|
|
|
printf("Console: ");
|
|
|
|
else
|
|
|
|
printf("%2d: ", gv->mode_num);
|
|
|
|
|
|
|
|
printf("%dx%d",
|
|
|
|
gv->disp_width,
|
|
|
|
gv->disp_height);
|
|
|
|
|
|
|
|
if (c != 255)
|
|
|
|
printf("x%d", gv->depth);
|
|
|
|
else
|
|
|
|
printf(" (%dx%d)",
|
|
|
|
gv->disp_width / 8,
|
|
|
|
gv->disp_height / gv->depth);
|
|
|
|
|
1997-07-29 21:39:52 +04:00
|
|
|
printf("\t%ld.%ldkHz @ %ldHz",
|
|
|
|
gv->pixel_clock / (gv->htotal * 1000),
|
|
|
|
(gv->pixel_clock / (gv->htotal * 100))
|
1995-10-09 06:43:22 +03:00
|
|
|
% 10,
|
1997-07-29 21:39:52 +04:00
|
|
|
gv->pixel_clock / (gv->htotal * gv->vtotal));
|
|
|
|
printf(" flags:");
|
|
|
|
|
|
|
|
if (gv->disp_flags == GRF_FLAGS_DEFAULT) {
|
2016-02-29 21:59:52 +03:00
|
|
|
printf(" default\n");
|
|
|
|
continue;
|
1997-07-29 21:39:52 +04:00
|
|
|
}
|
2016-02-29 21:59:52 +03:00
|
|
|
|
|
|
|
for (grf_flagp = grf_flags;
|
|
|
|
grf_flagp->grf_flag_number; grf_flagp++)
|
|
|
|
if (gv->disp_flags & grf_flagp->grf_flag_number)
|
|
|
|
printf(" %s", grf_flagp->grf_flag_name);
|
1997-07-29 21:39:52 +04:00
|
|
|
printf("\n");
|
1995-10-09 06:43:22 +03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
close(grffd);
|
2016-02-29 21:59:52 +03:00
|
|
|
return EXIT_SUCCESS;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
suggest(struct grfvideo_mode *gv, const char *d, const char *s)
|
|
|
|
{
|
|
|
|
warnx("Old and no longer supported %s: %s", d, s);
|
|
|
|
warnx("Wrong mode line, this could be a possible good model line:");
|
|
|
|
fprintf(stderr, "%s: ", getprogname());
|
|
|
|
print_modeline(stderr, gv, 0);
|
1995-10-09 06:43:22 +03:00
|
|
|
}
|
1997-07-29 21:39:52 +04:00
|
|
|
|
|
|
|
static void
|
2016-02-29 21:59:52 +03:00
|
|
|
print_modeline(FILE *fp, struct grfvideo_mode *gv, int rawflags)
|
1997-07-29 21:39:52 +04:00
|
|
|
{
|
|
|
|
struct grf_flag *grf_flagp;
|
|
|
|
|
2016-02-29 21:59:52 +03:00
|
|
|
if (gv->mode_num == 255)
|
|
|
|
fprintf(fp, "c ");
|
|
|
|
else
|
|
|
|
fprintf(fp, "%d ", gv->mode_num);
|
|
|
|
|
|
|
|
fprintf(fp, "%ld %d %d %d %d %d %d %d %d %d %d %d",
|
1997-07-29 21:39:52 +04:00
|
|
|
gv->pixel_clock,
|
|
|
|
gv->disp_width,
|
|
|
|
gv->disp_height,
|
|
|
|
gv->depth,
|
|
|
|
gv->hblank_start,
|
|
|
|
gv->hsync_start,
|
|
|
|
gv->hsync_stop,
|
|
|
|
gv->htotal,
|
|
|
|
gv->vblank_start,
|
|
|
|
gv->vsync_start,
|
|
|
|
gv->vsync_stop,
|
|
|
|
gv->vtotal);
|
2016-02-29 21:59:52 +03:00
|
|
|
|
|
|
|
if (rawflags) {
|
|
|
|
fprintf(fp, " 0x%.2x\n", gv->disp_flags);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
if (gv->disp_flags == GRF_FLAGS_DEFAULT) {
|
|
|
|
fprintf(fp, " default\n");
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
for (grf_flagp = grf_flags; grf_flagp->grf_flag_number; grf_flagp++)
|
|
|
|
if (gv->disp_flags & grf_flagp->grf_flag_number)
|
|
|
|
fprintf(fp, " %s", grf_flagp->grf_flag_name);
|
|
|
|
fprintf(fp, "\n");
|
1997-07-29 21:39:52 +04:00
|
|
|
}
|