aboutsummaryrefslogtreecommitdiff
path: root/libpcsxcore/psxdma.c
diff options
context:
space:
mode:
authornotaz2011-06-29 14:35:10 +0300
committernotaz2011-07-08 00:15:20 +0300
commitad418c19cd4ca9a80820593609b786c6993b2eda (patch)
tree545f51e495811f245b5c3625143791546c6174fa /libpcsxcore/psxdma.c
parent64bd6f82e9e86c7fac82c4c5c46056d6b4947826 (diff)
downloadpcsx_rearmed-ad418c19cd4ca9a80820593609b786c6993b2eda.tar.gz
pcsx_rearmed-ad418c19cd4ca9a80820593609b786c6993b2eda.tar.bz2
pcsx_rearmed-ad418c19cd4ca9a80820593609b786c6993b2eda.zip
dma: don't generate irqs after aborted DMA
An idea from Shalma. Verified on real thing with DMA2.
Diffstat (limited to 'libpcsxcore/psxdma.c')
-rw-r--r--libpcsxcore/psxdma.c21
1 files changed, 15 insertions, 6 deletions
diff --git a/libpcsxcore/psxdma.c b/libpcsxcore/psxdma.c
index df79b6d..6d7981f 100644
--- a/libpcsxcore/psxdma.c
+++ b/libpcsxcore/psxdma.c
@@ -27,8 +27,11 @@
// Dma3 in CdRom.c
void spuInterrupt() {
- HW_DMA4_CHCR &= SWAP32(~0x01000000);
- DMA_INTERRUPT(4);
+ if (HW_DMA4_CHCR & SWAP32(0x01000000))
+ {
+ HW_DMA4_CHCR &= SWAP32(~0x01000000);
+ DMA_INTERRUPT(4);
+ }
}
void psxDma4(u32 madr, u32 bcr, u32 chcr) { // SPU
@@ -192,8 +195,11 @@ void psxDma2(u32 madr, u32 bcr, u32 chcr) { // GPU
}
void gpuInterrupt() {
- HW_DMA2_CHCR &= SWAP32(~0x01000000);
- DMA_INTERRUPT(2);
+ if (HW_DMA2_CHCR & SWAP32(0x01000000))
+ {
+ HW_DMA2_CHCR &= SWAP32(~0x01000000);
+ DMA_INTERRUPT(2);
+ }
}
void psxDma6(u32 madr, u32 bcr, u32 chcr) {
@@ -239,6 +245,9 @@ void psxDma6(u32 madr, u32 bcr, u32 chcr) {
void gpuotcInterrupt()
{
- HW_DMA6_CHCR &= SWAP32(~0x01000000);
- DMA_INTERRUPT(6);
+ if (HW_DMA6_CHCR & SWAP32(0x01000000))
+ {
+ HW_DMA6_CHCR &= SWAP32(~0x01000000);
+ DMA_INTERRUPT(6);
+ }
}