EXI_Device: Move implementation details into the cpp file
Any change to the default behavior of any device methods now won't require the recompilation of all EXI devices.
This commit is contained in:
parent
e41a6ac9a3
commit
07a61b0d15
|
@ -40,6 +40,10 @@ u32 IEXIDevice::ImmRead(u32 size)
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void IEXIDevice::ImmReadWrite(u32& data, u32 size)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
void IEXIDevice::DMAWrite(u32 address, u32 size)
|
void IEXIDevice::DMAWrite(u32 address, u32 size)
|
||||||
{
|
{
|
||||||
while (size--)
|
while (size--)
|
||||||
|
@ -59,6 +63,42 @@ void IEXIDevice::DMARead(u32 address, u32 size)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
IEXIDevice* IEXIDevice::FindDevice(TEXIDevices device_type, int custom_index)
|
||||||
|
{
|
||||||
|
return (device_type == m_device_type) ? this : nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool IEXIDevice::UseDelayedTransferCompletion() const
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool IEXIDevice::IsPresent() const
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
void IEXIDevice::SetCS(int cs)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
void IEXIDevice::DoState(PointerWrap& p)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
void IEXIDevice::PauseAndLock(bool do_lock, bool resume_on_unlock)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
bool IEXIDevice::IsInterruptSet()
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
void IEXIDevice::TransferByte(u8& byte)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
// F A C T O R Y
|
// F A C T O R Y
|
||||||
std::unique_ptr<IEXIDevice> EXIDevice_Create(TEXIDevices device_type, const int channel_num)
|
std::unique_ptr<IEXIDevice> EXIDevice_Create(TEXIDevices device_type, const int channel_num)
|
||||||
{
|
{
|
||||||
|
|
|
@ -36,31 +36,31 @@ public:
|
||||||
// Immediate copy functions
|
// Immediate copy functions
|
||||||
virtual void ImmWrite(u32 data, u32 size);
|
virtual void ImmWrite(u32 data, u32 size);
|
||||||
virtual u32 ImmRead(u32 size);
|
virtual u32 ImmRead(u32 size);
|
||||||
virtual void ImmReadWrite(u32& /*data*/, u32 /*size*/) {}
|
virtual void ImmReadWrite(u32& data, u32 size);
|
||||||
|
|
||||||
// DMA copy functions
|
// DMA copy functions
|
||||||
virtual void DMAWrite(u32 address, u32 size);
|
virtual void DMAWrite(u32 address, u32 size);
|
||||||
virtual void DMARead(u32 address, u32 size);
|
virtual void DMARead(u32 address, u32 size);
|
||||||
|
|
||||||
virtual bool UseDelayedTransferCompletion() const { return false; }
|
virtual IEXIDevice* FindDevice(TEXIDevices device_type, int custom_index = -1);
|
||||||
virtual bool IsPresent() const { return false; }
|
|
||||||
virtual void SetCS(int) {}
|
virtual bool UseDelayedTransferCompletion() const;
|
||||||
virtual void DoState(PointerWrap&) {}
|
virtual bool IsPresent() const;
|
||||||
virtual void PauseAndLock(bool do_lock, bool resume_on_unlock = true) {}
|
virtual void SetCS(int cs);
|
||||||
virtual IEXIDevice* FindDevice(TEXIDevices device_type, int custom_index = -1)
|
virtual void DoState(PointerWrap& p);
|
||||||
{
|
virtual void PauseAndLock(bool do_lock, bool resume_on_unlock = true);
|
||||||
return (device_type == m_device_type) ? this : nullptr;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Is generating interrupt ?
|
// Is generating interrupt ?
|
||||||
virtual bool IsInterruptSet() { return false; }
|
virtual bool IsInterruptSet();
|
||||||
// for savestates. storing it here seemed cleaner than requiring each implementation to report its
|
|
||||||
// type.
|
// For savestates. storing it here seemed cleaner than requiring each implementation to report its
|
||||||
// I know this class is set up like an interface, but no code requires it to be strictly such.
|
// type. I know this class is set up like an interface, but no code requires it to be strictly
|
||||||
|
// such.
|
||||||
TEXIDevices m_device_type;
|
TEXIDevices m_device_type;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// Byte transfer function for this device
|
// Byte transfer function for this device
|
||||||
virtual void TransferByte(u8&) {}
|
virtual void TransferByte(u8& byte);
|
||||||
};
|
};
|
||||||
|
|
||||||
std::unique_ptr<IEXIDevice> EXIDevice_Create(const TEXIDevices device_type, const int channel_num);
|
std::unique_ptr<IEXIDevice> EXIDevice_Create(const TEXIDevices device_type, const int channel_num);
|
||||||
|
|
Loading…
Reference in New Issue