diff --git a/pcsx2/DEV9/ATA/ATA.h b/pcsx2/DEV9/ATA/ATA.h index b2d5a523a9..456e94f1bc 100644 --- a/pcsx2/DEV9/ATA/ATA.h +++ b/pcsx2/DEV9/ATA/ATA.h @@ -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(); diff --git a/pcsx2/DEV9/ATA/ATA_State.cpp b/pcsx2/DEV9/ATA/ATA_State.cpp index e18bcc1e21..a96444adb2 100644 --- a/pcsx2/DEV9/ATA/ATA_State.cpp +++ b/pcsx2/DEV9/ATA/ATA_State.cpp @@ -317,8 +317,7 @@ void ATA::ResetEnd(bool hard) mdmaMode = 2; } - regControlEnableIRQ = false; - HDD_ExecuteDeviceDiag(); + HDD_ExecuteDeviceDiag(false); regControlEnableIRQ = true; } diff --git a/pcsx2/DEV9/ATA/Commands/ATA_CmdExecuteDeviceDiag.cpp b/pcsx2/DEV9/ATA/Commands/ATA_CmdExecuteDeviceDiag.cpp index 6f8c115d44..00c0a9441b 100644 --- a/pcsx2/DEV9/ATA/Commands/ATA_CmdExecuteDeviceDiag.cpp +++ b/pcsx2/DEV9/ATA/Commands/ATA_CmdExecuteDeviceDiag.cpp @@ -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); } diff --git a/pcsx2/DEV9/ATA/Commands/ATA_Command.cpp b/pcsx2/DEV9/ATA/Commands/ATA_Command.cpp index 1e6532d5ce..a7b6b08ac4 100644 --- a/pcsx2/DEV9/ATA/Commands/ATA_Command.cpp +++ b/pcsx2/DEV9/ATA/Commands/ATA_Command.cpp @@ -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();