SDL2.0 introduces a new input backend for XInput devices. These have a
different layout (buttons, axis, hats, ...) than the previous backends. This
makes the current AutoConfig entries for such devices useless. Unfortunatelly,
SDL2 doesn't inform us about the backend used to talk to a joystick/gamepad.
This makes it hard to decide whether we must search for an entry without
prefix, with Win32 prefix or with a new "XInput" prefix.
Instead the whole ini is parsed and it is not stopped when a section with a
valid entry is finished. Priorities are saved to decide whether a new found
section is interesting for the user config or not. Entries without a known
prefix have the priority 3, one with a known entry have the priority 2 and
entries with the prefix "XInput" get the priority of 1 on windows with SDL2.
The lowest priority is always preferred.
This allows the autoconfiguration to use XInput configs whenever it is
required and use the old configurations everywhere else.
It is easier for a user to keep the old SDL1.2 values for the keys in the
config instead of converting them by hand. This is extreme important when the
default (automatic) config is used.
The plugin allows to use 4 input devices but only space for the force feedback
effects of 3 devices were provided. A fourth device with force feedback support
caused an invalid access.
n.pepinpe requested in #540 to allow overwriting the automatically searched
CFLAGS and LIBS for used libraries. This should allow distributors to set the
build configuration without patching the makefile. This is important for
systems were pkg-config or sdl-config aren't normally used.
The GCC introduced Link-time optimization in GCC 4.5 (2010-04-14). This should
be long enough available that interested users have upgraded to a compiler
supporting it.
The MSVC project already enabled WholeProgramOptimization since a long time.
Enabling it by default in GCC seems to be equally valid.
The GCC manual states for different parameters that the options for compilation
must also be used when linking. The options for compilation are stored in
CFLAGS and added to LINK.o to fix the behavior.
Option which need this are for example -fPIC/-fPIE or -flto.
The name of the Joystick device is automatically set back to '' when
SDL_JoystickClose(...) is called. The compability wrapper has to store the name
inside a private buffer to provide a similar functionality like pre-SDL2.0
versions of SDL_JoystickName.
The OSX driver seems to name the Controller using the "unique" name
"Controller". Therefore, mapping them to the "Microsoft X-Box 360 pad"
configuration may be a valid workaround for users of compatible gamepads.
The Grab API of SDL now needs the SDL_Window to work. This information is not
provided by Mupen64Plus and therefore such functionality is currently disabled
when building against SDL 2.0. Further adjustments of the Mupen64plus API
should consider moving this functionality do a different part which has access
to all necessary informations.
The Joystick API only changed in such way that it is possible to use a
compatibility wrapper.
SDL 1.3 separated KeyCodes and ScanCodes in its API. The new names for the
scancodes can therefore be easier "backported" than the old name which would be
conflict with the still existing KeyCodes. A simple compatible wrapper is
enough to allow coexistense of SDL 1.2 and SDL 1.3 code.
The POSTFIX make option is useful for distributions to compile different
versions of the plugin in parallel. The object files will be stored in a
directory with the postfix appended and the linker result will also have this
postfix appended.
The CROSS_COMPILE make option can be used to automatically prepend the prefix
to all build relevant tools to seamlessly allow cross compilation without
setting each tool name separately.
Cross compiling for MinGW32 would can be done using
$ make -C projects/unix/ CROSS_COMPILE=i686-pc-mingw32- HOST_CPU=i686 UNAME=MINGW