Controller: Always check for access byte

This commit is contained in:
Albert Liu 2021-02-21 15:20:31 -08:00
commit 329e8317b4
12 changed files with 100 additions and 39 deletions

View file

@ -314,6 +314,22 @@ bool AnalogController::Transfer(const u8 data_in, u8* data_out)
switch (m_command)
{
case Command::Idle:
{
*data_out = 0xFF;
if (data_in == 0x01)
{
Log_DevPrintf("ACK controller access");
m_command = Command::Ready;
return true;
}
Log_DevPrintf("Unknown data_in = 0x%02X", data_in);
return false;
}
break;
case Command::Ready:
{
if (data_in == 0x42)
{
@ -378,15 +394,8 @@ bool AnalogController::Transfer(const u8 data_in, u8* data_out)
}
else
{
*data_out = 0xFF;
ack = (data_in == 0x01);
if (ack)
Log_DevPrintf("ACK controller access");
else
Log_DevPrintf("Unknown data_in = 0x%02X", data_in);
return ack;
Log_ErrorPrintf("Unimplemented analog controller command 0x%02X", data_in);
Panic("Unimplemented analog controller command");
}
}
break;