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:
Lioncash 2017-01-22 04:16:25 -05:00
parent e41a6ac9a3
commit 07a61b0d15
2 changed files with 55 additions and 15 deletions

View File

@ -40,6 +40,10 @@ u32 IEXIDevice::ImmRead(u32 size)
return result;
}
void IEXIDevice::ImmReadWrite(u32& data, u32 size)
{
}
void IEXIDevice::DMAWrite(u32 address, u32 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
std::unique_ptr<IEXIDevice> EXIDevice_Create(TEXIDevices device_type, const int channel_num)
{

View File

@ -36,31 +36,31 @@ public:
// Immediate copy functions
virtual void ImmWrite(u32 data, u32 size);
virtual u32 ImmRead(u32 size);
virtual void ImmReadWrite(u32& /*data*/, u32 /*size*/) {}
virtual void ImmReadWrite(u32& data, u32 size);
// DMA copy functions
virtual void DMAWrite(u32 address, u32 size);
virtual void DMARead(u32 address, u32 size);
virtual bool UseDelayedTransferCompletion() const { return false; }
virtual bool IsPresent() const { return false; }
virtual void SetCS(int) {}
virtual void DoState(PointerWrap&) {}
virtual void PauseAndLock(bool do_lock, bool resume_on_unlock = true) {}
virtual IEXIDevice* FindDevice(TEXIDevices device_type, int custom_index = -1)
{
return (device_type == m_device_type) ? this : nullptr;
}
virtual IEXIDevice* FindDevice(TEXIDevices device_type, int custom_index = -1);
virtual bool UseDelayedTransferCompletion() const;
virtual bool IsPresent() const;
virtual void SetCS(int cs);
virtual void DoState(PointerWrap& p);
virtual void PauseAndLock(bool do_lock, bool resume_on_unlock = true);
// Is generating interrupt ?
virtual bool IsInterruptSet() { return false; }
// for savestates. storing it here seemed cleaner than requiring each implementation to report its
// type.
// I know this class is set up like an interface, but no code requires it to be strictly such.
virtual bool IsInterruptSet();
// For savestates. storing it here seemed cleaner than requiring each implementation to report its
// type. I know this class is set up like an interface, but no code requires it to be strictly
// such.
TEXIDevices m_device_type;
private:
// 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);