Bug #1470 » 0002-Drop-fast-slow-modes-and-the-broken-autodetection.patch
games/trek/main.c | ||
---|---|---|
|
||
# include "getpar.h"
|
||
# include "trek.h"
|
||
# include <termios.h>
|
||
|
||
# define PRIO 00 /* default priority */
|
||
|
||
... | ... | |
int prio;
|
||
int ac;
|
||
char **av;
|
||
struct termios argp;
|
||
|
||
/* revoke */
|
||
setgid(getgid());
|
||
... | ... | |
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])
|
||
... | ... | |
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)
|
games/trek/srscan.c | ||
---|---|---|
** 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
|
||
... | ... | |
statinfo = Etc.statreport;
|
||
}
|
||
if (f > 0)
|
||
{
|
||
Etc.statreport = 1;
|
||
if (!Etc.fast)
|
||
return;
|
||
}
|
||
if (f >= 0)
|
||
{
|
||
printf("\nShort range sensor scan\n");
|
games/trek/trek.h | ||
---|---|---|
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 */
|
||
-
|
- « Previous
- 1
- 2
- Next »