From owner-freebsd-ports Thu Jun 13 18: 9: 2 2002 Delivered-To: freebsd-ports@freebsd.org Received: from smtp.web.de (smtp02.web.de [217.72.192.151]) by hub.freebsd.org (Postfix) with ESMTP id 156A037B41C; Thu, 13 Jun 2002 18:08:42 -0700 (PDT) Received: from [217.9.35.9] (helo=dsl-217-9-35-9.berlikomm.net) by smtp.web.de with esmtp (WEB.DE(Exim) 4.60 #1) id 17Ieya-00070S-00; Fri, 14 Jun 2002 02:30:04 +0200 Received: from dsl-217-9-35-9.berlikomm.net (localhost [127.0.0.1]) by localhost.my.domain (8.12.3/8.12.3) with ESMTP id g5E0TpYB019345; Fri, 14 Jun 2002 02:29:51 +0200 (CEST) (envelope-from space7@dsl-217-9-35-9.berlikomm.net) Received: (from space7@localhost) by dsl-217-9-35-9.berlikomm.net (8.12.3/8.12.3/Submit) id g5E0SaV4019338; Fri, 14 Jun 2002 02:28:36 +0200 (CEST) Date: Fri, 14 Jun 2002 02:28:36 +0200 (CEST) From: Stefan Krüger Message-Id: <200206140028.g5E0SaV4019338@dsl-217-9-35-9.berlikomm.net> To: green@freebsd.org Subject: patch for emulators/snes9x Cc: ports@freebsd.org Sender: owner-freebsd-ports@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org Hi green, hi ports folks, the emulators/snes9x port is broken on 4.6-RELEASE and up, the following patch fixes this, but it's not backward compatible (due to the rename of libusb -> libusbhid) enjoy Stefan Krüger diff -urN snes9x.orig/Makefile snes9x/Makefile --- snes9x.orig/Makefile Fri Jun 14 02:14:30 2002 +++ snes9x/Makefile Fri Jun 14 02:15:41 2002 @@ -27,7 +27,7 @@ USE_ZIP= YES WRKSRC= ${WRKDIR}/release -.if exists(/usr/lib/libusb.a) +.if exists(/usr/lib/libusbhid.a) MAKE_ENV+= USB_JOYSTICK_SUPPORT=yes .endif diff -urN snes9x.orig/files/patch-aa snes9x/files/patch-aa --- snes9x.orig/files/patch-aa Fri Jun 14 02:14:30 2002 +++ snes9x/files/patch-aa Fri Jun 14 02:15:41 2002 @@ -51,7 +51,7 @@ +ifdef USB_JOYSTICK_SUPPORT +CCFLAGS += -DJOYSTICK_SUPPORT -+EXTRALIBS += -lusb ++EXTRALIBS += -lusbhid +endif + #-DSOUND diff -urN snes9x.orig/files/patch-af snes9x/files/patch-af --- snes9x.orig/files/patch-af Fri Jun 14 02:14:30 2002 +++ snes9x/files/patch-af Fri Jun 14 02:17:17 2002 @@ -1,8 +1,12 @@ ---- unix/unix.cpp.orig Wed Jan 10 15:40:14 2001 -+++ unix/unix.cpp Tue Feb 6 01:14:53 2001 -@@ -51,9 +51,11 @@ +--- unix/unix.cpp.orig Wed Feb 28 22:12:23 2001 ++++ unix/unix.cpp Fri Jun 14 02:09:27 2002 +@@ -50,10 +50,15 @@ + #include #include ++#if defined(__FreeBSD__) ++#include ++#endif -#if defined(__linux) || defined(__sun) +#if defined(__linux) || defined(__sun) || defined(__FreeBSD__) @@ -13,7 +17,7 @@ #include #include #include -@@ -68,8 +70,12 @@ +@@ -68,8 +73,12 @@ pthread_mutex_t mutex; #endif @@ -26,7 +30,7 @@ #include #endif -@@ -85,6 +91,11 @@ +@@ -85,6 +94,11 @@ typedef void (*SIG_PF)(); #endif @@ -38,7 +42,7 @@ #include "snes9x.h" #include "memmap.h" #include "debug.h" -@@ -111,7 +122,10 @@ +@@ -111,7 +125,10 @@ int NumControllers = 5; #ifdef JOYSTICK_SUPPORT @@ -49,7 +53,7 @@ #include int js_fd [4] = {-1, -1, -1, -1}; int js_map_button [4][16] = { -@@ -158,6 +172,63 @@ +@@ -158,6 +175,63 @@ char *js_device [4] = {"/dev/js0", "/dev/js1", "/dev/js2", "/dev/js3"}; #endif @@ -62,7 +66,7 @@ +#include +#undef class + -+#include ++#include +} + +#define JOYSTICK_MAX_BUTTONS 16 @@ -113,7 +117,7 @@ void InitJoysticks (); void ReadJoysticks (); #endif -@@ -169,7 +240,7 @@ +@@ -168,7 +242,7 @@ char *rom_filename = NULL; char *snapshot_filename = NULL; @@ -122,7 +126,7 @@ static void sigbrkhandler(int) { #ifdef DEBUGGER -@@ -196,91 +267,43 @@ +@@ -195,91 +269,43 @@ if (strcmp (argv [i], "-j") == 0 || strcasecmp (argv [i], "-nojoy") == 0) Settings.JoystickEnabled = FALSE; @@ -155,23 +159,9 @@ - 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; - } -+#ifdef __FreeBSD__ -+ else if (strcasecmp(argv[i], "-joyshift") == 0) -+ JoystickShift = 1; -+#endif -+ else if (strncasecmp(argv[i], "-joydev", sizeof("-joydev") - 1) == 0) { -+ 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 +- else - S9xUsage (); -+ S9xUsage(); - } +- } - else if (strcasecmp (argv [i], "-joymap2") == 0) - { - if (i + 8 < argc) @@ -205,9 +195,23 @@ - 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 ++#ifdef __FreeBSD__ ++ else if (strcasecmp(argv[i], "-joyshift") == 0) ++ JoystickShift = 1; ++#endif ++ else if (strncasecmp(argv[i], "-joydev", sizeof("-joydev") - 1) == 0) { ++ 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], "-joymap4") == 0) - { - if (i + 8 < argc) @@ -249,7 +253,7 @@ } else #endif -@@ -419,7 +442,7 @@ +@@ -418,7 +444,7 @@ #if !defined(__MSDOS) && defined(DEBUGGER) #if defined(__unix) && !defined(__NeXT__) struct sigaction sa; @@ -258,7 +262,7 @@ sa.sa_handler = sigbrkhandler; #else sa.sa_handler = (SIG_PF) sigbrkhandler; -@@ -611,6 +634,7 @@ +@@ -610,6 +636,7 @@ } #ifdef JOYSTICK_SUPPORT @@ -266,7 +270,7 @@ void InitJoysticks () { #ifdef JSIOCGVERSION -@@ -731,6 +755,184 @@ +@@ -730,6 +757,184 @@ } #endif } @@ -298,7 +302,7 @@ + return (-1); + } + report_id = 0; -+#if __FreeBSD__ >= 5 ++#if __FreeBSD_version >= 460000 + reportlen = hid_report_size(rd, report_id, hid_input); +#else + reportlen = hid_report_size(rd, hid_input, &report_id); @@ -451,7 +455,7 @@ #endif // defined (JOYSTICK_SUPPORT) const char *GetHomeDirectory () -@@ -1423,7 +1625,7 @@ +@@ -1422,7 +1627,7 @@ } #endif @@ -460,7 +464,7 @@ static int Rates[8] = { 0, 8192, 11025, 16500, 22050, 29300, 36600, 44000 -@@ -1542,7 +1744,7 @@ +@@ -1541,7 +1746,7 @@ } #endif @@ -469,7 +473,7 @@ void S9xUnixProcessSound (void) { } -@@ -1641,7 +1843,7 @@ +@@ -1640,7 +1845,7 @@ void *S9xProcessSound (void *) { To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-ports" in the body of the message