Compare commits

...

194 commits
2.5 ... master

Author SHA1 Message Date
Richard Goedeken
a4dc0d295e
Merge pull request #134 from orbea/sdl
Remove SDL1 support
2024-11-02 21:10:59 -07:00
Richard Goedeken
bb0bf30c37
Merge pull request #133 from orbea/strict-aliasing
build: remove -fno-strict-aliasing
2024-11-02 21:09:21 -07:00
orbea
3d36c9b9fe build: remove -fno-strict-aliasing
This builds with -Werror=strict-aliasing so it should be not required.
2024-10-28 11:55:49 -07:00
orbea
a1bc5235c9 src: remove SDL1 code path 2024-10-28 11:42:58 -07:00
orbea
0eb1743216 build: remove SDL1 support 2024-10-28 11:32:39 -07:00
orbea
aead6d917d build: remove executable permissions from Makefile 2024-10-28 11:31:15 -07:00
Richard Goedeken
f2ca383941 update version and release info for v2.6.0 release 2024-07-14 17:25:41 -07:00
Richard Goedeken
9cbdd4d002 update minimum macos SDK in makefile 2024-07-14 12:00:45 -07:00
Richard Goedeken
3698a2b12b
Merge pull request #132 from Jj0YzL5nvJ/up2024
CI/CD: Update to generic scripts, independent schedule, etc
2024-05-26 19:56:43 -07:00
Jj0YzL5nvJ
80232060cd CI/CD: Update to generic scripts, independent schedule, etc 2024-05-24 11:18:36 -06:00
Richard Goedeken
fd7ffe6360 add 8BitDo N64 controller modkit auto-config from Borden 2023-11-04 08:54:48 -07:00
Richard Goedeken
3486d9277e
Merge pull request #128 from metalj/patch-1
Add support for "Xbox Series X Controller"
2023-10-16 18:43:26 -07:00
Luis Figueroa
bd7c5abbc2
Add support for "Xbox Series X Controller"
I was surprised to see mupen not able to auto-config this controller. This fixes that. All the inputs match and works great.
2023-10-15 21:32:57 -04:00
Richard Goedeken
b175a41675
Merge pull request #127 from Jj0YzL5nvJ/up2023
CI/CD: Fixes Ubuntu i386 builds, among other changes
2023-06-11 12:20:57 -07:00
Jj0YzL5nvJ
e267afb32b CI/CD: Fixes Ubuntu i386 builds, among other changes 2023-05-22 00:37:50 -06:00
Richard Goedeken
557fc95018
Merge pull request #126 from GhostlyDark/rumble-fix2
Update rumble functions for SDL v2.0.18+
2023-05-08 19:27:32 -07:00
GhostlyDark
821debb536 Update rumble functions for SDL v2.0.18+
Co-Authored-By: Rosalie <rosalie@mailbox.org>
2023-05-06 23:48:39 +02:00
Richard Goedeken
b6fd2f99d7
Merge pull request #123 from Jj0YzL5nvJ/lx_x360
Fix inversion in C buttons on Ubuntu 22.04
2023-03-19 21:13:53 -07:00
Jj0YzL5nvJ
d9e650ad83 Fix inversion in C buttons on Ubuntu 22.04 (jammy) 2023-03-18 23:05:45 -06:00
Richard Goedeken
9734fd465f
Merge pull request #122 from Jj0YzL5nvJ/ci-schedule
CI/CD: Integrate scheduled builds and other...
2023-03-02 22:01:00 -08:00
Jj0YzL5nvJ
ca5f6d82c9 CI/CD: Integrate scheduled builds and other necessary updates 2023-02-14 23:49:49 -06:00
Richard Goedeken
2129e942fd fix for issue #120 2023-01-31 19:37:34 -08:00
Richard Goedeken
aa181483bf
Merge pull request #118 from vhns/add-xbox-360-controller-clone
Include yet another 360 controller.
2022-11-29 19:32:37 -08:00
Vitor Hugo Nunes dos Santos
af39198212 Include yet another 360 controller.
I have tested this on Debian 11 with kernel 6.0.0 on Mario 64.
Everything seems to work just fine.
2022-11-27 20:08:38 -03:00
Richard Goedeken
ac3b878cd1
Merge pull request #117 from Jj0YzL5nvJ/up2022
CI/CD: Update MSVC
2022-09-30 16:59:53 -07:00
Jj0YzL5nvJ
6ecfd55072 CI/CD: Update MSVC 2022-09-28 02:07:06 -06:00
Richard Goedeken
9cbe63f8e8
Merge pull request #114 from Jj0YzL5nvJ/ci-update
CI/CD: Update
2022-07-13 19:30:38 -07:00
Jj0YzL5nvJ
23fe417b16 CI/CD: Update 2022-07-10 18:52:22 -06:00
Richard Goedeken
c6bcb296d5
Merge pull request #113 from ppp0/add-ps1-classic-controller
Add USB controller from PS1 Classic
2022-05-13 18:21:10 -07:00
Richard Goedeken
003599b268 add auto-config section for fake playstation controller (SHANWAN PS3 GamePad) from Le Pape on google group mailing list 2022-05-13 16:58:46 -07:00
ppp0
b791f0b7a4 Add USB controller from PS1 Classic 2022-04-25 09:06:40 +02:00
Richard Goedeken
95d901b737
Merge pull request #111 from Jj0YzL5nvJ/ci-github
CI/CD: Implement GitHub Actions and public nightly builds
2022-04-11 20:53:18 -07:00
Richard Goedeken
715058d783 add info for PS4 controller config for Linux 2022-04-11 20:22:38 -07:00
Richard Goedeken
247110f2bc
Merge pull request #110 from aitet/master
Sony PS4 Controller support for linux
2022-04-11 20:08:37 -07:00
Jj0YzL5nvJ
25871f2ebd CI/CD: Implement GitHub Actions and public nightly builds 2021-12-05 09:00:13 -07:00
ait
3b2d5cc0c5 Sony PS4 Controller support for linux 2021-11-29 18:24:12 +01:00
Richard Goedeken
5e20c6f87b
Merge pull request #108 from GhostlyDark/master
Add Xbox One Elite Controller to InputAutoCfg.ini
2021-09-09 20:59:45 -07:00
GhostlyDark
46e90781b5 Add Xbox One Elite Controller to InputAutoCfg.ini
I am actually not using an Elite Controller. It's what both my revised Xbox One and Series controllers are recognized as.
2021-09-07 14:34:46 +02:00
Richard Goedeken
1e7741e474
Merge pull request #109 from GhostlyDark/xbox-one-s-fix
Fix Xbox One S Controller
2021-09-06 21:41:44 -07:00
GhostlyDark
893296b671 Fix Xbox One S Controller
Fixes wrong C-Button configuration.
2021-09-05 20:41:48 +02:00
Richard Goedeken
cb421bbfa9 add auto-configuration for Shan Wan gamecube adapter from Sumbigboi 2021-06-23 21:12:33 -07:00
Richard Goedeken
4340d306b7
Merge pull request #107 from HellMar/master
SAFFUN N64 A and B button and CL and CD button swapped
2021-04-28 19:27:59 -07:00
HellMar
cc1c43525e SAFFUN N64 A and B button and CL and CD button swapped 2021-04-26 16:32:04 +02:00
Richard Goedeken
fb73dcf57f controller config for Xbox One S controller from Magnus Olsen on github 2021-04-20 22:45:53 -07:00
Richard Goedeken
b65f4d5af7
Merge pull request #105 from dmccombs/add-stadia-controller
Add Google Stadia controller to README.md, minor button mapping updates.
2021-04-18 06:34:28 -07:00
Dan McCombs
fabde06a47 Add Google Stadia controller to README.md, minor button mapping updates. 2021-04-17 21:09:26 -04:00
Richard Goedeken
0803c862ed
Merge pull request #104 from dmccombs/add-stadia-controller
Add input config for Google Stadia controller.
2021-04-11 20:22:50 -07:00
Dan McCombs
966bd723a2 Add input config for Google Stadia controller. 2021-04-03 17:36:44 -04:00
Richard Goedeken
6bd512eaf8 add PS5 controller auto-config from z0z0z on github 2021-03-02 17:42:40 -08:00
Ben Slater
44d1d4bd86 Add Dragonbox Pyra Controller Config 2021-02-01 09:02:31 +01:00
Richard Goedeken
0ab2293042 add auto-config for Saitek P2600 from dL classic 2021-01-31 21:40:36 -08:00
Richard Goedeken
d17cfdecd8
Merge pull request #97 from Jj0YzL5nvJ/tiptoe
Enable tiptoe walking mechanics in Banjo games...
2021-01-22 20:43:07 -08:00
orbea
4015a8162a build: Allow out of tree builds. 2020-12-15 10:17:02 +01:00
Jj0YzL5nvJ
daf71bf2ef Enable tiptoe walking mechanics in Banjo games and other platformers with the keyboard 2020-11-10 23:12:10 -07:00
Richard Goedeken
0d7820e35a Revert "Allow non-default compilers without resorting to symbolic links"
This reverts commit 7c701d8b35, as it conflicts with GNU make which always defines default values for certain variables
2020-09-16 22:39:55 -07:00
Richard Goedeken
becff721ff
Merge pull request #94 from Jj0YzL5nvJ/alter_cc_cxx
Allow non-default compilers without resorting to symbolic links
2020-08-30 18:53:30 -07:00
Jj0YzL5nvJ
7c701d8b35 Allow non-default compilers without resorting to symbolic links 2020-08-30 03:53:39 -06:00
Richard Goedeken
5b0c654643
Merge pull request #93 from Jj0YzL5nvJ/alter
Allow to set custom platform toolset from commands
2020-08-19 23:36:23 -07:00
Jj0YzL5nvJ
dd2612bd05 Allow to set custom platform toolset from commands 2020-08-13 12:06:52 -06:00
Richard Goedeken
c0d76df367 fix logitech F710 a/b button mappings as requested by BrandonIrwan on github 2020-06-27 15:57:34 -07:00
Richard Goedeken
954a5dc742
Merge pull request #91 from Henrik0x7F/master
Correctly manage SDL subsystems
2020-05-05 17:21:59 -07:00
Henrik
a3b4a1e829 Correctly manage SDL subsystems
Only shutdown a subsystem if it wasn't already initialized
2020-05-04 20:14:34 +02:00
Richard Goedeken
73f00a0a6e add auto-config for 'SAFFUN N64 Wired USB PC Game pad Joystick' from rawsonjeremy@gmail.com 2020-04-21 19:35:10 -07:00
Richard Goedeken
01c66455c9 add auto-config for EasySMX ESM-9100 from brandonbundy@gmail.com 2020-04-21 19:26:44 -07:00
Richard Goedeken
a7ba9bd935 add auto-config for 'SZMY-POWER CO.,LTD. TIMgames gamepad A3069' from tonywhite1985@gmail.com 2020-04-21 18:32:11 -07:00
Richard Goedeken
978c39988e don't let analog X/Y stick values go outside of legal range 2020-04-21 18:25:07 -07:00
Richard Goedeken
3cbd9c153e
Merge pull request #86 from Mastergatto/controller-fix
Fixes for Nintendo Wii Remote Pro Controller autoconfig
2020-04-21 18:12:15 -07:00
Richard Goedeken
1eb1b873f9
Merge pull request #85 from mrexodia/xeox-autoconfig
add tested autoconfig for "Controller (XEOX Gamepad)"
2020-04-21 18:06:44 -07:00
Richard Goedeken
ad2af4cff4 update auto config based on issue #81 2020-04-21 16:42:26 -07:00
Jj0YzL5nvJ
02a73d3858 AppVeyor with artifact packaging 2020-03-02 09:36:46 +01:00
Jj0YzL5nvJ
c5daef94f4 Changes to have more generic project files 2020-02-26 12:39:44 +01:00
Gillou68310
01af91dd84 Migrate to VS2017 2019-11-13 17:13:10 +01:00
Mastergatto
9972386c14 [Nintendo Wii Remote Pro Controller] Increase value of AnalogDeadzone and AnalogPeak by 75% and 55%, assign buttons for Mempak/Rumblepak switch. 2019-10-19 22:42:02 +02:00
Duncan Ogilvie
7d7a0bd616
add tested autoconfig for "Controller (XEOX Gamepad)" 2019-10-06 21:21:32 +02:00
Richard Goedeken
7dcc45e2cf add function attributes so GCC can find bugs in calls to string formatting functions with variadic arguments 2019-03-03 09:18:32 -08:00
Richard Goedeken
830981f157 bump API version to 2.1.0 to fix issue #79 2019-02-27 23:09:04 -08:00
Richard Goedeken
c8d337aada update version and release info for v2.5.9 BETA release 2019-02-10 10:12:19 -08:00
Richard Goedeken
e68cb6a5f9 fix Travis CI test builds for MXE 32 and 64 bits 2019-01-29 22:12:04 -08:00
Richard Goedeken
25c8ffc0c5
Merge pull request #78 from bugfood/improve-startup
Improve input-sdl startup time.
2019-01-28 20:25:35 -08:00
Corey Hickey
097fc83e2c Improve input-sdl startup time.
SDL_InitSubSystem() takes approximately 0.6s for me, presumably because
it does lots of device enumeration.

When all Input-sdl-ControlX configuration sections are present and
valid, then input-sdl calls SDL_InitSubSystem(SDL_INIT_JOYSTICK) three
times. When configuration is not present, this happens once more for
each connected joysick.

Moving the SDL_InitSubSystem(SDL_INIT_JOYSTICK) calls to a higher level
allows for a reduction to two total calls (whether configuration is
present or not). The first remaining call happens when loading the
plugin and the second call happens when attaching the plugin to the
core. Keeping these calls separate allows SDL to refresh itself in case
the user has plugged/unplugged a joystick in between (not likely with
ui-console, but perhaps with a GUI).

On a system with three joystick devices, loading a game and then
exiting (--testshots 0), this reduces time by:
with configuration:    11.5%
without configuration: 32.1%

Full benchmarks:

[ ----------- original behavior -------------]
[ with configuraton ][ without configuration ]
real    0m5.255s        real    0m7.470s
user    0m1.499s        user    0m1.534s
sys     0m0.110s        sys     0m0.135s

real    0m5.313s        real    0m7.471s
user    0m1.471s        user    0m1.514s
sys     0m0.119s        sys     0m0.120s

real    0m5.360s        real    0m7.414s
user    0m1.496s        user    0m1.569s
sys     0m0.106s        sys     0m0.127s

[ ------------ patched behavior -------------]
[ with configuraton ][ without configuration ]
real    0m4.741s        real    0m5.088s
user    0m1.473s        user    0m1.468s
sys     0m0.122s        sys     0m0.101s

real    0m4.724s        real    0m5.066s
user    0m1.511s        user    0m1.484s
sys     0m0.082s        sys     0m0.090s

real    0m4.628s        real    0m5.024s
user    0m1.494s        user    0m1.504s
sys     0m0.094s        sys     0m0.081s
2019-01-28 19:53:15 -08:00
Richard Goedeken
232000501f
Merge pull request #77 from bugfood/fix-nosaveoptions
Remove use of ConfigSaveSection
2019-01-22 21:53:55 -08:00
Corey Hickey
eb1116c446 Remove use of ConfigSaveSection
Known front-ends have been modified to save configuration after plugin
initialization but before running the game. Now it is no longer
necessary for individual plugins to save their config.

Removing calls to ConfigSaveSection from within plugins makes the
mupen64plus-ui-console '--nosaveoptions' parameter work.

Also remove unused reference to ConfigSaveFile.
2019-01-22 20:59:14 -08:00
Richard Goedeken
cab01d8f6c
Merge pull request #76 from pedrib/patch-3
Recognise DS4 controllers in Bluetooth mode
2019-01-11 22:37:21 -08:00
Richard Goedeken
b3a083b036
Merge pull request #75 from deadmeu/master
Updated support for the TigerGame Adapter
2019-01-11 22:34:18 -08:00
Pedro Ribeiro
c7e31c4f0e
Add a new section as the mappings were all over the place 2019-01-06 23:55:11 +00:00
Pedro Ribeiro
5481b02c06
Recognise DS4 controllers in Bluetooth mode
Legit DS4 controllers advertise themselves as Wireless Controller when connected via Bluetooth.
sony 0005:054C:05C4.0043: input,hidraw4: BLUETOOTH HID v81.00 Gamepad [Wireless Controller] on b0:25:9f:d3:8b:d8
2019-01-06 00:10:49 +00:00
Alex Subaric
1910ed9d28
Updated support for the TigerGame Adapter
Added another name the adapter identifies as.
2019-01-06 03:14:40 +10:00
Richard Goedeken
f5c3995d19 fix mupen64plus-user-issues #709 - newer linux kernel driver maps the two N64 controllers on the HuiJia/Mayflash adapter to separate unix devices, instead of mapping them both to one device 2018-10-12 19:12:40 -07:00
Richard Goedeken
82f29bc1d2 add nintendo switch pro controller auto-config from Nathaniel Carter on google group mailing list 2018-10-03 22:14:07 -07:00
Richard Goedeken
c50780cfa1 remove backup file 2018-09-22 07:43:13 -07:00
Richard Goedeken
f4c518ed88
Merge pull request #72 from bkeys/cmake_build
Added an optional CMake build for mupen64plus-input-sdl
2018-09-21 20:22:25 -07:00
Brigham Henry Keys
7000ee130a Moved CMake project files to the projects/ directory 2018-09-21 02:36:52 -05:00
Richard Goedeken
380f331a1e
Merge pull request #73 from bkeys/markdown_readme
Added Markdown version of the README
2018-09-20 17:49:07 -07:00
Brigham Henry Keys
71c2dce7f8 Removed old README 2018-09-19 13:56:10 -05:00
Brigham Henry Keys
c9868ea0ab Added Markdown version of the README 2018-09-19 13:11:59 -05:00
Brigham Henry Keys
4294f3ce27 Removed extra option 2018-09-19 12:46:08 -05:00
Brigham Henry Keys
7cac1f0182 Added an optional CMake build for mupen64plus-input-sdl 2018-09-19 12:31:13 -05:00
hissingshark
4aff87c99c Added the gioteck VX2 Wireless controller. 2018-04-16 22:51:49 +02:00
Richard Goedeken
394cbc5866
Merge pull request #68 from loganmc10/patch-5
Call SDL_PumpEvents() before processing inputs
2018-03-27 20:21:49 -07:00
Logan
cd554c9022
Call SDL_PumpEvents() before processing inputs 2018-03-23 12:19:59 -06:00
bsmiles32
1a61a9a043 Revert "Update Present field in GetKeys function." 2018-02-20 13:09:39 +01:00
Richard Goedeken
0314ecf174
Merge pull request #66 from bsmiles32/unplug
Update Present field in GetKeys function.
2018-02-16 20:06:07 -08:00
Bobby Smiles
fb68d74829 Update Present field in GetKeys function. 2018-02-15 23:29:20 +01:00
Richard Goedeken
e1f3b93aaf update FSF address in license 2018-02-04 12:58:03 -08:00
Richard Goedeken
e02b4a037d add Xbox Wireless Controller config from Fabian Stumpf via the google group 2018-01-23 22:18:48 -08:00
Richard Goedeken
193ed7bbf7
Merge pull request #65 from Lithium64/patch-1
Added Multilaser Controller JS030
2018-01-23 22:14:39 -08:00
Lithium64
4be57a7511
Added Multilaser Controller JS30
It is recognized as USB Network Joystick on Windows and as Microntek USB Joystick on Ubuntu
2018-01-21 15:29:29 -03:00
Richard Goedeken
6f2290e52a issue #44 - Z and Start buttons swapped for linux and win32 MayFlash N64 controller adapter 2018-01-06 22:38:20 -08:00
Richard Goedeken
8ede639c0a
Merge pull request #63 from bsmiles32/guillemot
Add auto config support for Guillemot Corporation DA Leader
2018-01-05 19:39:04 -08:00
Bobby Smiles
ee729d06ad Add auto config support for Guillemot Corporation DA Leader
contributed by user Spctrlhrm through the mailing list
https://groups.google.com/d/msg/mupen64plus/tHw7rnWFgDE/uA5zCqkKCwAJ
2018-01-04 22:10:30 +01:00
Anthony J. Bentley
7be4d0dd82 Update wiki links. 2018-01-01 17:46:33 +01:00
Anthony J. Bentley
52fd15b4c0 Update homepage. 2018-01-01 17:46:33 +01:00
Anthony J. Bentley
318497be41 Update link to bug tracker. 2018-01-01 17:46:33 +01:00
Richard Goedeken
e6f84b4c8f
Merge pull request #61 from loganmc10/patch-4
If DEBUG not set, set NDEBUG
2017-11-30 19:36:35 -08:00
Logan
4855a9ba29
If DEBUG not set, set NDEBUG 2017-11-30 10:57:49 -07:00
Richard Goedeken
35fdd23231 update Makefile method for finding OSX_SDK_PATH 2017-11-14 16:21:00 -08:00
Richard Goedeken
6c10fddf1e
Merge pull request #60 from charlemagnelasse/travis-mxe
Build MXE targets as additional tests in travis build matrix
2017-11-08 20:06:32 -08:00
Richard Goedeken
3e00ab8f93 remove the ApplyAxisLimits function for now. If we run into problems with games due to over-excursion of joystick position in the corners, then we'll have to add it back in and try and find a happy medium 2017-11-07 20:42:25 -08:00
Charlemagne Lasse
e89b0b6c16 Build MXE targets as additional tests in travis build matrix 2017-11-05 15:34:53 +01:00
Richard Goedeken
1542273dc9 Merge pull request #58 from loganmc10/patch-3
Increase deadzone for axis->N64 button mappings
2017-10-13 22:11:46 -07:00
Logan
854a79353a Increase deadzone for axis->N64 button mappings 2017-10-13 21:48:59 -06:00
Richard Goedeken
5285e6e482 Merge pull request #56 from Jj0YzL5nvJ/patch-1
Fix Microsoft X-Box 360 pad for Linux
2017-10-09 17:24:38 -07:00
Jj0YzL5nvJ
b6b80796e5 Fix Microsoft X-Box 360 pad for Linux
This work best on my distro (Ubuntu 16.04.3 LTS).

The deadzone is very handy for Zelda games, the extra C buttons are indispensable to control Kirby and Jigglypuff in SSB64.
RT (axis(5+)) since always been broken, and interrupt LT (axis(2+))... "There can be only one" (Highlander style =P)
2017-10-09 03:47:02 -06:00
Richard Goedeken
6b58f770d0 Merge pull request #54 from bsmiles32/fix_p990
Fix Rumble switch button for Saitek P990 Dual Analog Pad.
2017-10-02 22:35:36 -07:00
Richard Goedeken
5b55d850c2 minor adjustments to xbox 360 controller config based upon my testing with Windows 7 machine and wired (usb) xb360 controller 2017-10-02 22:06:43 -07:00
Richard Goedeken
23f3b418a7 Merge pull request #53 from tony971/master
Fix XBOX 360 For Windows Controller
2017-10-02 22:02:28 -07:00
Bobby Smiles
1504adf425 Fix Rumble switch button for Saitek P990 Dual Analog Pad. 2017-10-02 11:56:20 +02:00
Tony
9fe1b0bdf3 Fix XBOX 360 For Windows Controller
This makes the mappings match all other xbox 360 mappings listed in the autoconfig. Tested in 3 different Windows 10 machines.
2017-09-29 07:03:25 -04:00
Richard Goedeken
4cc411b724 Merge pull request #45 from loganmc10/tp
Don't set "plugin" as part of autoconfig
2017-09-23 20:22:58 -07:00
Logan McNaughton
e1b542b85c Don't set "plugin" as part of autoconfig 2017-09-23 19:46:12 -06:00
Richard Goedeken
5e660767e1 Merge pull request #50 from loganmc10/patch-2
Re-attach joystick if it has disconnected
2017-09-20 23:02:31 -07:00
Logan
0afa0cd722 Re-attach joystick if it has disconnected 2017-09-19 12:55:18 -06:00
Dorian Fevrier
c3a14e06b0 Merge pull request #48 from charlemagnelasse/travis-container
Use faster container based Travis CI
2017-09-12 22:54:54 +02:00
Richard Goedeken
cf02a743e1 tweak the ApplyAxisLimits function to avoid causing problems mentioned in mupen64plus-input-sdl issue #46 and mupen64plus-user-issues issue #681. Instead of limiting joystick values to 87% of the axis limit on the cardinal directions N/S/E/W, we allow them to reach 100% 2017-09-04 21:11:21 -07:00
Charlemagne Lasse
c97d38e649 Use faster container based Travis CI 2017-09-01 09:57:14 +02:00
Charlemagne Lasse
da0a428d6f Let travis handle the package installation directly
The before_install  currently fails on Travis CI with:

    The following packages have unmet dependencies:
     libsdl2-dev : Depends: libegl1-mesa-dev
                   Depends: libgles2-mesa-dev
    E: Unable to correct problems, you have held broken packages.

This can currently only be solved by using the apt addon to install
packages.
2017-09-01 09:56:16 +02:00
Bobby Smiles
7d8eea23d8 Revert "Allow using compiler other than gcc"
This reverts commit 2766667e73.
2017-06-24 13:34:37 -06:00
bsmiles32
f280fde688 Merge pull request #42 from loganmc10/patch-1
Allow using compiler other than gcc
2017-06-22 20:19:54 -06:00
Logan McNaughton
2766667e73 Allow using compiler other than gcc 2017-06-20 21:16:50 -06:00
Richard Goedeken
68a048bb90 Merge pull request #41 from fprimex/fprimex-macos-version-min
bump macosx-version-min to 10.6 for SDL2.0.5
2017-03-16 23:57:32 -07:00
Richard Goedeken
e01d6de015 Merge pull request #39 from arichnad/master
add PS4 controller name.
2017-03-16 22:40:23 -07:00
Brent Woodruff
74202c7cec bump macosx-version-min to 10.6 for SDL2.0.5 2017-03-16 22:50:34 -04:00
adrian
434ff22b98 add PS4 controller name. 2017-02-19 14:14:07 -05:00
Richard Goedeken
ec69700961 Merge pull request #38 from orbea/horipad
(InputAutoCfg) Configure HORIPAD ONE automatically. [from orbea on 1/1/17: As a side note, in linux this gamepad currently only works correctly with the xpad git master. I'm not sure when that will be merged into the kernel.]
2017-02-02 19:29:02 -08:00
orbea
ae6d7dc308 (InputAutoCfg) Configure HORIPAD ONE automatically. 2017-01-01 10:05:43 -08:00
Richard Goedeken
9d8ec46e9b we dont need all the duplicate entries with version numbers 2016-10-21 23:14:45 -07:00
Richard Goedeken
4ffc65700e Merge pull request #36 from raphnet/raphnet
Add autoconfigs for raphnet-tech v3 series adapters
2016-10-21 23:09:43 -07:00
Raphael Assenat
b7923f746f Add autoconfigs for raphnet-tech v3 series adapters 2016-10-21 23:15:47 -04:00
Richard Goedeken
0056f904b9 libm is required for some linux distributions, possibly others. Hopefully this wont break the build on any architectures; it's also like this in the core makefile 2016-10-18 20:41:56 -07:00
Richard Goedeken
6189125766 experimental change: apply a pair of radius-limiting quadratic functions to the joystick X,Y coordinate values, so that instead of allowing them to have values in the full +/- 80 range for each axis, they are restricted to approximately the same area as that which is physically allowed by the controller case on a real N64 controller 2016-10-18 20:17:55 -07:00
Dorian Fevrier
016547d016 Merge pull request #35 from orbea/logic3
Add Logic3 controller config
2016-10-13 09:16:24 +02:00
orbea
c7efdf9125 Add Logic3 controller config 2016-10-12 19:38:13 -07:00
Richard Goedeken
ba9426c384 Merge pull request #34 from charlemagnelasse/master
Use Ubuntu Trusty as base system for Travis CI
2016-09-01 18:04:31 -07:00
Charlemagne Lasse
7eb46d4073 Use Ubuntu Trusty as base system for Travis CI 2016-09-01 20:23:59 +02:00
Richard Goedeken
799cad4422 Merge pull request #32 from kodlian/master
FIX Auto detection of PLAYSTATION(R)3 Controller on OSX
2016-08-15 22:39:05 -07:00
Jeremy Marchand
52e557184e FIX Auto detection of PLAYSTATION(R)3 Controller on OSX 2016-08-14 11:24:16 +02:00
Richard Goedeken
164472117d change VS2013 project files to build with the XP-compatible vc120 toolset, so the resulting binaries will run on pre-vista machines 2016-07-13 20:04:06 -07:00
Richard Goedeken
8e5e9901b1 add auto-config for Playfect PS3 controller from Reinaert Van de Cruys on google group 2016-07-12 21:08:34 -07:00
Richard Goedeken
dfbb873df0 add auto-config for Mayflash 4-port gamecube controller adapter from Lorenzo Pane on google group 2016-07-06 22:39:18 -07:00
Richard Goedeken
4754a02d49 Merge pull request #31 from Zero86Sk/patch-1
Add autoconfig support for Xbox One Wireless Controller (Dongle)
2016-07-05 22:17:48 -07:00
Zero86Sk
3d29d5bf76 Added Xbox One Wireless Controller (Dongle) support
Added the Xbox One Wireless Dongle device is listed under [Controller (Xbox One For Windows)]
2016-04-17 00:02:53 +02:00
Richard Goedeken
204e8d5784 from paradadf on github, this controller name needs 3 spaces, after the changes to prioritize bit-exact controller names 2016-04-12 20:03:59 -07:00
Richard Goedeken
149a7966ca add auto-config section for Thrustmaster T Mini Wireless from Pablo Casas via google group 2016-03-27 18:43:00 -07:00
Richard Goedeken
d9fff1dd51 fix for issue #152 in github issue tracker for mupen64plus-core 2016-03-16 22:14:25 -07:00
Richard Goedeken
85e9b2598d Logitech WingMan RumblePad apparently has the same button mapping as the WingMan Action Pad 2016-02-24 22:09:54 -08:00
Richard Goedeken
3d1ed346e5 add autoconfig section for NES30 Pro Controller from Wayne on google group 2016-02-24 22:05:24 -08:00
Richard Goedeken
a73230be7f auto-config for xbox 360 wired controller under OSX from Fredrik Daun via google group 2016-01-06 22:00:48 -08:00
Dorian Fevrier
b78b76a76b add 'Aftergl ow Gamepad for Xbox 360' in InputAutoCfg.ini 2016-01-01 23:08:17 -05:00
Richard Goedeken
4cac18ba21 Merge pull request #30 from EricxDu/master
Fix up the "Generic X-Box pad" section in accordance with the README
2015-11-21 20:40:20 -08:00
Eric Duhamel
78d3a43065 Fixed "Xbox 360 Wireless Receiver" section
Axes 3 and 4 were swapped
2015-11-21 12:36:07 -08:00
Eric Duhamel
2586367d2b Fixed a small error in the changed section 2015-11-21 11:54:46 -08:00
Eric Duhamel
77229317d0 Updated "Generic X-Box pad" to conform to the README
The [Generic X-Box pad] section was misconfigured so I updated it
to conform to the README. R-button, L-button, Z-trigger, B-button,
and START are now properly mapped. I tested this config by playing
Ocarina Of Time and the controller layout works well.
2015-11-21 11:51:16 -08:00
Richard Goedeken
d8e1b5b0ad add ShanWan USB autoconfig from Marco on google group list: A Playstation Clone, Rumble Trigger Incorrect 2015-11-04 22:07:11 -08:00
Richard Goedeken
120f4f3273 Merge branch 'master' of https://github.com/mupen64plus/mupen64plus-input-sdl 2015-10-18 21:46:28 -07:00
Richard Goedeken
493b3a6b10 fixes for Gasia PS Gamepad from Marcus Dean Adams on google group email list 2015-10-18 21:46:07 -07:00
Richard Goedeken
e96729614f Merge pull request #29 from gizmo98/USB-gamepad
Add "USB Gamepad "
2015-10-07 20:51:03 -07:00
Stefan
dc33cef836 Add "USB Gamepad " 2015-10-07 21:29:56 +02:00
Richard Goedeken
bcf6892ca6 added specific config for Logitech F310 from Marcus Dean Adams on google group, who suggested that this config is better than the old mapping which used the same config as other XBox Clones 2015-10-01 20:32:35 -07:00
Richard Goedeken
889312e419 Merge pull request #28 from Gillou68310/x64
Added x64 configuration to VisualStudio2013 project file
2015-09-12 21:52:38 -07:00
Richard Goedeken
24cc611bdb add another huijia auto-config from alecjw on github ticket #628 2015-09-12 17:23:22 -07:00
Richard Goedeken
67b4aa7a33 add OUYA wireless controller auto-config from github ticket #600 2015-09-12 16:52:06 -07:00
Gillou68310
58a56c38b2 Added x64 configuration to VisualStudio2013 project file 2015-08-28 16:26:24 +02:00
Richard Goedeken
b6486455a2 add new auto-config section for Rock Candy gamepad and new name for GC/N64 to USB (Raphnet technologies USB converter) 2015-08-02 14:26:57 -07:00
Richard Goedeken
681068aa00 new Saitek PLC Cyborg Force Rumble Pad auto-config from Pierre Neidhardt on the GG list 2015-07-07 22:33:14 -07:00
Richard Goedeken
198b8a7f03 add MayFlash PC048 adapter auto-config from Brandon Bundy via the google group 2015-06-12 21:30:05 -07:00
Richard Goedeken
0dbebae0e4 Merge pull request #26 from bentley/openbsd
Remove unnecessary OpenBSD warning.
2015-06-08 06:31:09 -07:00
Anthony J. Bentley
1580b6819d Remove unnecessary OpenBSD warning. 2015-06-08 01:45:45 -06:00
Richard Goedeken
b7cd607483 add auto-config for Logitech F710 gamepad by me 2015-06-06 21:59:46 -07:00
Richard Goedeken
10f69275e8 add auto-config for Xiaomi Bluetooth Controller from Peter Goelst on google group mailing list 2015-06-06 09:55:53 -07:00
Richard Goedeken
d0d385defa add auto-config for Super Joy Box 13 Gamecube USB adapter from Nick Griffiths on google group mailing list 2015-06-06 08:53:24 -07:00
Richard Goedeken
763107feb0 add auto-config for Snakebyte PS3-style USB controller from user on google group mailing list 2015-06-06 08:42:32 -07:00
Richard Goedeken
06d4271cf3 fix bug whereby a more general controller name in the inputautocfg file (such as OSX: Controller) which appeared earier in the file would be used instead of a more specific name found later. Now we score the name matches such that each matching word is worth 4 points, an OS-specific section is worth 1 point, and the XInput specific section is worth 2 points. The matching config section with the highest points is used, which fixes this bug 2015-06-03 23:29:48 -07:00
Richard Goedeken
53a90dde4a Merge pull request #25 from amietn/master
add config for Sony playstation 4 controller
2015-06-02 19:19:14 -07:00
amietn
bb0ffc3f82 add config for Sony playstation 4 controller and remove conflicting PS3 controller name 2015-05-07 15:22:51 +02:00
27 changed files with 2219 additions and 700 deletions

158
.github/workflows/build.yml vendored Normal file
View file

@ -0,0 +1,158 @@
name: SDL Input
on:
push:
paths-ignore:
- '.{gitattributes,gitignore,travis.yml}'
- '*.md,appveyor.yml,README'
pull_request:
paths-ignore:
- '.{gitattributes,gitignore,travis.yml}'
- '*.md,appveyor.yml,README'
workflow_dispatch:
jobs:
Linux:
strategy:
fail-fast: false
matrix:
include:
- cc: GCC
arch: x64
- cc: GCC
arch: x86
- cc: Clang
arch: x64
- cc: Clang
arch: x86
name: Linux / ${{ matrix.cc }} / ${{ matrix.arch }}
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: Get build dependencies and arrange the environment
run: |
git clone --depth 1 https://github.com/mupen64plus/mupen64plus-core.git ../mupen64plus-core
export C_CLANG_SUFFIX="-15" C_GCC_SUFFIX="-12"
export BUILD_DEPS="libsdl1.2-dev libsdl2-dev"
./../mupen64plus-core/.github/workflows/scripts/ci_install_ubuntu_deps.sh ${{ matrix.arch }} ${{ matrix.cc }}
- name: Build and related stuff, backup binaries
run: |
export C_CLANG_SUFFIX="-15" C_GCC_SUFFIX="-12"
export PATH="$(pwd)/../mupen64plus-core/.github/workflows/scripts:${PATH}"
export CONFIG_OVERRIDE="SDL_CONFIG="sdl-config""
ci_build.sh ${{ matrix.arch }} ${{ matrix.cc }}
export CONFIG_OVERRIDE="SDL_CONFIG="sdl2-config""
ci_build.sh ${{ matrix.arch }} ${{ matrix.cc }} makepkg
- name: Upload artifact
if: matrix.cc == 'GCC'
uses: actions/upload-artifact@v4
with:
name: ${{ env.PKG_NAME }}
path: pkg/*.tar.gz
MSYS2:
strategy:
fail-fast: false
matrix:
include:
- cc: GCC
arch: x64
cross: x86_64
env: MINGW64
- cc: GCC
arch: x86
cross: i686
env: MINGW32
name: Windows / MSYS2 ${{ matrix.cc }} / ${{ matrix.arch }}
runs-on: windows-2022
defaults:
run:
shell: msys2 {0}
steps:
- uses: actions/checkout@v4
- uses: msys2/setup-msys2@v2
with:
msystem: ${{ matrix.env }}
update: true
install: >-
git
libtool
make
mingw-w64-${{ matrix.cross }}-gcc
mingw-w64-${{ matrix.cross }}-toolchain
mingw-w64-${{ matrix.cross }}-ntldd
mingw-w64-${{ matrix.cross }}-SDL2
- name: Build and related stuff, backup binaries
run: |
git clone --depth 1 https://github.com/mupen64plus/mupen64plus-core.git ../mupen64plus-core
./../mupen64plus-core/.github/workflows/scripts/ci_build.sh ${{ matrix.arch }} ${{ matrix.cc }}
- name: Backup dependencies, etc...
run: |
./../mupen64plus-core/.github/workflows/scripts/ci_backup_mingw_deps.sh ${{ matrix.env }}
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: ${{ env.PKG_NAME }}
path: pkg/*
MSVC:
strategy:
fail-fast: false
matrix:
include:
- toolset: v143
arch: x64
vs: 2022
- toolset: v141_xp
arch: x86
vs: 2019
name: Windows / MSVC with ${{ matrix.toolset }} / ${{ matrix.arch }}
runs-on: windows-${{ matrix.vs }}
defaults:
run:
shell: cmd
steps:
- uses: actions/checkout@v4
- uses: microsoft/setup-msbuild@v2
- name: Build and related stuff, backup binaries
run: |
git clone --depth 1 https://github.com/mupen64plus/mupen64plus-core.git ..\mupen64plus-core
set TOOLSET=${{ matrix.toolset }}
.\..\mupen64plus-core\.github\workflows\scripts\ci_msvc_build.cmd ${{ matrix.arch }}
- name: Backup dependencies, etc...
run: |
.\..\mupen64plus-core\.github\workflows\scripts\ci_backup_msvc_deps.cmd ${{ matrix.arch }} SDL2.dll
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: ${{ env.PKG_NAME }}
path: pkg/*
Nightly-build:
runs-on: ubuntu-latest
if: github.ref_name == 'master'
needs: [Linux, MSYS2, MSVC]
steps:
- uses: actions/checkout@v4
- name: Download artifacts
uses: actions/download-artifact@v4
with:
path: binaries
- name: Get some tools
run: |
git clone --depth 1 https://github.com/mupen64plus/mupen64plus-core.git ../mupen64plus-core
sudo apt-get update
sudo apt-get -y install hashdeep
- name: Creating new artifacts and update nightly-build
run: |
./../mupen64plus-core/.github/workflows/scripts/ci_nightly_artifacts.sh
- name: Nightly-build
uses: ncipollo/release-action@v1
with:
prerelease: true
allowUpdates: true
removeArtifacts: true
replacesArtifacts: false
tag: nightly-build
artifacts: pkg/*

154
.github/workflows/schedule.yml vendored Normal file
View file

@ -0,0 +1,154 @@
name: SDL Input - Scheduled
on:
schedule:
- cron: '40 14 21 * *'
jobs:
Linux:
strategy:
fail-fast: false
matrix:
include:
- cc: GCC
arch: x64
- cc: GCC
arch: x86
- cc: Clang
arch: x64
- cc: Clang
arch: x86
name: Linux / ${{ matrix.cc }} / ${{ matrix.arch }}
runs-on: ubuntu-22.04
if: github.repository == 'mupen64plus/mupen64plus-input-sdl'
steps:
- uses: actions/checkout@v4
- name: Get build dependencies and arrange the environment
run: |
git clone --depth 1 https://github.com/mupen64plus/mupen64plus-core.git ../mupen64plus-core
export C_CLANG_SUFFIX="-15" C_GCC_SUFFIX="-12"
export BUILD_DEPS="libsdl1.2-dev libsdl2-dev"
./../mupen64plus-core/.github/workflows/scripts/ci_install_ubuntu_deps.sh ${{ matrix.arch }} ${{ matrix.cc }}
- name: Build and related stuff, backup binaries
run: |
export C_CLANG_SUFFIX="-15" C_GCC_SUFFIX="-12"
export PATH="$(pwd)/../mupen64plus-core/.github/workflows/scripts:${PATH}"
export CONFIG_OVERRIDE="SDL_CONFIG="sdl-config""
ci_build.sh ${{ matrix.arch }} ${{ matrix.cc }}
export CONFIG_OVERRIDE="SDL_CONFIG="sdl2-config""
ci_build.sh ${{ matrix.arch }} ${{ matrix.cc }} makepkg
- name: Upload artifact
if: matrix.cc == 'GCC'
uses: actions/upload-artifact@v4
with:
name: ${{ env.PKG_NAME }}
path: pkg/*.tar.gz
MSYS2:
strategy:
fail-fast: false
matrix:
include:
- cc: GCC
arch: x64
cross: x86_64
env: MINGW64
- cc: GCC
arch: x86
cross: i686
env: MINGW32
name: Windows / MSYS2 ${{ matrix.cc }} / ${{ matrix.arch }}
runs-on: windows-2022
if: github.repository == 'mupen64plus/mupen64plus-input-sdl'
defaults:
run:
shell: msys2 {0}
steps:
- uses: actions/checkout@v4
- uses: msys2/setup-msys2@v2
with:
msystem: ${{ matrix.env }}
update: true
install: >-
git
libtool
make
mingw-w64-${{ matrix.cross }}-gcc
mingw-w64-${{ matrix.cross }}-toolchain
mingw-w64-${{ matrix.cross }}-ntldd
mingw-w64-${{ matrix.cross }}-SDL2
- name: Build and related stuff, backup binaries
run: |
git clone --depth 1 https://github.com/mupen64plus/mupen64plus-core.git ../mupen64plus-core
./../mupen64plus-core/.github/workflows/scripts/ci_build.sh ${{ matrix.arch }} ${{ matrix.cc }}
- name: Backup dependencies, etc...
run: |
./../mupen64plus-core/.github/workflows/scripts/ci_backup_mingw_deps.sh ${{ matrix.env }}
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: ${{ env.PKG_NAME }}
path: pkg/*
MSVC:
strategy:
fail-fast: false
matrix:
include:
- toolset: v143
arch: x64
vs: 2022
- toolset: v141_xp
arch: x86
vs: 2019
name: Windows / MSVC with ${{ matrix.toolset }} / ${{ matrix.arch }}
runs-on: windows-${{ matrix.vs }}
if: github.repository == 'mupen64plus/mupen64plus-input-sdl'
defaults:
run:
shell: cmd
steps:
- uses: actions/checkout@v4
- uses: microsoft/setup-msbuild@v2
- name: Build and related stuff, backup binaries
run: |
git clone --depth 1 https://github.com/mupen64plus/mupen64plus-core.git ..\mupen64plus-core
set TOOLSET=${{ matrix.toolset }}
.\..\mupen64plus-core\.github\workflows\scripts\ci_msvc_build.cmd ${{ matrix.arch }}
- name: Backup dependencies, etc...
run: |
.\..\mupen64plus-core\.github\workflows\scripts\ci_backup_msvc_deps.cmd ${{ matrix.arch }} SDL2.dll
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: ${{ env.PKG_NAME }}
path: pkg/*
Nightly-build:
runs-on: ubuntu-latest
if: github.ref_name == 'master'
needs: [Linux, MSYS2, MSVC]
steps:
- uses: actions/checkout@v4
- name: Download artifacts
uses: actions/download-artifact@v4
with:
path: binaries
- name: Get some tools
run: |
git clone --depth 1 https://github.com/mupen64plus/mupen64plus-core.git ../mupen64plus-core
sudo apt-get update
sudo apt-get -y install hashdeep
- name: Creating new artifacts and update nightly-build
run: |
./../mupen64plus-core/.github/workflows/scripts/ci_nightly_artifacts.sh
- name: Nightly-build
uses: ncipollo/release-action@v1
with:
prerelease: true
allowUpdates: true
removeArtifacts: true
replacesArtifacts: false
tag: nightly-build
artifacts: pkg/*

1
.gitignore vendored
View file

@ -1,2 +1,3 @@
/projects/unix/_obj*/
/projects/unix/mupen64plus-input-sdl*.so
/build/

View file

@ -1,11 +1,16 @@
sudo: required
dist: xenial
language: cpp
compiler:
- gcc
- clang
addons:
apt:
packages:
- git
- libsdl1.2-dev
- libsdl2-dev
before_install:
- sudo add-apt-repository --yes ppa:zoogie/sdl2-snapshots
- sudo apt-get update -qq
- sudo apt-get install -y git libsdl1.2-dev libsdl2-dev
- git clone --depth=1 --branch=master git://github.com/mupen64plus/mupen64plus-core.git deps/mupen64plus-core
env:
- PLUGINDBG=0
@ -13,3 +18,34 @@ env:
script:
- make -C projects/unix APIDIR="$(pwd)/deps/mupen64plus-core/src/api/" V=1 clean && LDFLAGS="-Wl,--no-add-needed -Wl,--no-undefined" OPTFLAGS="-O2" make SDL_CONFIG=sdl-config CC="${CC}" CXX="${CXX}" -j$(nproc) -C projects/unix APIDIR="$(pwd)/deps/mupen64plus-core/src/api/" V=1 all
- make -C projects/unix APIDIR="$(pwd)/deps/mupen64plus-core/src/api/" V=1 clean && LDFLAGS="-Wl,--no-add-needed -Wl,--no-undefined" OPTFLAGS="-O2" make SDL_CONFIG=sdl2-config CC="${CC}" CXX="${CXX}" -j$(nproc) -C projects/unix APIDIR="$(pwd)/deps/mupen64plus-core/src/api/" V=1 all
# extra mxe build entries
matrix:
include:
- env:
- MXE_CPU=i686
- PATH="/usr/lib/mxe/usr/bin/:$PATH"
before_install:
- curl -sSL "https://mirror.mxe.cc/repos/apt/client-conf/mxeapt.gpg" | sudo -E apt-key add -
- echo "deb https://mirror.mxe.cc/repos/apt xenial main" | sudo tee -a /etc/apt/sources.list
- sudo apt-get update -qq
- sudo apt-get -y --allow-unauthenticated install mxe-i686-w64-mingw32.shared-gcc
- sudo apt-get -y --allow-unauthenticated install mxe-i686-w64-mingw32.shared-sdl2
- git clone --depth=1 --branch=master git://github.com/mupen64plus/mupen64plus-core.git deps/mupen64plus-core
script:
- make UNAME=MINGW CROSS_COMPILE="${MXE_CPU}-w64-mingw32.shared-" CC="${MXE_CPU}-w64-mingw32.shared-gcc" CXX="${MXE_CPU}-w64-mingw32.shared-g++" HOST_CPU="${MXE_CPU}" SDL_CONFIG="${MXE_CPU}-w64-mingw32.shared-sdl2-config" -C projects/unix APIDIR="$(pwd)/deps/mupen64plus-core/src/api/" V=1 clean &&
make UNAME=MINGW CROSS_COMPILE="${MXE_CPU}-w64-mingw32.shared-" CC="${MXE_CPU}-w64-mingw32.shared-gcc" CXX="${MXE_CPU}-w64-mingw32.shared-g++" HOST_CPU="${MXE_CPU}" SDL_CONFIG="${MXE_CPU}-w64-mingw32.shared-sdl2-config" -C projects/unix APIDIR="$(pwd)/deps/mupen64plus-core/src/api/" V=1 -j$(nproc) all
- env:
- MXE_CPU=x86_64
- PATH="/usr/lib/mxe/usr/bin/:$PATH"
before_install:
- curl -sSL "https://mirror.mxe.cc/repos/apt/client-conf/mxeapt.gpg" | sudo -E apt-key add -
- echo "deb https://mirror.mxe.cc/repos/apt xenial main" | sudo tee -a /etc/apt/sources.list
- sudo apt-get update -qq
- sudo apt-get -y --allow-unauthenticated install mxe-x86-64-w64-mingw32.shared-gcc
- sudo apt-get -y --allow-unauthenticated install mxe-x86-64-w64-mingw32.shared-sdl2
- git clone --depth=1 --branch=master git://github.com/mupen64plus/mupen64plus-core.git deps/mupen64plus-core
script:
- make UNAME=MINGW CROSS_COMPILE="${MXE_CPU}-w64-mingw32.shared-" CC="${MXE_CPU}-w64-mingw32.shared-gcc" CXX="${MXE_CPU}-w64-mingw32.shared-g++" HOST_CPU="${MXE_CPU}" SDL_CONFIG="${MXE_CPU}-w64-mingw32.shared-sdl2-config" -C projects/unix APIDIR="$(pwd)/deps/mupen64plus-core/src/api/" V=1 clean &&
make UNAME=MINGW CROSS_COMPILE="${MXE_CPU}-w64-mingw32.shared-" CC="${MXE_CPU}-w64-mingw32.shared-gcc" CXX="${MXE_CPU}-w64-mingw32.shared-g++" HOST_CPU="${MXE_CPU}" SDL_CONFIG="${MXE_CPU}-w64-mingw32.shared-sdl2-config" -C projects/unix APIDIR="$(pwd)/deps/mupen64plus-core/src/api/" V=1 -j$(nproc) all

View file

@ -34,7 +34,7 @@ Mupen64Plus is based on GPL-licensed source code from Mupen64 v0.5, originally w
Version 2, June 1991
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
675 Mass Ave, Cambridge, MA 02139, USA
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.

View file

@ -1,22 +1,19 @@
===============================================================================
-------------------------------------------------------------------------------
Mupen64plus-input-sdl README v2.0
-------------------------------------------------------------------------------
===============================================================================
![Logo](https://upload.wikimedia.org/wikipedia/commons/thumb/4/41/Mupen64plus.svg/127px-Mupen64plus.svg.png)
# https://mupen64plus.org/wiki/index.php/ControllerSetup
# Mupen64plus-input-sdl README v2.0
The latest documentation for this plugin can be found in wiki format at:
https://code.google.com/p/mupen64plus/wiki/KeyboardSetup
https://code.google.com/p/mupen64plus/wiki/ControllerSetup
https://mupen64plus.org/wiki/index.php/KeyboardSetup
https://mupen64plus.org/wiki/index.php/ControllerSetup
The format and usage of this plugin's "mupen64plus.cfg" configuration options
can be found at:
http://mupen64plus.retrouprising.com/mediawiki/index.php?title=Mupen64Plus_Plugin_Parameters#Input-SDL
https://mupen64plus.org/wiki/index.php/Mupen64Plus_Plugin_Parameters#Input-SDL
-------------------------------------------------------------------------------
Notes about usage of SDL input plugin:
-------------------------------------------------------------------------------
## Notes about usage of SDL input plugin:
- If one of the enabled controllers has the "mouse" general-purpose config parameters set
to True, the plugin will hide the mouse cursor and 'grab' the mouse pointer. The user
@ -25,26 +22,47 @@ Notes about usage of SDL input plugin:
being pressed all the way to the edge. To decrease the amount of simulated joystick
deflection, the user may press Right Control, Right Shift, or Right Ctrl+Right Shift.
-------------------------------------------------------------------------------
Notes for supported joysticks for auto-configuration:
-------------------------------------------------------------------------------
## Default Keyboard interface:
1. Jess Tech Rumble Pad (Saitek Rumble)
```
Analog Pad is "Arrow Keys"
C Up/Left/Down/Right are "I", "J", "K", "L"
DPad Up/Left/Down/Right are "W", "A", "S", "D"
Z trig is "z" key
L and R trigs are "x" and "c"
Start is "Enter" ("Return")
A is "left shift"
B is "left control"
Select Mempack = ","
Select Rumblepack = "."
```
## Special modifier keys
- Right-shift key: reduce amplitude of analog joystick X/Y axes by 25%
- Right-control key: reduce amplitude of analog joystick X/Y axes by 50%
- Left-Control + Left-Alt keys: grab or un-grab the mouse cursor (only if mouse control is enabled)
- Left-Windows key: do not auto-center joystick X/Y axes (only when mouse control is enabled)
## Notes for supported joysticks for auto-configuration:
1) Jess Tech Rumble Pad (Saitek Rumble)
The left D-pad is mapped to the D-pad; The joystick is mapped to the left joystick of the gamepad; the C buttons are mapped to the gampad's right joystick. Start button is mapped to start; the A-button is mapped to the lowest button on the gamepad's right front; the B-button to the left button (buttons marked 3 and 1 on my gamepad). The L and R buttons are mapped to the lower left and right rear triggers; the Z button is mapped to the left upper rear trigger. All other buttons are unused.
2. Logitech Dual Action gamepad, Logitech Cordless Rumblepad 2:
2) Logitech Dual Action gamepad, Logitech Cordless Rumblepad 2:
The digital pad maps to the N64 d-pad. The left analog stick maps to the N64 analog stick.
The right analog stick maps to the C-buttons, and the buttons 2 and 1 map to A and B.
Button 4 is the Z trigger, and the top shoulder buttons map to the left and right N64 triggers.
Button 10 is the start button.
The bottom shoulder buttons select the memory pack or rumble pak.
3. Logitech Logitech(R) Precision(TM) Gamepad, Gravis GamePad Pro USB
3) Logitech Logitech(R) Precision(TM) Gamepad, Gravis GamePad Pro USB
I came up with what I see as one of the few decent configurations (SSB aside) since it allows access to everything but the dpad.
A is L1, B is R1, Z is L2, R is R2, L is select. C buttons are the four buttons, and the dpad acts as the joystick. Not the most orthodox, but it works well.
4. Microsoft Xbox 360 controller and clones:
4) Microsoft Xbox 360 controller and clones:
```
N64 -> Xbox 360:
analog stick -> left stick
@ -61,6 +79,7 @@ C down -> B (additionally to right stick)
mempak -> none for now
rumblepak -> none for now
```
As discussed in issue #478 Xbox 360 controllers should follow the above
mapping convention. If you want to add a Xbox 360 controller clone please
@ -71,9 +90,10 @@ https://en.wikipedia.org/wiki/File:360_controller.svg
Keys that are still unbound are back (aka. select) and left/right stick button
clicks. Those might be used for mempack and rumblepak toggles.
5. MP-8866 Dual USB Joypad:
5) MP-8866 Dual USB Joypad:
This is a USB adapter for PlayStation controllers (2).
```
D-Pad: hat(0)
L-Stick: x:0, y:1
R-Stick: x:2, y:3
@ -90,12 +110,14 @@ Select: button(9)
L3: button(10)
R3: button(11)
Note: This is when analog mode is selected. If analog is off then D-Pad becomes axes 0/1 and both sticks are disabled (including L3/R3).
```
6. Nintendo Wiimote Classic
6) Nintendo Wiimote Classic
I am on a Mac and used https://code.google.com/p/wjoy/ successfully to connect my Wiimote + Classic Controller.
This is my working Wiimote + Class Controller configuration. You use the Classic Controller for all play, the Wiimote serves only as a host for the Classic Controller. I have swapped the left analog stick set as the C-Buttons and the right analog stick set as the N64 Analog (Y-Axis / X-Axis). This makes playing FPS titles like Perfect Dark a bit more reasonable for me. You can easily switch them by swapping 2 with 4 and 3 with 5 in the axis() sections below.
```
N64 -> Classic Controller
Z -> L
R -> R
@ -109,12 +131,15 @@ Analog -> Right Analog
Mempak switch -> Home
Rumblepak switch -> Select (-)
```
7. N64 controller:
7) N64 controller:
All controls are mapped to their proper place on the N64 controller with an Adaptoid or custom hardware with Gamecon driver.
Rumble and Memory packs can be selected with the 'r' and 'm' keys, respectively.
8. Playstation 3 Controller:
8) Playstation 3 Controller:
```
Left analog stick - analog stick
Right analog stick - C-pad
D-Pad - D-Pad
@ -123,8 +148,9 @@ Square - B
L1 / R1 - L / R
L2 - Z
Start - Start
```
9. SAITEK P880:
9) SAITEK P880:
The gamepad doesnt have enough keys to real assign all buttons. The second
analog stick can be used as button by pushing him insight.
@ -137,14 +163,16 @@ used for A and B and the second and third row was used for C-Buttons - except
for the Button next to the A button which would be C-Down but got the Z
button.
10. Xbox Gamepad (userspace driver)
10) Xbox Gamepad (userspace driver)
I created an Input Config for a Xbox 360 controller running with
xboxdrv on a Linux system (http://pingus.seul.org/~grumbel/xboxdrv/).
```
Z = Left shoulder button
L = Left shoulder trigger
A = A Button
B = X Button
```
everything else should be obvious.
@ -157,6 +185,7 @@ The guide=KEY_ESC allows you to quit the emulator by pressing the
guide key on the controller. This is obviously just nice-to-have and
not actually neccessary for the config to work.
```
[xboxdrv]
silent=true
trigger-as-button=true
@ -168,26 +197,78 @@ guide=KEY_ESC
[axismap]
x2^deadzone:27000
y2^deadzone:27000
```
11. Saitek Cyborg V.3 Rumble Pad (aka Saitek PS2700)
11) Saitek Cyborg V.3 Rumble Pad (aka Saitek PS2700)
Honestly, it's one of the best pads that I've used in a long time, so thought I'd contribute this quick config. Basically, Dpad and Analog sticks are unchanged, C-buttons are mapped to the right analog stick, L-R triggers are L1 and R1, Z is mapped to R2, A + B are mapped to X and Square, respectively, start is mapped to the Home button, and Triangle, Square, L2, Start, Select, and the Analog triggers are unused, since it's not intuitive to use them for what's left.
12. Default Keyboard interface:
Analog Pad is "Arrow Keys"
C Up/Left/Down/Right are "I", "J", "K", "L"
DPad Up/Left/Down/Right are "W", "A", "S", "D"
Z trig is "z" key
L and R trigs are "x" and "c"
Start is "Enter" ("Return")
A is "left shift"
B is "left control"
Select Mempack = ","
Select Rumblepack = "."
12) Arsenal Gaming PS3 controller (aka. "Gasia Co.,Ltd PS(R) Gamepad")
13. Special modifier keys
- Right-shift key: reduce amplitude of analog joystick X/Y axes by 25%
- Right-control key: reduce amplitude of analog joystick X/Y axes by 50%
- Left-Control + Left-Alt keys: grab or un-grab the mouse cursor (only if mouse control is enabled)
- Left-Windows key: do not auto-center joystick X/Y axes (only when mouse control is enabled)
```
N64 Start = PS3 Start
N64 D-pad = PS3 D-pad
N64 joystick = PS3 left joystick
N64 C buttons = PS3 right joystick
N64 A = PS3 X
N64 B = PS3 Square
N64 R = PS3 R1
N64 L = PS3 L1
N64 Z = PS3 L2
Rumble pack swap = PS3 Triangle
Memory pack swap = PS3 Circle
```
13) Google Stadia controller
The Google Stadia controller can be used as a HID joystick by plugging it into a computer via USB-C or USB-C to USB-A.
```
N64 Start = Stadia Logo/Start
N64 D-pad = Stadia D-pad
N64 joystick = Stadia Left Analog Joystick
N64 C buttons = Stadia Right Analog Joystick
N64 A = Stadia A
N64 B = Stadia B
N64 R = Stadia Right Bumper
N64 L = Stadia Left Bumper
N64 Z = Stadia Left Trigger
Rumble pack swap = Stadia Y
Memory pack swap = Stadia X
```
14) PS4 Controller for Linux
The non-Linux configuration for the Sony Interactive Entertainment Wireless Controller had incompatible bindings. Z was right analog stick up.
I made a list of the ps4 buttons:
```
button 0 = cross
button 1 = circle
button 2 = triangle
button 3 = square
button 4 = l1
button 5 = r1
button 6 = l2
button 7 = r2
button 8 = share
button 9 = options
button 10 = ps
button 11 = l3
button 12 = r3
axis 0- = lstick left
axis 0+ = lstick right
axis 1- = lstick up
axis 1+ = lstick down
axis 2+ = l2
axis 2- = l2
axis 3- = rstick left
axis 3+ = rstick right
axis 4- = rstick up
axis 4+ = rstick down
axis 5+ = r2
axis 5- = r2
hat 0 Right = Right
hat 0 Left = Left
hat 0 Down = Down
hat 0 Up = Up
```

100
RELEASE
View file

@ -1,6 +1,106 @@
SDL Input plugin for Mupen64Plus
--------------------------------
----------------------------------------------
# Mupen64Plus-input-sdl v2.6.0 - July 14, 2024
## Merged PRs
* [132](https://github.com/mupen64plus/mupen64plus-input-sdl/pull/132): CI/CD: Update to generic scripts, independent schedule, etc
* [128](https://github.com/mupen64plus/mupen64plus-input-sdl/pull/128): Add support for "Xbox Series X Controller"
* [127](https://github.com/mupen64plus/mupen64plus-input-sdl/pull/127): CI/CD: Fixes Ubuntu i386 builds, among other changes
* [126](https://github.com/mupen64plus/mupen64plus-input-sdl/pull/126): Update rumble functions for SDL v2.0.18+
* [123](https://github.com/mupen64plus/mupen64plus-input-sdl/pull/123): Fix inversion in C buttons on Ubuntu 22.04
* [122](https://github.com/mupen64plus/mupen64plus-input-sdl/pull/122): CI/CD: Integrate scheduled builds and other...
* [118](https://github.com/mupen64plus/mupen64plus-input-sdl/pull/118): Include yet another 360 controller.
* [117](https://github.com/mupen64plus/mupen64plus-input-sdl/pull/117): CI/CD: Update MSVC
* [114](https://github.com/mupen64plus/mupen64plus-input-sdl/pull/114): CI/CD: Update
* [113](https://github.com/mupen64plus/mupen64plus-input-sdl/pull/113): Add USB controller from PS1 Classic
* [111](https://github.com/mupen64plus/mupen64plus-input-sdl/pull/111): CI/CD: Implement GitHub Actions and public nightly builds
* [110](https://github.com/mupen64plus/mupen64plus-input-sdl/pull/110): Sony PS4 Controller support for linux
* [109](https://github.com/mupen64plus/mupen64plus-input-sdl/pull/109): Fix Xbox One S Controller
* [108](https://github.com/mupen64plus/mupen64plus-input-sdl/pull/108): Add Xbox One Elite Controller to InputAutoCfg.ini
* [107](https://github.com/mupen64plus/mupen64plus-input-sdl/pull/107): SAFFUN N64 A and B button and CL and CD button swapped
* [105](https://github.com/mupen64plus/mupen64plus-input-sdl/pull/105): Add Google Stadia controller to README.md, minor button mapping updates.
* [104](https://github.com/mupen64plus/mupen64plus-input-sdl/pull/104): Add input config for Google Stadia controller.
* [101](https://github.com/mupen64plus/mupen64plus-input-sdl/pull/101): Add Dragonbox Pyra Controller Config
* [98](https://github.com/mupen64plus/mupen64plus-input-sdl/pull/98): build: Allow out of tree builds.
* [97](https://github.com/mupen64plus/mupen64plus-input-sdl/pull/97): Enable tiptoe walking mechanics in Banjo games...
* [94](https://github.com/mupen64plus/mupen64plus-input-sdl/pull/94): Allow non-default compilers without resorting to symbolic links
* [93](https://github.com/mupen64plus/mupen64plus-input-sdl/pull/93): Allow to set custom platform toolset from commands
* [91](https://github.com/mupen64plus/mupen64plus-input-sdl/pull/91): Correctly manage SDL subsystems
* [90](https://github.com/mupen64plus/mupen64plus-input-sdl/pull/90): AppVeyor with artifact packaging
* [89](https://github.com/mupen64plus/mupen64plus-input-sdl/pull/89): Changes to have more generic project files
* [86](https://github.com/mupen64plus/mupen64plus-input-sdl/pull/86): Fixes for Nintendo Wii Remote Pro Controller autoconfig
* [85](https://github.com/mupen64plus/mupen64plus-input-sdl/pull/85): add tested autoconfig for "Controller (XEOX Gamepad)"
## Closed Issues
* [131](https://github.com/mupen64plus/mupen64plus-input-sdl/issues/131): No InputAutoConfig.ini entry for 'Xbox Series X Controller'
* [130](https://github.com/mupen64plus/mupen64plus-input-sdl/issues/130): vibration support
* [120](https://github.com/mupen64plus/mupen64plus-input-sdl/issues/120): [BUG] Key Modifier when pressing a diagonal
* [119](https://github.com/mupen64plus/mupen64plus-input-sdl/issues/119): inputautocfg.ini from home
* [103](https://github.com/mupen64plus/mupen64plus-input-sdl/issues/103): PS5 DS5 Dualsense controller on Linux button axis mapping
* [92](https://github.com/mupen64plus/mupen64plus-input-sdl/issues/92): InputAutoCfg.ini / Wrong Logitech F710 mappings for A and B.
* [84](https://github.com/mupen64plus/mupen64plus-input-sdl/issues/84): Numpad not working and unhandled exception when binding numpad key 5 with num lock turned off.
* [81](https://github.com/mupen64plus/mupen64plus-input-sdl/issues/81): Logitech F310 auto configuration issue
* [87](https://github.com/mupen64plus/mupen64plus-input-sdl/issues/87): Two MAYFLASH N64 Controller Adaptors Issue
* [80](https://github.com/mupen64plus/mupen64plus-input-sdl/issues/80): joy con on mupen64 discussion
* [79](https://github.com/mupen64plus/mupen64plus-input-sdl/issues/79): 2.5.9: Missing INPUT_API_VERSION change (2.5 Input plugin not working with 2.5.9 core)
## Top Contributors (2 or more commits)
1. richard42
2. Jj0YzL5nvJ
3. GhostlyDark
--------------------------------------------------
# Mupen64Plus-input-sdl v2.5.9 - February 10, 2019
## Merged PRs
* [78](https://github.com/mupen64plus/mupen64plus-input-sdl/pull/78): Improve input-sdl startup time.
* [77](https://github.com/mupen64plus/mupen64plus-input-sdl/pull/77): Remove use of ConfigSaveSection
* [76](https://github.com/mupen64plus/mupen64plus-input-sdl/pull/76): Recognise DS4 controllers in Bluetooth mode
* [75](https://github.com/mupen64plus/mupen64plus-input-sdl/pull/75): Updated support for the TigerGame Adapter
* [73](https://github.com/mupen64plus/mupen64plus-input-sdl/pull/73): Added Markdown version of the README
* [72](https://github.com/mupen64plus/mupen64plus-input-sdl/pull/72): Added an optional CMake build for mupen64plus-input-sdl
* [69](https://github.com/mupen64plus/mupen64plus-input-sdl/pull/69): Added the gioteck VX2 Wireless controller.
* [68](https://github.com/mupen64plus/mupen64plus-input-sdl/pull/68): Call SDL_PumpEvents() before processing inputs
* [65](https://github.com/mupen64plus/mupen64plus-input-sdl/pull/65): Added Multilaser Controller JS030
* [63](https://github.com/mupen64plus/mupen64plus-input-sdl/pull/63): Add auto config support for Guillemot Corporation DA Leader
* [62](https://github.com/mupen64plus/mupen64plus-input-sdl/pull/62): Update homepage links
* [61](https://github.com/mupen64plus/mupen64plus-input-sdl/pull/61): If DEBUG not set, set NDEBUG
* [60](https://github.com/mupen64plus/mupen64plus-input-sdl/pull/60): Build MXE targets as additional tests in travis build matrix
* [58](https://github.com/mupen64plus/mupen64plus-input-sdl/pull/58): Increase deadzone for axis->N64 button mappings
* [56](https://github.com/mupen64plus/mupen64plus-input-sdl/pull/56): Fix Microsoft X-Box 360 pad for Linux
* [54](https://github.com/mupen64plus/mupen64plus-input-sdl/pull/54): Fix Rumble switch button for Saitek P990 Dual Analog Pad.
* [53](https://github.com/mupen64plus/mupen64plus-input-sdl/pull/53): Fix XBOX 360 For Windows Controller
* [50](https://github.com/mupen64plus/mupen64plus-input-sdl/pull/50): Re-attach joystick if it has disconnected
* [48](https://github.com/mupen64plus/mupen64plus-input-sdl/pull/48): Use faster container based Travis CI
* [45](https://github.com/mupen64plus/mupen64plus-input-sdl/pull/45): Don't set "plugin" as part of autoconfig
* [41](https://github.com/mupen64plus/mupen64plus-input-sdl/pull/41): bump macosx-version-min to 10.6 for SDL2.0.5
* [39](https://github.com/mupen64plus/mupen64plus-input-sdl/pull/39): add PS4 controller name.
* [38](https://github.com/mupen64plus/mupen64plus-input-sdl/pull/38): (InputAutoCfg) Configure HORIPAD ONE automatically.
* [36](https://github.com/mupen64plus/mupen64plus-input-sdl/pull/36): Add autoconfigs for raphnet-tech v3 series adapters
* [35](https://github.com/mupen64plus/mupen64plus-input-sdl/pull/35): Add Logic3 controller config
* [34](https://github.com/mupen64plus/mupen64plus-input-sdl/pull/34): Use Ubuntu Trusty as base system for Travis CI
* [32](https://github.com/mupen64plus/mupen64plus-input-sdl/pull/32): FIX Auto detection of PLAYSTATION(R)3 Controller on OSX
* [31](https://github.com/mupen64plus/mupen64plus-input-sdl/pull/31): Add autoconfig support for Xbox One Wireless Controller (Dongle)
* [30](https://github.com/mupen64plus/mupen64plus-input-sdl/pull/30): Fix up the "Generic X-Box pad" section in accordance with the README
* [29](https://github.com/mupen64plus/mupen64plus-input-sdl/pull/29): Add "USB Gamepad "
* [28](https://github.com/mupen64plus/mupen64plus-input-sdl/pull/28): Added x64 configuration to VisualStudio2013 project file
* [26](https://github.com/mupen64plus/mupen64plus-input-sdl/pull/26): Remove unnecessary OpenBSD warning.
* [25](https://github.com/mupen64plus/mupen64plus-input-sdl/pull/25): add config for Sony playstation 4 controller
## Closed Issues
* [44](https://github.com/mupen64plus/mupen64plus-input-sdl/issues/44): Linux MayFlash Z and Start inverted
* [46](https://github.com/mupen64plus/mupen64plus-input-sdl/issues/46): Yoshis Story Stamp with 360 Controller
Mupen64Plus-input-sdl v2.5 - April 26, 2015
-------------------------------------------
- use SDL1.2 keysyms in the mupen64plus.cfg file Input section even when built against SDL2, with keysym converter

43
appveyor.yml Normal file
View file

@ -0,0 +1,43 @@
version: 1.0.{build}
image: Visual Studio 2022
skip_tags: true
skip_commits:
files:
- '**/*.md'
- .github/
- data/*
- .gitattributes
- .gitignore
- .travis.yml
- README
configuration:
- Release
platform:
- Win32
- x64
before_build:
- git tag --delete nightly-build
- git clone --depth 1 https://github.com/mupen64plus/mupen64plus-win32-deps.git ..\mupen64plus-win32-deps
- git clone --depth 1 https://github.com/mupen64plus/mupen64plus-core.git ..\mupen64plus-core
build_script:
- msbuild projects\msvc\mupen64plus-input-sdl.vcxproj /p:Configuration=%configuration%;Platform=%platform%
after_build:
- ps: $env:rev1 = git describe --tags
- set rev2=%platform%
- if "%rev2%"=="Win32" set rev2=x86
- set filepkg=mupen64plus-input-sdl_v%rev1%_%rev2%
- cd projects\msvc\%platform%\%configuration%
- copy *.dll ..\..\..\..\data
- cd ..\..\..\..\data
- 7z a -t7z ..\build\%filepkg%.7z *
artifacts:
- path: build\$(filepkg).7z
name: $(filepkg)

File diff suppressed because it is too large Load diff

View file

@ -1,114 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{7F3178D0-0E2E-471B-9160-69F0354F9DE9}</ProjectGuid>
<RootNamespace>mupen64plusinputsdl</RootNamespace>
<Keyword>Win32Proj</Keyword>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<CharacterSet>MultiByte</CharacterSet>
<WholeProgramOptimization>true</WholeProgramOptimization>
<PlatformToolset>v120</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>v120</PlatformToolset>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup>
<_ProjectFileVersion>10.0.40219.1</_ProjectFileVersion>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(SolutionDir)$(Configuration)\</OutDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Configuration)\</IntDir>
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</LinkIncremental>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(SolutionDir)$(Configuration)\</OutDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Configuration)\</IntDir>
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental>
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>..\..\..\mupen64plus-core\src\api;..\..\..\mupen64plus-win32-deps\SDL-1.2.14\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<MinimalRebuild>true</MinimalRebuild>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>EditAndContinue</DebugInformationFormat>
</ClCompile>
<Link>
<AdditionalDependencies>..\..\..\mupen64plus-win32-deps\SDL-1.2.14\lib\SDL.lib;%(AdditionalDependencies)</AdditionalDependencies>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Windows</SubSystem>
<TargetMachine>MachineX86</TargetMachine>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<AdditionalIncludeDirectories>..\..\..\mupen64plus-core\src\api;..\..\..\mupen64plus-win32-deps\SDL-1.2.14\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<CompileAs>Default</CompileAs>
</ClCompile>
<Link>
<AdditionalDependencies>..\..\..\mupen64plus-win32-deps\SDL-1.2.14\lib\SDL.lib;%(AdditionalDependencies)</AdditionalDependencies>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Windows</SubSystem>
<OptimizeReferences>true</OptimizeReferences>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<TargetMachine>MachineX86</TargetMachine>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="..\..\src\autoconfig.c" />
<ClCompile Include="..\..\src\config.c" />
<ClCompile Include="..\..\src\osal_dynamiclib_win32.c" />
<ClCompile Include="..\..\src\plugin.c" />
<ClCompile Include="..\..\src\sdl_key_converter.c" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\..\src\autoconfig.h" />
<ClInclude Include="..\..\src\config.h" />
<ClInclude Include="..\..\src\osal_dynamiclib.h" />
<ClInclude Include="..\..\src\osal_preproc.h" />
<ClInclude Include="..\..\src\plugin.h" />
<ClInclude Include="..\..\src\sdl_key_converter.h" />
<ClInclude Include="..\..\src\version.h" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>

View file

@ -0,0 +1,169 @@
# This module defines
# SDL2_LIBRARY, the name of the library to link against
# SDL2_FOUND, if false, do not try to link to SDL2
# SDL2_INCLUDE_DIR, where to find SDL.h
#
# This module responds to the the flag:
# SDL2_BUILDING_LIBRARY
# If this is defined, then no SDL2main will be linked in because
# only applications need main().
# Otherwise, it is assumed you are building an application and this
# module will attempt to locate and set the the proper link flags
# as part of the returned SDL2_LIBRARY variable.
#
# Don't forget to include SDLmain.h and SDLmain.m your project for the
# OS X framework based version. (Other versions link to -lSDL2main which
# this module will try to find on your behalf.) Also for OS X, this
# module will automatically add the -framework Cocoa on your behalf.
#
#
# Additional Note: If you see an empty SDL2_LIBRARY_TEMP in your configuration
# and no SDL2_LIBRARY, it means CMake did not find your SDL2 library
# (SDL2.dll, libsdl2.so, SDL2.framework, etc).
# Set SDL2_LIBRARY_TEMP to point to your SDL2 library, and configure again.
# Similarly, if you see an empty SDL2MAIN_LIBRARY, you should set this value
# as appropriate. These values are used to generate the final SDL2_LIBRARY
# variable, but when these values are unset, SDL2_LIBRARY does not get created.
#
#
# $SDL2DIR is an environment variable that would
# correspond to the ./configure --prefix=$SDL2DIR
# used in building SDL2.
# l.e.galup 9-20-02
#
# Modified by Eric Wing.
# Added code to assist with automated building by using environmental variables
# and providing a more controlled/consistent search behavior.
# Added new modifications to recognize OS X frameworks and
# additional Unix paths (FreeBSD, etc).
# Also corrected the header search path to follow "proper" SDL guidelines.
# Added a search for SDL2main which is needed by some platforms.
# Added a search for threads which is needed by some platforms.
# Added needed compile switches for MinGW.
#
# On OSX, this will prefer the Framework version (if found) over others.
# People will have to manually change the cache values of
# SDL2_LIBRARY to override this selection or set the CMake environment
# CMAKE_INCLUDE_PATH to modify the search paths.
#
# Note that the header path has changed from SDL2/SDL.h to just SDL.h
# This needed to change because "proper" SDL convention
# is #include "SDL.h", not <SDL2/SDL.h>. This is done for portability
# reasons because not all systems place things in SDL2/ (see FreeBSD).
#=============================================================================
# Copyright 2003-2009 Kitware, Inc.
#
# Distributed under the OSI-approved BSD License (the "License");
# see accompanying file Copyright.txt for details.
#
# This software is distributed WITHOUT ANY WARRANTY; without even the
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
message("<FindSDL2.cmake>")
SET(SDL2_SEARCH_PATHS
~/Library/Frameworks
/Library/Frameworks
/usr/local
/usr
/sw # Fink
/opt/local # DarwinPorts
/opt/csw # Blastwave
/opt
${SDL2_PATH}
)
FIND_PATH(SDL2_INCLUDE_DIR SDL.h
HINTS
$ENV{SDL2DIR}
PATH_SUFFIXES include/SDL2 include
PATHS ${SDL2_SEARCH_PATHS}
)
FIND_LIBRARY(SDL2_LIBRARY_TEMP
NAMES SDL2
HINTS
$ENV{SDL2DIR}
PATH_SUFFIXES lib64 lib
PATHS ${SDL2_SEARCH_PATHS}
)
IF(NOT SDL2_BUILDING_LIBRARY)
IF(NOT ${SDL2_INCLUDE_DIR} MATCHES ".framework")
# Non-OS X framework versions expect you to also dynamically link to
# SDL2main. This is mainly for Windows and OS X. Other (Unix) platforms
# seem to provide SDL2main for compatibility even though they don't
# necessarily need it.
FIND_LIBRARY(SDL2MAIN_LIBRARY
NAMES SDL2main
HINTS
$ENV{SDL2DIR}
PATH_SUFFIXES lib64 lib
PATHS ${SDL2_SEARCH_PATHS}
)
ENDIF(NOT ${SDL2_INCLUDE_DIR} MATCHES ".framework")
ENDIF(NOT SDL2_BUILDING_LIBRARY)
# SDL2 may require threads on your system.
# The Apple build may not need an explicit flag because one of the
# frameworks may already provide it.
# But for non-OSX systems, I will use the CMake Threads package.
IF(NOT APPLE)
FIND_PACKAGE(Threads)
ENDIF(NOT APPLE)
# MinGW needs an additional library, mwindows
# It's total link flags should look like -lmingw32 -lSDL2main -lSDL2 -lmwindows
# (Actually on second look, I think it only needs one of the m* libraries.)
IF(MINGW)
SET(MINGW32_LIBRARY mingw32 CACHE STRING "mwindows for MinGW")
ENDIF(MINGW)
IF(SDL2_LIBRARY_TEMP)
# For SDL2main
IF(NOT SDL2_BUILDING_LIBRARY)
IF(SDL2MAIN_LIBRARY)
SET(SDL2_LIBRARY_TEMP ${SDL2MAIN_LIBRARY} ${SDL2_LIBRARY_TEMP})
ENDIF(SDL2MAIN_LIBRARY)
ENDIF(NOT SDL2_BUILDING_LIBRARY)
# For OS X, SDL2 uses Cocoa as a backend so it must link to Cocoa.
# CMake doesn't display the -framework Cocoa string in the UI even
# though it actually is there if I modify a pre-used variable.
# I think it has something to do with the CACHE STRING.
# So I use a temporary variable until the end so I can set the
# "real" variable in one-shot.
IF(APPLE)
SET(SDL2_LIBRARY_TEMP ${SDL2_LIBRARY_TEMP} "-framework Cocoa")
ENDIF(APPLE)
# For threads, as mentioned Apple doesn't need this.
# In fact, there seems to be a problem if I used the Threads package
# and try using this line, so I'm just skipping it entirely for OS X.
IF(NOT APPLE)
SET(SDL2_LIBRARY_TEMP ${SDL2_LIBRARY_TEMP} ${CMAKE_THREAD_LIBS_INIT})
ENDIF(NOT APPLE)
# For MinGW library
IF(MINGW)
SET(SDL2_LIBRARY_TEMP ${MINGW32_LIBRARY} ${SDL2_LIBRARY_TEMP})
ENDIF(MINGW)
# Set the final string here so the GUI reflects the final state.
SET(SDL2_LIBRARY ${SDL2_LIBRARY_TEMP} CACHE STRING "Where the SDL2 Library can be found")
# Set the temp variable to INTERNAL so it is not seen in the CMake GUI
SET(SDL2_LIBRARY_TEMP "${SDL2_LIBRARY_TEMP}" CACHE INTERNAL "")
ENDIF(SDL2_LIBRARY_TEMP)
message("</FindSDL2.cmake>")
INCLUDE(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(SDL2 REQUIRED_VARS SDL2_LIBRARY SDL2_INCLUDE_DIR)

View file

@ -0,0 +1,105 @@
cmake_minimum_required(VERSION 2.8.11)
project(mupen64plus-input-sdl)
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
set(M64_APIDIR "${CMAKE_SOURCE_DIR}/../../../mupen64plus-core/src/api")
message("${CMAKE_SOURCE_DIR}/../../src/")
# State directories for modules and binaries
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR}/bin)
set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/CMake)
set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/CMake/Find)
set(CMAKE_CC_FLAGS "-ffast-math -fno-strict-aliasing -fvisibility=hidden -D_GNU_SOURCE=1")
set(CMAKE_CXX_FLAGS "-pthread -fvisibility-inlines-hidden")
set(SRCS
${CMAKE_SOURCE_DIR}/../../src/autoconfig.c
${CMAKE_SOURCE_DIR}/../../src/config.c
${CMAKE_SOURCE_DIR}/../../src/plugin.c
${CMAKE_SOURCE_DIR}/../../src/sdl_key_converter.c
)
if(WIN32)
set(SRCS
${SRCS}
${CMAKE_SOURCE_DIR}/../../src/osal_dynamiclib_win32.c
)
else()
set(SRCS
${SRCS}
${CMAKE_SOURCE_DIR}/../../src/osal_dynamiclib_unix.c
)
endif()
# Find dependencies
find_package(PNG REQUIRED)
if(NOT ZLIB_FOUND)
include(ZLIB)
message(FATAL_ERROR "Package zlib is required, but not found!")
endif(NOT ZLIB_FOUND)
find_package(PNG REQUIRED)
if(NOT PNG_FOUND)
include(PNG)
message(FATAL_ERROR "Package libpng is required, but not found!")
endif(NOT PNG_FOUND)
find_package(SDL2 REQUIRED)
if(NOT SDL2_FOUND)
include(SDL2)
message(FATAL_ERROR "Package SDL2 is required, but not found!")
endif(NOT SDL2_FOUND)
find_package(OpenGL REQUIRED)
if(NOT OpenGL_FOUND)
message(FATAL_ERROR "Package OpenGL is required, but not found!")
endif(NOT OpenGL_FOUND)
find_package(Freetype REQUIRED)
if(NOT FREETYPE_FOUND)
message(FATAL_ERROR "Package FreeType is required, but not found!")
endif(NOT FREETYPE_FOUND)
# Specify include directories
include_directories(
${PNG_INCLUDE_DIR}
${OpenGL_INCLUDE_DIR}
${SDL2_INCLUDE_DIR}
${FREETYPE_INCLUDE_DIR_ft2build}
${FREETYPE_INCLUDE_DIR_freetype2}
${M64_APIDIR}
${CMAKE_SOURCE_DIR}/../../src/
)
# Create the binary
add_library(${CMAKE_PROJECT_NAME} SHARED ${SRCS})
# Link the libraries
# add_dependencies(${CMAKE_PROJECT_NAME} ${SDL2_LIBRARIES})
if(WIN32)
target_link_libraries(${CMAKE_PROJECT_NAME}
${PNG_LIBRARY}
${OPENGL_LIBRARIES}
${SDL2_LIBRARY}
${ZLIB_LIBRARY}
)
elseif(APPLE)
target_link_libraries(${CMAKE_PROJECT_NAME}
${PNG_LIBRARY}
${OPENGL_LIBRARIES}
${SDL2_LIBRARY}
${ZLIB_LIBRARY}
)
else()
target_link_libraries(${CMAKE_PROJECT_NAME}
${PNG_LIBRARY}
${OPENGL_LIBRARIES}
${SDL2_LIBRARY}
${ZLIB_LIBRARY}
${FREETYPE_LIBRARIES}
dl
)
endif()

View file

@ -0,0 +1,161 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{7F3178D0-0E2E-471B-9160-69F0354F9DE9}</ProjectGuid>
<RootNamespace>mupen64plusinputsdl</RootNamespace>
</PropertyGroup>
<PropertyGroup Condition="'$(WindowsTargetPlatformVersion)'=='' and '$(VisualStudioVersion)' != '14.0'">
<LatestTargetPlatformVersion>$([Microsoft.Build.Utilities.ToolLocationHelper]::GetLatestSDKTargetPlatformVersion('Windows', '10.0'))</LatestTargetPlatformVersion>
<WindowsTargetPlatformVersion>$(LatestTargetPlatformVersion)</WindowsTargetPlatformVersion>
<TargetPlatformVersion>$(WindowsTargetPlatformVersion)</TargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(PlatformToolset)'=='' or '$(PlatformToolset)'=='v100'" Label="Configuration">
<PlatformToolset>$(DefaultPlatformToolset)</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<CharacterSet>MultiByte</CharacterSet>
<WholeProgramOptimization>true</WholeProgramOptimization>
<OutDir>$(SolutionDir)$(Platform)\$(Configuration)\</OutDir>
<IntDir>$(Platform)\$(Configuration)\</IntDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<CharacterSet>MultiByte</CharacterSet>
<WholeProgramOptimization>true</WholeProgramOptimization>
<OutDir>$(SolutionDir)$(Platform)\$(Configuration)\</OutDir>
<IntDir>$(Platform)\$(Configuration)\</IntDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<CharacterSet>MultiByte</CharacterSet>
<OutDir>$(SolutionDir)$(Platform)\$(Configuration)\</OutDir>
<IntDir>$(Platform)\$(Configuration)\</IntDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<CharacterSet>MultiByte</CharacterSet>
<OutDir>$(SolutionDir)$(Platform)\$(Configuration)\</OutDir>
<IntDir>$(Platform)\$(Configuration)\</IntDir>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>..\..\..\mupen64plus-core\src\api;..\..\..\mupen64plus-win32-deps\SDL2-2.26.3\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
<WarningLevel>Level3</WarningLevel>
</ClCompile>
<Link>
<AdditionalDependencies>..\..\..\mupen64plus-win32-deps\SDL2-2.26.3\lib\x86\SDL2.lib;%(AdditionalDependencies)</AdditionalDependencies>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Windows</SubSystem>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>..\..\..\mupen64plus-core\src\api;..\..\..\mupen64plus-win32-deps\SDL2-2.26.3\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
<WarningLevel>Level3</WarningLevel>
</ClCompile>
<Link>
<AdditionalDependencies>..\..\..\mupen64plus-win32-deps\SDL2-2.26.3\lib\x64\SDL2.lib;%(AdditionalDependencies)</AdditionalDependencies>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Windows</SubSystem>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<AdditionalIncludeDirectories>..\..\..\mupen64plus-core\src\api;..\..\..\mupen64plus-win32-deps\SDL2-2.26.3\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
<WarningLevel>Level3</WarningLevel>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
</ClCompile>
<Link>
<AdditionalDependencies>..\..\..\mupen64plus-win32-deps\SDL2-2.26.3\lib\x86\SDL2.lib;%(AdditionalDependencies)</AdditionalDependencies>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Windows</SubSystem>
<OptimizeReferences>true</OptimizeReferences>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<AdditionalIncludeDirectories>..\..\..\mupen64plus-core\src\api;..\..\..\mupen64plus-win32-deps\SDL2-2.26.3\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
<WarningLevel>Level3</WarningLevel>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
</ClCompile>
<Link>
<AdditionalDependencies>..\..\..\mupen64plus-win32-deps\SDL2-2.26.3\lib\x64\SDL2.lib;%(AdditionalDependencies)</AdditionalDependencies>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Windows</SubSystem>
<OptimizeReferences>true</OptimizeReferences>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="..\..\src\autoconfig.c" />
<ClCompile Include="..\..\src\config.c" />
<ClCompile Include="..\..\src\osal_dynamiclib_win32.c" />
<ClCompile Include="..\..\src\plugin.c" />
<ClCompile Include="..\..\src\sdl_key_converter.c" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\..\src\autoconfig.h" />
<ClInclude Include="..\..\src\config.h" />
<ClInclude Include="..\..\src\osal_dynamiclib.h" />
<ClInclude Include="..\..\src\osal_preproc.h" />
<ClInclude Include="..\..\src\plugin.h" />
<ClInclude Include="..\..\src\sdl_key_converter.h" />
<ClInclude Include="..\..\src\version.h" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>

71
projects/unix/Makefile Executable file → Normal file
View file

@ -1,6 +1,6 @@
#/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
# * Mupen64plus-input-sdl - Makefile *
# * Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ *
# * Mupen64Plus homepage: https://mupen64plus.org/ *
# * Copyright (C) 2007-2009 Richard Goedeken *
# * *
# * This program is free software; you can redistribute it and/or modify *
@ -52,7 +52,6 @@ ifeq ("$(UNAME)","OpenBSD")
OS = FREEBSD
SO_EXTENSION = so
SHARED = -shared
$(warning OS type "$(UNAME)" not officially supported.')
endif
ifneq ("$(filter GNU/kFreeBSD kfreebsd,$(UNAME))","")
OS = LINUX
@ -66,7 +65,7 @@ ifeq ("$(patsubst MINGW%,MINGW,$(UNAME))","MINGW")
PIC = 0
endif
ifeq ("$(OS)","NONE")
$(error OS type "$(UNAME)" not supported. Please file bug report at 'http://code.google.com/p/mupen64plus/issues')
$(error OS type "$(UNAME)" not supported. Please file bug report at 'https://github.com/mupen64plus/mupen64plus-core/issues')
endif
# detect system architecture, only if it matters for build flags
@ -91,11 +90,15 @@ ifeq ("$(CPU)","OTHER")
PIC ?= 1
endif
SRCDIR = ../../src
OBJDIR = _obj$(POSTFIX)
# base CFLAGS, LDLIBS, and LDFLAGS
OPTFLAGS ?= -O3 -flto
WARNFLAGS ?= -Wall
CFLAGS += $(OPTFLAGS) $(WARNFLAGS) -ffast-math -fno-strict-aliasing -fvisibility=hidden -I../../src -D_GNU_SOURCE=1
CFLAGS += $(OPTFLAGS) $(WARNFLAGS) -ffast-math -fvisibility=hidden -I$(SRCDIR) -D_GNU_SOURCE=1
LDFLAGS += $(SHARED)
LDLIBS += -lm
# Since we are building a shared library, we must compile with -fPIC on some architectures
# On 32-bit x86 systems we do not want to use -fPIC because we don't have to and it has a big performance penalty on this arch
@ -107,48 +110,58 @@ endif
# tweak flags for 32-bit build on 64-bit system
ifeq ($(ARCH_DETECTED), 64BITS_32)
CFLAGS += -m32
LDFLAGS += -Wl,-m,elf_i386
ifeq ($(OS), FREEBSD)
$(error Do not use the BITS=32 option with FreeBSD, use -m32 and -m elf_i386)
endif
ifneq ($(OS), OSX)
ifeq ($(OS), MINGW)
LDFLAGS += -Wl,-m,i386pe
else
CFLAGS += -m32
LDFLAGS += -Wl,-m,elf_i386
endif
endif
endif
ifeq ($(ARCH_DETECTED), 64BITS)
ifeq ($(OS), MINGW)
LDFLAGS += -Wl,-m,i386pep
endif
endif
# set special flags per-system
ifeq ($(OS), FREEBSD)
ifeq ($(ARCH_DETECTED), 64BITS_32)
$(error Do not use the BITS=32 option with FreeBSD, use -m32 and -m elf_i386)
endif
endif
ifeq ($(OS), LINUX)
LDLIBS += -ldl
endif
ifeq ($(OS), OSX)
#xcode-select has been around since XCode 3.0, i.e. OS X 10.5
OSX_SDK_ROOT = $(shell xcode-select -print-path)/Platforms/MacOSX.platform/Developer/SDKs
OSX_SDK_PATH = $(OSX_SDK_ROOT)/$(shell ls $(OSX_SDK_ROOT) | tail -1)
OSX_SDK_PATH = $(shell xcrun --sdk macosx --show-sdk-path)
ifeq ($(CPU), X86)
ifeq ($(ARCH_DETECTED), 64BITS)
CFLAGS += -arch x86_64 -mmacosx-version-min=10.5 -isysroot $(OSX_SDK_PATH)
CFLAGS += -arch x86_64 -mmacosx-version-min=10.9 -isysroot $(OSX_SDK_PATH)
LDLIBS += -ldl
else
CFLAGS += -mmmx -msse -fomit-frame-pointer -arch i686 -mmacosx-version-min=10.5 -isysroot $(OSX_SDK_PATH)
CFLAGS += -mmmx -msse -fomit-frame-pointer -arch i686 -mmacosx-version-min=10.9 -isysroot $(OSX_SDK_PATH)
LDLIBS += -ldl -read_only_relocs suppress
endif
endif
endif
# test for essential build dependencies
ifeq ($(origin PKG_CONFIG), undefined)
PKG_CONFIG = $(CROSS_COMPILE)pkg-config
ifeq ($(shell which $(PKG_CONFIG) 2>/dev/null),)
$(error $(PKG_CONFIG) not found)
endif
endif
# test for presence of SDL
ifeq ($(origin SDL_CFLAGS) $(origin SDL_LDLIBS), undefined undefined)
SDL_CONFIG = $(CROSS_COMPILE)sdl2-config
ifeq ($(shell which $(SDL_CONFIG) 2>/dev/null),)
SDL_CONFIG = $(CROSS_COMPILE)sdl-config
ifeq ($(shell which $(SDL_CONFIG) 2>/dev/null),)
$(error No SDL development libraries found!)
else
$(warning Using SDL 1.2 libraries)
endif
ifeq ($(shell $(PKG_CONFIG) --modversion sdl2 2>/dev/null),)
$(error No SDL2 development libraries found!)
endif
SDL_CFLAGS += $(shell $(SDL_CONFIG) --cflags)
SDL_LDLIBS += $(shell $(SDL_CONFIG) --libs)
SDL_CFLAGS += $(shell $(PKG_CONFIG) --cflags sdl2)
SDL_LDLIBS += $(shell $(PKG_CONFIG) --libs sdl2)
endif
CFLAGS += $(SDL_CFLAGS)
LDLIBS += $(SDL_LDLIBS)
@ -197,6 +210,7 @@ ifeq ($(DEBUG),1)
CFLAGS += -g
INSTALL_STRIP_FLAG ?=
else
CFLAGS += -DNDEBUG
ifneq ($(OS),OSX)
INSTALL_STRIP_FLAG ?= -s
endif
@ -219,9 +233,6 @@ ifeq ($(PLUGINDIR),)
PLUGINDIR := $(LIBDIR)/mupen64plus
endif
SRCDIR = ../../src
OBJDIR = _obj$(POSTFIX)
# list of source files to compile
SOURCE = \
$(SRCDIR)/plugin.c \
@ -275,7 +286,7 @@ install: $(TARGET)
$(INSTALL) -d "$(DESTDIR)$(PLUGINDIR)"
$(INSTALL) -m 0644 $(INSTALL_STRIP_FLAG) $(TARGET) "$(DESTDIR)$(PLUGINDIR)"
$(INSTALL) -d "$(DESTDIR)$(SHAREDIR)"
$(INSTALL) -m 0644 "../../data/InputAutoCfg.ini" "$(DESTDIR)$(SHAREDIR)"
$(INSTALL) -m 0644 "$(SRCDIR)/../data/InputAutoCfg.ini" "$(DESTDIR)$(SHAREDIR)"
uninstall:
$(RM) "$(DESTDIR)$(PLUGINDIR)/$(TARGET)"

View file

@ -1,6 +1,6 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Mupen64plus-input-sdl - autoconfig.c *
* Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ *
* Mupen64Plus homepage: https://mupen64plus.org/ *
* Copyright (C) 2009-2013 Richard Goedeken *
* *
* This program is free software; you can redistribute it and/or modify *
@ -120,7 +120,7 @@ int auto_copy_inputconfig(const char *pccSourceSectionName, const char *pccDestS
static int auto_compare_name(const char *joySDLName, char *line)
{
char *wordPtr;
int joyFound = 1, joyFoundPrio = 3;
int joyFound = 1, joyFoundScore = 0;
char Word[64];
wordPtr = line;
@ -128,36 +128,43 @@ static int auto_compare_name(const char *joySDLName, char *line)
#if defined(__unix__)
if (strncmp(wordPtr, "Unix:", 5) == 0) {
wordPtr = StripSpace(wordPtr + 5);
joyFoundPrio = 2;
joyFoundScore = 1;
}
#endif
#if defined(__linux__)
if (strncmp(wordPtr, "Linux:", 6) == 0) {
wordPtr = StripSpace(wordPtr + 6);
joyFoundPrio = 2;
joyFoundScore = 1;
}
#endif
#if defined(__APPLE__)
if (strncmp(wordPtr, "OSX:", 4) == 0) {
wordPtr = StripSpace(wordPtr + 4);
joyFoundPrio = 2;
joyFoundScore = 1;
}
#endif
#if defined(WIN32)
if (strncmp(wordPtr, "Win32:", 6) == 0) {
wordPtr = StripSpace(wordPtr + 6);
joyFoundPrio = 2;
joyFoundScore = 1;
}
#if SDL_VERSION_ATLEAST(2,0,0)
else if (strncmp(wordPtr, "XInput:", 7) == 0) {
wordPtr = StripSpace(wordPtr + 7);
joyFoundPrio = 1;
joyFoundScore = 2;
}
#endif
#endif
/* extra points if the section name is a perfect match */
if (strcmp(wordPtr, joySDLName) == 0)
joyFoundScore += 4;
/* search in the .ini device name for all the words in the joystick name. If any are missing, then this is not the right joystick model */
while (wordPtr != NULL && strlen(wordPtr) > 0)
{
/* skip over any preceding spaces */
while (*wordPtr == ' ')
wordPtr++;
if (*wordPtr == 0)
break;
/* search for the next space after the current word */
char *nextSpace = strchr(wordPtr, ' ');
if (nextSpace == NULL)
{
@ -175,12 +182,14 @@ static int auto_compare_name(const char *joySDLName, char *line)
}
if (strcasestr(joySDLName, Word) == NULL)
joyFound = 0;
else
joyFoundScore += 4;
}
if (joyFound)
return joyFoundPrio;
return joyFoundScore;
else
return 0;
return -1;
}
int auto_set_defaults(int iDeviceIdx, const char *joySDLName)
@ -192,7 +201,7 @@ int auto_set_defaults(int iDeviceIdx, const char *joySDLName)
char *pchIni, *pchNextLine, *pchCurLine;
long iniLength;
int ControllersFound = 0;
int joyFoundPrio = -1;
int joyFoundScore = -1;
/* if we couldn't get a name (no joystick plugged in to given port), then return with a failure */
if (joySDLName == NULL)
@ -238,6 +247,7 @@ int auto_set_defaults(int iDeviceIdx, const char *joySDLName)
pchIni[iniLength] = 0;
/* parse the INI file, line by line */
DebugMessage(M64MSG_INFO, "Using auto-config file at: '%s'", CfgFilePath);
pchNextLine = pchIni;
eParseState = E_NAME_SEARCH;
while (pchNextLine != NULL && *pchNextLine != 0)
@ -266,7 +276,7 @@ int auto_set_defaults(int iDeviceIdx, const char *joySDLName)
pchCurLine[strlen(pchCurLine)-1] = 0;
joyFound = auto_compare_name(joySDLName, StripSpace(pchCurLine + 1));
/* if we found the right joystick, then open up the core config section to store parameters and set the 'device' param */
if (joyFound && (joyFoundPrio == -1 || joyFound < joyFoundPrio))
if (joyFound > joyFoundScore)
{
char SectionName[32];
ControllersFound = 0;
@ -280,7 +290,7 @@ int auto_set_defaults(int iDeviceIdx, const char *joySDLName)
eParseState = E_NAME_FOUND;
ControllersFound++;
ConfigSetParameter(pConfig, "device", M64TYPE_INT, &iDeviceIdx);
joyFoundPrio = joyFound;
joyFoundScore = joyFound;
}
continue;
}
@ -297,7 +307,7 @@ int auto_set_defaults(int iDeviceIdx, const char *joySDLName)
*pivot++ = 0;
pchCurLine = StripSpace(pchCurLine);
pivot = StripSpace(pivot);
if (strcasecmp(pchCurLine, "plugin") == 0 || strcasecmp(pchCurLine, "device") == 0)
if (strcasecmp(pchCurLine, "device") == 0)
{
int iVal = atoi(pivot);
ConfigSetParameter(pConfig, pchCurLine, M64TYPE_INT, &iVal);
@ -353,7 +363,7 @@ int auto_set_defaults(int iDeviceIdx, const char *joySDLName)
DebugMessage(M64MSG_ERROR, "Invalid line in %s: '%s'", INI_FILE_NAME, pchCurLine);
}
if (joyFoundPrio != -1)
if (joyFoundScore != -1)
{
/* we've finished parsing all parameters for the discovered input device, which is the last in the .ini file */
free(pchIni);

View file

@ -1,6 +1,6 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Mupen64plus-input-sdl - autoconfig.h *
* Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ *
* Mupen64Plus homepage: https://mupen64plus.org/ *
* Copyright (C) 2009 Richard Goedeken *
* *
* This program is free software; you can redistribute it and/or modify *

View file

@ -1,6 +1,6 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Mupen64plus-input-sdl - config.c *
* Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ *
* Mupen64Plus homepage: https://mupen64plus.org/ *
* Copyright (C) 2009-2013 Richard Goedeken *
* *
* This program is free software; you can redistribute it and/or modify *
@ -89,7 +89,7 @@ static void clear_controller(int iCtrlIdx)
controller[iCtrlIdx].device = DEVICE_NO_JOYSTICK;
controller[iCtrlIdx].control->Present = 0;
controller[iCtrlIdx].control->RawData = 0;
controller[iCtrlIdx].control->Plugin = PLUGIN_NONE;
controller[iCtrlIdx].control->Plugin = PLUGIN_MEMPAK;
for( b = 0; b < 16; b++ )
{
controller[iCtrlIdx].button[b].button = -1;
@ -121,15 +121,6 @@ static const char * get_sdl_joystick_name(int iCtrlIdx)
{
static char JoyName[256];
const char *joySDLName;
int joyWasInit = SDL_WasInit(SDL_INIT_JOYSTICK);
/* initialize the joystick subsystem if necessary */
if (!joyWasInit)
if (SDL_InitSubSystem(SDL_INIT_JOYSTICK) == -1)
{
DebugMessage(M64MSG_ERROR, "Couldn't init SDL joystick subsystem: %s", SDL_GetError() );
return NULL;
}
/* get the name of the corresponding joystick */
joySDLName = SDL_JoystickName(iCtrlIdx);
@ -141,10 +132,6 @@ static const char * get_sdl_joystick_name(int iCtrlIdx)
JoyName[255] = 0;
}
/* quit the joystick subsystem if necessary */
if (!joyWasInit)
SDL_QuitSubSystem(SDL_INIT_JOYSTICK);
/* if the SDL function had an error, then return NULL, otherwise return local copy of joystick name */
if (joySDLName == NULL)
return NULL;
@ -152,29 +139,6 @@ static const char * get_sdl_joystick_name(int iCtrlIdx)
return JoyName;
}
static int get_sdl_num_joysticks(void)
{
int numJoysticks = 0;
int joyWasInit = SDL_WasInit(SDL_INIT_JOYSTICK);
/* initialize the joystick subsystem if necessary */
if (!joyWasInit)
if (SDL_InitSubSystem(SDL_INIT_JOYSTICK) == -1)
{
DebugMessage(M64MSG_ERROR, "Couldn't init SDL joystick subsystem: %s", SDL_GetError() );
return 0;
}
/* get thenumber of joysticks */
numJoysticks = SDL_NumJoysticks();
/* quit the joystick subsystem if necessary */
if (!joyWasInit)
SDL_QuitSubSystem(SDL_INIT_JOYSTICK);
return numJoysticks;
}
/////////////////////////////////////
// load_controller_config()
// return value: 1 = OK
@ -197,17 +161,12 @@ static int load_controller_config(const char *SectionName, int i, int sdlDeviceI
/* set SDL device number */
controller[i].device = sdlDeviceIdx;
/* throw warnings if 'plugged' or 'plugin' are missing */
/* throw warnings if 'plugged' is missing */
if (ConfigGetParameter(pConfig, "plugged", M64TYPE_BOOL, &controller[i].control->Present, sizeof(int)) != M64ERR_SUCCESS)
{
DebugMessage(M64MSG_WARNING, "missing 'plugged' parameter from config section %s. Setting to 1 (true).", SectionName);
controller[i].control->Present = 1;
}
if (ConfigGetParameter(pConfig, "plugin", M64TYPE_INT, &controller[i].control->Plugin, sizeof(int)) != M64ERR_SUCCESS)
{
DebugMessage(M64MSG_WARNING, "missing 'plugin' parameter from config section %s. Setting to 1 (none).", SectionName);
controller[i].control->Plugin = PLUGIN_NONE;
}
/* load optional parameters */
ConfigGetParameter(pConfig, "mouse", M64TYPE_BOOL, &controller[i].mouse, sizeof(int));
if (ConfigGetParameter(pConfig, "MouseSensitivity", M64TYPE_STRING, input_str, 256) == M64ERR_SUCCESS)
@ -334,7 +293,7 @@ static void init_controller_config(int iCtrlIdx, const char *pccDeviceName, eMod
ConfigSetDefaultInt(pConfig, "device", controller[iCtrlIdx].device, "Specifies which joystick is bound to this controller: -1=No joystick, 0 or more= SDL Joystick number");
ConfigSetDefaultString(pConfig, "name", pccDeviceName, "SDL joystick name (or Keyboard)");
ConfigSetDefaultBool(pConfig, "plugged", controller[iCtrlIdx].control->Present, "Specifies whether this controller is 'plugged in' to the simulated N64");
ConfigSetDefaultInt(pConfig, "plugin", controller[iCtrlIdx].control->Plugin, "Specifies which type of expansion pak is in the controller: 1=None, 2=Mem pak, 5=Rumble pak");
ConfigSetDefaultInt(pConfig, "plugin", controller[iCtrlIdx].control->Plugin, "Specifies which type of expansion pak is in the controller: 1=None, 2=Mem pak, 4=Transfer pak, 5=Rumble pak");
ConfigSetDefaultBool(pConfig, "mouse", controller[iCtrlIdx].mouse, "If True, then mouse buttons may be used with this controller");
sprintf(Param, "%.2f,%.2f", controller[iCtrlIdx].mouse_sens[0], controller[iCtrlIdx].mouse_sens[1]);
@ -454,7 +413,6 @@ static int setup_auto_controllers(int bPreConfig, int n64CtrlStart, int sdlCtrlI
if (!bPreConfig)
DebugMessage(M64MSG_INFO, "N64 Controller #%i: Using auto-config with SDL joystick %i ('%s')", n64CtrlStart+1, sdlCtrlIdx, sdlJoyName);
ActiveControllers++;
ConfigSaveSection(SectionName);
}
else
{
@ -492,7 +450,6 @@ static int setup_auto_controllers(int bPreConfig, int n64CtrlStart, int sdlCtrlI
if (!bPreConfig)
DebugMessage(M64MSG_INFO, "N64 Controller #%i: Using auto-config with SDL joystick %i ('%s')", n64CtrlStart+j+1, sdlCtrlIdx, sdlJoyName);
ActiveControllers++;
ConfigSaveSection(SectionName);
/* set the local controller mode to Manual so that we won't re-configure this controller in the next loop */
ControlMode[n64CtrlStart+j] = E_MODE_MANUAL;
}
@ -547,7 +504,7 @@ void load_configuration(int bPreConfig)
int ControlDevice[4];
char DeviceName[4][256];
int ActiveControllers = 0;
int sdlNumJoysticks = get_sdl_num_joysticks();
int sdlNumJoysticks = SDL_NumJoysticks();
float fVersion = 0.0f;
const char *sdl_name;
int ControllersFound = 0;
@ -583,8 +540,6 @@ void load_configuration(int bPreConfig)
DeviceName[n64CtrlIdx][0] = 0;
// write blank config for GUI front-ends
init_controller_config(n64CtrlIdx, "", E_MODE_FULL_AUTO);
// save it to the file too
ConfigSaveSection(SectionName);
}
else
{
@ -606,6 +561,11 @@ void load_configuration(int bPreConfig)
{
DeviceName[n64CtrlIdx][0] = 0;
}
if (ConfigGetParameter(pConfig, "plugin", M64TYPE_INT, &controller[n64CtrlIdx].control->Plugin, sizeof(int)) != M64ERR_SUCCESS)
{
DebugMessage(M64MSG_WARNING, "missing 'plugin' parameter from config section %s. Setting to 2 (mempak).", SectionName);
controller[n64CtrlIdx].control->Plugin = PLUGIN_MEMPAK;
}
}
}
@ -655,7 +615,6 @@ void load_configuration(int bPreConfig)
/* copy the auto-config settings to the controller config section */
auto_copy_inputconfig("AutoConfig0", SectionName, "Keyboard");
ActiveControllers++;
ConfigSaveSection(SectionName);
}
else
{
@ -752,7 +711,6 @@ void load_configuration(int bPreConfig)
ConfigSetParameter(section, "device", M64TYPE_INT, &iNoDevice);
if (OrigControlMode[n64CtrlIdx] == E_MODE_FULL_AUTO)
ConfigSetParameter(section, "name", M64TYPE_STRING, "");
ConfigSaveSection(SectionName);
}
}
}
@ -771,7 +729,6 @@ void load_configuration(int bPreConfig)
else
auto_copy_inputconfig("AutoConfig0", "Input-SDL-Control1", NULL); // don't overwrite 'name' parameter
ActiveControllers++;
ConfigSaveSection("Input-SDL-Control1");
}
else
{

View file

@ -1,6 +1,6 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Mupen64plus-input-sdl - config.h *
* Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ *
* Mupen64Plus homepage: https://mupen64plus.org/ *
* Copyright (C) 2009 Richard Goedeken *
* *
* This program is free software; you can redistribute it and/or modify *

View file

@ -1,6 +1,6 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Mupen64plus-core - osal/dynamiclib.h *
* Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ *
* Mupen64Plus homepage: https://mupen64plus.org/ *
* Copyright (C) 2009 Richard Goedeken *
* *
* This program is free software; you can redistribute it and/or modify *

View file

@ -1,6 +1,6 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Mupen64plus-core - osal/dynamiclib_unix.c *
* Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ *
* Mupen64Plus homepage: https://mupen64plus.org/ *
* Copyright (C) 2009 Richard Goedeken *
* *
* This program is free software; you can redistribute it and/or modify *

View file

@ -1,6 +1,6 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Mupen64plus-ui-console - osal_dynamiclib_win32.c *
* Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ *
* Mupen64Plus homepage: https://mupen64plus.org/ *
* Copyright (C) 2009 Richard Goedeken *
* *
* This program is free software; you can redistribute it and/or modify *

View file

@ -1,6 +1,6 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Mupen64plus - osal_preproc.h *
* Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ *
* Mupen64Plus homepage: https://mupen64plus.org/ *
* Copyright (C) 2009 Richard Goedeken *
* Copyright (C) 2002 Hacktarux *
* *

View file

@ -1,6 +1,6 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Mupen64plus-input-sdl - plugin.c *
* Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ *
* Mupen64Plus homepage: https://mupen64plus.org/ *
* Copyright (C) 2008-2011 Richard Goedeken *
* Copyright (C) 2008 Tillin9 *
* Copyright (C) 2002 Blight *
@ -26,6 +26,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#define M64P_PLUGIN_PROTOTYPES 1
#include "config.h"
@ -59,9 +60,7 @@
/* definitions of pointers to Core config functions */
ptr_ConfigOpenSection ConfigOpenSection = NULL;
ptr_ConfigDeleteSection ConfigDeleteSection = NULL;
ptr_ConfigSaveSection ConfigSaveSection = NULL;
ptr_ConfigListParameters ConfigListParameters = NULL;
ptr_ConfigSaveFile ConfigSaveFile = NULL;
ptr_ConfigSetParameter ConfigSetParameter = NULL;
ptr_ConfigGetParameter ConfigGetParameter = NULL;
ptr_ConfigGetParameterHelp ConfigGetParameterHelp = NULL;
@ -86,6 +85,8 @@ SController controller[4]; // 4 controllers
static void (*l_DebugCallback)(void *, int, const char *) = NULL;
static void *l_DebugCallContext = NULL;
static int l_PluginInit = 0;
static int l_joyWasInit = 0;
static int l_hapticWasInit = 0;
static unsigned short button_bits[] = {
0x0001, // R_DPAD
@ -110,12 +111,6 @@ static int romopen = 0; // is a rom opened
static unsigned char myKeyState[SDL_NUM_SCANCODES];
#if __linux__ && !SDL_VERSION_ATLEAST(2,0,0)
static struct ff_effect ffeffect[4];
static struct ff_effect ffstrong[4];
static struct ff_effect ffweak[4];
#endif //__linux__
/* Global functions */
void DebugMessage(int level, const char *message, ...)
{
@ -140,7 +135,7 @@ EXPORT m64p_error CALL PluginStartup(m64p_dynlib_handle CoreLibHandle, void *Con
void (*DebugCallback)(void *, int, const char *))
{
ptr_CoreGetAPIVersions CoreAPIVersionFunc;
int i, ConfigAPIVersion, DebugAPIVersion, VidextAPIVersion;
if (l_PluginInit)
@ -157,7 +152,7 @@ EXPORT m64p_error CALL PluginStartup(m64p_dynlib_handle CoreLibHandle, void *Con
DebugMessage(M64MSG_ERROR, "Core emulator broken; no CoreAPIVersionFunc() function found.");
return M64ERR_INCOMPATIBLE;
}
(*CoreAPIVersionFunc)(&ConfigAPIVersion, &DebugAPIVersion, &VidextAPIVersion, NULL);
if ((ConfigAPIVersion & 0xffff0000) != (CONFIG_API_VERSION & 0xffff0000) || ConfigAPIVersion < CONFIG_API_VERSION)
{
@ -169,8 +164,6 @@ EXPORT m64p_error CALL PluginStartup(m64p_dynlib_handle CoreLibHandle, void *Con
/* Get the core config function pointers from the library handle */
ConfigOpenSection = (ptr_ConfigOpenSection) osal_dynlib_getproc(CoreLibHandle, "ConfigOpenSection");
ConfigDeleteSection = (ptr_ConfigDeleteSection) osal_dynlib_getproc(CoreLibHandle, "ConfigDeleteSection");
ConfigSaveFile = (ptr_ConfigSaveFile) osal_dynlib_getproc(CoreLibHandle, "ConfigSaveFile");
ConfigSaveSection = (ptr_ConfigSaveSection) osal_dynlib_getproc(CoreLibHandle, "ConfigSaveSection");
ConfigListParameters = (ptr_ConfigListParameters) osal_dynlib_getproc(CoreLibHandle, "ConfigListParameters");
ConfigSetParameter = (ptr_ConfigSetParameter) osal_dynlib_getproc(CoreLibHandle, "ConfigSetParameter");
ConfigGetParameter = (ptr_ConfigGetParameter) osal_dynlib_getproc(CoreLibHandle, "ConfigGetParameter");
@ -188,7 +181,7 @@ EXPORT m64p_error CALL PluginStartup(m64p_dynlib_handle CoreLibHandle, void *Con
ConfigGetUserDataPath = (ptr_ConfigGetUserDataPath) osal_dynlib_getproc(CoreLibHandle, "ConfigGetUserDataPath");
ConfigGetUserCachePath = (ptr_ConfigGetUserCachePath) osal_dynlib_getproc(CoreLibHandle, "ConfigGetUserCachePath");
if (!ConfigOpenSection || !ConfigDeleteSection || !ConfigSaveFile || !ConfigSaveSection || !ConfigSetParameter || !ConfigGetParameter ||
if (!ConfigOpenSection || !ConfigDeleteSection || !ConfigSetParameter || !ConfigGetParameter ||
!ConfigSetDefaultInt || !ConfigSetDefaultFloat || !ConfigSetDefaultBool || !ConfigSetDefaultString ||
!ConfigGetParamInt || !ConfigGetParamFloat || !ConfigGetParamBool || !ConfigGetParamString ||
!ConfigGetSharedDataFilepath || !ConfigGetUserConfigPath || !ConfigGetUserDataPath || !ConfigGetUserCachePath)
@ -209,6 +202,15 @@ EXPORT m64p_error CALL PluginStartup(m64p_dynlib_handle CoreLibHandle, void *Con
for (i = 0; i < 4; i++)
controller[i].control = temp_core_controlinfo + i;
/* initialize the joystick subsystem if necessary */
l_joyWasInit = SDL_WasInit(SDL_INIT_JOYSTICK);
if (!l_joyWasInit)
if (SDL_InitSubSystem(SDL_INIT_JOYSTICK) == -1)
{
DebugMessage(M64MSG_ERROR, "Couldn't init SDL joystick subsystem: %s", SDL_GetError() );
return M64ERR_SYSTEM_FAIL;
}
/* read plugin config from core config database, auto-config if necessary and update core database */
load_configuration(1);
@ -225,6 +227,10 @@ EXPORT m64p_error CALL PluginShutdown(void)
l_DebugCallback = NULL;
l_DebugCallContext = NULL;
/* quit the joystick subsystem if necessary */
if (!l_joyWasInit)
SDL_QuitSubSystem(SDL_INIT_JOYSTICK);
l_PluginInit = 0;
return M64ERR_SUCCESS;
}
@ -240,7 +246,7 @@ EXPORT m64p_error CALL PluginGetVersion(m64p_plugin_type *PluginType, int *Plugi
if (APIVersion != NULL)
*APIVersion = INPUT_PLUGIN_API_VERSION;
if (PluginNamePtr != NULL)
*PluginNamePtr = PLUGIN_NAME;
@ -248,7 +254,7 @@ EXPORT m64p_error CALL PluginGetVersion(m64p_plugin_type *PluginType, int *Plugi
{
*Capabilities = 0;
}
return M64ERR_SUCCESS;
}
@ -263,7 +269,7 @@ doSdlKeys(const unsigned char* keystate)
if (keystate[SDL_SCANCODE_RCTRL])
axis_max_val -= 40;
if (keystate[SDL_SCANCODE_RSHIFT])
axis_max_val -= 20;
axis_max_val -= 25;
for( c = 0; c < 4; c++ )
{
@ -295,6 +301,12 @@ doSdlKeys(const unsigned char* keystate)
else
controller[c].buttons.Y_AXIS = -axis_val;
}
// sqrt-2 fix for too-fast diagonal movement
if (abs(controller[c].buttons.X_AXIS) == axis_max_val && abs(controller[c].buttons.Y_AXIS) == axis_max_val)
{
controller[c].buttons.X_AXIS = (int) (controller[c].buttons.X_AXIS / 1.41421356f);
controller[c].buttons.Y_AXIS = (int) (controller[c].buttons.Y_AXIS / 1.41421356f);
}
if (controller[c].mouse)
{
if (keystate[SDL_SCANCODE_LCTRL] && keystate[SDL_SCANCODE_LALT])
@ -304,11 +316,7 @@ doSdlKeys(const unsigned char* keystate)
grabtoggled = 1;
grabmouse = !grabmouse;
// grab/ungrab mouse
#if SDL_VERSION_ATLEAST(2,0,0)
SDL_SetRelativeMouseMode(grabmouse ? SDL_TRUE : SDL_FALSE);
#else
SDL_WM_GrabInput( grabmouse ? SDL_GRAB_ON : SDL_GRAB_OFF );
#endif
SDL_ShowCursor( grabmouse ? 0 : 1 );
}
}
@ -401,39 +409,21 @@ EXPORT void CALL ControllerCommand(int Control, unsigned char *Command)
unsigned int dwAddress = (Command[3] << 8) + (Command[4] & 0xE0);
if (dwAddress == PAK_IO_RUMBLE && *Data)
DebugMessage(M64MSG_VERBOSE, "Triggering rumble pack.");
#if SDL_VERSION_ATLEAST(2,0,0)
if(dwAddress == PAK_IO_RUMBLE && controller[Control].event_joystick) {
#if SDL_VERSION_ATLEAST(2,0,18)
if (*Data) {
SDL_JoystickRumble(controller[Control].joystick, 0xFFFF, 0xFFFF, SDL_HAPTIC_INFINITY);
} else {
SDL_JoystickRumble(controller[Control].joystick, 0, 0, 0);
}
#else
if (*Data) {
SDL_HapticRumblePlay(controller[Control].event_joystick, 1, SDL_HAPTIC_INFINITY);
} else {
SDL_HapticRumbleStop(controller[Control].event_joystick);
}
#endif /* SDL_VERSION_ATLEAST(2,0,18) */
}
#elif __linux__
struct input_event play;
if( dwAddress == PAK_IO_RUMBLE && controller[Control].event_joystick != 0)
{
if( *Data )
{
play.type = EV_FF;
play.code = ffeffect[Control].id;
play.value = 1;
if (write(controller[Control].event_joystick, (const void*) &play, sizeof(play)) == -1)
perror("Error starting rumble effect");
}
else
{
play.type = EV_FF;
play.code = ffeffect[Control].id;
play.value = 0;
if (write(controller[Control].event_joystick, (const void*) &play, sizeof(play)) == -1)
perror("Error stopping rumble effect");
}
}
#endif //__linux__
Data[32] = DataCRC( Data, 32 );
}
break;
@ -467,13 +457,31 @@ EXPORT void CALL GetKeys( int Control, BUTTONS *Keys )
{
static int mousex_residual = 0;
static int mousey_residual = 0;
int b, axis_val;
int b, axis_val, axis_max_val;
SDL_Event event;
unsigned char mstate;
SDL_PumpEvents();
// Handle keyboard input first
doSdlKeys(SDL_GetKeyboardState(NULL));
doSdlKeys(myKeyState);
// attenuate maximum analog stick movement if right shift/control is pressed
axis_max_val = 80;
if (myKeyState[SDL_SCANCODE_RCTRL])
axis_max_val -= 40;
if (myKeyState[SDL_SCANCODE_RSHIFT])
axis_max_val -= 25;
for ( b = 0; b < 4; ++b )
{
if (controller[b].device >= 0)
{
if (!SDL_JoystickGetAttached(controller[b].joystick))
controller[b].joystick = SDL_JoystickOpen(controller[b].device);
}
}
// read joystick state
SDL_JoystickUpdate();
@ -491,7 +499,7 @@ EXPORT void CALL GetKeys( int Control, BUTTONS *Keys )
int deadzone = controller[Control].button[b].axis_deadzone;
axis_val = SDL_JoystickGetAxis( controller[Control].joystick, controller[Control].button[b].axis );
if (deadzone < 0)
deadzone = 6000; /* default */
deadzone = 16384; /* 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 >= deadzone) )
@ -505,6 +513,8 @@ EXPORT void CALL GetKeys( int Control, BUTTONS *Keys )
controller[Control].buttons.Value |= button_bits[b];
}
}
int iX = controller[Control].buttons.X_AXIS;
int iY = controller[Control].buttons.Y_AXIS;
for( b = 0; b < 2; b++ )
{
/* from the N64 func ref: The 3D Stick data is of type signed char and in the range between -80 and +80 */
@ -515,50 +525,53 @@ EXPORT void CALL GetKeys( int Control, BUTTONS *Keys )
continue;
if( b == 0 )
axis_val = controller[Control].buttons.X_AXIS;
axis_val = iX;
else
axis_val = -controller[Control].buttons.Y_AXIS;
axis_val = -iY;
if( controller[Control].axis[b].axis_a >= 0 ) /* up and left for N64 */
{
int joy_val = SDL_JoystickGetAxis(controller[Control].joystick, controller[Control].axis[b].axis_a);
int axis_dir = controller[Control].axis[b].axis_dir_a;
if (joy_val * axis_dir > deadzone)
axis_val = -((abs(joy_val) - deadzone) * 80 / range);
if (axis_val < -80)
axis_val = -80;
axis_val = -((abs(joy_val) - deadzone) * axis_max_val / range);
}
if( controller[Control].axis[b].axis_b >= 0 ) /* down and right for N64 */
{
int joy_val = SDL_JoystickGetAxis(controller[Control].joystick, controller[Control].axis[b].axis_b);
int axis_dir = controller[Control].axis[b].axis_dir_b;
if (joy_val * axis_dir > deadzone)
axis_val = ((abs(joy_val) - deadzone) * 80 / range);
if (axis_val > 80)
axis_val = 80;
axis_val = ((abs(joy_val) - deadzone) * axis_max_val / range);
}
if( controller[Control].axis[b].hat >= 0 )
{
if( controller[Control].axis[b].hat_pos_a >= 0 )
if( SDL_JoystickGetHat( controller[Control].joystick, controller[Control].axis[b].hat ) & controller[Control].axis[b].hat_pos_a )
axis_val = -80;
axis_val = -axis_max_val;
if( controller[Control].axis[b].hat_pos_b >= 0 )
if( SDL_JoystickGetHat( controller[Control].joystick, controller[Control].axis[b].hat ) & controller[Control].axis[b].hat_pos_b )
axis_val = 80;
axis_val = axis_max_val;
}
if( controller[Control].axis[b].button_a >= 0 )
if( SDL_JoystickGetButton( controller[Control].joystick, controller[Control].axis[b].button_a ) )
axis_val = -80;
axis_val = -axis_max_val;
if( controller[Control].axis[b].button_b >= 0 )
if( SDL_JoystickGetButton( controller[Control].joystick, controller[Control].axis[b].button_b ) )
axis_val = 80;
axis_val = axis_max_val;
if( b == 0 )
controller[Control].buttons.X_AXIS = axis_val;
iX = axis_val;
else
controller[Control].buttons.Y_AXIS = -axis_val;
iY = -axis_val;
}
/* store the result */
if (iX < -80) iX = -80;
if (iX > 80) iX = 80;
if (iY < -80) iY = -80;
if (iY > 80) iY = 80;
controller[Control].buttons.X_AXIS = iX;
controller[Control].buttons.Y_AXIS = iY;
}
// process mouse events
@ -573,23 +586,12 @@ EXPORT void CALL GetKeys( int Control, BUTTONS *Keys )
if (controller[Control].mouse)
{
#if SDL_VERSION_ATLEAST(2,0,0)
if (SDL_GetRelativeMouseMode())
#else
if (SDL_WM_GrabInput(SDL_GRAB_QUERY) == SDL_GRAB_ON)
#endif
{
SDL_PumpEvents();
#if SDL_VERSION_ATLEAST(1,3,0)
while (SDL_PeepEvents(&event, 1, SDL_GETEVENT, SDL_MOUSEMOTION, SDL_MOUSEMOTION) == 1)
#else
while (SDL_PeepEvents(&event, 1, SDL_GETEVENT, SDL_EVENTMASK(SDL_MOUSEMOTION)) == 1)
#endif
{
#if SDL_VERSION_ATLEAST(2,0,0)
int w, h;
SDL_Window *focus;
#endif
if (event.motion.xrel)
{
@ -600,7 +602,6 @@ EXPORT void CALL GetKeys( int Control, BUTTONS *Keys )
mousey_residual += (int) (event.motion.yrel * controller[Control].mouse_sens[1]);
}
#if SDL_VERSION_ATLEAST(2,0,0)
focus = SDL_GetKeyboardFocus();
if (focus) {
SDL_GetWindowSize(focus, &w, &h);
@ -609,20 +610,18 @@ EXPORT void CALL GetKeys( int Control, BUTTONS *Keys )
mousex_residual = 0;
mousey_residual = 0;
}
#endif
}
axis_val = mousex_residual;
if (axis_val < -80)
axis_val = -80;
else if (axis_val > 80)
axis_val = 80;
controller[Control].buttons.X_AXIS = axis_val;
axis_val = mousey_residual;
if (axis_val < -80)
axis_val = -80;
else if (axis_val > 80)
axis_val = 80;
controller[Control].buttons.Y_AXIS = -axis_val;
/* store the result */
int iX = mousex_residual;
int iY = -mousey_residual;
if (iX < -80) iX = -80;
if (iX > 80) iX = 80;
if (iY < -80) iY = -80;
if (iY > 80) iY = 80;
controller[Control].buttons.X_AXIS = iX;
controller[Control].buttons.Y_AXIS = iY;
/* the mouse x/y values decay exponentially (returns to center), unless the left "Windows" key is held down */
if (!myKeyState[SDL_SCANCODE_LGUI])
{
@ -643,7 +642,7 @@ EXPORT void CALL GetKeys( int Control, BUTTONS *Keys )
*Keys = controller[Control].buttons;
/* handle mempack / rumblepak switching (only if rumble is active on joystick) */
#if SDL_VERSION_ATLEAST(2,0,0)
#if !SDL_VERSION_ATLEAST(2,0,18)
if (controller[Control].event_joystick) {
static unsigned int SwitchPackTime[4] = {0, 0, 0, 0}, SwitchPackType[4] = {0, 0, 0, 0};
if (controller[Control].buttons.Value & button_bits[14]) {
@ -666,55 +665,13 @@ EXPORT void CALL GetKeys( int Control, BUTTONS *Keys )
SwitchPackTime[Control] = 0;
}
}
#elif __linux__
if (controller[Control].event_joystick != 0)
{
struct input_event play;
static unsigned int SwitchPackTime[4] = {0, 0, 0, 0}, SwitchPackType[4] = {0, 0, 0, 0};
// when the user switches packs, we should mimick the act of removing 1 pack, and then inserting another 1 second later
if (controller[Control].buttons.Value & button_bits[14])
{
SwitchPackTime[Control] = SDL_GetTicks(); // time at which the 'switch pack' command was given
SwitchPackType[Control] = PLUGIN_MEMPAK; // type of new pack to insert
controller[Control].control->Plugin = PLUGIN_NONE;// remove old pack
play.type = EV_FF;
play.code = ffweak[Control].id;
play.value = 1;
if (write(controller[Control].event_joystick, (const void*) &play, sizeof(play)) == -1)
perror("Error starting rumble effect");
}
if (controller[Control].buttons.Value & button_bits[15])
{
SwitchPackTime[Control] = SDL_GetTicks(); // time at which the 'switch pack' command was given
SwitchPackType[Control] = PLUGIN_RAW; // type of new pack to insert
controller[Control].control->Plugin = PLUGIN_NONE;// remove old pack
play.type = EV_FF;
play.code = ffstrong[Control].id;
play.value = 1;
if (write(controller[Control].event_joystick, (const void*) &play, sizeof(play)) == -1)
perror("Error starting rumble effect");
}
// handle inserting new pack if the time has arrived
if (SwitchPackTime[Control] != 0 && (SDL_GetTicks() - SwitchPackTime[Control]) >= 1000)
{
controller[Control].control->Plugin = SwitchPackType[Control];
SwitchPackTime[Control] = 0;
}
}
#endif /* __linux__ */
#endif /* SDL_VERSION_ATLEAST(2,0,18) */
controller[Control].buttons.Value = 0;
}
static void InitiateJoysticks(int cntrl)
{
// init SDL joystick subsystem
if (!SDL_WasInit(SDL_INIT_JOYSTICK))
if (SDL_InitSubSystem(SDL_INIT_JOYSTICK) == -1) {
DebugMessage(M64MSG_ERROR, "Couldn't init SDL joystick subsystem: %s", SDL_GetError() );
return;
}
if (controller[cntrl].device >= 0) {
controller[cntrl].joystick = SDL_JoystickOpen(controller[cntrl].device);
if (!controller[cntrl].joystick)
@ -726,24 +683,31 @@ static void InitiateJoysticks(int cntrl)
static void DeinitJoystick(int cntrl)
{
#if SDL_VERSION_ATLEAST(2,0,0)
if (controller[cntrl].joystick) {
SDL_JoystickClose(controller[cntrl].joystick);
controller[cntrl].joystick = NULL;
}
#endif
}
static void InitiateRumble(int cntrl)
{
#if SDL_VERSION_ATLEAST(2,0,0)
if (!SDL_WasInit(SDL_INIT_HAPTIC)) {
l_hapticWasInit = SDL_WasInit(SDL_INIT_HAPTIC);
if (!l_hapticWasInit) {
if (SDL_InitSubSystem(SDL_INIT_HAPTIC) == -1) {
DebugMessage(M64MSG_ERROR, "Couldn't init SDL haptic subsystem: %s", SDL_GetError() );
return;
}
}
#if SDL_VERSION_ATLEAST(2,0,18)
if (SDL_JoystickHasRumble(controller[cntrl].joystick) == SDL_FALSE) {
DebugMessage(M64MSG_WARNING, "Joystick #%i doesn't support rumble effect", cntrl + 1);
controller[cntrl].event_joystick = 0;
return;
}
controller[cntrl].event_joystick = 1;
#else
controller[cntrl].event_joystick = SDL_HapticOpenFromJoystick(controller[cntrl].joystick);
if (!controller[cntrl].event_joystick) {
DebugMessage(M64MSG_WARNING, "Couldn't open rumble support for joystick #%i", cntrl + 1);
@ -763,120 +727,23 @@ static void InitiateRumble(int cntrl)
DebugMessage(M64MSG_WARNING, "Rumble initialization failed for Joystick #%i", cntrl + 1);
return;
}
#endif /* SDL_VERSION_ATLEAST(2,0,18) */
DebugMessage(M64MSG_INFO, "Rumble activated on N64 joystick #%i", cntrl + 1);
#elif __linux__
DIR* dp;
struct dirent* ep;
unsigned long features[4];
char temp[128];
char temp2[128];
int iFound = 0;
controller[cntrl].event_joystick = 0;
sprintf(temp,"/sys/class/input/js%d/device", controller[cntrl].device);
dp = opendir(temp);
if(dp==NULL)
return;
while ((ep=readdir(dp)))
{
if (strncmp(ep->d_name, "event",5)==0)
{
sprintf(temp, "/dev/input/%s", ep->d_name);
iFound = 1;
break;
}
else if(strncmp(ep->d_name,"input:event", 11)==0)
{
sscanf(ep->d_name, "input:%s", temp2);
sprintf(temp, "/dev/input/%s", temp2);
iFound = 1;
break;
}
else if(strncmp(ep->d_name,"input:input", 11)==0)
{
strcat(temp, "/");
strcat(temp, ep->d_name);
closedir (dp);
dp = opendir(temp);
if(dp==NULL)
return;
}
}
closedir(dp);
if (!iFound)
{
DebugMessage(M64MSG_WARNING, "Couldn't find input event for rumble support.");
return;
}
controller[cntrl].event_joystick = open(temp, O_RDWR);
if(controller[cntrl].event_joystick==-1)
{
DebugMessage(M64MSG_WARNING, "Couldn't open device file '%s' for rumble support.", temp);
controller[cntrl].event_joystick = 0;
return;
}
if(ioctl(controller[cntrl].event_joystick, EVIOCGBIT(EV_FF, sizeof(unsigned long) * 4), features)==-1)
{
DebugMessage(M64MSG_WARNING, "Linux kernel communication failed for force feedback (rumble).\n");
controller[cntrl].event_joystick = 0;
return;
}
if(!test_bit(FF_RUMBLE, features))
{
DebugMessage(M64MSG_WARNING, "No rumble supported on N64 joystick #%i", cntrl + 1);
controller[cntrl].event_joystick = 0;
return;
}
ffeffect[cntrl].type = FF_RUMBLE;
ffeffect[cntrl].id = -1;
ffeffect[cntrl].u.rumble.strong_magnitude = 0xFFFF;
ffeffect[cntrl].u.rumble.weak_magnitude = 0xFFFF;
ffeffect[cntrl].replay.length = 0x7fff; // hack: xboxdrv is buggy and doesn't support infinite replay.
// when xboxdrv is fixed (https://github.com/Grumbel/xboxdrv/issues/47),
// please remove this
ioctl(controller[cntrl].event_joystick, EVIOCSFF, &ffeffect[cntrl]);
ffstrong[cntrl].type = FF_RUMBLE;
ffstrong[cntrl].id = -1;
ffstrong[cntrl].u.rumble.strong_magnitude = 0xFFFF;
ffstrong[cntrl].u.rumble.weak_magnitude = 0x0000;
ffstrong[cntrl].replay.length = 500;
ffstrong[cntrl].replay.delay = 0;
ioctl(controller[cntrl].event_joystick, EVIOCSFF, &ffstrong[cntrl]);
ffweak[cntrl].type = FF_RUMBLE;
ffweak[cntrl].id = -1;
ffweak[cntrl].u.rumble.strong_magnitude = 0x0000;
ffweak[cntrl].u.rumble.weak_magnitude = 0xFFFF;
ffweak[cntrl].replay.length = 500;
ffweak[cntrl].replay.delay = 0;
ioctl(controller[cntrl].event_joystick, EVIOCSFF, &ffweak[cntrl]);
DebugMessage(M64MSG_INFO, "Rumble activated on N64 joystick #%i", cntrl + 1);
#endif /* __linux__ */
}
static void DeinitRumble(int cntrl)
{
#if SDL_VERSION_ATLEAST(2,0,0)
/* quit the haptic subsystem if necessary */
if (!l_hapticWasInit)
SDL_QuitSubSystem(SDL_INIT_HAPTIC);
#if !SDL_VERSION_ATLEAST(2,0,18)
if (controller[cntrl].event_joystick) {
SDL_HapticClose(controller[cntrl].event_joystick);
controller[cntrl].event_joystick = NULL;
}
#endif
#endif /* !SDL_VERSION_ATLEAST(2,0,18) */
}
/******************************************************************
@ -957,15 +824,8 @@ EXPORT void CALL RomClosed(void)
DeinitJoystick(i);
}
// quit SDL joystick subsystem
SDL_QuitSubSystem( SDL_INIT_JOYSTICK );
// release/ungrab mouse
#if SDL_VERSION_ATLEAST(2,0,0)
SDL_SetRelativeMouseMode(SDL_FALSE);
#else
SDL_WM_GrabInput( SDL_GRAB_OFF );
#endif
SDL_ShowCursor( 1 );
romopen = 0;
@ -982,14 +842,6 @@ EXPORT int CALL RomOpen(void)
{
int i;
// init SDL joystick subsystem
if( !SDL_WasInit( SDL_INIT_JOYSTICK ) )
if( SDL_InitSubSystem( SDL_INIT_JOYSTICK ) == -1 )
{
DebugMessage(M64MSG_ERROR, "Couldn't init SDL joystick subsystem: %s", SDL_GetError() );
return 0;
}
// open joysticks
for (i = 0; i < 4; i++) {
InitiateJoysticks(i);
@ -1000,16 +852,9 @@ EXPORT int CALL RomOpen(void)
if (controller[0].mouse || controller[1].mouse || controller[2].mouse || controller[3].mouse)
{
SDL_ShowCursor( 0 );
#if SDL_VERSION_ATLEAST(2,0,0)
if (SDL_SetRelativeMouseMode(SDL_TRUE) < 0) {
DebugMessage(M64MSG_WARNING, "Couldn't grab input! Mouse support won't work!");
}
#else
if (SDL_WM_GrabInput( SDL_GRAB_ON ) != SDL_GRAB_ON)
{
DebugMessage(M64MSG_WARNING, "Couldn't grab input! Mouse support won't work!");
}
#endif
}
romopen = 1;

View file

@ -1,6 +1,6 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Mupen64plus-input-sdl - plugin.h *
* Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ *
* Mupen64Plus homepage: https://mupen64plus.org/ *
* Copyright (C) 2008-2009 Richard Goedeken *
* Copyright (C) 2008 Tillin9 *
* Copyright (C) 2002 Blight *
@ -24,23 +24,14 @@
#ifndef __PLUGIN_H__
#define __PLUGIN_H__
#include <SDL.h>
#include <string.h>
#if ! SDL_VERSION_ATLEAST(1,3,0)
#define SDL_GetKeyboardState SDL_GetKeyState
#define SDL_SCANCODE_UNKNOWN SDLK_UNKNOWN
#define SDL_NUM_SCANCODES SDLK_LAST
#define SDL_SCANCODE_RCTRL SDLK_RCTRL
#define SDL_SCANCODE_RSHIFT SDLK_RSHIFT
#define SDL_SCANCODE_LCTRL SDLK_LCTRL
#define SDL_SCANCODE_LALT SDLK_LALT
#define SDL_SCANCODE_LGUI SDLK_LSUPER
#define SDL_Scancode SDLKey
#if defined(__GNUC__)
#define ATTR_FMT(fmtpos, attrpos) __attribute__ ((format (printf, fmtpos, attrpos)))
#else
#define ATTR_FMT(fmtpos, attrpos)
#endif
#if SDL_VERSION_ATLEAST(2,0,0)
#include <SDL.h>
#include <string.h>
static inline const char* _SDL_JoystickName(int device_index)
{
@ -65,8 +56,6 @@ static inline const char* _SDL_JoystickName(int device_index)
#define SDL_JoystickName(device_index) _SDL_JoystickName(device_index)
#endif
#define M64P_PLUGIN_PROTOTYPES 1
#include "m64p_config.h"
#include "m64p_plugin.h"
@ -137,10 +126,10 @@ typedef struct
int device; // joystick device; -1 = keyboard; -2 = none
int mouse; // mouse enabled: 0 = no; 1 = yes
SDL_Joystick *joystick; // SDL joystick device
#if SDL_VERSION_ATLEAST(2,0,0)
#if SDL_VERSION_ATLEAST(2,0,18)
int event_joystick; // if sdl device has rumble support
#else /* SDL_VERSION_ATLEAST(2,0,0) */
SDL_Haptic *event_joystick; // the sdl device for force feeback
#else
int event_joystick; // the /dev/input/eventX device for force feeback
#endif
int axis_deadzone[2]; // minimum absolute value before analog movement is recognized
int axis_peak[2]; // highest analog value returned by SDL, used for scaling
@ -151,15 +140,13 @@ typedef struct
extern SController controller[4]; // 4 controllers
/* global function definitions */
extern void DebugMessage(int level, const char *message, ...);
extern void DebugMessage(int level, const char *message, ...) ATTR_FMT(2,3);
/* declarations of pointers to Core config functions */
extern ptr_ConfigListSections ConfigListSections;
extern ptr_ConfigOpenSection ConfigOpenSection;
extern ptr_ConfigDeleteSection ConfigDeleteSection;
extern ptr_ConfigListParameters ConfigListParameters;
extern ptr_ConfigSaveFile ConfigSaveFile;
extern ptr_ConfigSaveSection ConfigSaveSection;
extern ptr_ConfigSetParameter ConfigSetParameter;
extern ptr_ConfigGetParameter ConfigGetParameter;
extern ptr_ConfigGetParameterHelp ConfigGetParameterHelp;

View file

@ -1,6 +1,6 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Mupen64plus - sdl_key_converter.c *
* Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ *
* Mupen64Plus homepage: https://mupen64plus.org/ *
* Copyright (C) 2013 Mupen64plus development team *
* *
* This program is free software; you can redistribute it and/or modify *

View file

@ -1,6 +1,6 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Mupen64plus - sdl_key_converter.h *
* Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ *
* Mupen64Plus homepage: https://mupen64plus.org/ *
* Copyright (C) 2013 Mupen64plus development team *
* *
* This program is free software; you can redistribute it and/or modify *
@ -27,8 +27,6 @@
uint16_t sdl_keysym2scancode(uint16_t keysym);
uint16_t sdl_scancode2keysym(uint16_t scancode);
#if SDL_VERSION_ATLEAST(1,3,0)
static osal_inline uint16_t sdl_keysym2native(uint16_t keysym)
{
return sdl_keysym2scancode(keysym);
@ -38,17 +36,3 @@ static osal_inline uint16_t sdl_native2keysym(uint16_t native)
{
return sdl_scancode2keysym(native);
}
#else
static osal_inline uint16_t sdl_keysym2native(uint16_t keysym)
{
return keysym;
}
static osal_inline uint16_t sdl_native2keysym(uint16_t native)
{
return native;
}
#endif

View file

@ -1,6 +1,6 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Mupen64plus-input-sdl - version.h *
* Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ *
* Mupen64Plus homepage: https://mupen64plus.org/ *
* Copyright (C) 2009-2012 Richard Goedeken *
* *
* This program is free software; you can redistribute it and/or modify *
@ -27,8 +27,8 @@
#define VERSION_H
#define PLUGIN_NAME "Mupen64Plus SDL Input Plugin"
#define PLUGIN_VERSION 0x020500
#define INPUT_PLUGIN_API_VERSION 0x020000
#define PLUGIN_VERSION 0x020600
#define INPUT_PLUGIN_API_VERSION 0x020100
#define CONFIG_API_VERSION 0x020100
#define VERSION_PRINTF_SPLIT(x) (((x) >> 16) & 0xffff), (((x) >> 8) & 0xff), ((x) & 0xff)