0002-Drop-fast-slow-modes-and-the-broken-autodetection.patch

uqs, 08/29/2009 12:14 AM

Download (3.3 KB)

View differences:

games/trek/main.c
38 38

  
39 39
# include	"getpar.h"
40 40
# include	"trek.h"
41
# include 	<termios.h>
42 41

  
43 42
# define	PRIO		00	/* default priority */
44 43

  
......
151 150
	int			prio;
152 151
	int		ac;
153 152
	char		**av;
154
	struct	termios		argp;
155 153

  
156 154
	/* revoke */
157 155
	setgid(getgid());
......
162 160
	srandomdev();
163 161
	opencode = 'w';
164 162
	prio = PRIO;
165
	if (tcgetattr(1, &argp) == 0)
166
	{
167
		if ((cfgetispeed(&argp)) < B1200)
168
			Etc.fast++;
169
	}
163

  
170 164
	while (ac > 1 && av[0][0] == '-')
171 165
	{
172 166
		switch (av[0][1])
......
175 169
			opencode = 'a';
176 170
			break;
177 171

  
178
		  case 'f':	/* set fast mode */
179
			Etc.fast++;
180
			break;
181

  
182
		  case 's':	/* set slow mode */
183
			Etc.fast = 0;
184
			break;
185

  
186 172
#		ifdef xTRACE
187 173
		  case 't':	/* trace */
188 174
			if (getuid() != Mother)
games/trek/srscan.c
42 42
**  SHORT RANGE SENSOR SCAN
43 43
**
44 44
**	A short range scan is taken of the current quadrant.  If the
45
**	flag 'f' is one, it is an "auto srscan", which is not done
46
**	unless in 'fast' mode.  It does a status report and a srscan.
45
**	flag 'f' is one, it is an "auto srscan".  It does a status
46
**      report and a srscan.
47 47
**	If 'f' is -1, you get a status report only.  If it is zero,
48 48
**	you get a srscan and an optional status report.  The status
49 49
**	report is taken if you enter "srscan yes"; for all srscans
......
84 84
		statinfo = Etc.statreport;
85 85
	}
86 86
	if (f > 0)
87
	{
88 87
		Etc.statreport = 1;
89
		if (!Etc.fast)
90
			return;
91
	}
92 88
	if (f >= 0)
93 89
	{
94 90
		printf("\nShort range sensor scan\n");
games/trek/trek.h
338 338
	struct kling	klingon[MAXKLQUAD];	/* sorted Klingon list */
339 339
	int		nkling;			/* number of Klingons in this sector */
340 340
						/* < 0 means automatic override mode */
341
	char		fast;			/* set if speed > 300 baud */
342 341
	struct xy	starbase;	/* starbase in current quadrant */
343 342
	char		snapshot[sizeof Quad + sizeof Event + sizeof Now];	/* snapshot for time warp */
344 343
	char		statreport;		/* set to get a status report on a srscan */
345
-