IOP: Seperate completing DMA8 to a seperate function

This commit is contained in:
TheLastRar 2024-10-15 16:50:42 +01:00 committed by Ty
parent 0806ca442a
commit 1f2d9ab4e5
3 changed files with 20 additions and 2 deletions

View File

@ -5,6 +5,8 @@
#include "common/Path.h" #include "common/Path.h"
#include "common/StringUtil.h" #include "common/StringUtil.h"
#include "IopDma.h"
#ifdef _WIN32 #ifdef _WIN32
#include "common/RedtapeWindows.h" #include "common/RedtapeWindows.h"
#include <winioctl.h> #include <winioctl.h>
@ -916,7 +918,10 @@ void DEV9readDMA8Mem(u32* pMem, int size)
DevCon.WriteLn("DEV9: *DEV9readDMA8Mem: size %x", size); DevCon.WriteLn("DEV9: *DEV9readDMA8Mem: size %x", size);
if (dev9.dma_ctrl & SPD_DMA_TO_SMAP) if (dev9.dma_ctrl & SPD_DMA_TO_SMAP)
{
smap_readDMA8Mem(pMem, size); smap_readDMA8Mem(pMem, size);
psxDMA8Interrupt();
}
else else
{ {
if (dev9.xfr_ctrl & SPD_XFR_DMAEN && if (dev9.xfr_ctrl & SPD_XFR_DMAEN &&
@ -926,6 +931,7 @@ void DEV9readDMA8Mem(u32* pMem, int size)
IOPReadFIFO(size); IOPReadFIFO(size);
dev9.ata->ATAreadDMA8Mem((u8*)pMem, size); dev9.ata->ATAreadDMA8Mem((u8*)pMem, size);
FIFOIntr(); FIFOIntr();
psxDMA8Interrupt();
} }
} }
@ -942,7 +948,10 @@ void DEV9writeDMA8Mem(u32* pMem, int size)
DevCon.WriteLn("DEV9: *DEV9writeDMA8Mem: size %x", size); DevCon.WriteLn("DEV9: *DEV9writeDMA8Mem: size %x", size);
if (dev9.dma_ctrl & SPD_DMA_TO_SMAP) if (dev9.dma_ctrl & SPD_DMA_TO_SMAP)
{
smap_writeDMA8Mem(pMem, size); smap_writeDMA8Mem(pMem, size);
psxDMA8Interrupt();
}
else else
{ {
if (dev9.xfr_ctrl & SPD_XFR_DMAEN && if (dev9.xfr_ctrl & SPD_XFR_DMAEN &&
@ -952,6 +961,7 @@ void DEV9writeDMA8Mem(u32* pMem, int size)
HDDReadFIFO(); HDDReadFIFO();
dev9.ata->ATAwriteDMA8Mem((u8*)pMem, size); dev9.ata->ATAwriteDMA8Mem((u8*)pMem, size);
FIFOIntr(); FIFOIntr();
psxDMA8Interrupt();
} }
} }

View File

@ -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); PSXDMA_LOG("*** DMA 8 - DEV9 unknown *** %lx addr = %lx size = %lx", chcr, madr, bcr);
break; 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) void psxDma9(u32 madr, u32 bcr, u32 chcr)

View File

@ -18,6 +18,7 @@ extern void psxDma12(u32 madr, u32 bcr, u32 chcr);
extern int psxDma4Interrupt(); extern int psxDma4Interrupt();
extern int psxDma7Interrupt(); extern int psxDma7Interrupt();
extern void psxDMA8Interrupt();
extern void psxDMA11Interrupt(); extern void psxDMA11Interrupt();
extern void psxDMA12Interrupt(); extern void psxDMA12Interrupt();
extern void dev9Interrupt(); extern void dev9Interrupt();