summaryrefslogtreecommitdiff
path: root/emulators/snes9x
diff options
context:
space:
mode:
authorjoerg <joerg@pkgsrc.org>2006-05-02 13:18:08 +0000
committerjoerg <joerg@pkgsrc.org>2006-05-02 13:18:08 +0000
commita408107af30c0c9b0db305333df13d92e47e5ac0 (patch)
treecf1711208167ec3f39aff186c344038095a51f20 /emulators/snes9x
parent321c0663d2467b12251ece6470b7d7ad4442f78e (diff)
downloadpkgsrc-a408107af30c0c9b0db305333df13d92e47e5ac0.tar.gz
DragonFly hack.
Diffstat (limited to 'emulators/snes9x')
-rw-r--r--emulators/snes9x/Makefile5
-rw-r--r--emulators/snes9x/distinfo4
-rw-r--r--emulators/snes9x/patches/patch-ag40
3 files changed, 30 insertions, 19 deletions
diff --git a/emulators/snes9x/Makefile b/emulators/snes9x/Makefile
index 694f33a9c65..c1abb18b854 100644
--- a/emulators/snes9x/Makefile
+++ b/emulators/snes9x/Makefile
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.36 2006/04/16 01:21:08 ben Exp $
+# $NetBSD: Makefile,v 1.37 2006/05/02 13:18:08 joerg Exp $
SNESVER= 1.43
DISTNAME= snes9x-${SNESVER}-src
@@ -74,6 +74,9 @@ MAKE_ENV+= USBJOY=1
.if exists(/usr/include/usbhid.h)
MAKE_ENV+= USBHID_H=1
.endif
+.elif ${OPSYS} == "DragonFly" && exists(/usr/include/libusbhid.h)
+MAKE_ENV+= USBJOY=1
+MAKE_ENV+= USBHID_H=1
.endif
.include "../../devel/zlib/buildlink3.mk"
diff --git a/emulators/snes9x/distinfo b/emulators/snes9x/distinfo
index a6c5a59bb5d..224ff18022c 100644
--- a/emulators/snes9x/distinfo
+++ b/emulators/snes9x/distinfo
@@ -1,4 +1,4 @@
-$NetBSD: distinfo,v 1.13 2006/04/16 01:21:08 ben Exp $
+$NetBSD: distinfo,v 1.14 2006/05/02 13:18:08 joerg Exp $
SHA1 (snes9x-1.43-src.tar.gz) = c6883c451aeb442030862ec19a8dca25ee02d82c
RMD160 (snes9x-1.43-src.tar.gz) = d2003f7afb208109405b41f4eec586b93518f9b2
@@ -9,7 +9,7 @@ SHA1 (patch-ac) = c1e35daa7e53536d05c1633b78c00d511ae7feb5
SHA1 (patch-ad) = c5febcdd6b5bf0f3b4b5d8b0bc19c4716434a23e
SHA1 (patch-ae) = c4258835925ee3a6e3606ad895ff697f379cb22f
SHA1 (patch-af) = 19d86d23e3af2c0cef09b8eeff1303d6f100c2f8
-SHA1 (patch-ag) = 64de847f4b3f11386567c6e5caa5e253d0146a0c
+SHA1 (patch-ag) = 1c05d83c9d21f46219cdd1be0c79af3ce9f22e62
SHA1 (patch-ah) = eb5ff0fed972644f9c8599ec5eb6a3cd3ce160cb
SHA1 (patch-ai) = 06bd00790d1a84ee31114de4205bba22b48cd547
SHA1 (patch-aj) = f5cdf8e917f787d7e9fc657ed7197a2c28460375
diff --git a/emulators/snes9x/patches/patch-ag b/emulators/snes9x/patches/patch-ag
index 2daca565b66..1c3b7788f4b 100644
--- a/emulators/snes9x/patches/patch-ag
+++ b/emulators/snes9x/patches/patch-ag
@@ -1,6 +1,6 @@
-$NetBSD: patch-ag,v 1.7 2006/03/18 15:56:00 ben Exp $
+$NetBSD: patch-ag,v 1.8 2006/05/02 13:18:08 joerg Exp $
---- unix/unix.cpp.orig 2004-12-30 14:15:47.000000000 -0800
+--- unix/unix.cpp.orig 2004-12-30 22:15:47.000000000 +0000
+++ unix/unix.cpp
@@ -117,15 +117,25 @@
@@ -39,12 +39,16 @@ $NetBSD: patch-ag,v 1.7 2006/03/18 15:56:00 ben Exp $
#include "snes9x.h"
#include "memmap.h"
-@@ -168,6 +181,56 @@ uint32 joypads [5] = {0};
+@@ -168,6 +181,60 @@ uint32 joypads [5] = {0};
int NumControllers = 5;
#ifdef JOYSTICK_SUPPORT
+#if defined(__NetBSD__) || defined(__DragonFly__)
-+#ifdef HAVE_USBHID_H
++#if defined(__DragonFly__)
++extern "C" {
++#include <libusbhid.h>
++}
++#elif defined(HAVE_USBHID_H)
+#include <usbhid.h>
+#else
+#include <usb.h>
@@ -96,7 +100,7 @@ $NetBSD: patch-ag,v 1.7 2006/03/18 15:56:00 ben Exp $
#if defined(__linux)
#include <linux/joystick.h>
int js_fd [4] = {-1, -1, -1, -1};
-@@ -227,7 +290,7 @@ char *snapshot_filename = NULL;
+@@ -227,7 +294,7 @@ char *snapshot_filename = NULL;
char *SDD1_pack = NULL;
//FIXME: I see no reason not to configureenable this for all Unixen
@@ -105,7 +109,7 @@ $NetBSD: patch-ag,v 1.7 2006/03/18 15:56:00 ben Exp $
static void sigbrkhandler(int)
{
CPU.Flags |= DEBUG_MODE_FLAG;
-@@ -700,6 +763,106 @@ void S9xInitInputDevices ()
+@@ -700,6 +767,110 @@ void S9xInitInputDevices ()
#ifdef JOYSTICK_SUPPORT
void InitJoysticks ()
{
@@ -129,14 +133,18 @@ $NetBSD: patch-ag,v 1.7 2006/03/18 15:56:00 ben Exp $
+
+ priv_joy_data[i].hids = NULL;
+
-+#ifdef HAVE_USBHID_H
++#if defined(HAVE_USBHID_H)
+ if (ioctl(js_fd [i], USB_GET_REPORT_ID, &report_id) < 0)
+ {
+ perror (js_device [i]);
+ close (js_fd [i]);
+ }
+
++#if defined(__DragonFly__)
++ size = hid_report_size(rd, report_id, hid_input);
++#else
+ size = hid_report_size(rd, hid_input, report_id);
++#endif
+ priv_joy_data[i].offset = 0;
+#else
+ size = hid_report_size(rd, hid_input, &report_id);
@@ -150,7 +158,7 @@ $NetBSD: patch-ag,v 1.7 2006/03/18 15:56:00 ben Exp $
+ priv_joy_data[i].dlen = size;
+
+ is_joystick = 0;
-+#ifdef HAVE_USBHID_H
++#if defined(HAVE_USBHID_H) && !defined(__DragonFly__)
+ for (d = hid_start_parse(rd, 1 << hid_input, report_id); hid_get_item(d, &h); )
+#else
+ for (d = hid_start_parse(rd, 1 << hid_input); hid_get_item(d, &h); )
@@ -212,7 +220,7 @@ $NetBSD: patch-ag,v 1.7 2006/03/18 15:56:00 ben Exp $
#ifdef JSIOCGVERSION
int version;
unsigned char axes, buttons;
-@@ -756,6 +919,77 @@ void InitJoysticks ()
+@@ -756,6 +927,77 @@ void InitJoysticks ()
void ReadJoysticks ()
{
@@ -290,7 +298,7 @@ $NetBSD: patch-ag,v 1.7 2006/03/18 15:56:00 ben Exp $
#ifdef JSIOCGVERSION
struct js_event js_ev;
int i;
-@@ -1646,7 +1880,7 @@ bool8 S9xOpenSoundDevice (int mode, bool
+@@ -1646,7 +1888,7 @@ bool8 S9xOpenSoundDevice (int mode, bool
}
#endif
@@ -299,7 +307,7 @@ $NetBSD: patch-ag,v 1.7 2006/03/18 15:56:00 ben Exp $
static int Rates[8] =
{
0, 8000, 11025, 16000, 22050, 32000, 44100, 48000
-@@ -1662,12 +1896,19 @@ bool8 S9xOpenSoundDevice (int mode, bool
+@@ -1662,12 +1904,19 @@ bool8 S9xOpenSoundDevice (int mode, bool
/* Linux version (OSS) */
int J, K;
@@ -320,7 +328,7 @@ $NetBSD: patch-ag,v 1.7 2006/03/18 15:56:00 ben Exp $
#ifdef MMAP_SOUND
if (ioctl (so.sound_fd, SNDCTL_DSP_GETCAPS, &J) < 0)
{
-@@ -1711,14 +1952,14 @@ bool8 S9xOpenSoundDevice (int mode, bool
+@@ -1711,14 +1960,14 @@ bool8 S9xOpenSoundDevice (int mode, bool
so.sixteen_bit = TRUE;
so.stereo = stereo;
@@ -337,7 +345,7 @@ $NetBSD: patch-ag,v 1.7 2006/03/18 15:56:00 ben Exp $
{
perror ("ioctl SNDCTL_DSP_SPEED");
return (FALSE);
-@@ -1743,7 +1984,7 @@ bool8 S9xOpenSoundDevice (int mode, bool
+@@ -1743,7 +1992,7 @@ bool8 S9xOpenSoundDevice (int mode, bool
perror ("ioctl SNDCTL_DSP_SETFRAGMENT");
return (FALSE);
}
@@ -346,7 +354,7 @@ $NetBSD: patch-ag,v 1.7 2006/03/18 15:56:00 ben Exp $
#ifdef MMAP_SOUND
J = PCM_ENABLE_OUTPUT;
-@@ -1768,7 +2009,7 @@ bool8 S9xOpenSoundDevice (int mode, bool
+@@ -1768,7 +2017,7 @@ bool8 S9xOpenSoundDevice (int mode, bool
#endif
@@ -355,7 +363,7 @@ $NetBSD: patch-ag,v 1.7 2006/03/18 15:56:00 ben Exp $
void S9xUnixProcessSound (void)
{
}
-@@ -1810,7 +2051,7 @@ void *S9xProcessSound (void *)
+@@ -1810,7 +2059,7 @@ void *S9xProcessSound (void *)
}
#endif
@@ -364,7 +372,7 @@ $NetBSD: patch-ag,v 1.7 2006/03/18 15:56:00 ben Exp $
void S9xGenerateSound ()
{
/* Linux and Sun versions */
-@@ -1902,7 +2143,7 @@ void *S9xProcessSound (void *)
+@@ -1902,7 +2151,7 @@ void *S9xProcessSound (void *)
/* If threads in use, this is to loop indefinitely */
/* If not, this will be called by timer */