also added license marker and moved the note about 8-bit displays to MESSAGE.
ok? -- jake...@sdf.lonestar.org SDF Public Access UNIX System - http://sdf.lonestar.org Index: Makefile =================================================================== RCS file: /cvs/ports/games/xboing/Makefile,v retrieving revision 1.24 diff -N -u -p Makefile --- Makefile 10 Aug 2009 06:31:43 -0000 1.24 +++ Makefile 3 Jan 2009 11:01:20 -0000 @@ -4,18 +4,19 @@ COMMENT= blockout style game for X11 V= 2.4 DISTNAME= xboing${V} -PKGNAME= xboing-${V}p2 +PKGNAME= xboing-${V}p3 CATEGORIES= games HOMEPAGE= http://www.techrescue.org/xboing/ +# X Consortium PERMIT_PACKAGE_CDROM= Yes PERMIT_PACKAGE_FTP= Yes PERMIT_DISTFILES_CDROM= Yes PERMIT_DISTFILES_FTP= Yes -WANTLIB= X11 Xau Xdmcp Xext Xpm c m ossaudio pthread-stubs xcb +WANTLIB= X11 Xau Xdmcp Xext Xpm c m pthread-stubs sndio xcb MASTER_SITES= ${MASTER_SITE_XCONTRIB:=games/} Index: patches/patch-Imakefile =================================================================== RCS file: /cvs/ports/games/xboing/patches/patch-Imakefile,v retrieving revision 1.5 diff -N -u -p patches/patch-Imakefile --- patches/patch-Imakefile 7 Dec 2007 10:25:46 -0000 1.5 +++ patches/patch-Imakefile 3 Jan 2009 11:01:20 -0000 @@ -1,6 +1,6 @@ $OpenBSD: patch-Imakefile,v 1.5 2007/12/07 10:25:46 ajacoutot Exp $ ---- Imakefile.orig Fri Nov 22 02:28:46 1996 -+++ Imakefile Fri Dec 7 09:53:24 2007 +--- Imakefile.orig Thu Nov 21 17:28:46 1996 ++++ Imakefile Sat Jan 2 23:47:56 2010 @@ -24,23 +24,23 @@ XCOMM ================================================ XCOMM This is the directory where the highscore, level & sound data will be XCOMM placed. Default will be the current directory. @@ -29,7 +29,7 @@ $OpenBSD: patch-Imakefile,v 1.5 2007/12/07 10:25:46 aj AUDIO_INCLUDE = - AUDIO_LIB = - CDEBUGFLAGS = -g -+ AUDIO_LIB = -lossaudio ++ AUDIO_LIB = -lsndio XCOMM Uncomment this if you want to use ANY of the AUDIO sound systems #define COMPILE_IN_AUDIO Index: patches/patch-audio-LINUXaudio.c =================================================================== RCS file: /cvs/ports/games/xboing/patches/patch-audio-LINUXaudio.c,v retrieving revision 1.2 diff -N -u -p patches/patch-audio-LINUXaudio.c --- patches/patch-audio-LINUXaudio.c 5 Mar 2004 22:56:42 -0000 1.2 +++ patches/patch-audio-LINUXaudio.c 3 Jan 2009 11:01:20 -0000 @@ -1,13 +1,128 @@ $OpenBSD: patch-audio-LINUXaudio.c,v 1.2 2004/03/05 22:56:42 naddy Exp $ ---- audio/LINUXaudio.c.orig 1996-11-22 02:28:33.000000000 +0100 -+++ audio/LINUXaudio.c 2004-03-05 23:30:39.000000000 +0100 -@@ -55,7 +55,8 @@ +--- audio/LINUXaudio.c.orig Thu Nov 21 17:28:33 1996 ++++ audio/LINUXaudio.c Sun Jan 3 02:36:53 2010 +@@ -52,11 +52,13 @@ + * Include file dependencies: + */ + ++#include <fcntl.h> #include <unistd.h> #include <stdio.h> - #include <fcntl.h> +-#include <fcntl.h> -#include <linux/soundcard.h> -+#include <sys/ioctl.h> -+#include <soundcard.h> ++#include <sndio.h> ++#include "include/ulaw.h" ++ #include "include/error.h" #include "include/audio.h" + +@@ -77,10 +79,11 @@ static int snd_pipes[2]; + * Internal variable declarations: + */ + +-static char *Audio_dev = "/dev/audio"; +-static int Audio_fd; ++static struct sio_hdl *hdl; ++ + /* size should depend on sample_rate */ + static unsigned char buf[BUFFER_SIZE]; ++static short linBuf[BUFFER_SIZE]; + static char errorString[255]; + + #if NeedFunctionPrototypes +@@ -90,7 +93,9 @@ int SetUpAudioSystem(display) + Display *display; + #endif + { +- int err, cnt; ++ struct sio_par par; ++ int i,err, cnt; ++ uint32_t pos = 0; + + + if (child_pid == 0) +@@ -124,17 +129,30 @@ int SetUpAudioSystem(display) + + if (!strcmp(string, "EXIT")) + { +- /* Make sure that the audio device is flushed and reset */ +- ioctl(Audio_fd, SNDCTL_DSP_RESET, 0); +- + exit(0); + } + + /* Try to open the audio device */ +- if (!(Audio_fd = open(Audio_dev, O_WRONLY))) ++ if (!(hdl = sio_open(NULL, SIO_PLAY, 0))) + { ++fprintf(stderr, "sio_open failed\n"); + continue; + } ++ sio_initpar(&par); ++ par.bits = 16; ++ par.sig = 1; ++ par.rate = 8000; ++ par.le = SIO_LE_NATIVE; ++ if (!sio_setpar(hdl, &par) || !sio_getpar(hdl, &par)) { ++ sprintf(errorString, "Unable to configure sndio device."); ++ WarningMessage(errorString); ++ continue; ++ } ++ if (!sio_start(hdl)) { ++ sprintf(errorString, "Unable to start sndio device."); ++ WarningMessage(errorString); ++ continue; ++ } + + /* Must be a sound file name */ + if (str != NULL) +@@ -151,13 +169,28 @@ int SetUpAudioSystem(display) + + } + ++ /* skip the header, if present */ ++ if (read(ifd, (char *)buf, 4) == 4) { ++ if (!strncmp(buf, ".snd", 4)) { ++ if (read(ifd, &pos, sizeof(pos)) == sizeof(pos)) { ++ pos = ntohl(pos); ++ } ++ } ++ } ++ lseek(ifd, (off_t)pos, SEEK_SET); ++ + /* At this point, we're all ready to copy the data. */ +- while ((cnt = read(ifd, (char *) buf, BUFFER_SIZE)) >= 0) ++ while ((cnt = read(ifd, (char *) buf, BUFFER_SIZE)) > 0) + { ++ /* Now do the ulaw stuff to the raw data */ ++ for(i = 0; i < cnt; i++) ++ { ++ linBuf[i] = UlToLin(buf[i]); ++ } + /* If input EOF, write an eof marker */ +- err = write(Audio_fd, (char *)buf, cnt); ++ err = sio_write(hdl, (char *)linBuf, cnt * 2); + +- if (err != cnt) ++ if (err != cnt * 2) + { + sprintf(errorString, "Problem while writing to sound device"); + WarningMessage(errorString); +@@ -176,15 +209,9 @@ int SetUpAudioSystem(display) + } + + +- /* Flush any audio activity */ +- if (ioctl(Audio_fd, SNDCTL_DSP_SYNC, 0) < 0) +- { +- sprintf(errorString, "Unable to flush audio device."); +- WarningMessage(errorString); +- } + /* Close the sound file */ + (void) close(ifd); +- (void) close(Audio_fd); ++ sio_close(hdl); + } while (True); + } + Index: pkg/DESCR =================================================================== RCS file: /cvs/ports/games/xboing/pkg/DESCR,v retrieving revision 1.4 diff -N -u -p pkg/DESCR --- pkg/DESCR 7 Dec 2007 10:25:46 -0000 1.4 +++ pkg/DESCR 3 Jan 2009 11:01:20 -0000 @@ -2,4 +2,3 @@ XBoing is a blockout type game where you have a paddle to bounce a ball around the game area blowing up blocks with the ball. You win by obtaining points for each block destroyed and each level completed. The person with the highest score wins. -Note that XBoing can only be started on 8-bit color mode display. Index: pkg/MESSAGE =================================================================== RCS file: pkg/MESSAGE diff -N -u -p pkg/MESSAGE --- /dev/null 3 Jan 2009 04:01:21 -0000 +++ pkg/MESSAGE 3 Jan 2009 11:01:20 -0000 @@ -0,0 +1,3 @@ +XBoing can only be started on 8-bit color mode display, or by using the +'-usedefcmap' switch on invocation. Sounds are disabled by default and +can be enabled with the '-sound' switch. Index: pkg/PLIST =================================================================== RCS file: /cvs/ports/games/xboing/pkg/PLIST,v retrieving revision 1.7 diff -N -u -p pkg/PLIST --- pkg/PLIST 1 Oct 2004 08:13:43 -0000 1.7 +++ pkg/PLIST 3 Jan 2009 11:01:20 -0000 @@ -1,7 +1,7 @@ @comment $OpenBSD: PLIST,v 1.7 2004/10/01 08:13:43 xsa Exp $ @mode g+s @group games -bin/xboing +...@bin bin/xboing @mode @group @man man/cat1/xboing.0