mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-01-24 15:01:16 +01:00
Implement STOP_TRANSMISSION and APP_CMD SD_SEND_OP_COND
Both of these are used by Pokémon Channel. However, Pokémon Channel actually DOES care about CRCs, so... yay.
This commit is contained in:
parent
251c330c6d
commit
c80c323a26
@ -57,7 +57,6 @@ u32 CEXISD::ImmRead(u32 size)
|
|||||||
u8 byte = ReadByte();
|
u8 byte = ReadByte();
|
||||||
res |= byte << (24 - (position++ * 8));
|
res |= byte << (24 - (position++ * 8));
|
||||||
}
|
}
|
||||||
INFO_LOG_FMT(EXPANSIONINTERFACE, "Responding with {:08x}", res);
|
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -123,8 +122,10 @@ void CEXISD::WriteByte(u8 byte)
|
|||||||
}
|
}
|
||||||
else if (cmd[0] == 0x41) // SEND_OP_COND
|
else if (cmd[0] == 0x41) // SEND_OP_COND
|
||||||
{
|
{
|
||||||
// R1
|
// Used by libogc for non-SDHC cards
|
||||||
response.push_back(0);
|
bool hcs = cmd[1] & 0x40; // Host Capacity Support (for SDHC/SDXC cards)
|
||||||
|
(void)hcs;
|
||||||
|
response.push_back(0); // R1 - not idle
|
||||||
}
|
}
|
||||||
else if (cmd[0] == 0x48) // SEND_IF_COND
|
else if (cmd[0] == 0x48) // SEND_IF_COND
|
||||||
{
|
{
|
||||||
@ -265,6 +266,11 @@ void CEXISD::WriteByte(u8 byte)
|
|||||||
response.push_back(0);
|
response.push_back(0);
|
||||||
response.push_back(0);
|
response.push_back(0);
|
||||||
}
|
}
|
||||||
|
else if (cmd[0] == 0x4c) // STOP_TRANSMISSION
|
||||||
|
{
|
||||||
|
response.push_back(0); // R1
|
||||||
|
// There can be further padding bytes, but it's not needed
|
||||||
|
}
|
||||||
else if (cmd[0] == 0x50) // SET_BLOCKLEN
|
else if (cmd[0] == 0x50) // SET_BLOCKLEN
|
||||||
{
|
{
|
||||||
response.push_back(0); // R1
|
response.push_back(0); // R1
|
||||||
@ -287,6 +293,13 @@ void CEXISD::WriteByte(u8 byte)
|
|||||||
response.push_back(0);
|
response.push_back(0);
|
||||||
response.push_back(0);
|
response.push_back(0);
|
||||||
}
|
}
|
||||||
|
else if (cmd[0] == 0x69) // APP_CMD SD_SEND_OP_COND
|
||||||
|
{
|
||||||
|
// Used by Pokémon Channel for all cards, and libogc for SDHC cards
|
||||||
|
bool hcs = cmd[1] & 0x40; // Host Capacity Support (for SDHC/SDXC cards)
|
||||||
|
(void)hcs;
|
||||||
|
response.push_back(0); // R1 - not idle
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// Don't know it
|
// Don't know it
|
||||||
@ -300,7 +313,7 @@ u8 CEXISD::ReadByte()
|
|||||||
{
|
{
|
||||||
if (response.empty())
|
if (response.empty())
|
||||||
{
|
{
|
||||||
WARN_LOG_FMT(EXPANSIONINTERFACE, "Attempted to read from empty SD queue");
|
// WARN_LOG_FMT(EXPANSIONINTERFACE, "Attempted to read from empty SD queue");
|
||||||
return 0xFF;
|
return 0xFF;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
Loading…
x
Reference in New Issue
Block a user