[Plib-cvs] plib/src/js js.h,1.29,1.30 jsBSD.cxx,1.1,1.2
Brought to you by:
sjbaker
From: M?rten Str?m. <str...@us...> - 2003-11-11 22:54:52
|
Update of /cvsroot/plib/plib/src/js In directory sc8-pr-cvs1:/tmp/cvs-serv24486/src/js Modified Files: js.h jsBSD.cxx Log Message: BSD patches from Bert Driehuis Index: js.h =================================================================== RCS file: /cvsroot/plib/plib/src/js/js.h,v retrieving revision 1.29 retrieving revision 1.30 diff -u -d -r1.29 -r1.30 --- js.h 4 Jan 2003 02:55:53 -0000 1.29 +++ js.h 11 Nov 2003 22:54:48 -0000 1.30 @@ -31,17 +31,12 @@ #include <string.h> // -dw- for memcpy #define _JS_MAX_AXES 16 +#define _JS_MAX_BUTTONS 32 #ifdef UL_MACINTOSH # include <InputSprocket.h> #endif -#ifdef UL_BSD -# include <machine/joystick.h> -# define JS_DATA_TYPE joystick -# define JS_RETURN (sizeof(struct JS_DATA_TYPE)) -#endif - #ifdef UL_MAC_OSX # include <mach/mach.h> # include <IOKit/IOkitLib.h> @@ -92,6 +87,8 @@ ISpElementReference isp_elem [ isp_num_needs ] ; ISpNeed isp_needs [ isp_num_needs ] ; +#elif defined(UL_BSD) + struct os_specific_s *os ; #elif defined(UL_MAC_OSX) IOHIDDeviceInterface ** hidDev; Index: jsBSD.cxx =================================================================== RCS file: /cvsroot/plib/plib/src/js/jsBSD.cxx,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- jsBSD.cxx 29 Nov 2002 19:39:48 -0000 1.1 +++ jsBSD.cxx 11 Nov 2003 22:54:48 -0000 1.2 @@ -21,93 +21,395 @@ $Id$ */ +/* + * Inspired by the X-Mame USB HID joystick driver for NetBSD and + * FreeBSD by Krister Walfridsson <ca...@df...>. + * Incorporates the original analog joystick driver for BSD by + * Stephen Montgomery-Smith <st...@ma...>, with + * NetBSD mods courtesy of Rene Hexel. + * + * Bert Driehuis <dri...@pl...> [...497 lines suppressed...] + else + os->cache_buttons &= ~(1 << usage - 1) ; + } + } + } + } + if (len < 0 && errno != EAGAIN) + { + perror( os->fname ) ; + setError () ; + error = 1; } + if ( buttons != NULL ) *buttons = os->cache_buttons ; + if ( axes != NULL ) + memcpy ( axes, os->cache_axes, sizeof(float) * num_axes ) ; +#endif } #endif - |