summaryrefslogtreecommitdiff
path: root/audio/nspmod
diff options
context:
space:
mode:
authoraugustss <augustss@pkgsrc.org>1997-10-28 23:18:20 +0000
committeraugustss <augustss@pkgsrc.org>1997-10-28 23:18:20 +0000
commit4daa64a62986fd842753a48935d3c8adf6758d93 (patch)
treecc8ee8439ae9a5d7d4a09af2bda1536118792658 /audio/nspmod
parent4434fa54eccf4fa0896d9f01cd93c91ab718ec2c (diff)
downloadpkgsrc-4daa64a62986fd842753a48935d3c8adf6758d93.tar.gz
Initial import of FreeBSD audio packages.
Diffstat (limited to 'audio/nspmod')
-rw-r--r--audio/nspmod/Makefile23
-rw-r--r--audio/nspmod/files/md51
-rw-r--r--audio/nspmod/patches/patch-aa245
-rw-r--r--audio/nspmod/patches/patch-ab21
-rw-r--r--audio/nspmod/patches/patch-ac50
-rw-r--r--audio/nspmod/patches/patch-ad12
-rw-r--r--audio/nspmod/patches/patch-ae12
-rw-r--r--audio/nspmod/pkg/COMMENT1
-rw-r--r--audio/nspmod/pkg/DESCR10
-rw-r--r--audio/nspmod/pkg/PLIST2
10 files changed, 377 insertions, 0 deletions
diff --git a/audio/nspmod/Makefile b/audio/nspmod/Makefile
new file mode 100644
index 00000000000..e44aafc44be
--- /dev/null
+++ b/audio/nspmod/Makefile
@@ -0,0 +1,23 @@
+# New ports collection makefile for: nspmod-0.1
+# Version required: 0.1
+# Date created: 1 Jun 1997
+# Whom: jmg
+#
+# $Id: Makefile,v 1.1.1.1 1997/10/28 23:18:47 augustss Exp $
+#
+
+DISTNAME= nspmod-0.1
+CATEGORIES= audio
+MASTER_SITES= http://www.jeton.or.jp/users/toru/www/orgsoft/nspmod/ \
+ ${MASTER_SITE_SUNSITE}
+MASTER_SITE_SUBDIR= apps/sound/players
+
+MAINTAINER= jmg@FreeBSD.ORG
+
+MAN1= nspmod.1
+
+do-install:
+ ${INSTALL_PROGRAM} ${WRKSRC}/nspmod ${PREFIX}/bin
+ ${INSTALL_MAN} ${WRKSRC}/nspmod.1 ${MANPREFIX}/man/man1
+
+.include <bsd.port.mk>
diff --git a/audio/nspmod/files/md5 b/audio/nspmod/files/md5
new file mode 100644
index 00000000000..1adb758c56e
--- /dev/null
+++ b/audio/nspmod/files/md5
@@ -0,0 +1 @@
+MD5 (nspmod-0.1.tar.gz) = 79c68fe8cb287eca2940458c3917193b
diff --git a/audio/nspmod/patches/patch-aa b/audio/nspmod/patches/patch-aa
new file mode 100644
index 00000000000..27557f1828c
--- /dev/null
+++ b/audio/nspmod/patches/patch-aa
@@ -0,0 +1,245 @@
+*** dacio-linux.c.orig Wed Sep 3 14:57:59 1997
+--- dacio-linux.c Wed Sep 3 14:50:20 1997
+***************
+*** 3,9 ****
+--- 3,13 ----
+ #include <fcntl.h> /*O_WRONLY*/
+ #include <sys/ioctl.h> /*(ioctl)*/
+ #include <unistd.h> /*(write)*/
++ #if defined(LINUX)
+ #include <sys/soundcard.h> /*SNDCTL_XXX*/
++ #else
++ #include <machine/soundcard.h>
++ #endif
+ #include <errno.h> /*EINTR*/
+ #include "defs.h" /*u8,u16*/
+ #include "dacio.h" /*(dacioXXX)*/
+***************
+*** 47,53 ****
+ static struct {
+ union {
+ u8 *p8;
+! u16 *p16;
+ } p;
+ u8 *top;
+ u8 *bot;
+--- 51,57 ----
+ static struct {
+ union {
+ u8 *p8;
+! i15 *p16;
+ } p;
+ u8 *top;
+ u8 *bot;
+***************
+*** 67,77 ****
+ exit(1);
+ }
+ #endif
+! tmp = AFMT_U8;
+ if (ioctl(fd, SNDCTL_DSP_SETFMT, &tmp) < 0) {
+ perror("dacioConf");
+ exit(1);
+ }
+ /*fprintf(stderr, "fmt = 0x%x\n", tmp);*/
+
+ if (ioctl(fd, SNDCTL_DSP_STEREO, &dcp->stereo) < 0) {
+--- 71,109 ----
+ exit(1);
+ }
+ #endif
+! switch (dcp->bits) {
+! case 0:
+! case 8:
+! dcp->bits = 8;
+! tmp = AFMT_U8; break;
+! case 16:
+! tmp = AFMT_S16_LE; break;
+! default:
+! fprintf(stderr, "Don't know how to handle %d bit output.\n", dcp->bits);
+! exit(1);
+! break;
+! }
+!
+ if (ioctl(fd, SNDCTL_DSP_SETFMT, &tmp) < 0) {
+ perror("dacioConf");
+ exit(1);
+ }
++
++ switch (tmp) {
++ case AFMT_U8:
++ if (dcp->bits != 8) {
++ fprintf(stderr, "soundcard doesn't support 8bits.\n");
++ exit(1);
++ }
++ break;
++ case AFMT_S16_LE:
++ if (dcp->bits != 16) {
++ fprintf(stderr, "soundcard doesn't support 16bits.\n");
++ exit(1);
++ }
++ break;
++ }
++
+ /*fprintf(stderr, "fmt = 0x%x\n", tmp);*/
+
+ if (ioctl(fd, SNDCTL_DSP_STEREO, &dcp->stereo) < 0) {
+***************
+*** 90,99 ****
+ perror("dacioConf");
+ exit(1);
+ }
+! /*fprintf(stderr, "buffer size = 0x%x\n", buf.size);*/
+ dci = *dcp;
+ /*if (buf.top != NULL) free(buf.top);*/
+! buf.top = memPerm(buf.size * sizeof(u8));
+ buf.p.p8 = buf.top;
+ buf.bot = buf.top + buf.size;
+ }
+--- 122,136 ----
+ perror("dacioConf");
+ exit(1);
+ }
+! /*fprintf(stderr, "sound buffer size = 0x%x\n", buf.size);*/
+! tmp = buf.size;
+! while (tmp <= (0.1 * (dcp->speed * (dcp->stereo+1) * (dcp->bits/8))))
+! tmp += buf.size;
+! buf.size = tmp;
+! /*fprintf(stderr, "buffer size = 0x%x\n", buf.size);*/
+ dci = *dcp;
+ /*if (buf.top != NULL) free(buf.top);*/
+! buf.top = memPerm(buf.size);
+ buf.p.p8 = buf.top;
+ buf.bot = buf.top + buf.size;
+ }
+***************
+*** 115,121 ****
+ int s;
+
+ if (buf.p.p8 <= buf.top) return;
+! for ( ; buf.p.p8 < buf.bot; buf.p.p8++) *buf.p.p8 = 128;
+ RETRY:
+ s = write(fd, buf.top, buf.size);
+ if (s < buf.size) {
+--- 152,165 ----
+ int s;
+
+ if (buf.p.p8 <= buf.top) return;
+! switch (dci.bits) {
+! case 8:
+! for ( ; buf.p.p8 < buf.bot; buf.p.p8++) *buf.p.p8 = 128;
+! break;
+! case 16:
+! for ( ; buf.p.p8 < buf.bot; buf.p.p16++) *buf.p.p16 = 0;
+! break;
+! }
+ RETRY:
+ s = write(fd, buf.top, buf.size);
+ if (s < buf.size) {
+***************
+*** 179,184 ****
+--- 223,230 ----
+ (tmpvar & ~255)? ~tmpvar >> 16 : tmpvar ) /* 16 will be OK */
+ /* ~(tmpvar >> 16) makes longer asm */
+ #endif
++ #define to16bit(x) \
++ (((x) * gv) >> 12)
+
+ /* stereo */
+ static void
+***************
+*** 186,199 ****
+ {
+ const i31 *inbufp = inbuf.p;
+ u8 *u8p = buf.p.p8;
+
+! for (; n > 0; n--) {
+! i31x tmp;
+! *u8p++ = to8bit(*inbufp++, tmp); /* L */
+! *u8p++ = to8bit(*inbufp++, tmp); /* R */
+ }
+ inbuf.p = inbufp;
+- buf.p.p8 = u8p;
+ }
+
+ /* mono */
+--- 232,257 ----
+ {
+ const i31 *inbufp = inbuf.p;
+ u8 *u8p = buf.p.p8;
++ i15 *s15p = buf.p.p16;
+
+! switch (dci.bits) {
+! case 8:
+! for (; n > 0; n--) {
+! i31x tmp;
+! *u8p++ = to8bit(*inbufp++, tmp); /* L */
+! *u8p++ = to8bit(*inbufp++, tmp); /* R */
+! }
+! buf.p.p8 = u8p;
+! break;
+! case 16:
+! for (; n > 0; n--) {
+! *s15p++ = to16bit(*inbufp++); /* L */
+! *s15p++ = to16bit(*inbufp++); /* R */
+! }
+! buf.p.p16 = s15p;
+! break;
+ }
+ inbuf.p = inbufp;
+ }
+
+ /* mono */
+***************
+*** 202,220 ****
+ {
+ const i31 *inbufp = inbuf.p;
+ u8 *u8p = buf.p.p8;
+
+! for (; n > 0; n--) {
+! i31x tmp;
+! *u8p++ = to8bit(*inbufp, tmp);
+! inbufp += 2;
+ }
+ inbuf.p = inbufp;
+- buf.p.p8 = u8p;
+ }
+
+ #define dacioOutHirev(x) \
+ if (dci.stereo) dacioOutHirevS(x); else dacioOutHirevM(x)
+! #define bufRest() (dci.stereo? (buf.bot - buf.p.p8)/2 : buf.bot - buf.p.p8)
+
+ void
+ dacioOut(void)
+--- 260,290 ----
+ {
+ const i31 *inbufp = inbuf.p;
+ u8 *u8p = buf.p.p8;
++ i15 *s16p = buf.p.p16;
+
+! switch (dci.bits) {
+! case 8:
+! for (; n > 0; n--) {
+! i31x tmp;
+! *u8p++ = to8bit(*inbufp, tmp);
+! inbufp += 2;
+! }
+! buf.p.p8 = u8p;
+! break;
+! case 16:
+! for (; n > 0; n--) {
+! *s16p++ = to16bit(*inbufp);
+! inbufp += 2;
+! }
+! buf.p.p16 = s16p;
+! break;
+ }
+ inbuf.p = inbufp;
+ }
+
+ #define dacioOutHirev(x) \
+ if (dci.stereo) dacioOutHirevS(x); else dacioOutHirevM(x)
+! #define bufRest() ((dci.stereo? (buf.bot - buf.p.p8)/2 : buf.bot - buf.p.p8)/(dci.bits/8))
+
+ void
+ dacioOut(void)
diff --git a/audio/nspmod/patches/patch-ab b/audio/nspmod/patches/patch-ab
new file mode 100644
index 00000000000..07273f38949
--- /dev/null
+++ b/audio/nspmod/patches/patch-ab
@@ -0,0 +1,21 @@
+*** Makefile.orig Sun Sep 17 06:18:20 1995
+--- Makefile Tue Jun 3 02:48:46 1997
+***************
+*** 25,32 ****
+
+ #}
+
+! CFLAGS = $(CFLAGS_OS) $(CFLAGS_OPT) $(CFLAGS_EXT)
+! CFLAGS_HIOPT_ = $(CFLAGS_OS) $(CFLAGS_HIOPT) $(CFLAGS_EXT)
+ LDFLAGS = $(LDFLAGS_OS) $(LDFLAGS_EXT)
+ LIBS = $(LIBS_EXT) $(LIBS_OS)
+
+--- 25,32 ----
+
+ #}
+
+! #CFLAGS = $(CFLAGS_OS) $(CFLAGS_OPT) $(CFLAGS_EXT)
+! CFLAGS_HIOPT_ = $(CFLAGS) $(CFLAGS_HIOPT)
+ LDFLAGS = $(LDFLAGS_OS) $(LDFLAGS_EXT)
+ LIBS = $(LIBS_EXT) $(LIBS_OS)
+
diff --git a/audio/nspmod/patches/patch-ac b/audio/nspmod/patches/patch-ac
new file mode 100644
index 00000000000..e031445d0fd
--- /dev/null
+++ b/audio/nspmod/patches/patch-ac
@@ -0,0 +1,50 @@
+*** nspmod.c.orig Wed Sep 3 14:58:19 1997
+--- nspmod.c Wed Sep 3 14:55:06 1997
+***************
+*** 1,4 ****
+--- 1,5 ----
+ #include <stdio.h> /*(perror)*/
++ #include <sys/types.h>
+ #include <sys/mman.h> /*PROT_READ,MAP_xxx*/
+ #include <fcntl.h> /*O_RDONLY*/
+ #include <sys/stat.h> /*stat*/
+***************
+*** 35,40 ****
+--- 36,42 ----
+ printf("NSPmod version " LIT(VERSION_MAJOR) "." LIT(VERSION_MINOR) "\n");
+ printf("Usage: %s [options] modfile\n", argv0);
+ printf("Options:\n");
++ printf(" -b # number of bits to output (8 or 16)\n");
+ printf(" -c # play only the channel\n");
+ printf(" -e show events\n");
+ printf(" -f # output sample rate\n");
+***************
+*** 62,69 ****
+ oi.outRate = DEF_OUTRATE;
+ oi.ovsFreq = -1;
+ /*oi.repLimit = 1;*/
+! while ((optChar = getopt(argc, argv, "c:ef:il:mo:rs:v:")) > 0) {
+ switch (optChar) {
+ case 'c': oi.onlyCh = (i15x)strtol(optarg, NULL, 0) | 0x100; break;
+ case 'e': oi.showEvents++; break;
+ case 'f': oi.outRate = (u16x)strtol(optarg, NULL, 0); break;
+--- 64,72 ----
+ oi.outRate = DEF_OUTRATE;
+ oi.ovsFreq = -1;
+ /*oi.repLimit = 1;*/
+! while ((optChar = getopt(argc, argv, "b:c:ef:il:mo:rs:v:")) > 0) {
+ switch (optChar) {
++ case 'b': oi.bits = (i15x)strtol(optarg, NULL, 0); break;
+ case 'c': oi.onlyCh = (i15x)strtol(optarg, NULL, 0) | 0x100; break;
+ case 'e': oi.showEvents++; break;
+ case 'f': oi.outRate = (u16x)strtol(optarg, NULL, 0); break;
+***************
+*** 116,121 ****
+--- 119,125 ----
+
+ lookOverFile(p, statbuf.st_size);
+ dacioInit();
++ dci.bits = oi.bits;
+ dci.speed = oi.outRate;
+ dci.stereo = !oi.mono;
+ dacioConf(&dci);
diff --git a/audio/nspmod/patches/patch-ad b/audio/nspmod/patches/patch-ad
new file mode 100644
index 00000000000..eaf68819e35
--- /dev/null
+++ b/audio/nspmod/patches/patch-ad
@@ -0,0 +1,12 @@
+*** dacio.h.orig Wed Sep 3 14:58:39 1997
+--- dacio.h Wed Sep 3 13:49:32 1997
+***************
+*** 3,8 ****
+--- 3,9 ----
+ #endif
+
+ typedef struct {
++ int bits;
+ int speed;
+ int stereo;
+ } DacioConfInfo;
diff --git a/audio/nspmod/patches/patch-ae b/audio/nspmod/patches/patch-ae
new file mode 100644
index 00000000000..687f69484bf
--- /dev/null
+++ b/audio/nspmod/patches/patch-ae
@@ -0,0 +1,12 @@
+*** nspmod.h.orig Wed Sep 3 14:58:53 1997
+--- nspmod.h Wed Sep 3 13:47:40 1997
+***************
+*** 3,8 ****
+--- 3,9 ----
+ #endif
+
+ typedef struct {
++ i15x bits; /* -b # */
+ i15x onlyCh; /* -c # */
+ i15x showEvents; /* -e, -ee */
+ u16x outRate; /* -f # */
diff --git a/audio/nspmod/pkg/COMMENT b/audio/nspmod/pkg/COMMENT
new file mode 100644
index 00000000000..e3333c706cd
--- /dev/null
+++ b/audio/nspmod/pkg/COMMENT
@@ -0,0 +1 @@
+MOD/S3M/MTM tracker that does it's own DSP, uses VoxWare v2.90+
diff --git a/audio/nspmod/pkg/DESCR b/audio/nspmod/pkg/DESCR
new file mode 100644
index 00000000000..68a08b0e93f
--- /dev/null
+++ b/audio/nspmod/pkg/DESCR
@@ -0,0 +1,10 @@
+NSPmod is a MOD (Protracker module and some of its extensions) / S3M
+(Scream Tracker 3 module) / MTM (Multitracker module) music player.
+This program uses a technology called No Signal Processor (NSP), which
+enables your PC play MODs without DSP such as Gravis UltraSound (GUS)
+GF1.
+
+This program requires VoxWare v2.90 compatible 8bit DAC device.
+
+I, John-Mark Gurney, have added support for output in 16bits. The
+volume level is slightly less than the 8bit version though.
diff --git a/audio/nspmod/pkg/PLIST b/audio/nspmod/pkg/PLIST
new file mode 100644
index 00000000000..2ecf6b13608
--- /dev/null
+++ b/audio/nspmod/pkg/PLIST
@@ -0,0 +1,2 @@
+bin/nspmod
+man/man1/nspmod.1.gz