Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 22 Feb 2007 16:05:17 GMT
From:      Dwayne MacKinnon<dwaynemk@hotmail.com>
To:        freebsd-gnats-submit@FreeBSD.org
Subject:   ports/109438: [patch] emulators/vice  Add support for joysticks.
Message-ID:  <200702221605.l1MG5H6E027472@www.freebsd.org>
Resent-Message-ID: <200702221610.l1MGA52Y007985@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         109438
>Category:       ports
>Synopsis:       [patch] emulators/vice  Add support for joysticks.
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Thu Feb 22 16:10:05 GMT 2007
>Closed-Date:
>Last-Modified:
>Originator:     Dwayne MacKinnon
>Release:        6.2-RELEASE
>Organization:
>Environment:
FreeBSD chiron 6.2-RELEASE FreeBSD 6.2-RELEASE #1: Fri Jan 26 08:20:47 EST 2007     root@chiron:/usr/obj/usr/src/sys/CHIRON  i386

>Description:
The VICE port does not configure itself to use FreeBSD's joystick support (/dev/joy*). It looks for machine/joystick.h, when in FreeBSD the include file is actually sys/joystick.h.

>How-To-Repeat:
Compile the VICE port from src, and examine the configure output.
>Fix:
I've included four files with this PR:

1) A patch to the port Makefile, which uses a post-patch sed command to change all instances of machine/joystick.h in the configure script to sys/joystick.h.

2) A patch to src/arch/unix/joy.c, which changes machine/joystick.h to sys/joystick.h.

3) A patch to src/arch/unix/joy_usb.c. Enabling joystick support via the changes to the configure script reveals a secondary problem: the compilation of joy_usb.c fails. The compile failure is due to _IOWR not being defined. The patch adds the header file sys/ioccom.h to the .c file. This solves the compile problem, but I have not been able to test to see if a USB joystick would actually work with VICE due to lack of equipment.

4) A pkg-message file to help steer people installing VICE on how to load the joy kernel module and set the permissions for /dev/joy* properly so that VICE can use the devices.

Patch attached with submission follows:

--- Makefile.orig	Tue Feb 20 10:36:50 2007
+++ Makefile	Tue Feb 20 10:07:22 2007
@@ -101,6 +101,8 @@
 post-patch:
 	${REINPLACE_CMD} -e "s|%%PREFIX%%|${PREFIX}|g" \
 		${WRKSRC}/man/vice.1
+	${REINPLACE_CMD} -e "s|machine/joystick.h|sys/joystick.h|g" \
+		${WRKSRC}/configure
 .if defined(NOPORTDOCS)
 	${REINPLACE_CMD} -e 's| doc||' ${WRKSRC}/Makefile.in
 .endif

--- src/arch/unix/joy.c.orig	Tue Feb 20 10:11:02 2007
+++ src/arch/unix/joy.c	Tue Feb 20 10:11:13 2007
@@ -117,7 +117,7 @@
 #endif
 
 #elif defined(BSD_JOYSTICK)
-#include <machine/joystick.h>
+#include <sys/joystick.h>
 #define JS_DATA_TYPE joystick
 #define JS_RETURN    sizeof(struct joystick)
 int     use_old_api=1;

--- src/arch/unix/joy_usb.c.orig	Tue Feb 20 10:11:57 2007
+++ src/arch/unix/joy_usb.c	Tue Feb 20 10:12:37 2007
@@ -50,6 +50,7 @@
 
 extern log_t joystick_log;
 
+#include <sys/ioccom.h>
 #include <dev/usb/usb.h>
 #include <dev/usb/usbhid.h>
 #include <errno.h>


The VICE port can use /dev/joy* for joystick support for video games. To enable
the joystick port, add 

joy_load="YES" to /boot/loader.conf 

and the following lines to /etc/devfs.conf (for additional joysticks use
/dev/joy1, /dev/joy2 etc.) :

own	/dev/joy0 root:wheel
perm 	/dev/joy0 0666

>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200702221605.l1MG5H6E027472>