Commit Graph

175 Commits

Author SHA1 Message Date
Abandoned Cart d7b5533210
Merge pull request #1304 from gameblabla/glesfix
Fixes compiling with GLES and X11
2018-08-21 14:02:06 -04:00
Christoph "baka0815" Schwerdtfeger ad20b55d2c Fix lgtm-warning 2018-08-21 00:33:18 -04:00
Christoph "baka0815" Schwerdtfeger c8baaac632 evdev/MapleType: Controller in port 1 defaults to VMU for Maple device, all other to None
Also allow 0 for "None"
2018-08-21 00:33:18 -04:00
Christoph "baka0815" Schwerdtfeger 638a97d1ae Maple: Reworked the way controllers are created
A new function was introduced to abstract the setup of input devices for each os: os_SetupInput().
I hope I implemented this everywhere correctly and the behaviour is identical to before.

The new function mcfg_CreateNAOMIJamma() creates the NAOMI Jamma interface and is hidden behind a compile flag (same as before).
The previous function mcfg_CreateDevices() was renamed to mcfg_CreateDevicesFromConfig() because it creates the devices based on the configuration (``nb`` setting).
2018-08-21 00:33:18 -04:00
Christoph "baka0815" Schwerdtfeger 7ef105822a evdev: Move creation of controllers
Don't expose mcfg_Create() directly, but use a proxy method mcfg_CreateController() to create the complete controller.
Using evdev the ``nb``-setting in the ``emu.cfg`` is no longer necessary (see #970) as the devices get created while initializing the controllers.

Moved the ``switch`` to it's own function.
2018-08-21 00:32:05 -04:00
Christoph "baka0815" Schwerdtfeger f75ba32fa9 evdev/maple: Set devices via config 2018-08-21 00:32:05 -04:00
Christoph "baka0815" Schwerdtfeger 17d9159b82 evdev: Add maple devices 1 and 2 to mapping & cfg 2018-08-21 00:32:05 -04:00
Ender's Games 78977387ac Reios: perform initial configuration, as needed 2018-08-20 12:28:58 -04:00
gameblabla 8a53efec62
Fixes compiling with GLES and X11 2018-08-20 13:17:01 +02:00
Flyinghead 04b84b90e3 Merge master into fh/mymaster 2018-08-13 18:01:24 +02:00
Christoph "baka0815" Schwerdtfeger 7029af98a3 evdev/dupcheck: Don't check unassigned buttons
Also removes the trailing whitespaces.
2018-08-13 13:10:59 +02:00
Christoph "baka0815" Schwerdtfeger 21ea713032 X11: Values >= 1 enable keyboard 2018-08-12 15:17:56 +02:00
Christoph "baka0815" Schwerdtfeger 369ecf2db2 evdev: Print a warning if a key is not configured 2018-08-12 09:50:14 +02:00
Christoph "baka0815" Schwerdtfeger 891666d9ce evdev: Check for duplicate key assignment 2018-08-11 09:56:13 +02:00
Christoph "baka0815" Schwerdtfeger e2d186f7be evdev: Testing shows: You *can* assign the same device to multiple ports. 2018-08-10 10:16:29 +02:00
Flyinghead 9942bfc86e Merge branch clean-exit-light 2018-08-01 18:02:50 +02:00
Flyinghead 960904c401 Exit cleanly in desktop platforms
Lighter and cleaner version of the previous PR
2018-07-23 19:52:50 +02:00
Stefanos Kornilios Mitsis Poiitidis 95ce251639
Merge pull request #1079 from myfreeweb/master
Build on FreeBSD
2018-07-22 00:37:34 +02:00
Flyinghead 71d7f90858 Merge upstream 2018-07-19 12:19:51 +02:00
Stefanos Kornilios Mitsis Poiitidis a5cf5406cb
Merge pull request #1181 from baka0815/X11
X11: Refactored and fixed buttons
2018-07-18 20:59:02 +02:00
Christoph "baka0815" Schwerdtfeger 2a167e343b X11: use x11_keymap[] for the shoulder trigger
Use DC_AXIS_LT and DC_AXIS_RT for the sliders. They are not real axes on a keyboard, but it fits.
Also hide the printf() behind a define.
2018-07-18 19:31:35 +02:00
Flyinghead 4fced53e25 Dangling pointer in evdev code (electric fence) 2018-07-18 11:19:53 +02:00
Flyinghead 673841d1df Dump frame when F10 pressed 2018-07-16 17:31:52 +02:00
topu 90304f0c67 Fix controller support when building with GCC8 2018-07-15 13:59:37 +02:00
Greg V 5d69e19ed1 Build on FreeBSD (and potentially other BSD) 2018-07-08 15:43:10 +03:00
Flyinghead 3cac9134ce Don't use the window title for debug info as it delays frames 2018-07-06 22:38:48 +02:00
Flyinghead 3c4913a35a Merge remote-tracking branch 'upstream/master' 2018-07-03 15:46:25 +02:00
TwistedUmbrella 75189f0a78
Merge pull request #1180 from baka0815/unused_code
Removed unused code in core/linux-dist/main.cpp
2018-06-14 15:52:23 -04:00
Christoph "baka0815" Schwerdtfeger 3d43505504 Allow for custom <device>.cfg files in the /mappings/ directory.
Check if a configuration file named exactly like the device exists in the /mappings/ directory.
If it does, use this instead of the generic one.

Expose file_exists() from stdclass.
2018-06-13 19:33:51 +02:00
Christoph "baka0815" Schwerdtfeger 2e4cf087bd Refactored and fixed X11 buttons.
Replaced magic number with X11 constants.
Added keys for left and right shoulder buttons.
Added key for (missing) Y button.
Moved the debug printf() where it belongs.
2018-06-13 19:24:48 +02:00
Christoph "baka0815" Schwerdtfeger 8309eb7d6a Added most important X11-keys as constants. 2018-06-13 19:23:20 +02:00
Christoph "baka0815" Schwerdtfeger e6854ef87d Removed unused code in core/linux-dist/main.cpp
This is a leftover from #964
2018-06-13 19:17:20 +02:00
Flyinghead 64a8ac1dd5 Add clean exit patch for x11 and 64-bit architecture 2018-04-27 16:54:15 +02:00
Flyinghead 10bdf7f449 Clean exit when exit key is pressed 2018-04-27 10:37:56 +00:00
Stefan 8c967b0591
Merge pull request #1 from OrN/rpi2-stuff
omx audio backend, and dispmanx window
2018-04-11 21:33:45 +02:00
Promi 5615694ea0 Fix #1051 2017-12-09 15:51:57 +01:00
Jan Holthuis b7fa676546 linux-dist/evdev: Use std::Map.find() instead of operator[]
Since EvdevControllerMapping does not have a default constructor,
we can't use the operator[];

    data_type& operator[](const key_type& k) - Returns a reference to
    the object that is associated with a particular key. If the map
    does not already contain such an object, operator[] inserts the
    default object data_type().

Instead, we use the std::map.find() function.

This should resolve #971.
2016-09-23 12:54:27 +02:00
Preston Smith 6f1fa1ab08 omx audio backend, and dispmanx window 2016-09-21 17:21:13 -05:00
Stefanos Kornilios Mitsis Poiitidis e5d8851316 Merge pull request #964 from Holzhaus/linux-rumble-support
Linux rumble support
2016-09-20 13:49:13 +02:00
Stefanos Kornilios Mitsis Poiitidis 42e6a62fac Merge pull request #877 from KrossX/purupuru
X360 controller support for Windows + Rumble
2016-09-17 22:26:46 +02:00
Jan Holthuis fdc3de7870 Port right motor adjustment to linux version
This adapts KrossX' commit c37c5c42e4 so
that we can use it in the linux version, too.
2016-09-13 14:54:29 +02:00
Phil Eichinger dde4647e55 Fix the check for the enviroment variable
I tried running reicast and it immediately died with:

terminate called after throwing an instance of 'std::logic_error'
  what():  basic_string::_S_construct null not valid
Aborted

I was missing the environment variable XDG_CONFIG_DIRS

Turns out find_system_config_dirs() checked for the existence of
XDG_DATA_DIRS but then tried to use XDG_CONFIG_DIRS (non-existent in my
case).

fixes #847
2016-01-30 10:29:36 +01:00
Jan Holthuis cc5719e845 Linux/evdev: Add Force Feedback/Rumble support 2015-12-14 01:09:03 +01:00
Stefanos Kornilios Mitsis Poiitidis f3e4416bb4 linux/softrend: Cleanup accidental file changes 2015-12-13 14:08:16 +01:00
Stefanos Kornilios Mitsis Poiitidis 62018cf203 linux/softrend: Fix porting bugs, hackplement X11 drawing
- Fix RECT fields oder (initialized via {} on the code)
- Initialize shuffle_alpha (duh ...)
- X11 Image drawing (hacky, depends on internal X11 details)
- Untwidle code w/ optional flipping (X11 doesn't use inverted bitmaps)
- rgba shuffling (not needed yet, but left for documentation)
2015-12-13 14:00:25 +01:00
Stefanos Kornilios Mitsis Poiitidis 5e377399d3 linux/softrend: builds & runs, doesn't push to screen yet 2015-12-13 14:00:25 +01:00
KrossX 832eeeb419 Might help compilation in other platforms
I cannot verify it though.
2015-12-07 21:27:19 -03:00
Stefanos Kornilios Mitsis Poiitidis 543e355259 Merge pull request #826 from reicast/holzhaus/merge-sdl-into-linux-dist
SDL: Merge sdl/ code into linux-dist/ code
2015-09-23 11:42:46 +02:00
Jan Holthuis 76dfeae55c SDL: Remove redundant sdl/ code 2015-09-12 16:31:32 +02:00
Stefanos Kornilios Mitsis Poiitidis 56f8ffac0e Merge pull request #807 from randomstuff/nixprof
Nixprof: some enchancements
2015-09-04 19:55:19 +02:00
Gabriel Corona ad068dcff2 Bind profiling in X11 to F10 2015-09-03 21:08:13 +02:00
Jan Holthuis 4267d51f90 stdclass: Make path getter function names more verbose 2015-09-02 15:49:00 +02:00
Jan Holthuis 5f6480e983 linux-dist: Also add /etc/reicast as system config dir 2015-09-02 15:48:59 +02:00
Jan Holthuis b6d0cddcaa stdclass: Add support for separate config/data dirs and system wide dirs
This adds support for separate config and data dirs.

On Linux, these will be compliant XDG Basedir Specification, i.e.
XDG_CONFIG_HOME and XDG_CONFIG_DIRS (or XDG_DATA_HOME and XDG_DATA_DIRS
respectively). On all other platforms, there currently just set to the
homedir path (so no previous behaviour has been changed).

If reicast wants to read and write a data file, it just calls
get_data_path("/samplefile.txt"). If it does not need to write to
that file, it just uses get_data_path("/samplefile.txt", false). That
way, we can also use system-wide dirs (like /usr/share/reicast on
linux), that the user usually doesn't have write access to.

The same applies for config file, where you use get_config_path(args)
respectively.
2015-09-02 15:48:53 +02:00
Jan Holthuis c24a5faf5b Linux: Use $XDG_CONFIG_HOME if possible
This coommit makes reicast use $XDG_CONFIG_HOME from XDG Base Directory
Specification[1] if possible.

For backwards-compatability with older installations, it checks if the
old-style config directory at $HOME/.reicast exists. If so, it'll use
that instead.

All new installation should use $XDG_CONFIG_HOME/reicast (or if
that environment variable is not set: $HOME/.config/reicast).

[1] http://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html
2015-08-29 01:05:39 +02:00
Jan Holthuis def93ca4be linux/x11: Map X11 ESC key to exit emulator 2015-08-28 04:06:36 +02:00
Jan Holthuis 62029a40b1 linux-dist/joystick: Disable legacy joystick API by default 2015-08-26 01:34:49 +02:00
Jan Holthuis 25b8bb5f29 linux-dist/evdev: Move *_inverted in mappings to compat section 2015-08-26 01:11:16 +02:00
Jan Holthuis 7eab958472 linux-dist/evdev: Print error msg if unable to open mapping file 2015-08-25 21:45:39 +02:00
Jan Holthuis c97727984d linux-dist/evdev: Add absolute mapping file path support 2015-08-25 21:45:39 +02:00
Jan Holthuis e3b796e812 linux-dist/evdev: Always show Keycode names if possible 2015-08-25 21:45:38 +02:00
Jan Holthuis b12f1fa199 linux-dist/evdev: Remove unecessary newlines 2015-08-25 21:45:38 +02:00
Jan Holthuis 785b819cb9 linux-dist/evdev: Introduce a more consistens button naming scheme 2015-08-25 21:45:38 +02:00
Jan Holthuis ceb2a11441 linux-dist/evdev: Clean up namespace a bit 2015-08-25 21:45:38 +02:00
Jan Holthuis 7018ca42c4 linux-dist/evdev: Make controller axes invertable 2015-08-25 21:45:37 +02:00
Jan Holthuis 72778bdf39 linux-dist/evdev: Replace evdev_keycodes.cpp/.h with dynamic libevdev call 2015-08-25 21:45:37 +02:00
Jan Holthuis e4e7e092c2 linux-dist/evdev: Add controller axis value autoconversion 2015-08-25 21:45:37 +02:00
Jan Holthuis 528cd5a793 linux-dist: Drop hardcoded mappings in favor of mapping files 2015-08-25 21:45:32 +02:00
Jan Holthuis 5c01098cab linux-dist/evdev: Support custom mapping files 2015-08-25 21:38:18 +02:00
Jan Holthuis e466cba3e9 linux-dist: Remove unneeded code 2015-08-23 03:18:27 +02:00
Jan Holthuis c0ede35263 Merge pull request #788 from reicast/holzhaus/evdev-raw-keycodes-in-mappings
linux-dist/evdev: Use raw button codes
2015-08-21 19:57:39 +02:00
Jan Holthuis 7b963c941a linux-dist/evdev: Use raw button codes 2015-08-21 15:03:08 +02:00
Jan Holthuis e35518aca1 linux-dist/evdev: Fix evdev_config_key buffer overflow
Fixes #785.
2015-08-21 14:39:55 +02:00
Jan Holthuis 71021175df x11: Add some typecasting so that gcc is happy ;-) 2015-08-21 02:29:14 +02:00
Jan Holthuis e404a5201d x11: Get rid of one platform ifdef 2015-08-21 02:16:48 +02:00
Jan Holthuis ac18a59906 x11: Remove unused code 2015-08-21 02:10:31 +02:00
Jan Holthuis 4dee5652ee x11: Allow starting in fullscreen via config 2015-08-21 02:07:03 +02:00
Jan Holthuis dc6758d847 x11: Use the default x11 display (not always 0) 2015-08-20 17:15:06 +02:00
Jan Holthuis fc2d1edea9 linux-dist/x11: Enable fullscreen toggling via F11 button 2015-08-19 18:47:42 +02:00
Jan Holthuis b0e91185d2 linux-dist: Fix indentation 2015-08-19 12:02:47 +02:00
Jan Holthuis 1661c23680 linux-dist: Fix missing const members in keyboard mapping
On some compiler versions, this caused an error:
../../core/linux-dist/evdev_mappings.cpp:57:3: error: uninitialized
const member ‘s_evdev_controller_mapping::Axis_DPad_X’
../../core/linux-dist/evdev_mappings.cpp:57:3: error: uninitialized
const member ‘s_evdev_controller_mapping::Axis_DPad_Y’
../../core/linux-dist/evdev_mappings.cpp:57:3: error: uninitialized
const member ‘s_evdev_controller_mapping::Axis_DPad2_X’
../../core/linux-dist/evdev_mappings.cpp:57:3: error: uninitialized
const member ‘s_evdev_controller_mapping::Axis_DPad2_Y’
../../core/linux-dist/evdev_mappings.cpp:57:3: error: uninitialized
const member ‘s_evdev_controller_mapping::Axis_Analog_X’
../../core/linux-dist/evdev_mappings.cpp:57:3: error: uninitialized
const member ‘s_evdev_controller_mapping::Axis_Analog_Y’
../../core/linux-dist/evdev_mappings.cpp:57:3: error: uninitialized
const member ‘s_evdev_controller_mapping::Axis_Trigger_Left’
../../core/linux-dist/evdev_mappings.cpp:57:3: error: uninitialized
const member ‘s_evdev_controller_mapping::Axis_Trigger_Right’
2015-08-19 11:59:48 +02:00
Jan Holthuis 223b1284fe linux-dist: Separate xpad and xboxdrv controller mappings 2015-08-19 11:59:48 +02:00
Jan Holthuis 32c3cca681 linux-dist: Fix evdev mapping detection for xboxdrv 2015-08-19 11:59:48 +02:00
Jan Holthuis a408e27cda linux-dist: Don't print EV_MSC events (evdev) 2015-08-19 11:59:48 +02:00
Jan Holthuis 3b2472766d linux-dist: Add evdev keyboard support & option to disable x11 keyboard 2015-08-19 11:59:48 +02:00
Jan Holthuis a2b2b4fd5f linux-dist: Fixed variable reference in Pandora's clean_exit 2015-08-19 11:59:47 +02:00
Jan Holthuis 1843fc3fe4 linux-dist: Move most x11 related code into a separate file 2015-08-19 11:59:47 +02:00
Jan Holthuis 729ded83f6 linux-dist: Move evdev/joystick code into separate files 2015-08-19 11:59:47 +02:00
Jan Holthuis 14ea9e4196 linux-dist: Refactor the evdev input code 2015-08-19 11:59:47 +02:00
Jan Holthuis 452374afab linux-dist: Add evdev multiplayer support 2015-08-19 11:59:47 +02:00
Jan Holthuis 845f101bf0 linux-dist: Add DPad support for xpad kernel driver (XBox 360) 2015-08-19 11:59:47 +02:00
Jan Holthuis 5fe9803743 linux-dist: Improve XBox360 controller support for legacy joystick api 2015-08-19 11:59:47 +02:00
Jan Holthuis 14f77c92d9 linux-dist: Fix bug where trigger values zeroes all the time 2015-08-19 11:59:46 +02:00
Jan Holthuis 275cd3eb73 linux-dist: Add XBox360 controller support via evdev 2015-08-19 11:59:46 +02:00
Jan Holthuis e3fc2cd1b9 linux-dist: Add missing newline in printf calls 2015-08-19 11:59:46 +02:00
Jan Holthuis a49c83b21c linux-dist: Make input devices configurable 2015-08-19 11:59:46 +02:00
Jan Holthuis d76e605aeb linux-dist: Use a switch case in UpdateInputState 2015-08-19 11:59:46 +02:00
Jan Holthuis 73a9269fbd linux-dist: Remove redundant code in input_evdev_handle 2015-08-19 11:59:46 +02:00
Jan Holthuis 87b6a79199 linux-dist: Consolidate evdev/joystick code even further 2015-08-19 11:59:46 +02:00
Jan Holthuis 9dac10ae10 linux-dist: Replace platform ifdefs with USE_EVDEV and USE_JOYSTICK 2015-08-19 11:59:45 +02:00