diff --git a/Source/Core/Core/HW/SI_Device.cpp b/Source/Core/Core/HW/SI_Device.cpp index c239ee1350..56c27b94df 100644 --- a/Source/Core/Core/HW/SI_Device.cpp +++ b/Source/Core/Core/HW/SI_Device.cpp @@ -67,6 +67,26 @@ public: }; +// Check if a device class is inheriting from CSIDevice_GCController +// The goal of this function is to avoid special casing a long list of +// device types when there is no "real" input device, e.g. when playing +// a TAS movie, or netplay input. +bool SIDevice_IsGCController(SIDevices type) +{ + switch (type) + { + case SIDEVICE_GC_CONTROLLER: + case SIDEVICE_WIIU_ADAPTER: + case SIDEVICE_GC_TARUKONGA: + case SIDEVICE_DANCEMAT: + case SIDEVICE_GC_STEERING: + return true; + default: + return false; + } +} + + // F A C T O R Y std::unique_ptr SIDevice_Create(const SIDevices device, const int port_number) { diff --git a/Source/Core/Core/HW/SI_Device.h b/Source/Core/Core/HW/SI_Device.h index 866ae98e2a..5671cfba05 100644 --- a/Source/Core/Core/HW/SI_Device.h +++ b/Source/Core/Core/HW/SI_Device.h @@ -107,4 +107,6 @@ public: } }; +bool SIDevice_IsGCController(SIDevices type); + std::unique_ptr SIDevice_Create(const SIDevices device, const int port_number);