svn commit: r339575 - in head: . games/jfsw games/jfsw/files

Ganael LAPLANCHE martymac at FreeBSD.org
Mon Jan 13 08:20:35 UTC 2014


Author: martymac
Date: Mon Jan 13 08:20:30 2014
New Revision: 339575
URL: http://svnweb.freebsd.org/changeset/ports/339575

Log:
  - Fix build on recent FreeBSD (10, 11)
  - Add LICENSE and update LEGAL accordingly
  - Update USES
  - Use NO_WRKSUBDIR/BUILD_WRKSRC instead of WRKSRC
  - Enable staging (and always stage documentation)
  - Rework patches: split them and convert them to UNIX file format (use dos2unix)

Added:
  head/games/jfsw/files/patch-jfbuild_src_20051009-Makefile   (contents, props changed)
  head/games/jfsw/files/patch-jfbuild_src_20051009-include-editor.h   (contents, props changed)
  head/games/jfsw/files/patch-jfbuild_src_20051009-src-build.c   (contents, props changed)
  head/games/jfsw/files/patch-jfbuild_src_20051009-src-crc32.c   (contents, props changed)
  head/games/jfsw/files/patch-jfbuild_src_20051009-src-sdlayer.c   (contents, props changed)
  head/games/jfsw/files/patch-jfsw_src_20051009-Makefile   (contents, props changed)
  head/games/jfsw/files/patch-jfsw_src_20051009-Makefile.deps   (contents, props changed)
  head/games/jfsw/files/patch-jfsw_src_20051009-source-config.c   (contents, props changed)
  head/games/jfsw/files/patch-jfsw_src_20051009-source-game.c   (contents, props changed)
  head/games/jfsw/files/patch-jfsw_src_20051009-source-jaudiolib-_multivc.h   (contents, props changed)
  head/games/jfsw/files/patch-jfsw_src_20051009-source-jaudiolib-debugio.h   (contents, props changed)
  head/games/jfsw/files/patch-jfsw_src_20051009-source-jaudiolib-dma.h   (contents, props changed)
  head/games/jfsw/files/patch-jfsw_src_20051009-source-jaudiolib-dpmi.h   (contents, props changed)
  head/games/jfsw/files/patch-jfsw_src_20051009-source-jaudiolib-dsl.c   (contents, props changed)
  head/games/jfsw/files/patch-jfsw_src_20051009-source-jaudiolib-dsl.h   (contents, props changed)
  head/games/jfsw/files/patch-jfsw_src_20051009-source-jaudiolib-interrup.h   (contents, props changed)
  head/games/jfsw/files/patch-jfsw_src_20051009-source-jaudiolib-nodpmi.c   (contents, props changed)
  head/games/jfsw/files/patch-jfsw_src_20051009-source-jaudiolib-platform.h   (contents, props changed)
  head/games/jfsw/files/patch-jfsw_src_20051009-source-jaudiolib-sdlmusic.c   (contents, props changed)
  head/games/jfsw/files/patch-jfsw_src_20051009-source-jaudiolib-unixglob.c   (contents, props changed)
  head/games/jfsw/files/patch-jfsw_src_20051009-source-jaudiolib-unixpitch.c   (contents, props changed)
  head/games/jfsw/files/patch-jfsw_src_20051009-source-jaudiolib-unixvoc.c   (contents, props changed)
  head/games/jfsw/files/patch-jfsw_src_20051009-source-jaudiolib-util.h   (contents, props changed)
  head/games/jfsw/files/patch-jfsw_src_20051009-source-lists.h   (contents, props changed)
  head/games/jfsw/files/patch-jfsw_src_20051009-source-menus.c   (contents, props changed)
  head/games/jfsw/files/patch-jfsw_src_20051009-source-sounds.c   (contents, props changed)
Deleted:
  head/games/jfsw/files/patch-jfbuild_src_20051009
  head/games/jfsw/files/patch-jfsw_src_20051009
Modified:
  head/LEGAL
  head/games/jfsw/Makefile   (contents, props changed)

Modified: head/LEGAL
==============================================================================
--- head/LEGAL	Mon Jan 13 07:50:03 2014	(r339574)
+++ head/LEGAL	Mon Jan 13 08:20:30 2014	(r339575)
@@ -150,6 +150,7 @@ java3d-sdk-*-linux-i386* java/java3d		Li
 javax_comm-*-solsparc.*	comms/java-commapi	No commercial use
 jdk-6*-i586.bin		java/linux-sun-jdk16	Redistribution of repackaged binaries not permitted
 jdk-7*-i586.tar.gz	java/linux-sun-jdk17	Redistribution of repackaged binaries not permitted
+jfbuild_src_*		games/jfsw		Must be distributed only through the Internet and free of charge
 jmf-*-alljava.zip	java/jmf		Redistribution of pre-compiled binaries is not permitted
 jpgraph-2.*		graphics/jpgraph2	Not for commercial use
 jre-6*-i586.bin		java/linux-sun-jre16	License does not allow distribution with fee

Modified: head/games/jfsw/Makefile
==============================================================================
--- head/games/jfsw/Makefile	Mon Jan 13 07:50:03 2014	(r339574)
+++ head/games/jfsw/Makefile	Mon Jan 13 08:20:30 2014	(r339575)
@@ -3,7 +3,7 @@
 
 PORTNAME=	jfsw
 PORTVERSION=	20051009
-PORTREVISION=	2
+PORTREVISION=	3
 CATEGORIES=	games
 MASTER_SITES=	http://users.on.net/~jonof/buildport/
 DISTFILES=	${PORTNAME}_src_${PORTVERSION}.zip \
@@ -12,25 +12,35 @@ DISTFILES=	${PORTNAME}_src_${PORTVERSION
 MAINTAINER=	martymac at FreeBSD.org
 COMMENT=	Jonathon Fowler's Shadow Warrior Port
 
+LICENSE=	GPLv2 BuildLic
+LICENSE_COMB=	multi
+LICENSE_NAME_BuildLic=	Build source code license
+LICENSE_FILE_BuildLic=	${WRKDIR}/jfbuild_src_${PORTVERSION}/buildlic.txt
+LICENSE_PERMS_BuildLic=	dist-mirror no-dist-sell pkg-mirror no-pkg-sell auto-accept
+
 BUILD_DEPENDS=	nasm:${PORTSDIR}/devel/nasm
 
+NO_CDROM=	Must be distributed only through the Internet and free of charge
+
 ONLY_FOR_ARCHS=	i386
 ONLY_FOR_ARCHS_REASON=	uses x86 assembly code
+
 USE_ZIP=	yes
-USE_GMAKE=	yes
 USE_GL=		gl
 USE_GNOME=	gtk20
 USE_SDL=	mixer sdl
-WRKSRC=		${WRKDIR}/${PORTNAME}_src_${PORTVERSION}
-PATCH_WRKSRC=	${WRKDIR}
+USE_GCC=	any
+
+USES=	dos2unix gmake
+DOS2UNIX_REGEX=	.*(\.(c|h)|Makefile)(\.deps)?
+
+NO_WRKSUBDIR=	yes
+BUILD_WRKSRC=	${WRKDIR}/${PORTNAME}_src_${PORTVERSION}
 
 SUB_FILES=	pkg-message
 
 PORTDOCS=	readme.txt releasenotes.html
 
-NO_STAGE=	yes
-.include <bsd.port.options.mk>
-
 post-patch:
 	@${REINPLACE_CMD} -Ee \
 		's|^(EROOT=)../build/|\1../jfbuild_src_${PORTVERSION}/|; \
@@ -39,22 +49,20 @@ post-patch:
 		 s|^(NASMFLAGS=).*|\1 -s -f elf|; \
 		 s|/usr/X11R6|${LOCALBASE}|; \
 		 s|sdl-config|${SDL_CONFIG}|' \
-		${WRKSRC}/Makefile \
+		${BUILD_WRKSRC}/Makefile \
 		${WRKDIR}/jfbuild_src_${PORTVERSION}/Makefile \
 		${WRKDIR}/jfbuild_src_${PORTVERSION}/Makefile.shared
 	@${REINPLACE_CMD} -e 's|/usr/share/games/jfsw|${DATADIR}|' \
-		${WRKSRC}/source/game.c ${WRKSRC}/source/jnstub.c
+		${BUILD_WRKSRC}/source/game.c \
+		${BUILD_WRKSRC}/source/jnstub.c
 
 do-install:
-	${INSTALL_PROGRAM} ${WRKSRC}/sw ${PREFIX}/bin/${PORTNAME}
-	${INSTALL_PROGRAM} ${WRKSRC}/build ${PREFIX}/bin/${PORTNAME}-build
-	${MKDIR} ${DATADIR}
-.if ${PORT_OPTIONS:MDOCS}
-	${MKDIR} ${DOCSDIR}
-.for doc in ${PORTDOCS}
-	${INSTALL_DATA} ${WRKSRC}/${doc} ${DOCSDIR}
-.endfor
-	@${CAT} ${PKGMESSAGE}
-.endif
+	${INSTALL_PROGRAM} ${BUILD_WRKSRC}/sw ${STAGEDIR}${PREFIX}/bin/${PORTNAME}
+	${INSTALL_PROGRAM} ${BUILD_WRKSRC}/build ${STAGEDIR}${PREFIX}/bin/${PORTNAME}-build
+	${MKDIR} ${STAGEDIR}${DOCSDIR}
+	${INSTALL_DATA} ${PORTDOCS:S|^|${BUILD_WRKSRC}/|} ${STAGEDIR}${DOCSDIR}
+
+post-install:
+	${MKDIR} ${STAGEDIR}${DATADIR}
 
 .include <bsd.port.mk>

Added: head/games/jfsw/files/patch-jfbuild_src_20051009-Makefile
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/games/jfsw/files/patch-jfbuild_src_20051009-Makefile	Mon Jan 13 08:20:30 2014	(r339575)
@@ -0,0 +1,11 @@
+--- jfbuild_src_20051009/Makefile.orig	2005-10-09 15:23:00.000000000 +0200
++++ jfbuild_src_20051009/Makefile	2005-10-10 15:06:22.000000000 +0200
+@@ -27,7 +27,7 @@
+ # Debugging options
+ #  RELEASE - 1 = no debugging
+ #  EFENCE  - 1 = compile with Electric Fence for malloc() debugging
+-RELEASE?=0
++RELEASE?=1
+ EFENCE?=0
+ 
+ # SDK locations - adjust to match your setup

Added: head/games/jfsw/files/patch-jfbuild_src_20051009-include-editor.h
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/games/jfsw/files/patch-jfbuild_src_20051009-include-editor.h	Mon Jan 13 08:20:30 2014	(r339575)
@@ -0,0 +1,11 @@
+--- jfbuild_src_20051009/include/editor.h.orig	2005-10-09 15:23:02.000000000 +0200
++++ jfbuild_src_20051009/include/editor.h	2005-10-10 15:06:18.000000000 +0200
+@@ -18,7 +18,7 @@
+ 
+ extern short temppicnum, tempcstat, templotag, temphitag, tempextra;
+ extern char tempshade, temppal, tempxrepeat, tempyrepeat;
+-extern char somethingintab;
++static char somethingintab;
+ 
+ extern char buildkeys[NUMBUILDKEYS];
+ 

Added: head/games/jfsw/files/patch-jfbuild_src_20051009-src-build.c
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/games/jfsw/files/patch-jfbuild_src_20051009-src-build.c	Mon Jan 13 08:20:30 2014	(r339575)
@@ -0,0 +1,11 @@
+--- jfbuild_src_20051009/src/build.c.orig	2005-10-09 15:23:00.000000000 +0200
++++ jfbuild_src_20051009/src/build.c	2005-10-10 15:06:18.000000000 +0200
+@@ -86,7 +86,7 @@
+ 
+ short temppicnum, tempcstat, templotag, temphitag, tempextra;
+ char tempshade, temppal, tempvis, tempxrepeat, tempyrepeat;
+-char somethingintab = 255;
++static char somethingintab = 255;
+ 
+ static char boardfilename[BMAX_PATH], selectedboardfilename[BMAX_PATH];
+ static struct _directoryitem {

Added: head/games/jfsw/files/patch-jfbuild_src_20051009-src-crc32.c
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/games/jfsw/files/patch-jfbuild_src_20051009-src-crc32.c	Mon Jan 13 08:20:30 2014	(r339575)
@@ -0,0 +1,19 @@
+--- jfbuild_src_20051009/src/crc32.c.orig	2005-10-09 15:23:00.000000000 +0200
++++ jfbuild_src_20051009/src/crc32.c	2005-10-10 15:06:18.000000000 +0200
+@@ -73,16 +73,6 @@
+ 	}
+ }
+ 
+-
+-unsigned long crc32(unsigned char *blk, unsigned long len)
+-{
+-	unsigned long crc;
+-	
+-	crc32init(&crc);
+-	crc32block(&crc, blk, len);
+-	return crc32finish(&crc);
+-}
+-
+ void crc32init(unsigned long *crcvar)
+ {
+ 	if (!crcvar) return;

Added: head/games/jfsw/files/patch-jfbuild_src_20051009-src-sdlayer.c
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/games/jfsw/files/patch-jfbuild_src_20051009-src-sdlayer.c	Mon Jan 13 08:20:30 2014	(r339575)
@@ -0,0 +1,68 @@
+--- jfbuild_src_20051009/src/sdlayer.c.orig	2005-10-09 15:23:00.000000000 +0200
++++ jfbuild_src_20051009/src/sdlayer.c	2005-10-10 15:06:22.000000000 +0200
+@@ -24,6 +24,10 @@
+ // undefine to restrict windowed resolutions to conventional sizes
+ #define ANY_WINDOWED_SIZE
+ 
++// fix for mousewheel
++#define MWHEELTICKS 10
++static unsigned long mwheelup, mwheeldown;
++
+ int   _buildargc = 1;
+ char **_buildargv = NULL;
+ extern long app_main(long argc, char *argv[]);
+@@ -486,8 +490,8 @@
+ 	initprintf("Initialising mouse\n");
+ 
+ 	// grab input
+-	grabmouse(1);
+ 	moustat=1;
++	grabmouse(1);
+ 
+ 	return 0;
+ }
+@@ -1363,14 +1367,22 @@
+ 					case SDL_BUTTON_LEFT: j = 0; break;
+ 					case SDL_BUTTON_RIGHT: j = 1; break;
+ 					case SDL_BUTTON_MIDDLE: j = 2; break;
+-					default: j = -1; break;
++					default: j = ev.button.button; break;
+ 				}
+ 				if (j<0) break;
+ 				
+-				if (ev.button.state == SDL_PRESSED)
++				if (ev.button.state == SDL_PRESSED) {
++					if (ev.button.button == SDL_BUTTON_WHEELUP) {
++						mwheelup = totalclock;
++					}
++					if (ev.button.button == SDL_BUTTON_WHEELDOWN) {
++						mwheeldown = totalclock;
++					}
+ 					mouseb |= (1<<j);
+-				else
+-					mouseb &= ~(1<<j);
++				}
++				else {
++					if (j < 4) mouseb &= ~(1<<j);
++				}
+ 
+ 				if (mousepresscallback)
+ 					mousepresscallback(j+1, ev.button.state == SDL_PRESSED);
+@@ -1435,6 +1447,17 @@
+ 
+ 	sampletimer();
+ 
++	if (moustat) {
++		if ((mwheelup) && (mwheelup <= (totalclock - MWHEELTICKS))) {
++			mouseb &= ~16;
++			mwheelup = 0;
++		}
++		if ((mwheeldown) && (mwheeldown <= (totalclock - MWHEELTICKS))) {
++			mouseb &= ~32;
++			mwheeldown = 0;
++		}
++	}
++
+ #ifdef HAVE_GTK2
+ 	if (gtkenabled) update_startwin();
+ #endif

Added: head/games/jfsw/files/patch-jfsw_src_20051009-Makefile
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/games/jfsw/files/patch-jfsw_src_20051009-Makefile	Mon Jan 13 08:20:30 2014	(r339575)
@@ -0,0 +1,57 @@
+--- jfsw_src_20051009/Makefile.orig	2005-10-09 15:28:24.000000000 +0200
++++ jfsw_src_20051009/Makefile	2005-10-10 15:02:08.000000000 +0200
+@@ -12,7 +12,7 @@
+ NOASM = 0
+ 
+ # Debugging options
+-RELEASE?=0
++RELEASE?=1
+ 
+ # build locations
+ SRC=source/
+@@ -56,11 +56,8 @@
+ AUDIOLIB_FX=$(OBJ)mv_mix.$o \
+ 	  $(OBJ)mv_mix16.$o \
+ 	  $(OBJ)mvreverb.$o \
+-	  $(OBJ)pitch.$o \
+-	  $(OBJ)multivoc.$o \
+ 	  $(OBJ)ll_man.$o \
+-	  $(OBJ)fx_man.$o \
+-	  $(OBJ)dsoundout.$o
++	  $(OBJ)fx_man.$o
+ AUDIOLIB_MUSIC=$(OBJ)midi.$o \
+ 	  $(OBJ)mpu401.$o \
+ 	  $(OBJ)music.$o
+@@ -157,9 +154,16 @@
+ 	EDITOROBJS+= $(OBJ)buildres.$o
+ endif
+ 
+-ifeq ($(RENDERTYPE),SDL)
+-	override CFLAGS+= $(subst -Dmain=SDL_main,,$(shell sdl-config --cflags))
+-	AUDIOLIBOBJ=$(AUDIOLIB_MUSIC_STUB) $(AUDIOLIB_FX_STUB)
++ifeq ($(RENDERTYPE),SDL)
++	override CFLAGS+= $(subst -Dmain=SDL_main,,$(shell sdl-config --cflags) -D__cdecl=" ") 
++	LIBS+= $(shell sdl-config --libs) -lSDL_mixer
++	AUDIOLIB_FX+= $(OBJ)dsl.$o \
++		      $(OBJ)nodpmi.$o \
++		      $(OBJ)unixpitch.$o \
++		      $(OBJ)unixvoc.$o
++		      
++	AUDIOLIB_MUSIC=$(OBJ)sdlmusic.$o $(OBJ)unixglob.$o
++	AUDIOLIBOBJ=$(AUDIOLIB_MUSIC) $(AUDIOLIB_FX)
+ 
+ 	ifeq (1,$(HAVE_GTK2))
+ 		override CFLAGS+= -DHAVE_GTK2 $(shell pkg-config --cflags gtk+-2.0)
+@@ -170,7 +174,11 @@
+ 	GAMEOBJS+= $(OBJ)game_icon.$o
+ 	EDITOROBJS+= $(OBJ)build_icon.$o
+ endif
+-ifeq ($(RENDERTYPE),WIN)
++ifeq ($(RENDERTYPE),WIN)
++	AUDIOLIB_FX+= $(OBJ)audiolib_fx_fmod.$o \
++	              $(OBJ)dsoundout.$o \
++	              $(OBJ)pitch.$o \
++	              $(OBJ)multivoc.$o
+ 	AUDIOLIBOBJ=$(AUDIOLIB_MUSIC) $(AUDIOLIB_FX)
+ endif
+ 

Added: head/games/jfsw/files/patch-jfsw_src_20051009-Makefile.deps
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/games/jfsw/files/patch-jfsw_src_20051009-Makefile.deps	Mon Jan 13 08:20:30 2014	(r339575)
@@ -0,0 +1,14 @@
+--- jfsw_src_20051009/Makefile.deps.orig	2005-10-09 15:28:24.000000000 +0200
++++ jfsw_src_20051009/Makefile.deps	2005-10-10 15:02:08.000000000 +0200
+@@ -95,6 +95,11 @@
+ $(OBJ)animlib.$o: $(SRC)jmact/animlib.c $(SRC)jmact/types.h $(SRC)jmact/develop.h $(SRC)jmact/util_lib.h $(SRC)jmact/animlib.h
+ 
+ # jAudioLib objects
++$(OBJ)dsl.$o: $(SRC)jaudiolib/dsl.c $(SRC)jaudiolib/util.h
++$(OBJ)nodpmi.$o: $(SRC)jaudiolib/nodpmi.c $(SRC)jaudiolib/dpmi.h
++$(OBJ)unixpitch.$o: $(SRC)jaudiolib/unixpitch.c $(SRC)jaudiolib/pitch.h
++$(OBJ)unixvoc.$o: $(SRC)jaudiolib/unixvoc.c $(SRC)jaudiolib/usrhooks.h $(SRC)jaudiolib/linklist.h $(SRC)jaudiolib/pitch.h $(SRC)jaudiolib/multivoc.h $(SRC)jaudiolib/_multivc.h
++
+ $(OBJ)audiolib_fxstub.$o: $(SRC)jaudiolib/audiolib_fxstub.c $(SRC)jaudiolib/fx_man.h
+ $(OBJ)audiolib_musicstub.$o: $(SRC)jaudiolib/audiolib_musicstub.c $(SRC)jaudiolib/music.h
+ 

Added: head/games/jfsw/files/patch-jfsw_src_20051009-source-config.c
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/games/jfsw/files/patch-jfsw_src_20051009-source-config.c	Mon Jan 13 08:20:30 2014	(r339575)
@@ -0,0 +1,24 @@
+--- jfsw_src_20051009/source/config.c.orig	2005-10-09 15:28:26.000000000 +0200
++++ jfsw_src_20051009/source/config.c	2005-10-10 15:02:08.000000000 +0200
+@@ -63,8 +63,8 @@
+ //
+ // Sound variables
+ //
+-int32 FXDevice    = -1;
+-int32 MusicDevice = -1;
++int32 FXDevice    = 1;
++int32 MusicDevice = 1;
+ int32 FXVolume    = 192;
+ int32 MusicVolume = 128;
+ int32 NumVoices   = 4;
+@@ -215,8 +215,8 @@
+    ScreenWidth = 640;
+    ScreenHeight = 480;
+    ScreenBPP = 8;
+-   FXDevice = -1;
+-   MusicDevice = -1;
++   FXDevice = 1;
++   MusicDevice = 1;
+    FXVolume = 192;
+    MusicVolume = 128;
+    NumVoices = 4;

Added: head/games/jfsw/files/patch-jfsw_src_20051009-source-game.c
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/games/jfsw/files/patch-jfsw_src_20051009-source-game.c	Mon Jan 13 08:20:30 2014	(r339575)
@@ -0,0 +1,23 @@
+--- jfsw_src_20051009/source/game.c.orig.orig	2005-10-09 15:28:24.000000000 +0000
++++ jfsw_src_20051009/source/game.c	2010-03-17 07:30:51.119214522 +0000
+@@ -197,7 +197,7 @@
+ TRUE, // fx on
+ TRUE, // Music on
+ TRUE, // talking
+-TRUE, // ambient
++FALSE, // ambient
+ FALSE, // Flip Stereo
+ 
+ // Network game settings
+@@ -5182,7 +5182,10 @@
+             angvel = info.dyaw >> 8;
+         }
+     
+-    svel -= info.dx;
++    if (!running) svel -= (info.dx / 8.75);
++    else svel -= (info.dx / 4.375);
++    if (!running) vel -= (info.dpitch / 8.75);
++    else vel -= (info.dpitch / 4.375);
+ 
+     switch (ControllerType)
+         {

Added: head/games/jfsw/files/patch-jfsw_src_20051009-source-jaudiolib-_multivc.h
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/games/jfsw/files/patch-jfsw_src_20051009-source-jaudiolib-_multivc.h	Mon Jan 13 08:20:30 2014	(r339575)
@@ -0,0 +1,15 @@
+--- jfsw_src_20051009/source/jaudiolib/_multivc.h.orig	2005-10-09 15:28:24.000000000 +0200
++++ jfsw_src_20051009/source/jaudiolib/_multivc.h	2005-10-10 15:02:08.000000000 +0200
+@@ -67,8 +67,11 @@
+ #define SILENCE_8BIT      0x80808080
+ //#define SILENCE_16BIT_PAS 0
+ 
+-//#define MixBufferSize     256
++#ifdef WINDOWS
+ #define MixBufferSize     (MV_GetBufferSize(MV_RequestedMixRate))
++#else
++#define MixBufferSize     256
++#endif
+ 
+ #define NumberOfBuffers   16
+ #define TotalBufferSize   ( MixBufferSize * NumberOfBuffers )

Added: head/games/jfsw/files/patch-jfsw_src_20051009-source-jaudiolib-debugio.h
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/games/jfsw/files/patch-jfsw_src_20051009-source-jaudiolib-debugio.h	Mon Jan 13 08:20:30 2014	(r339575)
@@ -0,0 +1,33 @@
+--- jfsw_src_20051009/source/jaudiolib/debugio.h.orig	1970-01-01 01:00:00.000000000 +0100
++++ jfsw_src_20051009/source/jaudiolib/debugio.h	2005-10-10 15:02:08.000000000 +0200
+@@ -0,0 +1,30 @@
++/*
++Copyright (C) 1994-1995 Apogee Software, Ltd.
++
++This program is free software; you can redistribute it and/or
++modify it under the terms of the GNU General Public License
++as published by the Free Software Foundation; either version 2
++of the License, or (at your option) any later version.
++
++This program is distributed in the hope that it will be useful,
++but WITHOUT ANY WARRANTY; without even the implied warranty of
++MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
++
++See the GNU General Public License for more details.
++
++You should have received a copy of the GNU General Public License
++along with this program; if not, write to the Free Software
++Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
++
++*/
++#ifndef __DEBUGIO_H
++#define __DEBUGIO_H
++
++void DB_SetXY( int x, int y );
++void DB_PutChar( char ch );
++int  DB_PrintString( char *string );
++int  DB_PrintNum( int number );
++int  DB_PrintUnsigned( unsigned long number, int radix );
++int  DB_printf( char *fmt, ... );
++
++#endif

Added: head/games/jfsw/files/patch-jfsw_src_20051009-source-jaudiolib-dma.h
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/games/jfsw/files/patch-jfsw_src_20051009-source-jaudiolib-dma.h	Mon Jan 13 08:20:30 2014	(r339575)
@@ -0,0 +1,86 @@
+--- jfsw_src_20051009/source/jaudiolib/dma.h.orig	1970-01-01 01:00:00.000000000 +0100
++++ jfsw_src_20051009/source/jaudiolib/dma.h	2005-10-10 15:02:08.000000000 +0200
+@@ -0,0 +1,83 @@
++/*
++Copyright (C) 1994-1995 Apogee Software, Ltd.
++
++This program is free software; you can redistribute it and/or
++modify it under the terms of the GNU General Public License
++as published by the Free Software Foundation; either version 2
++of the License, or (at your option) any later version.
++
++This program is distributed in the hope that it will be useful,
++but WITHOUT ANY WARRANTY; without even the implied warranty of
++MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
++
++See the GNU General Public License for more details.
++
++You should have received a copy of the GNU General Public License
++along with this program; if not, write to the Free Software
++Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
++
++*/
++/**********************************************************************
++   file:   DMA.H
++
++   author: James R. Dose
++   date:   February 4, 1994
++
++   Public header file for DMA.C
++
++   (c) Copyright 1994 James R. Dose.  All Rights Reserved.
++**********************************************************************/
++
++#ifndef __DMA_H
++#define __DMA_H
++
++enum DMA_ERRORS
++   {
++   DMA_Error = -1,
++   DMA_Ok    = 0,
++   DMA_ChannelOutOfRange,
++   DMA_InvalidChannel
++   };
++
++enum DMA_Modes
++   {
++   DMA_SingleShotRead,
++   DMA_SingleShotWrite,
++   DMA_AutoInitRead,
++   DMA_AutoInitWrite
++   };
++
++char *DMA_ErrorString
++   (
++   int ErrorNumber
++   );
++
++int DMA_VerifyChannel
++   (
++   int channel
++   );
++
++int DMA_SetupTransfer
++   (
++   int  channel,
++   char *address,
++   int  length,
++   int  mode
++   );
++
++int DMA_EndTransfer
++   (
++   int channel
++   );
++
++char *DMA_GetCurrentPos
++   (
++   int channel
++   );
++
++int DMA_GetTransferCount
++   (
++   int channel
++   );
++
++#endif

Added: head/games/jfsw/files/patch-jfsw_src_20051009-source-jaudiolib-dpmi.h
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/games/jfsw/files/patch-jfsw_src_20051009-source-jaudiolib-dpmi.h	Mon Jan 13 08:20:30 2014	(r339575)
@@ -0,0 +1,46 @@
+--- jfsw_src_20051009/source/jaudiolib/dpmi.h.orig	1970-01-01 01:00:00.000000000 +0100
++++ jfsw_src_20051009/source/jaudiolib/dpmi.h	2005-10-10 15:02:08.000000000 +0200
+@@ -0,0 +1,43 @@
++/*
++Copyright (C) 1994-1995 Apogee Software, Ltd.
++
++This program is free software; you can redistribute it and/or
++modify it under the terms of the GNU General Public License
++as published by the Free Software Foundation; either version 2
++of the License, or (at your option) any later version.
++
++This program is distributed in the hope that it will be useful,
++but WITHOUT ANY WARRANTY; without even the implied warranty of
++MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
++
++See the GNU General Public License for more details.
++
++You should have received a copy of the GNU General Public License
++along with this program; if not, write to the Free Software
++Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
++
++*/
++/**********************************************************************
++   module: DPMI.H
++
++   author: James R. Dose
++   date:   March 31, 1994
++
++   Inline functions for performing DPMI calls.
++
++   (c) Copyright 1994 James R. Dose.  All Rights Reserved.
++**********************************************************************/
++
++#ifndef __DPMI_H
++#define __DPMI_H
++
++enum DPMI_Errors
++   {
++   DPMI_Warning = -2,
++   DPMI_Error   = -1,
++   DPMI_Ok      = 0
++   };
++
++int  DPMI_GetDOSMemory( void **ptr, int *descriptor, unsigned length );
++int  DPMI_FreeDOSMemory( int descriptor );
++#endif

Added: head/games/jfsw/files/patch-jfsw_src_20051009-source-jaudiolib-dsl.c
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/games/jfsw/files/patch-jfsw_src_20051009-source-jaudiolib-dsl.c	Mon Jan 13 08:20:30 2014	(r339575)
@@ -0,0 +1,260 @@
+--- jfsw_src_20051009/source/jaudiolib/dsl.c.orig	1970-01-01 01:00:00.000000000 +0100
++++ jfsw_src_20051009/source/jaudiolib/dsl.c	2005-10-10 15:02:08.000000000 +0200
+@@ -0,0 +1,257 @@
++/*
++Copyright (C) 2003-2004 Ryan C. Gordon. and James Bentler
++
++This program is free software; you can redistribute it and/or
++modify it under the terms of the GNU General Public License
++as published by the Free Software Foundation; either version 2
++of the License, or (at your option) any later version.
++
++This program is distributed in the hope that it will be useful,
++but WITHOUT ANY WARRANTY; without even the implied warranty of
++MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
++
++See the GNU General Public License for more details.
++
++You should have received a copy of the GNU General Public License
++along with this program; if not, write to the Free Software
++Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
++
++Originally written by Ryan C. Gordon. (icculus at clutteredmind.org)
++Adapted to work with JonoF's port by James Bentler (bentler at cs.umn.edu)
++
++*/
++#include <stdlib.h>
++#include <string.h>
++
++#include "dsl.h"
++#include "util.h"
++
++#include "SDL.h"
++#include "SDL_mixer.h"
++
++extern volatile int MV_MixPage;
++
++static int DSL_ErrorCode = DSL_Ok;
++
++static int mixer_initialized;
++
++static void ( *_CallBackFunc )( void );
++static volatile char *_BufferStart;
++static int _BufferSize;
++static int _NumDivisions;
++static int _SampleRate;
++static int _remainder;
++
++static Mix_Chunk *blank;
++static unsigned char *blank_buf;
++
++/*
++possible todo ideas: cache sdl/sdl mixer error messages.
++*/
++
++char *DSL_ErrorString( int ErrorNumber )
++{
++   char *ErrorString;
++   
++   switch (ErrorNumber) {
++       case DSL_Warning:
++       case DSL_Error:
++           ErrorString = DSL_ErrorString(DSL_ErrorCode);
++           break;
++       
++       case DSL_Ok:
++           ErrorString = "SDL Driver ok.";
++           break;
++       
++       case DSL_SDLInitFailure:
++           ErrorString = "SDL Audio initialization failed.";
++           break;
++       
++       case DSL_MixerActive:
++           ErrorString = "SDL Mixer already initialized.";
++           break;  
++   
++       case DSL_MixerInitFailure:
++           ErrorString = "SDL Mixer initialization failed.";
++           break;
++           
++       default:
++           ErrorString = "Unknown SDL Driver error.";
++           break;
++   }
++   
++   return ErrorString;
++}
++
++static void DSL_SetErrorCode(int ErrorCode)
++{
++   DSL_ErrorCode = ErrorCode;
++}
++
++int DSL_Init( void )
++{
++   DSL_SetErrorCode(DSL_Ok);
++   
++   if (SDL_InitSubSystem(SDL_INIT_AUDIO) < 0) {
++       DSL_SetErrorCode(DSL_SDLInitFailure);
++       
++       return DSL_Error;
++   }
++   
++   return DSL_Ok;
++}
++
++void DSL_Shutdown( void )
++{
++   DSL_StopPlayback();
++}
++
++static void mixer_callback(int chan, void *stream, int len, void *udata)
++{
++   Uint8 *stptr;
++   Uint8 *fxptr;
++   int copysize;
++   
++   /* len should equal _BufferSize, else this is screwed up */
++
++   stptr = (Uint8 *)stream;
++   
++   if (_remainder > 0) {
++       copysize = min(len, _remainder);
++       
++       fxptr = (Uint8 *)(&_BufferStart[MV_MixPage * 
++           _BufferSize]);
++       
++       memcpy(stptr, fxptr+(_BufferSize-_remainder), copysize);
++       
++       len -= copysize;
++       _remainder -= copysize;
++       
++       stptr += copysize;
++   }
++   
++   while (len > 0) {
++       /* new buffer */
++       
++       _CallBackFunc();
++       
++       fxptr = (Uint8 *)(&_BufferStart[MV_MixPage * 
++           _BufferSize]);
++
++       copysize = min(len, _BufferSize);
++       
++       memcpy(stptr, fxptr, copysize);
++       
++       len -= copysize;
++       
++       stptr += copysize;
++   }
++   
++   _remainder = len;
++}
++
++int   DSL_BeginBufferedPlayback( char *BufferStart,
++      int BufferSize, int NumDivisions, unsigned SampleRate,
++      int MixMode, void ( *CallBackFunc )( void ) )
++{
++   Uint16 format;
++   Uint8 *tmp;
++   int channels;
++   int chunksize;
++       
++   if (mixer_initialized) {
++       DSL_SetErrorCode(DSL_MixerActive);
++       
++       return DSL_Error;
++   }
++   
++   _CallBackFunc = CallBackFunc;
++   _BufferStart = BufferStart;
++   _BufferSize = (BufferSize / NumDivisions);
++   _NumDivisions = NumDivisions;
++   _SampleRate = SampleRate;
++
++   _remainder = 0;
++   
++   format = (MixMode & SIXTEEN_BIT) ? AUDIO_S16SYS : AUDIO_U8;
++   channels = (MixMode & STEREO) ? 2 : 1;
++
++/*
++   23ms is typically ideal (11025,22050,44100)
++   46ms isn't bad
++*/
++   
++   chunksize = 512;
++   
++   if (SampleRate >= 16000) chunksize *= 2;
++   if (SampleRate >= 32000) chunksize *= 2;
++   
++/* 
++// SDL mixer does this already
++   if (MixMode & SIXTEEN_BIT) chunksize *= 2;
++   if (MixMode & STEREO) chunksize *= 2;
++*/
++   
++   if (Mix_OpenAudio(SampleRate, format, channels, chunksize) < 0) {
++       DSL_SetErrorCode(DSL_MixerInitFailure);
++       
++       return DSL_Error;
++   }
++
++/*
++   Mix_SetPostMix(mixer_callback, NULL);
++*/
++   /* have to use a channel because postmix will overwrite the music... */
++   Mix_RegisterEffect(0, mixer_callback, NULL, NULL);
++   
++   /* create a dummy sample just to allocate that channel */
++   blank_buf = (Uint8 *)malloc(4096);
++   memset(blank_buf, 0, 4096);
++   
++   blank = Mix_QuickLoad_RAW(blank_buf, 4096);
++       
++   Mix_PlayChannel(0, blank, -1);
++   
++   mixer_initialized = 1;
++   
++   return DSL_Ok;
++}
++
++void DSL_StopPlayback( void )
++{
++   if (mixer_initialized) {
++       Mix_HaltChannel(0);
++   }
++   
++   if (blank != NULL) {
++       Mix_FreeChunk(blank);
++   }
++   
++   blank = NULL;
++   
++   if (blank_buf  != NULL) {
++       free(blank_buf);
++   }
++   
++   blank_buf = NULL;
++   
++   if (mixer_initialized) {
++       Mix_CloseAudio();
++   }
++   
++   mixer_initialized = 0;
++}
++
++unsigned DSL_GetPlaybackRate( void )
++{
++   return _SampleRate;
++}
++
++unsigned long DisableInterrupts( void )
++{
++   return 0;
++}
++
++void RestoreInterrupts( unsigned long flags )
++{
++}

Added: head/games/jfsw/files/patch-jfsw_src_20051009-source-jaudiolib-dsl.h
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/games/jfsw/files/patch-jfsw_src_20051009-source-jaudiolib-dsl.h	Mon Jan 13 08:20:30 2014	(r339575)
@@ -0,0 +1,53 @@
+--- jfsw_src_20051009/source/jaudiolib/dsl.h.orig	1970-01-01 01:00:00.000000000 +0100
++++ jfsw_src_20051009/source/jaudiolib/dsl.h	2005-10-10 15:02:08.000000000 +0200
+@@ -0,0 +1,50 @@
++/*
++Copyright (C) 2003-2004 Ryan C. Gordon. and James Bentler
++
++This program is free software; you can redistribute it and/or
++modify it under the terms of the GNU General Public License
++as published by the Free Software Foundation; either version 2
++of the License, or (at your option) any later version.
++
++This program is distributed in the hope that it will be useful,
++but WITHOUT ANY WARRANTY; without even the implied warranty of
++MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
++
++See the GNU General Public License for more details.
++
++You should have received a copy of the GNU General Public License
++along with this program; if not, write to the Free Software
++Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
++
++Originally written by Ryan C. Gordon. (icculus at clutteredmind.org)
++Adapted to work with JonoF's port by James Bentler (bentler at cs.umn.edu)
++
++*/
++#ifndef AUDIOLIB__DSL_H
++#define AUDIOLIB__DSL_H
++
++#define MONO_8BIT    0
++#define STEREO      1
++#define SIXTEEN_BIT 2
++#define STEREO_16BIT ( STEREO | SIXTEEN_BIT )
++
++enum DSL_ERRORS
++   {
++   DSL_Warning = -2,
++   DSL_Error = -1,
++   DSL_Ok = 0,
++   DSL_SDLInitFailure,
++   DSL_MixerActive,
++   DSL_MixerInitFailure
++   };
++
++char *DSL_ErrorString( int ErrorNumber );
++int   DSL_Init( void );
++void  DSL_StopPlayback( void );
++unsigned DSL_GetPlaybackRate( void );
++int   DSL_BeginBufferedPlayback( char *BufferStart,
++      int BufferSize, int NumDivisions, unsigned SampleRate,
++      int MixMode, void ( *CallBackFunc )( void ) );
++void  DSL_Shutdown( void );
++
++#endif

Added: head/games/jfsw/files/patch-jfsw_src_20051009-source-jaudiolib-interrup.h
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/games/jfsw/files/patch-jfsw_src_20051009-source-jaudiolib-interrup.h	Mon Jan 13 08:20:30 2014	(r339575)
@@ -0,0 +1,53 @@
+--- jfsw_src_20051009/source/jaudiolib/interrup.h.orig	1970-01-01 01:00:00.000000000 +0100
++++ jfsw_src_20051009/source/jaudiolib/interrup.h	2005-10-10 15:02:08.000000000 +0200
+@@ -0,0 +1,50 @@
++/*
++Copyright (C) 1994-1995 Apogee Software, Ltd.
++
++This program is free software; you can redistribute it and/or
++modify it under the terms of the GNU General Public License
++as published by the Free Software Foundation; either version 2
++of the License, or (at your option) any later version.
++
++This program is distributed in the hope that it will be useful,
++but WITHOUT ANY WARRANTY; without even the implied warranty of
++MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
++
++See the GNU General Public License for more details.
++
++You should have received a copy of the GNU General Public License
++along with this program; if not, write to the Free Software
++Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
++
++*/
++/**********************************************************************
++   module: INTERRUP.H
++
++   author: James R. Dose
++   date:   March 31, 1994
++
++   Inline functions for disabling and restoring the interrupt flag.
++
++   (c) Copyright 1994 James R. Dose.  All Rights Reserved.
++**********************************************************************/
++
++#ifndef __INTERRUPT_H
++#define __INTERRUPT_H
++
++unsigned long DisableInterrupts( void );
++void          RestoreInterrupts( unsigned long flags );
++
++#ifdef PLAT_DOS
++#pragma aux DisableInterrupts = \
++   "pushfd",                    \
++   "pop    eax",                \
++   "cli"                        \
++   modify [ eax ];
++
++#pragma aux RestoreInterrupts = \
++   "push   eax",                \
++   "popfd"                      \
++   parm [ eax ];
++#endif
++
++#endif

Added: head/games/jfsw/files/patch-jfsw_src_20051009-source-jaudiolib-nodpmi.c
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/games/jfsw/files/patch-jfsw_src_20051009-source-jaudiolib-nodpmi.c	Mon Jan 13 08:20:30 2014	(r339575)
@@ -0,0 +1,53 @@
+--- jfsw_src_20051009/source/jaudiolib/nodpmi.c.orig	1970-01-01 01:00:00.000000000 +0100
++++ jfsw_src_20051009/source/jaudiolib/nodpmi.c	2005-10-10 15:02:08.000000000 +0200
+@@ -0,0 +1,50 @@
++/*
++Copyright (C) 1994-1995 Apogee Software, Ltd.
++
++This program is free software; you can redistribute it and/or
++modify it under the terms of the GNU General Public License
++as published by the Free Software Foundation; either version 2
++of the License, or (at your option) any later version.
++
++This program is distributed in the hope that it will be useful,
++but WITHOUT ANY WARRANTY; without even the implied warranty of
++MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
++
++See the GNU General Public License for more details.
++
++You should have received a copy of the GNU General Public License
++along with this program; if not, write to the Free Software
++Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
++
++*/
++/**********************************************************************
++   module: NODPMI.C
++
++   Functions for faking DPMI calls.
++
++**********************************************************************/
++
++#include <stdlib.h>
++#include <string.h>
++#include "dpmi.h"
++
++#define TRUE  ( 1 == 1 )
++#define FALSE ( !TRUE )
++
++int DPMI_GetDOSMemory( void **ptr, int *descriptor, unsigned length )
++{
++   /* Lovely... */
++   
++   *ptr = (void *)malloc(length);
++   
++   *descriptor = (int) *ptr;
++   
++   return (descriptor == 0) ? DPMI_Error : DPMI_Ok;
++}
++
++int DPMI_FreeDOSMemory( int descriptor )
++{
++   free((void *)descriptor);
++   
++   return (descriptor == 0) ? DPMI_Error : DPMI_Ok;
++}

Added: head/games/jfsw/files/patch-jfsw_src_20051009-source-jaudiolib-platform.h
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/games/jfsw/files/patch-jfsw_src_20051009-source-jaudiolib-platform.h	Mon Jan 13 08:20:30 2014	(r339575)
@@ -0,0 +1,63 @@
+--- jfsw_src_20051009/source/jaudiolib/platform.h.orig	1970-01-01 01:00:00.000000000 +0100
++++ jfsw_src_20051009/source/jaudiolib/platform.h	2005-10-10 15:02:08.000000000 +0200
+@@ -0,0 +1,60 @@
++#ifndef _INCLUDE_PLATFORM_H_
++#define _INCLUDE_PLATFORM_H_
++
++#if (!defined __EXPORT__)
++#define __EXPORT__
++#endif
++
++#if (defined __WATCOMC__)
++#define snprintf _snprintf
++#endif

*** DIFF OUTPUT TRUNCATED AT 1000 LINES ***


More information about the svn-ports-all mailing list