From 6731f46940e60bae9f95a85120bc901c63fa429e Mon Sep 17 00:00:00 2001 From: uqs@spoerlein.net Date: Sat, 29 Aug 2009 01:44:43 +0200 Subject: [PATCH 2/2] 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! --- games/trek/main.c | 16 +--------------- games/trek/srscan.c | 8 ++------ games/trek/trek.h | 1 - 3 files changed, 3 insertions(+), 22 deletions(-) diff --git a/games/trek/main.c b/games/trek/main.c index 76f3c40..b8b183c 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 termios argp; /* revoke */ setgid(getgid()); @@ -162,11 +160,7 @@ main(int argc, char **argv) srandomdev(); opencode = 'w'; prio = PRIO; - if (tcgetattr(1, &argp) == 0) - { - if ((cfgetispeed(&argp)) < 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 d0cc379..23b4b37 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 d10b05b..a981fe5 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 */ -- 1.6.4