diff --git a/Source/Core/Core/HW/SI/SI_Device.cpp b/Source/Core/Core/HW/SI/SI_Device.cpp index 03ee5836f4..da18ac595c 100644 --- a/Source/Core/Core/HW/SI/SI_Device.cpp +++ b/Source/Core/Core/HW/SI/SI_Device.cpp @@ -18,6 +18,23 @@ #include "Core/HW/SI/SI_DeviceKeyboard.h" #include "Core/HW/SI/SI_DeviceNull.h" +ISIDevice::ISIDevice(SIDevices device_type, int device_number) + : m_device_number(device_number), m_device_type(device_type) +{ +} + +ISIDevice::~ISIDevice() = default; + +int ISIDevice::GetDeviceNumber() const +{ + return m_device_number; +} + +SIDevices ISIDevice::GetDeviceType() const +{ + return m_device_type; +} + int ISIDevice::RunBuffer(u8* buffer, int length) { #ifdef _DEBUG @@ -48,6 +65,10 @@ int ISIDevice::TransferInterval() return 0; } +void ISIDevice::DoState(PointerWrap& p) +{ +} + // 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 diff --git a/Source/Core/Core/HW/SI/SI_Device.h b/Source/Core/Core/HW/SI/SI_Device.h index 388892bfe0..6702c33969 100644 --- a/Source/Core/Core/HW/SI/SI_Device.h +++ b/Source/Core/Core/HW/SI/SI_Device.h @@ -73,14 +73,12 @@ enum SIDevices : int class ISIDevice { public: - // Constructor - ISIDevice(SIDevices device_type, int device_number) - : m_device_number(device_number), m_device_type(device_type) - { - } + ISIDevice(SIDevices device_type, int device_number); + virtual ~ISIDevice(); + + int GetDeviceNumber() const; + SIDevices GetDeviceType() const; - // Destructor - virtual ~ISIDevice() {} // Run the SI Buffer virtual int RunBuffer(u8* buffer, int length); virtual int TransferInterval(); @@ -92,9 +90,7 @@ public: virtual void SendCommand(u32 command, u8 poll) = 0; // Savestate support - virtual void DoState(PointerWrap& p) {} - int GetDeviceNumber() const { return m_device_number; } - SIDevices GetDeviceType() const { return m_device_type; } + virtual void DoState(PointerWrap& p); protected: int m_device_number;