#define XCONFIG "/usr/X386/lib/X11/Xconfig"
#endif
+/* Floating-point modulo operation. SVr4 has this directly */
+#define fmodf(x, y) (x - (floor(x/y) * y))
+
/**************************************************************************
*
* Globals
{"RSH", 1, EDIT, "Right shift (in units of 8 pixels)"},
};
-static int tweak_config()
-{
- int newlevel, c;
- float diff;
-
-
- c = '\0';
- for (;;)
- {
- if (c)
- c = getchoice("Command", "abx", 'x');
- else
- {
- (void) printf("\nRecomputing...\n");
- c = '?';
- }
-
- switch (c)
- {
- case 'a': /* change HSP */
- diff = (hsp.value * dcf.value);
- getfloat(&hsp);
- diff -= (hsp.value * dcf.value);
- hs1.value += (diff / 2);
- hs2.value -= (diff / 2);
- break;
-
- case 'b': /* change VSP width */
- diff = (vsp.value * dcf.value) / vfl.value;
- getfloat(&vsp);
- diff -= (vsp.value * dcf.value) / vfl.value;
- vs1.value += (diff / 2);
- vs2.value -= (diff / 2);
- break;
-
-
- case 'c': /* shift left */
- getint(&lsh);
- hs1.value += lsh.value;
- hs2.value += lsh.value;
- break;
-
- case 'd': /* shift right */
- getint(&rsh);
- hs1.value += rsh.value;
- hs2.value += rsh.value;
- break;
-
- case 'x':
- return(DONE);
-
- default:
- (void) printf("Available commands are:\n");
- /* FALL THROUGH */
- case '?':
- (void) printf("a -- change horizontal sync pulse width (HSP).\n");
- (void) printf("b -- change vertical sync pulse width (VSP).\n");
- (void) printf("c -- shift image to the left.\n");
- (void) printf("d -- shift image to the right.\n");
- (void) printf("? -- display commands.\n");
- (void) printf("x -- return to main menu.\n");
- break;
- }
-
- redisplay(&hfl, &vs2);
-
- (void) printf("Current timing mumbers: %d %d %d %d %d %d %d %d\n",
- (int)hr.value, (int)hs1.value, (int)hs2.value, (int)hfl.value,
- (int)vr.value, (int)vs1.value, (int)vs2.value, (int)vfl.value);
-
- if ((newlevel = sanecheck(EDIT)) < EDIT)
- return(newlevel);
- (void) putchar('\n');
- }
-}
-
-/**************************************************************************
- *
- * Main sequence
- *
- **************************************************************************/
-
static int sanecheck(const int level)
/* check for configuration problems */
{
return(level + 1);
}
+static int tweak_config()
+{
+ int newlevel, c;
+ float diff;
+
+
+ c = '\0';
+ for (;;)
+ {
+ if (c)
+ c = getchoice("Command", "abx", 'x');
+ else
+ {
+ (void) printf("\nRecomputing...\n");
+ c = '?';
+ }
+
+ switch (c)
+ {
+ case 'a': /* change HSP */
+ diff = (hsp.value * dcf.value);
+ getfloat(&hsp);
+ diff -= (hsp.value * dcf.value);
+ hs1.value += (diff / 2);
+ hs2.value -= (diff / 2);
+ break;
+
+ case 'b': /* change VSP width */
+ diff = (vsp.value * dcf.value) / vfl.value;
+ getfloat(&vsp);
+ diff -= (vsp.value * dcf.value) / vfl.value;
+ vs1.value += (diff / 2);
+ vs2.value -= (diff / 2);
+ break;
+
+
+ case 'c': /* shift left */
+ getint(&lsh);
+ hs1.value += lsh.value;
+ hs2.value += lsh.value;
+ break;
+
+ case 'd': /* shift right */
+ getint(&rsh);
+ hs1.value += rsh.value;
+ hs2.value += rsh.value;
+ break;
+
+ case 'x':
+ return(DONE);
+
+ default:
+ (void) printf("Available commands are:\n");
+ /* FALL THROUGH */
+ case '?':
+ (void) printf("a -- change horizontal sync pulse width (HSP).\n");
+ (void) printf("b -- change vertical sync pulse width (VSP).\n");
+ (void) printf("c -- shift image to the left.\n");
+ (void) printf("d -- shift image to the right.\n");
+ (void) printf("? -- display commands.\n");
+ (void) printf("x -- return to main menu.\n");
+ break;
+ }
+
+ redisplay(&hfl, &vs2);
+
+ (void) printf("Current timing mumbers: %d %d %d %d %d %d %d %d\n",
+ (int)hr.value, (int)hs1.value, (int)hs2.value, (int)hfl.value,
+ (int)vr.value, (int)vs1.value, (int)vs2.value, (int)vfl.value);
+
+ if ((newlevel = sanecheck(EDIT)) < EDIT)
+ return(newlevel);
+ (void) putchar('\n');
+ }
+}
+
+/**************************************************************************
+ *
+ * Main sequence
+ *
+ **************************************************************************/
+
main(int argc, char **argv)
{
int enable;