--- config.h.orig Sun Jun 8 00:11:14 1997 +++ config.h Sun Jun 8 00:12:37 1997 @@ -64,6 +64,14 @@ #define GUS #endif /* GUS */ +#elif defined(__FreeBSD__) +#define BIT_32 +#undef NEAR_FAR_PTR +#define DSP +#ifndef GUS +#define GUS +#endif /* GUS */ + #elif defined(MSDOS) #define NEAR_FAR_PTR #define DSP --- dsp.c.orig Sat Oct 21 14:40:29 1995 +++ dsp.c Sun Jun 8 00:21:50 1997 @@ -22,14 +22,14 @@ * linux_dsp.c - Support for the Linux DSP driver from the Voxware(C) Drivers. */ -#ifdef LINUX +#ifdef __FreeBSD__ #include "config.h" #include #include #include #include -#include -#include +#include +#include #include "main.h" #include "dsp.h" @@ -93,5 +93,5 @@ return; } -#endif /* ?LINUX */ +#endif /* ?__FreeBSD__ */ --- gus.c.orig Sun Jun 8 00:05:28 1997 +++ gus.c Sun Jun 8 00:05:51 1997 @@ -25,8 +25,8 @@ #ifdef GUS -#include -#include +#include +#include #include #include "gus.h" #include "mod.h" --- main.c.orig Sun Jun 8 00:05:59 1997 +++ main.c Sun Jun 8 00:10:46 1997 @@ -56,6 +56,10 @@ printf(" Linux Support by Daniel Marks \n"); printf(" GUS Support by David Jeske (jeske@uiuc.edu)\n"); #endif /* LINUX */ +#ifdef __FreeBSD__ + printf(" FreeBSD Support by Vanilla I. Shu \n"); + printf(" GUS Support by David Jeske (jeske@uiuc.edu\n"); +#endif /* __FreeBSD__ */ #if defined(__sgi) printf(" SGI Support by Mike Muuss (Mike@arl.mil)\n\n"); #endif /* __sgi */ @@ -69,6 +73,9 @@ #ifdef LINUX printf(" -b 16 bit samples\n"); #endif /* ?LINUX */ +#ifdef __FreeBSD__ + printf(" -b 16 bit samples\n"); +#endif /* __FreeBSD__ */ printf(" -f set frequency\n"); printf(" -q quiet (don't print anything)\n"); printf(" -n don't loop\n"); @@ -76,6 +83,9 @@ #ifdef LINUX printf(" -g do NOT use GUS native mode\n"); #endif /* ?LINUX */ +#ifdef __FreeBSD__ + printf(" -g do NOT use GUS native mode\n"); +#endif /* __FreeBSD__ */ printf(" -p PAL speed adjustment (145bpm start)\n"); printf("s3mod -sbf 44100 foobar.mod\n"); printf(" plays in stereo, 16 bits, 44.1 kHz\n\n"); --- mod.c.orig Sun Jun 8 00:12:48 1997 +++ mod.c Sun Jun 8 00:14:30 1997 @@ -11,7 +11,7 @@ #ifdef GUS -#include +#include #include "gus.h" #endif /* GUS */ @@ -130,8 +130,10 @@ /* Portamento Down */ if ((track->period += track->port_down) > track->period_high_limit) track->period = track->period_high_limit; - track->pitch = track->finetune_rate / track->period; - + if (track->period != 0) + track->pitch = track->finetune_rate / track->period; + else + track->pitch = 1; track->playing_period = track->period; } --- play.c.orig Sun Jun 8 00:15:23 1997 +++ play.c Sun Jun 8 00:15:46 1997 @@ -36,7 +36,7 @@ #include "dsp.h" #ifdef GUS -#include +#include #include "gus.h" #endif /* GUS */ --- gus.h.orig Sun Jun 8 00:31:14 1997 +++ gus.h Sun Jun 8 00:31:23 1997 @@ -26,7 +26,7 @@ #ifndef _GUS_H #define _GUS_H -#include +#include #define ERR_SEQUENCER 51 #define ERR_NOGUS 53 --- Makefile.orig Sun Oct 22 03:48:51 1995 +++ Makefile Sun Jun 8 01:03:46 1997 @@ -9,7 +9,6 @@ RM = rm LN = ln -s -CFLAGS = -O2 LFLAGS = OBJS = mod.o s3m.o main.o play.o mix.o cmdline.o dsp.o gus.o @@ -24,6 +23,7 @@ @echo " make sun - SunOS/Solaris" @echo " make sgi - SGI Irix" @echo " make linux - Voxware DSP/GUS" + @echo " make freebsd - Voxware DSP/GUS" @echo " make dec - Dec OSF/1" @echo " make clean - remove all .o files" @echo " make clobber - remove all .o and targets" @@ -51,6 +51,9 @@ $(LN) DspDrivers/linux_dsp.c dsp.c make CC=gcc CFLAGS=-O2 DEFINES="-DLINUX -DGUS" s3mod +freebsd: + make CC=gcc CFLAGS="$(CFLAGS)" DEFINES="-DGUS" s3mod + s3mod: $(OBJS) $(CC) $(CFLAGS) -o s3mod $(OBJS) $(LFLAGS) $(LIBS) @@ -62,6 +65,9 @@ dep: makedepend $(CFLAGS) $(LFLAGS) $(LIBS) $(CFILES) + +install: + install -m 555 s3mod /usr/local/bin # DO NOT DELETE THIS LINE -- make depend depends on it.