[mupen64plus-input-sdl] 15/196: Imported Upstream version 1.99.4~hg20100403
Sven Eckelmann
ecsv-guest at moszumanska.debian.org
Thu Nov 26 06:00:03 UTC 2015
This is an automated email from the git hooks/post-receive script.
ecsv-guest pushed a commit to branch master
in repository mupen64plus-input-sdl.
commit 33d3229a945bb414072342bdd628d1ea3cf1c0f5
Author: Sven Eckelmann <sven.eckelmann at gmx.de>
Date: Sun Apr 4 21:39:41 2010 +0200
Imported Upstream version 1.99.4~hg20100403
---
data/InputAutoCfg.ini | 211 +++++++++++++++++++++++++++++++++++++++++++++++--
projects/unix/Makefile | 27 +++++--
src/config.c | 10 ++-
src/plugin.c | 8 +-
src/plugin.h | 1 +
5 files changed, 240 insertions(+), 17 deletions(-)
diff --git a/data/InputAutoCfg.ini b/data/InputAutoCfg.ini
index c7465b6..b6cad48 100644
--- a/data/InputAutoCfg.ini
+++ b/data/InputAutoCfg.ini
@@ -150,18 +150,19 @@ X Axis = axis(0-,0+)
Y Axis = axis(1-,1+)
[Logitech Cordless Rumblepad 2]
+[Logitech RumblePad 2 USB]
[Logitech Dual Action]
plugged = True
plugin = 2
mouse = False
AnalogDeadzone = 4096,4096
AnalogPeak = 32768,32768
-DPad R = axis(4+)
-DPad L = axis(4-)
-DPad D = axis(5+)
-DPad U = axis(5-)
+DPad R = axis(4+) hat(0 Right)
+DPad L = axis(4-) hat(0 Left)
+DPad D = axis(5+) hat(0 Down)
+DPad U = axis(5-) hat(0 Up)
Start = button(9)
-Z Trig = button(3)
+Z Trig = button(6)
B Button = button(0)
A Button = button(1)
C Button R = axis(2+)
@@ -170,7 +171,7 @@ C Button D = axis(3+)
C Button U = axis(3-)
R Trig = button(5)
L Trig = button(4)
-Mempak switch = button(6)
+Mempak switch = button(8)
Rumblepak switch = button(7)
X Axis = axis(0-,0+)
Y Axis = axis(1-,1+)
@@ -225,6 +226,79 @@ Rumblepak switch = axis(5+)
X Axis = axis(0-,0+)
Y Axis = axis(1-,1+)
+[Win32: Controller (XBOX 360 For Windows)]
+plugged = True
+plugin = 2
+mouse = False
+AnalogDeadzone = 4096,4096
+AnalogPeak = 32768,32768
+DPad R = hat(0 Right)
+DPad L = hat(0 Left)
+DPad D = hat(0 Down)
+DPad U = hat(0 Up)
+Start = button(7)
+Z Trig = axis(2+)
+B Button = button(2)
+A Button = button(0)
+C Button R = button(1) axis(4+)
+C Button L = axis(4-)
+C Button D = axis(3+)
+C Button U = button(3) axis(3-)
+R Trig = button(5)
+L Trig = button(4)
+Mempak switch = button(9)
+Rumblepak switch = axis(2-)
+X Axis = axis(0-,0+)
+Y Axis = axis(1-,1+)
+[Win32: XBOX 360 For Windows (Controller)]
+plugged = True
+plugin = 2
+mouse = False
+AnalogDeadzone = 4096,4096
+AnalogPeak = 32768,32768
+DPad R = hat(0 Right)
+DPad L = hat(0 Left)
+DPad D = hat(0 Down)
+DPad U = hat(0 Up)
+Start = button(7)
+Z Trig = axis(2-)
+B Button = button(1)
+A Button = button(0)
+C Button R = axis(4+)
+C Button L = axis(4-)
+C Button D = axis(3+)
+C Button U = axis(3-)
+R Trig = button(5)
+L Trig = button(4)
+Mempak switch = button(6)
+Rumblepak switch = axis(2+)
+X Axis = axis(0-,0+)
+Y Axis = axis(1-,1+)
+[Win32: XBOX 360 For Windows]
+plugged = True
+plugin = 2
+mouse = False
+AnalogDeadzone = 4096,4096
+AnalogPeak = 32768,32768
+DPad R = axis(6+)
+DPad L = axis(6-)
+DPad D = axis(7+)
+DPad U = axis(7-)
+Start = button(7)
+Z Trig = axis(2-)
+B Button = button(2)
+A Button = button(0)
+C Button R = axis(4+)
+C Button L = axis(4-)
+C Button D = axis(3+)
+C Button U = axis(3-)
+R Trig = button(5)
+L Trig = button(4)
+Mempak switch = button(8)
+Rumblepak switch = axis(9)
+X Axis = axis(0-,0+)
+Y Axis = axis(1-,1+)
+
[Xbox 360 Wireless Receiver]
plugged = True
plugin = 2
@@ -350,6 +424,81 @@ Rumblepak switch = axis(10+)
X Axis = axis(0-,0+)
Y Axis = axis(1-,1+)
+[Thrustmaster Dual Trigger 3-in-1]
+plugged = True
+plugin = 2
+mouse = False
+AnalogDeadzone = 4096,4096
+AnalogPeak = 32768,32768
+DPad R = hat(0 Right)
+DPad L = hat(0 Left)
+DPad D = hat(0 Down)
+DPad U = hat(0 Up)
+Start = button(9)
+Z Trig = button(3)
+B Button = button(0)
+A Button = button(1)
+C Button R = axis(2+)
+C Button L = axis(2-)
+C Button D = axis(5+)
+C Button U = axis(5-)
+R Trig = button(5)
+L Trig = button(4)
+Mempak switch = button(6)
+Rumblepak switch = button(7)
+X Axis = axis(0-,0+)
+Y Axis = axis(1-,1+)
+
+[THRUSTMASTER Firestorm Dual Power 2]
+plugged = True
+plugin = 2
+mouse = False
+AnalogDeadzone = 4096,4096
+AnalogPeak = 32768,32768
+DPad R = hat(0 Right)
+DPad L = hat(0 Left)
+DPad D = hat(0 Down)
+DPad U = hat(0 Up)
+Start = button(5)
+Z Trig = button(8)
+B Button = button(1)
+A Button = button(0)
+C Button R = axis(2+)
+C Button L = axis(2-)
+C Button D = axis(3+)
+C Button U = axis(3-)
+R Trig = button(6)
+L Trig = button(4)
+Mempak switch =
+Rumblepak switch =
+X Axis = axis(0-,0+)
+Y Axis = axis(1-,1+)
+
+[Twin USB Joystick]
+plugged = True
+plugin = 2
+mouse = False
+AnalogDeadzone = 4096,4096
+AnalogPeak = 32768,32768
+DPad R = hat(0 Right)
+DPad L = hat(0 Left)
+DPad D = hat(0 Down)
+DPad U = hat(0 Up)
+Start = button(9)
+Z Trig = button(4)
+B Button = button(6)
+A Button = button(7)
+C Button R = button(1)
+C Button L = button(3)
+C Button D = button(2)
+C Button U = button(0)
+R Trig = button(5)
+L Trig = button(11)
+Mempak switch =
+Rumblepak switch =
+Y Axis = axis(1-,1+)
+X Axis = axis(0-,0+)
+
[Sony PLAYSTATION(R)3 Controller]
[OSX: PLAYSTATION(R)3 Controller]
plugged = True
@@ -376,6 +525,56 @@ Rumblepak switch =
X Axis = axis(0-,0+)
Y Axis = axis(1-,1+)
+[WiseGroup.,Ltd TigerGame XBOX+PS2+GC Game Controller Adapter]
+plugged = True
+plugin = 2
+mouse = False
+AnalogDeadzone = 4096,4096
+AnalogPeak = 32768,32768
+DPad R = button(9)
+DPad L = button(8)
+DPad D = button(10)
+DPad U = button(11)
+Start = button(7)
+Z Trig = button(6)
+B Button = button(1)
+A Button = button(0)
+C Button R = axis(2+)
+C Button L = axis(2-)
+C Button D = axis(3+)
+C Button U = axis(3-)
+R Trig = axis(4+)
+L Trig = axis(5-)
+Mempak switch =
+Rumblepak switch =
+X Axis = axis(0-,0+)
+Y Axis = axis(1-,1+)
+
+[Wish Technologies Adaptoid]
+plugged = True
+plugin = 2
+mouse = False
+AnalogDeadzone = 4096,4096
+AnalogPeak = 32768,32768
+DPad R = button(13)
+DPad L = button(12)
+DPad D = button(11)
+DPad U = button(10)
+Start = button(8)
+Z Trig = button(9)
+B Button = button(3)
+A Button = button(0)
+C Button R = button(2)
+C Button L = button(4)
+C Button D = button(1)
+C Button U = button(5)
+R Trig = button(7)
+L Trig = button(6)
+Mempak switch =
+Rumblepak switch =
+X Axis = axis(0-,0+)
+Y Axis = axis(1-,1+)
+
; X-box controllers and compatible clones
[Microsoft X-Box pad v1 (US)]
[Microsoft X-Box pad v2 (US)]
diff --git a/projects/unix/Makefile b/projects/unix/Makefile
index 82ccb61..d269d60 100644
--- a/projects/unix/Makefile
+++ b/projects/unix/Makefile
@@ -43,8 +43,8 @@ ifeq ("$(UNAME)","FreeBSD")
SO_EXTENSION = so
SHARED = -shared
endif
-ifeq ("$(UNAME)","GNU/kFreeBSD")
- OS = FREEBSD
+ifneq ("$(filter GNU/kFreeBSD kfreebsd,$(UNAME))","")
+ OS = LINUX
SO_EXTENSION = so
SHARED = -shared
endif
@@ -82,8 +82,8 @@ ifeq ("$(CPU)","NONE")
endif
# base CFLAGS, LIBS, and LDFLAGS
-CFLAGS = -ffast-math -funroll-loops -fexpensive-optimizations -fno-strict-aliasing -I../../src
-LDFLAGS = -ldl
+CFLAGS += -ffast-math -funroll-loops -fexpensive-optimizations -fno-strict-aliasing -fvisibility=hidden -I../../src
+LDFLAGS += -ldl
ifneq ($(OS), FREEBSD)
CFLAGS += -pipe -O3
endif
@@ -91,7 +91,7 @@ endif
# Since we are building a shared library, we must compile with -fPIC for x86_64 CPUs.
# On 32-bit systems we do not want to use -fPIC because we don't have to and it has a big performance penalty on this arch
ifeq ($(ARCH_DETECTED), 64BITS)
- CFLAGS += -fpic -DPIC -fvisibility=hidden
+ CFLAGS += -fpic -DPIC
endif
# tweak flags for 32-bit build on 64-bit system
ifeq ($(ARCH_DETECTED), 64BITS_32)
@@ -215,6 +215,18 @@ OBJECTS := $(patsubst $(SRCDIR)/%.c, $(OBJDIR)/%.o, $(filter %.c, $(SOURCE)))
OBJDIRS = $(dir $(OBJECTS))
$(shell mkdir -p $(OBJDIRS))
+# build dependency files
+CFLAGS += -MD
+-include $(OBJECTS:.o=.d)
+
+# reduced compile output when running make without V=1
+ifneq ($(findstring $(MAKEFLAGS),s),s)
+ifndef V
+ Q_CC = @echo ' CC '$@;
+ Q_LD = @echo ' LD '$@;
+endif
+endif
+
# build targets
TARGET = mupen64plus-input-sdl.$(SO_EXTENSION)
@@ -251,15 +263,16 @@ uninstall:
clean:
rm -rf ./_obj/* $(TARGET)
+ rmdir ./_obj
rebuild: clean all
# build rules
$(TARGET): $(OBJECTS)
- $(CC) $(SHARED) $^ $(LDFLAGS) -o $@
+ $(Q_LD)$(CC) $(SHARED) $^ $(LDFLAGS) -o $@
$(STRIP) $@
$(OBJDIR)/%.o: $(SRCDIR)/%.c
- $(CC) -o $@ $(CFLAGS) -c $<
+ $(Q_CC)$(CC) -o $@ $(CFLAGS) -c $<
diff --git a/src/config.c b/src/config.c
index 405c828..f6845b0 100644
--- a/src/config.c
+++ b/src/config.c
@@ -87,6 +87,7 @@ static void clear_controller(int iCtrlIdx)
controller[iCtrlIdx].button[b].button = -1;
controller[iCtrlIdx].button[b].key = SDLK_UNKNOWN;
controller[iCtrlIdx].button[b].axis = -1;
+ controller[iCtrlIdx].button[b].axis_deadzone = -1;
controller[iCtrlIdx].button[b].hat = -1;
controller[iCtrlIdx].button[b].hat_pos = -1;
controller[iCtrlIdx].button[b].mouse = -1;
@@ -191,7 +192,8 @@ static int load_controller_config(const char *SectionName, int i)
if ((config_ptr = strstr(input_str, "axis")) != NULL)
{
char chAxisDir;
- if (sscanf(config_ptr, "axis(%i%c)", &controller[i].button[j].axis, &chAxisDir) != 2)
+ if (sscanf(config_ptr, "axis(%d%c,%d", &controller[i].button[j].axis, &chAxisDir, &controller[i].button[j].axis_deadzone) != 3 &&
+ sscanf(config_ptr, "axis(%i%c", &controller[i].button[j].axis, &chAxisDir) != 2)
DebugMessage(M64MSG_WARNING, "parsing error in axis() parameter of button '%s' for controller %i", button_names[j], i + 1);
controller[i].button[j].axis_dir = (chAxisDir == '+' ? 1 : (chAxisDir == '-' ? -1 : 0));
}
@@ -295,7 +297,11 @@ void save_controller_config(int iCtrlIdx)
}
if (controller[iCtrlIdx].button[j].axis >= 0)
{
- sprintf(Param, "axis(%i%c) ", controller[iCtrlIdx].button[j].axis, (controller[iCtrlIdx].button[j].axis_dir == -1) ? '-' : '+' );
+ if (controller[iCtrlIdx].button[j].axis_deadzone >= 0)
+ sprintf(Param, "axis(%i%c,%i) ", controller[iCtrlIdx].button[j].axis, (controller[iCtrlIdx].button[j].axis_dir == -1) ? '-' : '+',
+ controller[iCtrlIdx].button[j].axis_deadzone);
+ else
+ sprintf(Param, "axis(%i%c) ", controller[iCtrlIdx].button[j].axis, (controller[iCtrlIdx].button[j].axis_dir == -1) ? '-' : '+');
strcat(ParamString, Param);
}
if (controller[iCtrlIdx].button[j].hat >= 0)
diff --git a/src/plugin.c b/src/plugin.c
index 1bd2b68..1f33173 100644
--- a/src/plugin.c
+++ b/src/plugin.c
@@ -37,6 +37,7 @@
#include "osal_dynamiclib.h"
#ifdef __linux__
+#include <unistd.h>
#include <dirent.h>
#include <fcntl.h>
#include <sys/types.h>
@@ -430,10 +431,13 @@ EXPORT void CALL GetKeys( int Control, BUTTONS *Keys )
if( controller[Control].button[b].axis >= 0 )
{
+ int deadzone = controller[Control].button[b].axis_deadzone;
axis_val = SDL_JoystickGetAxis( controller[Control].joystick, controller[Control].button[b].axis );
- if( (controller[Control].button[b].axis_dir < 0) && (axis_val <= -6000) )
+ if (deadzone < 0)
+ deadzone = 6000; /* default */
+ if( (controller[Control].button[b].axis_dir < 0) && (axis_val <= -deadzone) )
controller[Control].buttons.Value |= button_bits[b];
- else if( (controller[Control].button[b].axis_dir > 0) && (axis_val >= 6000) )
+ else if( (controller[Control].button[b].axis_dir > 0) && (axis_val >= deadzone) )
controller[Control].buttons.Value |= button_bits[b];
}
diff --git a/src/plugin.h b/src/plugin.h
index fe8299e..e64aa0d 100644
--- a/src/plugin.h
+++ b/src/plugin.h
@@ -71,6 +71,7 @@ typedef struct
int button; // button index; -1 if notassigned
SDLKey key; // sdl keysym; SDLK_UNKNOWN if not assigned
int axis, axis_dir; // aixs + direction (i.e. 0, 1 = X Axis +; 0, -1 = X Axis -); -1 if notassigned
+ int axis_deadzone; // -1 for default, or >= 0 for custom value
int hat, hat_pos; // hat + hat position; -1 if not assigned
int mouse; // mouse button
} SButtonMap;
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-games/mupen64plus-input-sdl.git
More information about the Pkg-games-commits
mailing list