View | Details | Raw Unified | Return to bug 205208
Collapse All | Expand All

(-)games/xscavenger/Makefile (-5 / +14 lines)
Lines 2-17 Link Here
2
# $FreeBSD: head/games/xscavenger/Makefile 401096 2015-11-09 12:59:03Z antoine $
2
# $FreeBSD: head/games/xscavenger/Makefile 401096 2015-11-09 12:59:03Z antoine $
3
3
4
PORTNAME=	xscavenger
4
PORTNAME=	xscavenger
5
PORTVERSION=	1.4.4
5
PORTVERSION=	1.4.5
6
PORTREVISION=	2
7
CATEGORIES=	games
6
CATEGORIES=	games
8
MASTER_SITES=	http://www.xdr.com/dash/
7
MASTER_SITES=	http://www.linuxmotors.com/scavenger/downloads/
9
8
10
MAINTAINER=	ports@FreeBSD.org
9
MAINTAINER=	ports@FreeBSD.org
11
COMMENT=	Lode Runner clone for X11
10
COMMENT=	Lode Runner clone for X11
12
11
13
BROKEN=		unfetchable
14
15
LICENSE=	GPLv2
12
LICENSE=	GPLv2
16
LICENSE_FILE=	${WRKSRC}/../copyright
13
LICENSE_FILE=	${WRKSRC}/../copyright
17
14
Lines 22-27 Link Here
22
19
23
CFLAGS+=	-Wno-return-type -Wno-pointer-sign
20
CFLAGS+=	-Wno-return-type -Wno-pointer-sign
24
21
22
DESKTOP_ENTRIES="XScavenger" "" "" "scavenger" "" ""
23
24
OPTIONS_DEFINE=		ALSA
25
OPTIONS_DEFAULT=	ALSA
26
27
ALSA_LIB_DEPENDS=	libasound.so:${PORTSDIR}/audio/alsa-lib
28
ALSA_CFLAGS_OFF=	-DNO_ALSA
29
30
post-patch-ALSA-off:
31
	@${REINPLACE_CMD} -e \
32
		's|-lasound||' ${WRKSRC}/Imakefile
33
25
pre-configure:
34
pre-configure:
26
	@${LN} -sf scavenger.6 ${WRKSRC}/scavenger.man
35
	@${LN} -sf scavenger.6 ${WRKSRC}/scavenger.man
27
	@${ECHO_CMD} "MANSUFFIX=6" >> ${WRKSRC}/Imakefile
36
	@${ECHO_CMD} "MANSUFFIX=6" >> ${WRKSRC}/Imakefile
(-)games/xscavenger/distinfo (-2 / +2 lines)
Lines 1-2 Link Here
1
SHA256 (xscavenger-1.4.4.tgz) = 65c8d2224068151fcac704f34b91fb46056f77b708b1a60170a955d93751553e
1
SHA256 (xscavenger-1.4.5.tgz) = f719ffd4ed2abaed9f34b5d22bc392f3067b5c4b19bea2e9a02be07243a4d406
2
SIZE (xscavenger-1.4.4.tgz) = 193346
2
SIZE (xscavenger-1.4.5.tgz) = 192990
(-)games/xscavenger/files/patch-edit.c (-10 lines)
Lines 1-10 Link Here
1
--- edit.c.orig	2013-06-11 18:21:01.902812410 +0400
2
+++ edit.c	2013-06-11 18:21:15.931811652 +0400
3
@@ -2,6 +2,7 @@
4
 
5
 #include <stdio.h>
6
 #include <unistd.h>
7
+#include <string.h>
8
 #include "scav.h"
9
 #include "edit.h"
10
 #include "x.h"
(-)games/xscavenger/files/patch-sound.c (-10 / +226 lines)
Lines 1-11 Link Here
1
--- sound.c.orig	Tue May 22 17:45:42 2001
1
--- sound.c.orig	2014-11-18 23:26:13 UTC
2
+++ sound.c	Tue May 22 17:45:53 2001
2
+++ sound.c
3
@@ -5,7 +5,7 @@
3
@@ -10,7 +10,13 @@
4
 #include <unistd.h>
5
 #include <fcntl.h>
6
 #include <sys/ioctl.h>
7
-#include <linux/soundcard.h>
8
+#include <sys/soundcard.h>
9
 #include <sys/time.h>
10
 #include <signal.h>
11
 #include <string.h>
4
 #include <string.h>
5
 #include <errno.h>
6
 
7
+#ifdef NO_ALSA
8
+#include <sys/ioctl.h>
9
+#include <sys/soundcard.h>
10
+#define SOUNDDEV "/dev/dsp"
11
+#else
12
 #include <alsa/asoundlib.h>
13
+#endif
14
 
15
 
16
 #include "scav.h"
17
@@ -42,10 +48,14 @@ sample samples[NUMSOUNDS];
18
 
19
 int soundworking=0;
20
 int fragment;
21
+#ifdef NO_ALSA
22
+int dsp;
23
+#endif
24
 int soundwrite,soundread;
25
 int *soundbuffer;
26
 int soundbufferlen;
27
 
28
+#ifndef NO_ALSA
29
 snd_pcm_t *playback_handle;
30
 
31
 void opendsp(int samplerate)
32
@@ -122,6 +132,7 @@ void opendsp(int samplerate)
33
 	}
34
 
35
 }
36
+#endif
37
 
38
 
39
 void soundinit(void)
40
@@ -129,26 +140,50 @@ void soundinit(void)
41
 	int fd[2];
42
 	char devname[256];
43
 	int value;
44
+#ifndef NO_ALSA
45
 	int res;
46
+#endif
47
 
48
 	sprintf(dirlist,"%s/%s,%s",localname,localdirname,libname);
49
 	soundworking=0;
50
+#ifdef NO_ALSA
51
+	pipe(fd);
52
+#else
53
 	res=pipe(fd);res=res;//STFU
54
+#endif
55
 	soundread=fd[0];
56
 	soundwrite=fd[1];
57
+#ifdef NO_ALSA
58
+	if(fork())
59
+#else
60
 	res = fork();
61
 	if(res>0)
62
+#endif
63
 	{
64
 		close(soundread);
65
 		return;
66
 	}
67
 	close(soundwrite);
68
 	memset(samples,0,sizeof(samples));
69
+#ifdef NO_ALSA
70
+	strcpy(devname,SOUNDDEV);
71
+	dsp=open(devname,O_WRONLY);
72
+	if(dsp<0) goto failed;
73
+	fragment=0x20009;
74
+	ioctl(dsp,SNDCTL_DSP_SETFRAGMENT,&fragment);
75
+	value=10000;
76
+	ioctl(dsp,SNDCTL_DSP_SPEED,&value);
77
+	value=0;
78
+	ioctl(dsp,SNDCTL_DSP_STEREO,&value);
79
+	ioctl(dsp,SNDCTL_DSP_GETBLKSIZE,&fragment);
80
+	if(!fragment) {close(dsp);goto failed;}
81
+#else
82
 
83
 // 10,000 hz mono 8bit samples
84
 	fragment = 256;
85
 	opendsp(10000);
86
 
87
+#endif
88
 	soundbufferlen=fragment*sizeof(int);
89
 	soundbuffer=malloc(soundbufferlen);
90
 	if(!soundbuffer) goto failed;
91
@@ -180,12 +215,21 @@ int i,file,size,len;
92
 	}
93
 	size=lseek(file,0,SEEK_END);
94
 	lseek(file,0,SEEK_SET);
95
+#ifdef NO_ALSA
96
+	len=samples[num].len=(size+fragment-1)/fragment;
97
+#else
98
 	int expand = 1;
99
 	len=samples[num].len=(size*expand+fragment-1)/fragment;
100
+#endif
101
 	len*=fragment;
102
 	p1=samples[num].data=malloc(len);
103
 	if(p1)
104
 	{
105
+#ifdef NO_ALSA
106
+		i=read(file,p1,size);
107
+		if(len-size) memset(p1+size,0,len-size);
108
+		while(size--) *p1++ ^= 0x80;
109
+#else
110
 		memset(p1, 0, len);
111
 		int got=read(file,p1,size);
112
 		for(i=got-1;i>=0;--i)
113
@@ -194,6 +238,7 @@ int i,file,size,len;
114
 			for(j=expand-1;j>=0;--j)
115
 				p1[i*expand+j] = p1[i] - 0x80;
116
 		}
117
+#endif
118
 	} else
119
 		samples[num].data=0;
120
 	close(file);
121
@@ -207,8 +252,12 @@ signed char *p;
122
 int *ip;
123
 int playing[MIXMAX],position[MIXMAX];
124
 int which;
125
+#ifdef NO_ALSA
126
+unsigned char clip[8192];
127
+#else
128
 int *mixbuffer;
129
 short *outbuffer;
130
+#endif
131
 
132
 	while(!soundworking)
133
 	{
134
@@ -223,12 +272,21 @@ short *outbuffer;
135
 		com=*commands;
136
 		if(com==SOUND_EXIT) exit(0);
137
 	}
138
+#ifdef NO_ALSA
139
+	for(i=0;i<8192;i++)
140
+	{
141
+		j=i-4096;
142
+		clip[i]=j > 127 ? 255 : (j<-128 ? 0 : j+128);
143
+	}
144
+#endif
145
 	for(i=0;i<NUMSOUNDS;++i)
146
 		readsound(i);
147
 	memset(playing,0,sizeof(playing));
148
 	memset(position,0,sizeof(position));
149
+#ifndef NO_ALSA
150
 	mixbuffer = malloc(fragment * sizeof(*mixbuffer));
151
 	outbuffer = malloc(fragment * sizeof(*outbuffer));
152
+#endif
153
 	for(;;)
154
 	{
155
 		commandlen=read(soundread,commands,64);
156
@@ -238,10 +296,18 @@ short *outbuffer;
157
 			commandlen=0;
158
 			if(errno==EPIPE) exit(0);
159
 		} else if(commandlen==0) exit(0);
160
+#ifdef NO_ALSA
161
+		p=commands;
162
+#else
163
 		signed char *comp=commands;
164
+#endif
165
 		while(commandlen--)
166
 		{
167
+#ifdef NO_ALSA
168
+			com=*p++;
169
+#else
170
 			com=*comp++;
171
+#endif
172
 			if(com==SOUND_QUIET) {memset(position,0,sizeof(position));continue;}
173
 			if(com==SOUND_EXIT) exit(0);
174
 			if(com<NUMSOUNDS)
175
@@ -261,7 +327,11 @@ short *outbuffer;
176
 						position[i]=0;
177
 			}
178
 		}
179
+#ifdef NO_ALSA
180
+		memset(soundbuffer,0,soundbufferlen);
181
+#else
182
 		memset(mixbuffer, 0, fragment * sizeof(*mixbuffer));
183
+#endif
184
 		for(i=0;i<MIXMAX;++i)
185
 		{
186
 			if(!position[i]) continue;
187
@@ -274,6 +344,17 @@ short *outbuffer;
188
 			p=samples[which].data;
189
 			if(!p) continue;
190
 			p+=fragment*(position[i]++ -1);
191
+#ifdef NO_ALSA
192
+			ip=soundbuffer;
193
+			j=fragment;
194
+			while(j--) *ip++ += *p++;
195
+		}
196
+		j=fragment;
197
+		ip=soundbuffer;
198
+		p=(char *) soundbuffer;
199
+		while(j--) *p++ = clip[4096+*ip++];
200
+		write(dsp,(char *)soundbuffer,fragment);
201
+#else
202
 
203
 			for(j=0;j<fragment;++j)
204
 				mixbuffer[j] += 255*p[j];
205
@@ -289,15 +370,22 @@ short *outbuffer;
206
 		res = snd_pcm_writei(playback_handle, outbuffer, fragment);
207
 //printf("res=%d\n", res);
208
 
209
+#endif
210
 	}
211
 }
212
 
213
 void playsound(int n)
214
 {
215
 	char c;
216
+#ifndef NO_ALSA
217
 	int res;
218
+#endif
219
 	c=n;
220
+#ifdef NO_ALSA
221
+	write(soundwrite,&c,1);
222
+#else
223
 	res=write(soundwrite,&c,1);res=res;//STFU
224
+#endif
225
 }
226
 
227
 void endsound(void)
(-)games/xscavenger/pkg-descr (-8 / +8 lines)
Lines 1-12 Link Here
1
Scavenger is like Lode Runner. You've got to run around gathering objects
1
Scavenger is like Lode Runner. You've got to run around gathering
2
while avoiding enemies. You can dig down through some of the blocks to get
2
objects while avoiding enemies. You can dig down through some of the
3
at buried objects. After you've collected everything, ladders may appear.
3
blocks to get at buried objects. After you've collected everything,
4
To finish the level you've got to exit through the top of the screen. If
4
ladders may appear. To finish the level you've got to exit through the
5
an enemy falls into a dug brick, he is stunned for a while. If the brick
5
top of the screen. If an enemy falls into a dug brick, he is stunned for
6
fills in with him in it, he is killed, and he will reappear at the top of
6
a while. If the brick fills in with him in it, he is killed, and he will
7
the screen.
7
reappear at the top of the screen.
8
8
9
This version has a level editor for designing your own levels, and a
9
This version has a level editor for designing your own levels, and a
10
graphics editor for drawing your own artwork.
10
graphics editor for drawing your own artwork.
11
11
12
WWW: http://www.xdr.com/dash/scavenger.html
12
WWW: http://www.linuxmotors.com/scavenger/

Return to bug 205208