``input_evdev_init(EvdevController* controller, const char* device, const char* mapping_fname)`` and ``input_evdev_button_duplicate_button(EvdevControllerMapping* mapping1, EvdevControllerMapping* mapping2)`` are no longer used outside evdev.cpp
Needed to move ``input_evdev_init()`` around a bit.
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).
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.
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.
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.
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.
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
- 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)
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.
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
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’