DEV9: Rewrite suppression of diagnostics IRQ during reset

This commit is contained in:
TheLastRar 2024-10-13 16:28:18 +01:00 committed by lightningterror
parent 1a95bd3088
commit a8a0c5c0bf
4 changed files with 10 additions and 9 deletions

View File

@ -234,8 +234,8 @@ private:
void HDD_WriteDMA(bool isLBA48);
void PreCmdExecuteDeviceDiag();
void PostCmdExecuteDeviceDiag();
void HDD_ExecuteDeviceDiag();
void PostCmdExecuteDeviceDiag(bool sendIRQ);
void HDD_ExecuteDeviceDiag(bool sendIRQ);
void PostCmdNoData();
void CmdNoDataAbort();

View File

@ -317,8 +317,7 @@ void ATA::ResetEnd(bool hard)
mdmaMode = 2;
}
regControlEnableIRQ = false;
HDD_ExecuteDeviceDiag();
HDD_ExecuteDeviceDiag(false);
regControlEnableIRQ = true;
}

View File

@ -12,20 +12,22 @@ void ATA::PreCmdExecuteDeviceDiag()
//dev9.spd.regIntStat &= unchecked((UInt16)~DEV9Header.ATA_INTR_DMA_RDY); //Is this correct?
}
void ATA::PostCmdExecuteDeviceDiag()
void ATA::PostCmdExecuteDeviceDiag(bool sendIRQ)
{
regStatus &= ~ATA_STAT_BUSY;
regStatus |= ATA_STAT_READY;
SetSelectedDevice(0);
if (regControlEnableIRQ)
// If Device Diagnostics is performed as part of a reset
// then we don't raise an IRQ or set pending interrupt
if (regControlEnableIRQ && sendIRQ)
_DEV9irq(ATA_INTR_INTRQ, 1);
}
//GENRAL FEATURE SET
void ATA::HDD_ExecuteDeviceDiag()
void ATA::HDD_ExecuteDeviceDiag(bool sendIRQ)
{
PreCmdExecuteDeviceDiag();
//Perform Self Diag
@ -44,5 +46,5 @@ void ATA::HDD_ExecuteDeviceDiag()
regStatus &= ~ATA_STAT_ECC;
regStatus &= ~ATA_STAT_ERR;
PostCmdExecuteDeviceDiag();
PostCmdExecuteDeviceDiag(sendIRQ);
}

View File

@ -39,7 +39,7 @@ void ATA::IDE_ExecCmd(u16 value)
HDD_SeekCmd();
break;
case 0x90:
HDD_ExecuteDeviceDiag();
HDD_ExecuteDeviceDiag(true);
break;
case 0x91:
HDD_InitDevParameters();