Only return SD device when CS is 0

This is NOT needed to fix anything, but still seems like a good idea to me.  Though getting a device based on CS still seems less than perfect (e.g. what does the hardware do if multiple chips are selected at the same time?  Probably it doesn't handle it well, but it might still be worth emulating...)
This commit is contained in:
Pokechu22 2020-09-12 17:58:05 -07:00
parent d53407252e
commit bb432b6a9e

View File

@ -230,7 +230,11 @@ IEXIDevice* CEXIChannel::GetDevice(const u8 chip_select)
{
switch (chip_select)
{
case 0: // HACK - SD
case 0: // SD responds when the CS signal is 0, instead of 1.
if (m_devices[0] && m_devices[0]->m_device_type == EXIDeviceType::SD)
return m_devices[0].get();
else
return nullptr;
case 1:
return m_devices[0].get();
case 2: