When on Linux and using libusb from Externals, and with libudev
available, an "undefined reference" error message appears at link time.
This is due to a wrong define being set in CMake for libusb with
libudev. This causes the code for netlink being used instead of the
correct code for libudev support.
Fix the issue by setting the correct define so the correct libusb code
is used.
is_hardware is an obscure name (what does hardware mean?) and it forces
us to assume that anything that !is_hardware is a FileIO device. This
assumption prevents properly restoring OH0 child devices (which will be
implemented in the USB PR), so this commit replaces the is_hardware
bool with a device type.
Confirmed by a hardware test and a quick diassembly of /dev/es.
I'm not aware of anything that opens several ES handles, but
technically, this fixes a small inaccuracy in IOS HLE.
For IOCTL_STM_EVENTHOOK, IOS checks if there is already an event hook
to prevent overriding an existing event hook message with a new one,
without first releasing it.
Currently, the country is always overridden depending on the Wii
language setting. This makes it impossible to change the country
independently from the language, unlike on a Wii, since a language
will always be associated to an unique country (which is hardcoded
in Dolphin's codebase).
This behaviour was added in c881262 and changed in PR 4319 to happen
every time emulation is started. It doesn't seem to be needed anymore,
as a quick testing shows that a Japanese system menu is able to load
in Japanese even with the region set to France, or anything other than
Japan in fact. So what this commit changes is drop this code.
Fixes issue 9884.
Removes #defines which have been unused for years and cleans up
naming.
This also changes IPC_REP_ASYNC to simply IPC_REPLY because it turns
out it's actually not specific to async replies, but used for all
command replies.
- Use an enum instead of defines.
- Only use the FS_ prefix for return codes which are actually related
to FS stuff, not for everything.
- Remove duplicated error codes and clean up the names.
Size is internally stored as a size_t, so having an int parameter
would cause implicit sign-conversion from a signed value to an
unsigned value to occur.
This removes Open() and Close() functions from devices whenever they
did nothing more than the base class (setting m_Active, returning a
default reply).
Also, since IOS close commands practically always return FS_SUCCESS,
writing the return code is moved to HandleCommand() in WII_IPC_HLE,
which has two benefits: it's not duplicated all over the place
(so people will not forget it) and it gets rid of having to check
the force parameter, since HandleCommand() is always called for
real IOS commands, so command_address is guaranteed to be valid.
It looks like at some point Dolphin device IDs coincided with IOS file
descriptors, but this is not the case anymore, so keeping those
WriteReturnCode(GetDeviceID()) in every single IOS HLE device,
as if the device ID was used as IOS fd, is both unnecessary
and confusing.