8int graph_make_config(
int mode,
int interlace,
int ffmd,
int x,
int y,
int flicker_filter,
char *config)
36 default: sprintf(config,
"GRAPH_MODE_AUTO:");
break;
44 case GRAPH_MODE_NONINTERLACED: sprintf(config,
"GRAPH_MODE_NONINTERLACED:");
break;
45 case GRAPH_MODE_INTERLACED:
46 default: sprintf(config,
"GRAPH_MODE_INTERLACED:");
break;
54 case GRAPH_MODE_FRAME: sprintf(config,
"GRAPH_MODE_FRAME:");
break;
55 case GRAPH_MODE_FIELD:
56 default: sprintf(config,
"GRAPH_MODE_FIELD:");
break;
61 switch (flicker_filter)
64 case GRAPH_ENABLE: sprintf(config,
"GRAPH_ENABLE:");
break;
66 default: sprintf(config,
"GRAPH_DISABLE:");
break;
71 sprintf(config,
"%d:",x);
72 sprintf(config,
"%d:",y);
82 int mode, interlace, ffmd;
87 temp0 = config; temp1 = strtok(temp0,
":"); temp0 += strlen(temp1) + 1;
90 if (strcmp(temp1,
"GRAPH_MODE_AUTO" ) == 0) { mode =
GRAPH_MODE_AUTO; }
else
91 if (strcmp(temp1,
"GRAPH_MODE_NTSC" ) == 0) { mode =
GRAPH_MODE_NTSC; }
else
92 if (strcmp(temp1,
"GRAPH_MODE_PAL" ) == 0) { mode =
GRAPH_MODE_PAL; }
else
120 temp1 = strtok(temp0,
":"); temp0 += strlen(temp1) + 1;
123 if (strcmp(temp1,
"GRAPH_MODE_NONINTERLACED" ) == 0) { interlace = GRAPH_MODE_NONINTERLACED; }
else
124 if (strcmp(temp1,
"GRAPH_MODE_INTERLACED" ) == 0) { interlace = GRAPH_MODE_INTERLACED; }
128 interlace = GRAPH_MODE_INTERLACED;
133 temp1 = strtok(temp0,
":"); temp0 += strlen(temp1) + 1;
136 if (strcmp(temp1,
"GRAPH_MODE_FRAME" ) == 0) { ffmd = GRAPH_MODE_FRAME; }
else
137 if (strcmp(temp1,
"GRAPH_MODE_FIELD" ) == 0) { ffmd = GRAPH_MODE_FIELD; }
141 ffmd = GRAPH_MODE_FIELD;
146 temp1 = strtok(temp0,
":"); temp0 += strlen(temp1) + 1;
149 if (strcmp(temp1,
"GRAPH_DISABLE" ) == 0) { flicker_filter =
GRAPH_DISABLE; }
else
150 if (strcmp(temp1,
"GRAPH_ENABLE" ) == 0) { flicker_filter = GRAPH_ENABLE; }
154 flicker_filter = GRAPH_ENABLE;
159 if (interlace == GRAPH_MODE_NONINTERLACED)
167 temp1 = strtok(temp0,
":"); temp0 += strlen(temp1) + 1;
173 temp1 = strtok(temp0,
":"); temp0 += strlen(temp1) + 1;
187 FILE *infile;
char config[512];
190 if ((infile = fopen(filename,
"r")) == NULL)
198 if (fread(config, 1,
sizeof(config), infile) !=
sizeof(config))
207 if (fclose(infile) != 0)
222 FILE *outfile;
char config[512];
228 if ((outfile = fopen(filename,
"w")) == NULL)
236 if (fwrite(config, 1, strnlen(config,
sizeof(config)), outfile) == strnlen(config,
sizeof(config)))
245 if (fclose(outfile) != 0)
#define GRAPH_MODE_VGA_1024_75
#define GRAPH_MODE_VGA_1280_60
#define GRAPH_MODE_HDTV_576P
#define GRAPH_MODE_VGA_800_75
#define GRAPH_MODE_VGA_1280_75
#define GRAPH_MODE_VGA_800_85
#define GRAPH_MODE_HDTV_1080I
#define GRAPH_MODE_VGA_640_72
#define GRAPH_MODE_VGA_640_85
#define GRAPH_MODE_VGA_640_60
#define GRAPH_MODE_VGA_1024_85
#define GRAPH_MODE_VGA_1024_60
#define GRAPH_MODE_VGA_800_60
#define GRAPH_MODE_VGA_640_75
#define GRAPH_MODE_VGA_800_56
#define GRAPH_MODE_HDTV_720P
#define GRAPH_MODE_HDTV_480P
#define GRAPH_MODE_VGA_1024_70
#define GRAPH_MODE_VGA_800_72
int graph_set_mode(int interlace, int mode, int ffmd, int flicker_filter)
int graph_load_config(char *filename)
int graph_set_config(char *config)
int graph_save_config(char *filename)
int graph_get_config(char *config)
int graph_make_config(int mode, int interlace, int ffmd, int x, int y, int flicker_filter, char *config)