aboutsummaryrefslogtreecommitdiffstats
path: root/emulators
diff options
context:
space:
mode:
authoracm <acm@FreeBSD.org>2006-12-28 01:27:37 +0800
committeracm <acm@FreeBSD.org>2006-12-28 01:27:37 +0800
commit6610f0cfa41289131b3b5364369175d536fb66ab (patch)
tree5489f4d4f3fea0cd3d07dd97245871eff411584d /emulators
parent280351f9460c11e32b770b93a0c25094061617f9 (diff)
downloadfreebsd-ports-gnome-6610f0cfa41289131b3b5364369175d536fb66ab.tar.gz
freebsd-ports-gnome-6610f0cfa41289131b3b5364369175d536fb66ab.tar.zst
freebsd-ports-gnome-6610f0cfa41289131b3b5364369175d536fb66ab.zip
- Update to 1.5
- Add new mirrors to MASTER_SITES - Add pkg-message file - Convert to OPTIONS - Clean patch files - Install DOCSDIR files - Remove obsolete patch - Remove USE_X_PREFIX - Take maintainership
Diffstat (limited to 'emulators')
-rw-r--r--emulators/snes9x/Makefile87
-rw-r--r--emulators/snes9x/distinfo6
-rw-r--r--emulators/snes9x/files/patch-Makefile.in55
-rw-r--r--emulators/snes9x/files/patch-ab22
-rw-r--r--emulators/snes9x/files/patch-ae18
-rw-r--r--emulators/snes9x/files/patch-af614
-rw-r--r--emulators/snes9x/files/patch-configure152
-rw-r--r--emulators/snes9x/files/pkg-message.in28
8 files changed, 495 insertions, 487 deletions
diff --git a/emulators/snes9x/Makefile b/emulators/snes9x/Makefile
index cc2f38bc8b89..24af869e1114 100644
--- a/emulators/snes9x/Makefile
+++ b/emulators/snes9x/Makefile
@@ -6,39 +6,69 @@
#
PORTNAME= snes9x
-PORTVERSION= 1.42
-PORTREVISION= 1
+PORTVERSION= 1.5
CATEGORIES= emulators
-MASTER_SITES= http://www.lysator.liu.se/snes9x/${PORTVERSION}/
+MASTER_SITES= http://files.ipherswipsite.com/snes9x/ \
+ http://www.geocities.co.jp/SiliconValley-PaloAlto/2560/release/ \
+ http://www.lysator.liu.se/snes9x/${PORTVERSION}/
DISTNAME= ${PORTNAME}-${PORTVERSION}-src
-MAINTAINER= ports@FreeBSD.org
+MAINTAINER= acm@FreeBSD.org
COMMENT= Super Nintendo Entertainment System(SNES) Emulator
-WRKSRC= ${WRKDIR}/${DISTNAME}/${PORTNAME}
-
-USE_X_PREFIX= YES
-USE_GMAKE= YES
-GNU_CONFIGURE= YES
+USE_BZIP2= yes
+USE_XLIB= yes
+USE_GMAKE= yes
+GNU_CONFIGURE= yes
+CONFIGURE_ARGS+= --without-extensions
+CONFIGURE_ENV+= CPPFLAGS="-I${LOCALBASE}/include -I${X11BASE}/include" \
+ LDFLAGS="-L${LOCALBASE}/lib -L${X11BASE}/lib"
CONFIGURE_TARGET= --build=${MACHINE_ARCH}-portbld-freebsd${OSREL}
-MAKE_ARGS= INCLUDES="-I${X11BASE}/include ${PTHREAD_CFLAGS}" \
- LDLIBS="-L${X11BASE}/lib ${PTHREAD_LIBS}" \
+MAKE_ARGS= INCLUDES="-I${WRKSRC}/unzip -I${WRKSRC} -I${X11BASE}/include \
+ -I${LOCALBASE}/include ${PTHREAD_CFLAGS}" \
+ LDLIBS="-L${X11BASE}/lib -L${LOCALBASE}/lib ${PTHREAD_LIBS}" \
OPTIMISE="${CXXFLAGS}"
+WRKSRC= ${WRKDIR}/${DISTNAME}
PLIST_FILES= bin/${SNES9X_BIN}
+SUB_FILES= pkg-message
+
+OPTIONS= DEBUG "Enable debug information" off \
+ OPENGL "Enable OpenGL support" off \
+ SCREENSHOT "Enable screenshot support" on \
+ X86_ASM "Use i386 optimization (only for i386)" on \
+ MMX "Enable MMX (only for i386)" off \
+ JMA "Enable JMA archive decompression support" on
.include <bsd.port.pre.mk>
-.if ${ARCH} == "i386" && !defined(WITHOUT_X86_ASM)
+.if !defined(NOPORTDOCS)
+PORTDOCS= controls.txt control-inputs.txt changes.txt hardware.txt \
+ porting.html problems.txt snapshots.txt snes9x.conf.default \
+ README
+.endif
+
+.if defined(WITH_DEBUG)
+CONFIGURE_ARGS+= --with-debug
+.else
+CONFIGURE_ARGS+= --without-debug
+.endif
+
+.if ${ARCH} == "i386"
+.if !defined(WITHOUT_X86_ASM)
BUILD_DEPENDS+= nasm:${PORTSDIR}/devel/nasm
CONFIGURE_ARGS+= --with-assembler
-.if defined(WITH_MMX)
-CONFIGURE_ARGS+= --with-mmx
-.endif
.else
CONFIGURE_ARGS+= --without-assembler
.endif
+.if defined(WITH_MMX) && !defined(PACKAGE_BUILDING)
+CONFIGURE_ARGS+= --with-mmx
+.else
+CONFIGURE_ARGS+= --without-mmx
+.endif
+.endif
+
.if defined(WITH_OPENGL)
USE_GL= yes
CONFIGURE_ARGS+= --with-opengl
@@ -47,13 +77,40 @@ SNES9X_BIN= osnes9x
SNES9X_BIN= snes9x
.endif
+.if !defined(WITHOUT_SCREENSHOT)
+LIB_DEPENDS+= png.5:${PORTSDIR}/graphics/png
+CONFIGURE_ARGS+= --with-screenshot
+.else
+CONFIGURE_ARGS+= --without-screenshot
+.endif
+
+.if !defined(WITHOUT_JMA)
+CONFIGURE_ARGS+= --with-jma-decomp
+.else
+CONFIGURE_ARGS+= --without-jma-decomp
+.endif
+
.if exists(/usr/lib/libusbhid.a)
CONFIGURE_ARGS+= --with-joystick
.else
CONFIGURE_ARGS+= --without-joystick
.endif
+post-patch:
+ @${REINPLACE_CMD} -i "" -e 's|Pitch2|Pitch|g' ${WRKSRC}/unix/opengl.cpp
+
do-install:
+.if !defined(NOPORTDOCS)
+ ${MKDIR} ${DOCSDIR}
+.for FILE in control* changes.txt hardware.txt porting.html problems.txt \
+ snapshots.txt snes9x.conf.default
+ ${INSTALL_DATA} ${WRKSRC}/doc/${FILE} ${DOCSDIR}
+.endfor
+ ${INSTALL_DATA} ${WRKSRC}/unix/docs/readme_unix.txt ${DOCSDIR}/README
+.endif
${INSTALL_PROGRAM} ${WRKSRC}/${SNES9X_BIN} ${PREFIX}/bin
+post-install:
+ @${CAT} ${PKGMESSAGE}
+
.include <bsd.port.post.mk>
diff --git a/emulators/snes9x/distinfo b/emulators/snes9x/distinfo
index 9b8e59ed7595..d482cf44797f 100644
--- a/emulators/snes9x/distinfo
+++ b/emulators/snes9x/distinfo
@@ -1,3 +1,3 @@
-MD5 (snes9x-1.42-src.tar.gz) = 1e8af4c590e35352ddac58d25a468676
-SHA256 (snes9x-1.42-src.tar.gz) = 136c7c9bf826bf9dba91073aae14e4b315ab78e67eee189322dec2637e949ffb
-SIZE (snes9x-1.42-src.tar.gz) = 945282
+MD5 (snes9x-1.5-src.tar.bz2) = b51fb463687f812f68116b33abbf0427
+SHA256 (snes9x-1.5-src.tar.bz2) = 56ff80f24eb506ba713a258e6bfa65febdda02d3c582b1a12d05008e2a9ce48a
+SIZE (snes9x-1.5-src.tar.bz2) = 1456821
diff --git a/emulators/snes9x/files/patch-Makefile.in b/emulators/snes9x/files/patch-Makefile.in
index 6d1a80565347..6db416002d06 100644
--- a/emulators/snes9x/files/patch-Makefile.in
+++ b/emulators/snes9x/files/patch-Makefile.in
@@ -1,15 +1,6 @@
---- Makefile.in.orig Tue Aug 12 17:27:16 2003
-+++ Makefile.in Mon Oct 20 22:23:13 2003
-@@ -74,8 +74,6 @@
- CHEATS.O cheats2.o data.o unix/unix.o unix/config.o GLOBALS.O \
- $(SPC7110OBJ) $(OBC1OBJ) $(SETAOBJ) $(KREEDOBJ)
-
--OBJECTS += ../zlib/libz.a
--
- ifdef GUI
- GUIOBJS = unix/snes9x_gui.o unix/moc_snes9x_gui.o
- GUILIBS = -L$(QTDIR)/lib -lqt
-@@ -95,7 +93,6 @@
+--- Makefile.in Tue Dec 26 16:46:56 2006
++++ Makefile.in Tue Dec 26 16:49:20 2006
+@@ -138,7 +138,6 @@
ifdef THREAD_SOUND
CPUDEFINES += -DUSE_THREADS
@@ -17,46 +8,12 @@
endif
ifdef GLIDE
-@@ -112,7 +109,7 @@
+@@ -150,7 +149,7 @@
ifdef OPENGL
OPENGLOBJS = unix/opengl.o
OPENGLDEFINES = -DUSE_OPENGL
-OPENGLLIBS = -lGL -lGLU -ldl
+OPENGLLIBS = -lGL -lGLU
- OPENGLDEPENDS=use_opengl
- OPENGLNO_DEPENDS=no_opengl
- else
-@@ -132,7 +129,7 @@
- CC = @CC@
- NASM = @NASM@
-
--INCLUDES = -I../zlib @XINCLUDES@
-+INCLUDES = @XINCLUDES@
-
- OPTIMISE = @OPTIMIZE@
-
-@@ -209,19 +206,19 @@
- ../zlib/libz.a:
- cd ../zlib && sh ./configure && make
-
--snes9x: $(OBJECTS) ../zlib/libz.a unix/x11.o $(AIDOOBJS) $(GUIOBJS)
-+snes9x: $(OBJECTS) unix/x11.o $(AIDOOBJS) $(GUIOBJS)
- $(CCC) $(INCLUDES) -o $@ $(OBJECTS) $(AIDOOBJS) $(GLIDEOBJS) $(OPENGLOBJS) unix/x11.o $(GUIOBJS) $(LDLIBS) $(GLIDELIBS) $(OPENGLLIBS) $(GUILIBS) @SYSLIBS@ -lXext -lX11 $(EXTRALIBS) -lz -lm
-
--ssnes9x: $(OBJECTS) ../zlib/libz.a unix/svga.o
-+ssnes9x: $(OBJECTS) unix/svga.o
- $(CCC) $(INCLUDES) -o $@ $(OBJECTS) $(GLIDEOBJS) unix/svga.o $(LDLIBS) $(GLIDELIBS) -lvga -lvgagl -lz $(EXTRALIBS) -lm
-
--gsnes9x: $(OBJECTS) ../zlib/libz.a $(GLIDEOBJS)
-+gsnes9x: $(OBJECTS) $(GLIDEOBJS)
- $(CCC) $(INCLUDES) -o $@ $(OBJECTS) $(GLIDEOBJS) $(LDLIBS) -lglide -lz $(EXTRALIBS) -lm
-
--ggisnes9x: $(OBJECTS) ../zlib/libz.a unix/ggi.o
-+ggisnes9x: $(OBJECTS) unix/ggi.o
- $(CCC) $(INCLUDES) -o $@ $(OBJECTS) unix/ggi.o $(LDLIBS) -lggi -lz $(EXTRALIBS) -lm
-
--osnes9x: $(OBJECTS) ../zlib/libz.a unix/x11.o $(OPENGLOBJS)
-+osnes9x: $(OBJECTS) unix/x11.o $(OPENGLOBJS)
- $(CCC) $(INCLUDES) -o $@ $(OBJECTS) unix/x11.o $(OPENGLOBJS) $(LDLIBS) $(OPENGLLIBS) @SYSLIBS@ -lXext -lX11 $(EXTRALIBS) -lz -lm
+ endif
- s9xserver: $(SERVER_OBJECTS)
+ ifdef AIDO
diff --git a/emulators/snes9x/files/patch-ab b/emulators/snes9x/files/patch-ab
deleted file mode 100644
index 1fc3debf0b8d..000000000000
--- a/emulators/snes9x/files/patch-ab
+++ /dev/null
@@ -1,22 +0,0 @@
---- fxemu.h.orig Mon Jan 24 16:13:54 2000
-+++ fxemu.h Wed Mar 8 23:04:52 2000
-@@ -39,18 +39,7 @@
- #ifndef _FXEMU_H_
- #define _FXEMU_H_ 1
-
--/* Types used by structures and code */
--#ifndef snes9x_types_defined
--#define snes9x_types_defined
--
--typedef unsigned char uint8;
--typedef unsigned short uint16;
--typedef unsigned int uint32;
--typedef unsigned char bool8;
--typedef signed char int8;
--typedef short int16;
--typedef int int32;
--#endif
-+#include "port.h"
-
- #ifndef TRUE
- #define TRUE 1
diff --git a/emulators/snes9x/files/patch-ae b/emulators/snes9x/files/patch-ae
index 5e322bf43321..ad032b66b036 100644
--- a/emulators/snes9x/files/patch-ae
+++ b/emulators/snes9x/files/patch-ae
@@ -1,13 +1,13 @@
---- port.h.orig Fri Jul 25 23:20:20 2003
-+++ port.h Sat Aug 9 01:14:02 2003
-@@ -255,6 +255,10 @@
+--- port.h.orig Fri Jun 30 08:40:56 2006
++++ port.h Tue Dec 26 23:09:22 2006
+@@ -360,6 +360,10 @@
+ #define SYS_CONFIG_FILE "/etc/snes9x/snes9x.conf"
+ #endif
- #ifdef __linux
- #define TITLE "Snes9X: Linux"
-+#endif
-+
+#ifdef __FreeBSD__
+#define TITLE "Snes9X: FreeBSD"
- #endif
-
++#endif
++
#ifndef TITLE
+ #define TITLE "Snes9x"
+ #endif
diff --git a/emulators/snes9x/files/patch-af b/emulators/snes9x/files/patch-af
index b407c62131ea..b3cb734cedce 100644
--- a/emulators/snes9x/files/patch-af
+++ b/emulators/snes9x/files/patch-af
@@ -1,12 +1,12 @@
---- unix/unix.cpp.orig Fri Dec 5 02:03:08 2003
-+++ unix/unix.cpp Sun Jan 25 00:52:36 2004
-@@ -109,8 +109,12 @@
+--- unix/unix.cpp Fri Jun 30 08:34:57 2006
++++ unix/unix.cpp Wed Dec 27 00:07:21 2006
+@@ -178,8 +178,12 @@
pthread_mutex_t mutex;
#endif
--#ifdef __linux
+-#if !defined(NOSOUND) && defined(__linux)
+#ifndef __sun
-+#if defined(__linux) || defined(__FreeBSD__)
++#if !defined(NOSOUND) && (defined(__linux) || defined(__FreeBSD__))
#include <sys/soundcard.h>
+#else
+#include <machine/soundcard.h>
@@ -14,43 +14,42 @@
#include <sys/mman.h>
#endif
-@@ -127,6 +131,11 @@
- //typedef void (*SIG_PF)();
- //#endif
+@@ -191,6 +195,11 @@
+ #endif
+ #endif
+#if defined(__FreeBSD__)
+typedef sig_t SIG_PF;
+#include <err.h>
+#endif
+
- #include "snes9x.h"
- #include "memmap.h"
- #include "debug.h"
-@@ -153,7 +162,10 @@
- int NumControllers = 5;
+ //Breaks sol9 and probably others.
+ //#if defined(__sun) && defined(__GNUC__)
+ //typedef void (*SIG_PF)();
+@@ -222,13 +231,78 @@
+ #endif
#ifdef JOYSTICK_SUPPORT
-+#define JOYSTICK_MAX_DEVICES 4
-+int JoystickShift = 0;
- #ifdef __linux
-+#define JOYSTICK_MAX_BUTTONS 4
++#define JOYSTICK_MAX_DEVICES 4
++int JoystickShift = 0
+ #if defined(__linux)
++#define JOYSTICK_MAX_BUTTONS 4
#include <linux/joystick.h>
- int js_fd [4] = {-1, -1, -1, -1};
- int js_map_button [4][16] = {
-@@ -200,6 +212,68 @@
- char *js_device [4] = {"/dev/js0", "/dev/js1", "/dev/js2", "/dev/js3"};
+ uint8 js_mod [8] = {0, 0, 0, 0, 0, 0, 0, 0};
+ int js_fd [8] = {-1, -1, -1, -1, -1, -1, -1, -1};
+ char *js_device [8] = {"/dev/js0", "/dev/js1", "/dev/js2", "/dev/js3", "/dev/js4", "/dev/js5", "/dev/js6", "/dev/js7" };
#endif
+#if defined(__FreeBSD__)
+#include <sys/types.h>
+#include <sys/param.h>
-+
++
+extern "C" {
+#define class klass
+#include <dev/usb/usb.h>
-+#include <dev/usb/usbhid.h>
++#include <dev/usb/usbhid.h>
+#undef class
-+
++
+#if __FreeBSD_version < 500111
+#include <libusbhid.h>
+#else
@@ -58,47 +57,47 @@
+#endif
+}
+
-+#define JOYSTICK_MAX_BUTTONS 16
++#define JOYSTICK_MAX_BUTTONS 16
+
-+#define JOYSTICK_MAP_BUTTON_INITIALIZER \
-+ { \
-+ SNES_Y_MASK, SNES_B_MASK, SNES_A_MASK, \
-+ SNES_X_MASK, SNES_TL_MASK, SNES_TR_MASK, \
-+ SNES_TL_MASK, SNES_TR_MASK, \
-+ SNES_SELECT_MASK, SNES_START_MASK, 0, 0, 0, 0, 0, 0 \
++#define JOYSTICK_MAP_BUTTON_INITIALIZER \
++ { \
++ SNES_Y_MASK, SNES_B_MASK, SNES_A_MASK, \
++ SNES_X_MASK, SNES_TL_MASK, SNES_TR_MASK, \
++ SNES_TL_MASK, SNES_TR_MASK, \
++ SNES_SELECT_MASK, SNES_START_MASK, 0, 0, 0, 0, 0, 0 \
+ }
+
+int js_map_button[JOYSTICK_MAX_BUTTONS][16] = {
-+ JOYSTICK_MAP_BUTTON_INITIALIZER,
-+ JOYSTICK_MAP_BUTTON_INITIALIZER,
-+ JOYSTICK_MAP_BUTTON_INITIALIZER,
-+ JOYSTICK_MAP_BUTTON_INITIALIZER,
-+ JOYSTICK_MAP_BUTTON_INITIALIZER,
-+ JOYSTICK_MAP_BUTTON_INITIALIZER,
-+ JOYSTICK_MAP_BUTTON_INITIALIZER,
-+ JOYSTICK_MAP_BUTTON_INITIALIZER,
-+ JOYSTICK_MAP_BUTTON_INITIALIZER,
-+ JOYSTICK_MAP_BUTTON_INITIALIZER,
-+ JOYSTICK_MAP_BUTTON_INITIALIZER,
-+ JOYSTICK_MAP_BUTTON_INITIALIZER,
-+ JOYSTICK_MAP_BUTTON_INITIALIZER,
-+ JOYSTICK_MAP_BUTTON_INITIALIZER,
-+ JOYSTICK_MAP_BUTTON_INITIALIZER,
-+ JOYSTICK_MAP_BUTTON_INITIALIZER
++ JOYSTICK_MAP_BUTTON_INITIALIZER,
++ JOYSTICK_MAP_BUTTON_INITIALIZER,
++ JOYSTICK_MAP_BUTTON_INITIALIZER,
++ JOYSTICK_MAP_BUTTON_INITIALIZER,
++ JOYSTICK_MAP_BUTTON_INITIALIZER,
++ JOYSTICK_MAP_BUTTON_INITIALIZER,
++ JOYSTICK_MAP_BUTTON_INITIALIZER,
++ JOYSTICK_MAP_BUTTON_INITIALIZER,
++ JOYSTICK_MAP_BUTTON_INITIALIZER,
++ JOYSTICK_MAP_BUTTON_INITIALIZER,
++ JOYSTICK_MAP_BUTTON_INITIALIZER,
++ JOYSTICK_MAP_BUTTON_INITIALIZER,
++ JOYSTICK_MAP_BUTTON_INITIALIZER,
++ JOYSTICK_MAP_BUTTON_INITIALIZER,
++ JOYSTICK_MAP_BUTTON_INITIALIZER,
++ JOYSTICK_MAP_BUTTON_INITIALIZER
+};
+char *js_device [4] = {"/dev/uhid0", "/dev/uhid1", "/dev/uhid2", "/dev/uhid3"};
+struct js_range {
-+ int min, max, lower_third, higher_third;
++ int min, max, lower_third, higher_third;
+};
+struct js_info {
-+ char *buf;
-+ int reportlen;
-+ int offset;
-+ struct js_range x, y;
-+ int buttons;
-+ struct hid_item *hids;
-+ int fd;
-+ int joy;
++ char *buf;
++ int reportlen;
++ int offset;
++ struct js_range x, y;
++ int buttons;
++ struct hid_item *hids;
++ int fd;
++ int joy;
+} js_info[4];
+int js_count = 0;
+#endif
@@ -106,8 +105,8 @@
void InitJoysticks ();
void ReadJoysticks ();
#endif
-@@ -212,7 +286,7 @@
- char *SDD1_pack = NULL;
+@@ -249,7 +323,7 @@
+ const char *inc_format="%03d";
//FIXME: I see no reason not to configureenable this for all Unixen
-#if defined(DEBUGGER) && (defined(__linux) || defined(__sun))
@@ -115,134 +114,75 @@
static void sigbrkhandler(int)
{
CPU.Flags |= DEBUG_MODE_FLAG;
-@@ -237,91 +311,43 @@
+@@ -287,22 +361,54 @@
+
+ void S9xParseArg (char **argv, int &i, int argc)
+ {
++#ifdef JOYSTICK_SUPPORT
if (strcmp (argv [i], "-j") == 0 ||
- strcasecmp (argv [i], "-nojoy") == 0)
- Settings.JoystickEnabled = FALSE;
-- else if (strcasecmp (argv [i], "-joydev1") == 0)
+ strcasecmp (argv [i], "-nojoy") == 0) {
+-#ifdef JOYSTICK_SUPPORT
+- Settings.JoystickEnabled = FALSE;
+-#endif
+- } else if (strncasecmp (argv [i], "-joydev", 7) == 0 && argv[i][7]>='1' && argv[i][7]<='8' && argv[i][8]=='\0')
- {
-- if (i + 1 < argc)
-- js_device[0] = argv[++i];
+- int j = argv[i][7]-'1';
+- if (i + 1 < argc) {
+-#ifdef JOYSTICK_SUPPORT
+- js_device[j] = argv[++i];
+-#else
+- S9xMessage(S9X_WARNING, S9X_USAGE, "Joystick support is not available!");
++ Settings.JoystickEnabled = FALSE;
++ }
++
+#ifdef __FreeBSD__
+ else if (strcasecmp(argv[i], "-joyshift") == 0)
-+ JoystickShift = 1;
++ JoystickShift = 1;
+#endif
+ else if (strncasecmp(argv[i], "-joydev", sizeof("-joydev") - 1) == 0) {
-+ char *end, *snum = argv[i] + sizeof("-joydev") - 1;
-+ unsigned long num;
++ char *end, *snum = argv[i] + sizeof("-joydev") - 1;
++ unsigned long num;
+
-+ if (*snum == '\0' || argc < i + 1)
-+ S9xUsage();
-+ if ((num = strtoul(snum, &end, 10)) < JOYSTICK_MAX_DEVICES &&
-+ num > 0 && *end == '\0')
-+ js_device[num - 1] = argv[++i];
- else
-- S9xUsage ();
-+ S9xUsage();
- }
-- else if (strcasecmp (argv [i], "-joydev2") == 0)
-- {
-- if (i + 1 < argc)
-- js_device[1] = argv[++i];
-- else
-- S9xUsage ();
-- }
-- else if (strcasecmp (argv [i], "-joymap1") == 0)
-- {
-- if (i + 8 < argc)
-- {
-- int t;
--
-- if ((t = atoi (argv [++i])) < 15) js_map_button [0][t] = SNES_A_MASK;
-- if ((t = atoi (argv [++i])) < 15) js_map_button [0][t] = SNES_B_MASK;
-- if ((t = atoi (argv [++i])) < 15) js_map_button [0][t] = SNES_X_MASK;
-- if ((t = atoi (argv [++i])) < 15) js_map_button [0][t] = SNES_Y_MASK;
-- if ((t = atoi (argv [++i])) < 15) js_map_button [0][t] = SNES_TL_MASK;
-- if ((t = atoi (argv [++i])) < 15) js_map_button [0][t] = SNES_TR_MASK;
-- if ((t = atoi (argv [++i])) < 15) js_map_button [0][t] = SNES_START_MASK;
-- if ((t = atoi (argv [++i])) < 15) js_map_button [0][t] = SNES_SELECT_MASK;
-- }
-- else
-- S9xUsage ();
-- }
-- else if (strcasecmp (argv [i], "-joymap2") == 0)
-- {
-- if (i + 8 < argc)
-- {
-- int t;
--
-- if ((t = atoi (argv [++i])) < 15) js_map_button [1][t] = SNES_A_MASK;
-- if ((t = atoi (argv [++i])) < 15) js_map_button [1][t] = SNES_B_MASK;
-- if ((t = atoi (argv [++i])) < 15) js_map_button [1][t] = SNES_X_MASK;
-- if ((t = atoi (argv [++i])) < 15) js_map_button [1][t] = SNES_Y_MASK;
-- if ((t = atoi (argv [++i])) < 15) js_map_button [1][t] = SNES_TL_MASK;
-- if ((t = atoi (argv [++i])) < 15) js_map_button [1][t] = SNES_TR_MASK;
-- if ((t = atoi (argv [++i])) < 15) js_map_button [1][t] = SNES_START_MASK;
-- if ((t = atoi (argv [++i])) < 15) js_map_button [1][t] = SNES_SELECT_MASK;
-- }
-- else
-- S9xUsage ();
-- }
-- else if (strcasecmp (argv [i], "-joymap3") == 0)
-- {
-- if (i + 8 < argc)
-- {
-- int t;
--
-- if ((t = atoi (argv [++i])) < 15) js_map_button [2][t] = SNES_A_MASK;
-- if ((t = atoi (argv [++i])) < 15) js_map_button [2][t] = SNES_B_MASK;
-- if ((t = atoi (argv [++i])) < 15) js_map_button [2][t] = SNES_X_MASK;
-- if ((t = atoi (argv [++i])) < 15) js_map_button [2][t] = SNES_Y_MASK;
-- if ((t = atoi (argv [++i])) < 15) js_map_button [2][t] = SNES_TL_MASK;
-- if ((t = atoi (argv [++i])) < 15) js_map_button [2][t] = SNES_TR_MASK;
-- if ((t = atoi (argv [++i])) < 15) js_map_button [2][t] = SNES_START_MASK;
-- if ((t = atoi (argv [++i])) < 15) js_map_button [2][t] = SNES_SELECT_MASK;
-- }
-- else
-- S9xUsage ();
-- }
-- else if (strcasecmp (argv [i], "-joymap4") == 0)
-- {
-- if (i + 8 < argc)
-- {
-- int t;
--
-- if ((t = atoi (argv [++i])) < 15) js_map_button [3][t] = SNES_A_MASK;
-- if ((t = atoi (argv [++i])) < 15) js_map_button [3][t] = SNES_B_MASK;
-- if ((t = atoi (argv [++i])) < 15) js_map_button [3][t] = SNES_X_MASK;
-- if ((t = atoi (argv [++i])) < 15) js_map_button [3][t] = SNES_Y_MASK;
-- if ((t = atoi (argv [++i])) < 15) js_map_button [3][t] = SNES_TL_MASK;
-- if ((t = atoi (argv [++i])) < 15) js_map_button [3][t] = SNES_TR_MASK;
-- if ((t = atoi (argv [++i])) < 15) js_map_button [3][t] = SNES_START_MASK;
-- if ((t = atoi (argv [++i])) < 15) js_map_button [3][t] = SNES_SELECT_MASK;
-- }
-- else
-- S9xUsage ();
++ if (*snum == '\0' || argc < i + 1)
++ S9xUsage();
++ if ((num = strtoul(snum, &end, 10)) < JOYSTICK_MAX_DEVICES &&
++ num > 0 && *end == '\0')
++ js_device[num - 1] = argv[++i];
++ else
++ S9xUsage ();
++ }
+ else if (strncasecmp(argv[i], "-joymap", sizeof("-joymap") - 1) == 0) {
-+ static const int button_masks[] = {
-+ SNES_A_MASK, SNES_B_MASK, SNES_X_MASK, SNES_Y_MASK,
-+ SNES_TL_MASK, SNES_TR_MASK, SNES_START_MASK, SNES_SELECT_MASK
-+ };
-+ char *end, *snum = argv[i] + sizeof("-joymap") - 1;
-+ unsigned long num;
-+ int *js_buttons, b;
++ static const int button_masks[] = {
++ SNES_A_MASK, SNES_B_MASK, SNES_X_MASK, SNES_Y_MASK,
++ SNES_TL_MASK, SNES_TR_MASK, SNES_START_MASK, SNES_SELECT_MASK
++ };
++ char *end, *snum = argv[i] + sizeof("-joymap") - 1;
++ unsigned long num;
++ int *js_buttons, b;
+
-+ if (argc < i + (sizeof(button_masks) / sizeof(int)) || *snum == '\0')
-+ S9xUsage();
-+ num = strtoul(snum, &end, 10);
-+ if (*end != '\0')
-+ S9xUsage();
-+ if (num == 0 || num > 4) /* hardcode: max joysticks */
-+ S9xUsage();
-+ js_buttons = js_map_button[num - 1];
-+ for (b = 0; b < (sizeof(button_masks) / sizeof(int)); b++)
-+ if ((num = strtoul(argv[++i], &end, 10)) <= 16 && num != 0 &&
-+ *end == '\0')
-+ js_buttons[num - 1] = button_masks[b];
- }
- else
++ if (argc < i + (sizeof(button_masks) / sizeof(int)) || *snum == '\0')
++ S9xUsage();
++ num = strtoul(snum, &end, 10);
++ if (*end != '\0')
++ S9xUsage();
++ if (num == 0 || num > 4) /* hardcode: max joysticks */
++ S9xUsage();
++ js_buttons = js_map_button[num - 1];
++ for (b = 0; b < (sizeof(button_masks) / sizeof(int)); b++)
++ if ((num = strtoul(argv[++i], &end, 10)) <= 16 && num != 0 &&
++ *end == '\0')
++ js_buttons[num - 1] = button_masks[b];
++ }
++
++ else
#endif
-@@ -472,7 +498,7 @@
+- } else S9xUsage ();
+- } else if (strcasecmp (argv [i], "-b") == 0 ||
++ if (strcasecmp (argv [i], "-b") == 0 ||
+ strcasecmp (argv [i], "-bs") == 0 ||
+ strcasecmp (argv [i], "-buffersize") == 0)
+ {
+@@ -413,7 +519,7 @@
#if !defined(__MSDOS) && defined(DEBUGGER)
#if defined(__unix) && !defined(__NeXT__)
struct sigaction sa;
@@ -251,15 +191,15 @@
sa.sa_handler = sigbrkhandler;
#else
sa.sa_handler = (SIG_PF) sigbrkhandler;
-@@ -664,6 +690,7 @@
+@@ -613,6 +719,7 @@
}
#ifdef JOYSTICK_SUPPORT
-+#ifdef linux
++#ifdef __linux
void InitJoysticks ()
{
#ifdef JSIOCGVERSION
-@@ -784,6 +811,189 @@
+@@ -697,6 +804,189 @@
}
#endif
}
@@ -278,208 +218,208 @@
+
+int
+InitJoystickFd(int fd, char *dev) {
-+ report_desc_t rd;
-+ struct hid_data *d;
-+ struct hid_item h, new_h;
-+ struct js_info *my_info;
-+ int reportlen, report_id, is_joystick;
++ report_desc_t rd;
++ struct hid_data *d;
++ struct hid_item h, new_h;
++ struct js_info *my_info;
++ int reportlen, report_id, is_joystick;
+
-+ my_info = &js_info[js_count];
-+ rd = hid_get_report_desc(fd);
-+ if (rd == 0) {
-+ warn("%s", dev);
-+ return (-1);
-+ }
-+ report_id = 0;
++ my_info = &js_info[js_count];
++ rd = hid_get_report_desc(fd);
++ if (rd == 0) {
++ warn("%s", dev);
++ return (-1);
++ }
++ report_id = 0;
+#if __FreeBSD_version < 500111
-+ reportlen = hid_report_size(rd, report_id, hid_input);
++ reportlen = hid_report_size(rd, report_id, hid_input);
+#else
-+ reportlen = hid_report_size(rd, hid_input, report_id);
++ reportlen = hid_report_size(rd, hid_input, report_id);
+#endif
-+ my_info->buf = (char *)malloc(reportlen);
-+ if (my_info->buf == NULL)
-+ err(1, "malloc");
-+ my_info->reportlen = reportlen;
-+ my_info->offset = report_id != 0;
-+ my_info->buttons = 0;
-+ my_info->hids = NULL;
++ my_info->buf = (char *)malloc(reportlen);
++ if (my_info->buf == NULL)
++ err(1, "malloc");
++ my_info->reportlen = reportlen;
++ my_info->offset = report_id != 0;
++ my_info->buttons = 0;
++ my_info->hids = NULL;
+
-+ is_joystick = 0;
++ is_joystick = 0;
+#if __FreeBSD_version < 500111
-+ for (d = hid_start_parse(rd, 1 << hid_input);
++ for (d = hid_start_parse(rd, 1 << hid_input);
+#else
-+ for (d = hid_start_parse(rd, 1 << hid_input, report_id);
++ for (d = hid_start_parse(rd, 1 << hid_input, report_id);
+#endif
-+ hid_get_item(d, &h);) {
-+ int usage, page, link_it = 0;
-+ struct js_range *axis;
++ hid_get_item(d, &h);) {
++ int usage, page, link_it = 0;
++ struct js_range *axis;
+
-+ page = HID_PAGE(h.usage);
-+ usage = HID_USAGE(h.usage);
-+ if (!is_joystick)
-+ is_joystick = (h.kind == hid_collection &&
-+ page == HUP_GENERIC_DESKTOP &&
-+ (usage == HUG_JOYSTICK || usage == HUG_GAME_PAD));
-+ if (h.kind != hid_input || !is_joystick)
-+ continue;
-+ axis = NULL;
-+ if (page == HUP_GENERIC_DESKTOP) {
-+ switch (usage) {
-+ case HUG_X:
-+ case HUG_RX:
-+ axis = &my_info->x;
-+ break;
-+ case HUG_Y:
-+ case HUG_RY:
-+ axis = &my_info->y;
-+ break;
-+ }
-+ }
-+ if (axis != NULL) {
-+ axis->min = h.logical_minimum;
-+ axis->max = h.logical_maximum;
-+ axis->lower_third = axis->min +
-+ (axis->max - axis->min) / 3;
-+ axis->higher_third = axis->min +
-+ (axis->max - axis->min) * 2 / 3;
-+ link_it = 1;
-+ }
-+ if (!link_it) {
-+ if (page != HUP_BUTTON || usage > 16)
-+ continue;
-+ if (usage > my_info->buttons)
-+ my_info->buttons = usage;
-+ }
-+ new_h = h;
-+ new_h.next = my_info->hids;
-+ my_info->hids = (struct hid_item *)
-+ malloc(sizeof(*my_info->hids));
-+ if (my_info->hids == NULL)
-+ err(1, "malloc");
-+ *my_info->hids = new_h;
-+ }
-+ printf("Joystick %s: %d buttons, X range %d - %d, Y range %d - %d\n",
-+ dev, my_info->buttons, my_info->x.min, my_info->x.max,
-+ my_info->y.min, my_info->y.max);
-+ my_info->fd = fd;
-+ if (JoystickShift) {
-+ my_info->joy = js_count + 1;
-+ } else
-+ my_info->joy = js_count;
-+ return (0);
++ page = HID_PAGE(h.usage);
++ usage = HID_USAGE(h.usage);
++ if (!is_joystick)
++ is_joystick = (h.kind == hid_collection &&
++ page == HUP_GENERIC_DESKTOP &&
++ (usage == HUG_JOYSTICK || usage == HUG_GAME_PAD));
++ if (h.kind != hid_input || !is_joystick)
++ continue;
++ axis = NULL;
++ if (page == HUP_GENERIC_DESKTOP) {
++ switch (usage) {
++ case HUG_X:
++ case HUG_RX:
++ axis = &my_info->x;
++ break;
++ case HUG_Y:
++ case HUG_RY:
++ axis = &my_info->y;
++ break;
++ }
++ }
++ if (axis != NULL) {
++ axis->min = h.logical_minimum;
++ axis->max = h.logical_maximum;
++ axis->lower_third = axis->min +
++ (axis->max - axis->min) / 3;
++ axis->higher_third = axis->min +
++ (axis->max - axis->min) * 2 / 3;
++ link_it = 1;
++ }
++ if (!link_it) {
++ if (page != HUP_BUTTON || usage > 16)
++ continue;
++ if (usage > my_info->buttons)
++ my_info->buttons = usage;
++ }
++ new_h = h;
++ new_h.next = my_info->hids;
++ my_info->hids = (struct hid_item *)
++ malloc(sizeof(*my_info->hids));
++ if (my_info->hids == NULL)
++ err(1, "malloc");
++ *my_info->hids = new_h;
++ }
++ printf("Joystick %s: %d buttons, X range %d - %d, Y range %d - %d\n",
++ dev, my_info->buttons, my_info->x.min, my_info->x.max,
++ my_info->y.min, my_info->y.max);
++ my_info->fd = fd;
++ if (JoystickShift) {
++ my_info->joy = js_count + 1;
++ } else
++ my_info->joy = js_count;
++ return (0);
+}
+
+void
+InitJoysticks() {
-+ int i, fd;
++ int i, fd;
+
-+ for (i = 0; i < (sizeof(js_device) / sizeof(js_device[0])); i++) {
-+ fd = open(js_device[i], O_RDONLY | O_NONBLOCK);
-+ if (fd == -1)
-+ continue;
-+ if (InitJoystickFd(fd, js_device[i]) == 0)
-+ js_count++;
-+ else
-+ close(fd);
-+ }
++ for (i = 0; i < (sizeof(js_device) / sizeof(js_device[0])); i++) {
++ fd = open(js_device[i], O_RDONLY | O_NONBLOCK);
++ if (fd == -1)
++ continue;
++ if (InitJoystickFd(fd, js_device[i]) == 0)
++ js_count++;
++ else
++ close(fd);
++ }
+}
+
+void
+ReadJoysticks() {
-+ struct hid_item *h;
-+ int page, usage, njoy, joy;
++ struct hid_item *h;
++ int page, usage, njoy, joy;
+
-+ for (njoy = 0; njoy < js_count; njoy++) {
-+ struct js_info *jsi;
++ for (njoy = 0; njoy < js_count; njoy++) {
++ struct js_info *jsi;
+
-+ jsi = &js_info[njoy];
-+ joy = jsi->joy;
++ jsi = &js_info[njoy];
++ joy = jsi->joy;
+
-+ if (read(jsi->fd, jsi->buf, jsi->reportlen) != jsi->reportlen)
-+ continue;
-+ for (h = jsi->hids; h != NULL; h = h->next) {
-+ int d;
++ if (read(jsi->fd, jsi->buf, jsi->reportlen) != jsi->reportlen)
++ continue;
++ for (h = jsi->hids; h != NULL; h = h->next) {
++ int d;
+
-+ d = hid_get_data(jsi->buf + jsi->offset, h);
-+ page = HID_PAGE(h->usage);
-+ usage = HID_USAGE(h->usage);
++ d = hid_get_data(jsi->buf + jsi->offset, h);
++ page = HID_PAGE(h->usage);
++ usage = HID_USAGE(h->usage);
+
-+ switch (page) {
-+ case HUP_GENERIC_DESKTOP:
-+ switch (usage) {
-+ case HUG_X:
-+ case HUG_RX:
-+ if (d < jsi->x.lower_third) {
-+ joypads[joy] |= SNES_LEFT_MASK;
-+ joypads[joy] &= ~SNES_RIGHT_MASK;
-+ } else if (d < jsi->x.higher_third) {
-+ joypads[joy] &= ~SNES_LEFT_MASK;
-+ joypads[joy] &= ~SNES_RIGHT_MASK;
-+ } else {
-+ joypads[joy] &= ~SNES_LEFT_MASK;
-+ joypads[joy] |= SNES_RIGHT_MASK;
-+ }
-+ break;
-+ case HUG_Y:
-+ case HUG_RY:
-+ if (d < jsi->y.lower_third) {
-+ joypads[joy] |= SNES_UP_MASK;
-+ joypads[joy] &= ~SNES_DOWN_MASK;
-+ } else if (d < jsi->y.higher_third) {
-+ joypads[joy] &= ~SNES_UP_MASK;
-+ joypads[joy] &= ~SNES_DOWN_MASK;
-+ } else {
-+ joypads[joy] &= ~SNES_UP_MASK;
-+ joypads[joy] |= SNES_DOWN_MASK;
-+ }
-+ break;
-+ }
-+ break;
-+ case HUP_BUTTON:
-+ if (d)
-+ joypads[joy] |= js_map_button[njoy][usage - 1];
-+ else
-+ joypads[joy] &= ~js_map_button[njoy][usage - 1];
-+ break;
-+ }
-+ }
-+ }
++ switch (page) {
++ case HUP_GENERIC_DESKTOP:
++ switch (usage) {
++ case HUG_X:
++ case HUG_RX:
++ if (d < jsi->x.lower_third) {
++ joypads[joy] |= SNES_LEFT_MASK;
++ joypads[joy] &= ~SNES_RIGHT_MASK;
++ } else if (d < jsi->x.higher_third) {
++ joypads[joy] &= ~SNES_LEFT_MASK;
++ joypads[joy] &= ~SNES_RIGHT_MASK;
++ } else {
++ joypads[joy] &= ~SNES_LEFT_MASK;
++ joypads[joy] |= SNES_RIGHT_MASK;
++ }
++ break;
++ case HUG_Y:
++ case HUG_RY:
++ if (d < jsi->y.lower_third) {
++ joypads[joy] |= SNES_UP_MASK;
++ joypads[joy] &= ~SNES_DOWN_MASK;
++ } else if (d < jsi->y.higher_third) {
++ joypads[joy] &= ~SNES_UP_MASK;
++ joypads[joy] &= ~SNES_DOWN_MASK;
++ } else {
++ joypads[joy] &= ~SNES_UP_MASK;
++ joypads[joy] |= SNES_DOWN_MASK;
++ }
++ break;
++ }
++ break;
++ case HUP_BUTTON:
++ if (d)
++ joypads[joy] |= js_map_button[njoy][usage - 1];
++ else
++ joypads[joy] &= ~js_map_button[njoy][usage - 1];
++ break;
++ }
++ }
++ }
+}
+#endif // defined(__FreeBSD__)
#endif // defined (JOYSTICK_SUPPORT)
- const char *GetHomeDirectory ()
-@@ -1575,7 +1785,7 @@
+ START_EXTERN_C
+@@ -1522,7 +1812,7 @@
}
#endif
--#if defined(__linux)
-+#if defined(__linux) || defined(__FreeBSD__)
+-#if !defined(NOSOUND) && defined(__linux)
++#if !defined(NOSOUND) && (defined(__linux) || defined(__FreeBSD__))
static int Rates[8] =
{
0, 8000, 11025, 16000, 22050, 32000, 44100, 48000
-@@ -1696,7 +1906,7 @@
+@@ -1644,7 +1934,7 @@
#endif
--#if defined (__linux) || defined (__sun) || defined(NOSOUND)
-+#if defined(__linux) || defined(__sun) || defined(__FreeBSD__) || defined(NOSOUND)
+-#if !defined(NOSOUND) && (defined (__linux) || defined (__sun))
++#if !defined(NOSOUND) && (defined (__linux) || defined (__sun) || defined(__FreeBSD__))
void S9xUnixProcessSound (void)
{
}
-@@ -1737,7 +1947,7 @@
+@@ -1687,7 +1977,7 @@
}
#endif
--#if defined (__linux) || defined (__sun)
-+#if defined(__linux) || defined(__sun) || defined(__FreeBSD__)
+-#if !defined(NOSOUND) && (defined (__linux) || defined (__sun))
++#if !defined(NOSOUND) && (defined (__linux) || defined (__sun) || defined(__FreeBSD__))
void S9xGenerateSound ()
{
- int bytes_so_far = so.sixteen_bit ? (so.samples_mixed_so_far << 1) :
-@@ -1822,7 +2032,7 @@
-
- void *S9xProcessSound (void *)
- {
+ /* Linux and Sun versions */
+@@ -1779,7 +2069,7 @@
+ /* If threads in use, this is to loop indefinitely */
+ /* If not, this will be called by timer */
+
-#ifdef __linux
+#if defined(__linux) || defined(__FreeBSD__)
audio_buf_info info;
diff --git a/emulators/snes9x/files/patch-configure b/emulators/snes9x/files/patch-configure
index ecc24c5f49fc..0e7ec37927f2 100644
--- a/emulators/snes9x/files/patch-configure
+++ b/emulators/snes9x/files/patch-configure
@@ -1,16 +1,86 @@
---- configure.orig Thu Dec 4 18:03:08 2003
-+++ configure Sat Apr 29 23:35:05 2006
-@@ -646,6 +646,7 @@
+--- configure.orig Tue Dec 26 23:42:54 2006
++++ configure Tue Dec 26 23:52:49 2006
+@@ -1268,6 +1268,7 @@
+ --with(out)-opengl Use OpenGL for output (default: without)
--with(out)-aido Use a shared memory area for output (default: without)
- --with(out)-joystick Enable joystick support if available (default: with)
- --with(out)-assembler Use assembler cores if available (default: with)
-+ --with(out)-mmx Use mmx assembly code (default: with)
- --with(out)-sdd1-decomp Use SDD1 decompression (default: with)
- --with(out)-screenshot Screenshot support through libpng if available (default: with)
- --with-x use the X Window System
-@@ -1992,6 +1993,14 @@
- with_assembler=yes
- fi;
+ --with(out)-assembler Use assembler cores if available (default: with)
++ --with(out)-mmx Use assembler cores if available (default: with)
+ --with(out)-zsnesc4 Use ZSNES C4 core if available (default: same as --with-assembler)
+ --with(out)-zsnesfx Use ZSNES SuperFX core if available (default: same as --with-assembler)
+ --with(out)-correct-vram-reads Use Correct VRAM read logic (default: with)
+@@ -7182,6 +7183,59 @@
+ { echo "$as_me:$LINENO: result: $snes9x_cv_hpux_os" >&5
+ echo "${ECHO_T}$snes9x_cv_hpux_os" >&6; }
+
++echo "$as_me:$LINENO: checking if the OS is FreeBSD" >&5
++echo $ECHO_N "checking if the OS is FreeBSD... $ECHO_C" >&6
++if test "${snes9x_cv_freebsd_os+set}" = set; then
++ echo $ECHO_N "(cached) $ECHO_C" >&6
++else
++
++ cat >conftest.$ac_ext <<_ACEOF
++#line 3885 "configure"
++/* confdefs.h. */
++_ACEOF
++cat confdefs.h >>conftest.$ac_ext
++cat >>conftest.$ac_ext <<_ACEOF
++/* end confdefs.h. */
++
++#ifdef __FreeBSD__
++/* */
++#else
++#error Not FreeBSD.
++#endif
++
++int
++main ()
++{
++
++ ;
++ return 0;
++}
++_ACEOF
++rm -f conftest.$ac_objext
++if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
++ (eval $ac_compile) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); } &&
++ { ac_try='test -s conftest.$ac_objext'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; }; then
++ snes9x_cv_freebsd_os=yes
++else
++ echo "$as_me: failed program was:" >&5
++sed 's/^/| /' conftest.$ac_ext >&5
++
++snes9x_cv_freebsd_os=no
++fi
++rm -f conftest.$ac_objext conftest.$ac_ext
++fi
++
++echo "$as_me:$LINENO: result: $snes9x_cv_freebsd_os" >&5
++echo "${ECHO_T}$snes9x_cv_freebsd_os" >&6
++
+ { echo "$as_me:$LINENO: checking if the OS is MS Windows" >&5
+ echo $ECHO_N "checking if the OS is MS Windows... $ECHO_C" >&6; }
+ if test "${snes9x_cv_win32_os+set}" = set; then
+@@ -7437,6 +7491,9 @@
+ # Check whether --with-joystick was given.
+ if test "${with_joystick+set}" = set; then
+ withval=$with_joystick;
++elif test yes = "$snes9x_cv_freebsd_os" -a yes = "$with_joystick"; then
++ JOYDEFINES=' -DJOYSTICK_SUPPORT'
++ SYSLIBS="$SYSLIBS"' -lusbhid'
+ else
+ with_joystick=yes
+ fi
+@@ -7473,6 +7530,13 @@
+ CPUINC='-Ish'
+ fi
+# Check whether --with-mmx or --without-mmx was given.
+if test "${with_mmx+set}" = set -a yes = "$with_assembler"; then
@@ -19,13 +89,12 @@
+else
+ with_mmx=no
+fi;
-+
- # Check whether --with-sdd1-decomp or --without-sdd1-decomp was given.
+
+ # Check whether --with-sdd1-decomp was given.
if test "${with_sdd1_decomp+set}" = set; then
- withval="$with_sdd1_decomp"
-@@ -3866,6 +3875,59 @@
- echo "$as_me:3866: result: $snes9x_cv_hpux_os" >&5
- echo "${ECHO_T}$snes9x_cv_hpux_os" >&6
+@@ -11190,6 +11254,58 @@
+ echo "${ECHO_T}Defining _XOPEN_SOURCE_EXTENDED since HP-UX needs it." >&6; }
+ fi
+echo "$as_me:$LINENO: checking if the OS is FreeBSD" >&5
+echo $ECHO_N "checking if the OS is FreeBSD... $ECHO_C" >&6
@@ -79,44 +148,23 @@
+
+echo "$as_me:$LINENO: result: $snes9x_cv_freebsd_os" >&5
+echo "${ECHO_T}$snes9x_cv_freebsd_os" >&6
-+
- echo "$as_me:3869: checking if the OS is MS Windows" >&5
- echo $ECHO_N "checking if the OS is MS Windows... $ECHO_C" >&6
- if test "${snes9x_cv_win32_os+set}" = set; then
-@@ -3970,7 +4032,9 @@
- ZSNESFX='ZSNESFX=1'
- ZSNESC4='ZSNESC4=1'
- ASMCPU='ASMCPU=1'
-+if test yes = "$with_mmx"; then
- ASMKREED='ASMKREED=1'
-+fi
- # SPC700ASM='SPC700ASM=1'
- I386SPC='i386/SPC.O'
- CPUINC='-Ii386'
-@@ -3985,6 +4049,9 @@
- if test yes = "$snes9x_cv_linux_os" -a yes = "$with_joystick"; then
- JOYDEFINES=' -DJOYSTICK_SUPPORT'
-+elif test yes = "$snes9x_cv_freebsd_os" -a yes = "$with_joystick"; then
-+ JOYDEFINES=' -DJOYSTICK_SUPPORT'
-+ SYSLIBS="$SYSLIBS"' -lusbhid'
- else
- with_joystick="no"
- fi
-@@ -5141,7 +5208,7 @@
- #line 5141 "configure"
- #include "confdefs.h"
+ THREAD_SOUND='#THREAD_SOUND=1'
+ if test "${ac_cv_header_pthread_h+set}" = set; then
+@@ -11372,7 +11488,7 @@
+ cat >>conftest.$ac_ext <<_ACEOF
+ /* end confdefs.h. */
-#if defined(__linux) || defined(__sun) || defined(__sgi)
+#if defined(__linux) || defined(__sun) || defined(__sgi) || defined(__FreeBSD__)
/* */
#else
#error No sound for this platform
-@@ -5320,6 +5387,7 @@
- display system.... $snes9x_info_display
- joystick support.. $with_joystick
- using asm cores... $with_assembler
-+using mmx code.... $with_mmx
- SDD1 decompession. $with_sdd1_decomp
- debugger.......... $with_debugger
-
+@@ -11665,6 +11781,7 @@
+ sound support....... $snes9x_cv_sound
+ display system...... $snes9x_info_display
+ joystick support.... $with_joystick
++using mmx code.... $with_mmx
+ SDD1 decompression.. $with_sdd1_decomp
+ JMA decompression... $with_jma_decomp
+ debugger............ $with_debugger
diff --git a/emulators/snes9x/files/pkg-message.in b/emulators/snes9x/files/pkg-message.in
new file mode 100644
index 000000000000..24ee22c3276e
--- /dev/null
+++ b/emulators/snes9x/files/pkg-message.in
@@ -0,0 +1,28 @@
+###############################################################################
+
+The SNES9X emulator was installed
+
+1) You can run the emulator using:
+
+ # (o)snes9x -y2 -ts /path/to/rom_file
+
+2) You can see all options that you can use with snes9x at:
+
+ %%DOCSDIR%%/README
+
+ or only typing:
+
+ # (o)snes9x
+
+3) Also you can define a config file, see an example at:
+
+ %%DOCSDIR%%/snes9x.conf.default
+
+ and you can select this config file using:
+
+ # (o)snes9x -conf /path/to/conf_file
+
+4) Enjoy it ;)
+
+
+###############################################################################