From 1f2d9ab4e559d3b81447efb1b0387508613a01f9 Mon Sep 17 00:00:00 2001 From: TheLastRar Date: Tue, 15 Oct 2024 16:50:42 +0100 Subject: [PATCH] IOP: Seperate completing DMA8 to a seperate function --- pcsx2/DEV9/DEV9.cpp | 10 ++++++++++ pcsx2/IopDma.cpp | 11 +++++++++-- pcsx2/IopDma.h | 1 + 3 files changed, 20 insertions(+), 2 deletions(-) diff --git a/pcsx2/DEV9/DEV9.cpp b/pcsx2/DEV9/DEV9.cpp index 542f172f8d..4d9b0aabd6 100644 --- a/pcsx2/DEV9/DEV9.cpp +++ b/pcsx2/DEV9/DEV9.cpp @@ -5,6 +5,8 @@ #include "common/Path.h" #include "common/StringUtil.h" +#include "IopDma.h" + #ifdef _WIN32 #include "common/RedtapeWindows.h" #include @@ -916,7 +918,10 @@ void DEV9readDMA8Mem(u32* pMem, int size) DevCon.WriteLn("DEV9: *DEV9readDMA8Mem: size %x", size); if (dev9.dma_ctrl & SPD_DMA_TO_SMAP) + { smap_readDMA8Mem(pMem, size); + psxDMA8Interrupt(); + } else { if (dev9.xfr_ctrl & SPD_XFR_DMAEN && @@ -926,6 +931,7 @@ void DEV9readDMA8Mem(u32* pMem, int size) IOPReadFIFO(size); dev9.ata->ATAreadDMA8Mem((u8*)pMem, size); FIFOIntr(); + psxDMA8Interrupt(); } } @@ -942,7 +948,10 @@ void DEV9writeDMA8Mem(u32* pMem, int size) DevCon.WriteLn("DEV9: *DEV9writeDMA8Mem: size %x", size); if (dev9.dma_ctrl & SPD_DMA_TO_SMAP) + { smap_writeDMA8Mem(pMem, size); + psxDMA8Interrupt(); + } else { if (dev9.xfr_ctrl & SPD_XFR_DMAEN && @@ -952,6 +961,7 @@ void DEV9writeDMA8Mem(u32* pMem, int size) HDDReadFIFO(); dev9.ata->ATAwriteDMA8Mem((u8*)pMem, size); FIFOIntr(); + psxDMA8Interrupt(); } } diff --git a/pcsx2/IopDma.cpp b/pcsx2/IopDma.cpp index d4714151d8..f335133ea7 100644 --- a/pcsx2/IopDma.cpp +++ b/pcsx2/IopDma.cpp @@ -188,8 +188,15 @@ void psxDma8(u32 madr, u32 bcr, u32 chcr) PSXDMA_LOG("*** DMA 8 - DEV9 unknown *** %lx addr = %lx size = %lx", chcr, madr, bcr); break; } - HW_DMA8_CHCR &= ~0x01000000; - psxDmaInterrupt2(1); +} + +void psxDMA8Interrupt() +{ + if (HW_DMA8_CHCR & 0x01000000) + { + HW_DMA8_CHCR &= ~0x01000000; + psxDmaInterrupt2(1); + } } void psxDma9(u32 madr, u32 bcr, u32 chcr) diff --git a/pcsx2/IopDma.h b/pcsx2/IopDma.h index f5eff8f17d..6b3f4c0a1a 100644 --- a/pcsx2/IopDma.h +++ b/pcsx2/IopDma.h @@ -18,6 +18,7 @@ extern void psxDma12(u32 madr, u32 bcr, u32 chcr); extern int psxDma4Interrupt(); extern int psxDma7Interrupt(); +extern void psxDMA8Interrupt(); extern void psxDMA11Interrupt(); extern void psxDMA12Interrupt(); extern void dev9Interrupt();