From: Sascha Wildner Date: Sun, 30 Aug 2009 09:58:32 +0000 (+0200) Subject: trek(6): Drop fast/slow modes and the broken autodetection X-Git-Tag: v2.4.0~100^2~2 X-Git-Url: https://gitweb.dragonflybsd.org/dragonfly.git/commitdiff_plain/dd3e6a730a745fcc6cc6e1e79b109fdcb6fd4b21 trek(6): Drop fast/slow modes and the broken autodetection These modes were not documented in the manpage, the autodetect logic was reversed (only terminals with baud < 1200 would get the fast flag) and even the source was confused claiming this fast setting was for terminals with baud > 300. The only thing that changes is the automatic short range scan output down when entering a new sector. Now the full report is shown always but can still be somewhat customized. Incidentally, this also obviates the need for termios. yay! Submitted-by: Ulrich Spoerlein Dragonfly-bug: --- diff --git a/games/trek/main.c b/games/trek/main.c index df2a5aefde..b8b183c358 100644 --- a/games/trek/main.c +++ b/games/trek/main.c @@ -38,7 +38,6 @@ # include "getpar.h" # include "trek.h" -# include # define PRIO 00 /* default priority */ @@ -151,7 +150,6 @@ main(int argc, char **argv) int prio; int ac; char **av; - struct sgttyb argp; /* revoke */ setgid(getgid()); @@ -162,11 +160,7 @@ main(int argc, char **argv) srandomdev(); opencode = 'w'; prio = PRIO; - if (ioctl(1, TIOCGETP, &argp) == 0) - { - if ((argp.sg_ispeed ) < B1200) - Etc.fast++; - } + while (ac > 1 && av[0][0] == '-') { switch (av[0][1]) @@ -175,14 +169,6 @@ main(int argc, char **argv) opencode = 'a'; break; - case 'f': /* set fast mode */ - Etc.fast++; - break; - - case 's': /* set slow mode */ - Etc.fast = 0; - break; - # ifdef xTRACE case 't': /* trace */ if (getuid() != Mother) diff --git a/games/trek/srscan.c b/games/trek/srscan.c index d0cc379c79..5d17f85305 100644 --- a/games/trek/srscan.c +++ b/games/trek/srscan.c @@ -42,8 +42,8 @@ ** SHORT RANGE SENSOR SCAN ** ** A short range scan is taken of the current quadrant. If the -** flag 'f' is one, it is an "auto srscan", which is not done -** unless in 'fast' mode. It does a status report and a srscan. +** flag 'f' is one, it is an "auto srscan". It does a status +** report and a srscan. ** If 'f' is -1, you get a status report only. If it is zero, ** you get a srscan and an optional status report. The status ** report is taken if you enter "srscan yes"; for all srscans @@ -84,11 +84,7 @@ srscan(int f) statinfo = Etc.statreport; } if (f > 0) - { Etc.statreport = 1; - if (!Etc.fast) - return; - } if (f >= 0) { printf("\nShort range sensor scan\n"); diff --git a/games/trek/trek.h b/games/trek/trek.h index d10b05b285..a981fe50fc 100644 --- a/games/trek/trek.h +++ b/games/trek/trek.h @@ -338,7 +338,6 @@ struct struct kling klingon[MAXKLQUAD]; /* sorted Klingon list */ int nkling; /* number of Klingons in this sector */ /* < 0 means automatic override mode */ - char fast; /* set if speed > 300 baud */ struct xy starbase; /* starbase in current quadrant */ char snapshot[sizeof Quad + sizeof Event + sizeof Now]; /* snapshot for time warp */ char statreport; /* set to get a status report on a srscan */