== DETAILS
We discovered that the controller_patcher code was causing
the WiiU to intermittently crash when switching ROMs.
Changes:
- Completely extricates the controller_patcher code
- Create a skeleton wiiu_hid driver
- Wire up the build system to build/link it successfully
== TESTING
Has not been tested. Probably doesn't crash, since the
skeleton driver is just a copy of the null driver.
As discussed in libretro#5357; controller_patcher is now optional. It's
off by default; though this could be changed with a simple makefile
tweak (ENABLE_CONTROLLER_PATCHER ?= 1, perhaps?)
To re-enable controller_patcher; append ENABLE_CONTROLLER_PATCHER=1 to
your usual make command.
controller_patcher was the only user of c++ constructors in the Wii U
port, so you'll need 26a006c in your tree otherwise you will have a
blackscreen on startup.
The old setup relied on there being at least one constructor *or* the
value of *__CTOR_LIST__ being NULL. Neither of these are guaranteed; and
having no C++ constructors actually resulted in a random value being
read (which passed the NULL check!). This new setup uses the
__CTOR_END__ symbol; which is a pointer to just after the end of the
list. When there are no constructors, it has the same value as
__CTOR_LIST__; so the while loop is never entered.
This fix also allows us to re-enable destructors; in case they're ever
needed.
CFSearchPathForDirectoriesInDomains returns a path in /var, while
getenv(HOME) returns the same path in /private/var. /var is a symlink
to /private/var, but when config is generated, the difference in paths
means they won't be abbreviated correctly.
This change expands symlinks before filling in the default
directories, so those paths will match.