From c8fa4ffd454434c3597f3d84247f818cd956bf7d Mon Sep 17 00:00:00 2001 From: arcum42 Date: Fri, 22 Jan 2010 15:02:50 +0000 Subject: [PATCH] Fix the release build. Minor Sif changes. git-svn-id: http://pcsx2.googlecode.com/svn/trunk@2473 96395faa-99c1-11dd-bbfe-3dabce05a288 --- pcsx2/R5900OpcodeImpl.cpp | 2 ++ pcsx2/Sif.cpp | 26 ++++++++++++++------------ 2 files changed, 16 insertions(+), 12 deletions(-) diff --git a/pcsx2/R5900OpcodeImpl.cpp b/pcsx2/R5900OpcodeImpl.cpp index 8ad29c5cee..fa47087ce2 100644 --- a/pcsx2/R5900OpcodeImpl.cpp +++ b/pcsx2/R5900OpcodeImpl.cpp @@ -843,6 +843,7 @@ void SYSCALL() } // The only thing this code is used for is the one log message, so don't execute it if we aren't logging bios messages. +#ifdef PCSX2_DEVBUILD if (macTrace.EE.Bios() && (call == 0x77)) { t_sif_dma_transfer *dmat; @@ -865,6 +866,7 @@ void SYSCALL() dmat->dest, dmat->src); } } +#endif cpuRegs.pc -= 4; cpuException(0x20, cpuRegs.branch); diff --git a/pcsx2/Sif.cpp b/pcsx2/Sif.cpp index 8d7084392f..ef5e5ed2db 100644 --- a/pcsx2/Sif.cpp +++ b/pcsx2/Sif.cpp @@ -203,15 +203,13 @@ __forceinline void SIF1EEDma(int &cycles, int &psxCycles, bool &done) else { // There's some data ready to transfer into the fifo.. - int qwTransfer = sif1dma->qwc; tDMA_TAG *pTag; - + + const int qwTransfer = min((s32)sif1dma->qwc, (FIFO_SIF_W - sif1.fifo.size) / 4); + pTag = safeDmaGetAddr(sif1dma, sif1dma->madr, DMAC_SIF1); if (pTag == NULL) return; - if (qwTransfer > (FIFO_SIF_W - sif1.fifo.size) / 4) // Copy part of sif1dma into FIFO - qwTransfer = (FIFO_SIF_W - sif1.fifo.size) / 4; - sif1.fifo.write((u32*)pTag, qwTransfer << 2); sif1dma->madr += qwTransfer << 4; @@ -303,7 +301,9 @@ __forceinline void SIF1IOPDma(int &cycles, int &psxCycles, bool &done) if (sif1.counter <= 0) { - if ((sif1.tagMode & 0x80) || (sif1.tagMode & 0x40)) // Stop on tag IRQ or END + // Stop on tag IRQ or END + + if ((sif1.tagMode & 0x80) || (sif1.tagMode & 0x40)) { if (sif1.tagMode & 0x40) SIF_LOG(" IOP SIF end"); @@ -322,12 +322,14 @@ __forceinline void SIF1IOPDma(int &cycles, int &psxCycles, bool &done) } else if (sif1.fifo.size >= 4) // Read a tag { - struct sifData d; - sif1.fifo.read((u32*)&d, 4); - SIF_LOG(" IOP SIF dest chain tag madr:%08X wc:%04X id:%X irq:%d", d.data & 0xffffff, d.words, DMA_TAG(d.data).ID, DMA_TAG(d.data).IRQ); - HW_DMA10_MADR = d.data & 0xffffff; - sif1.counter = d.words; - sif1.tagMode = (d.data >> 24) & 0xFF; + sif1.fifo.read((u32*)&sif1.data, 4); + SIF_LOG(" IOP SIF dest chain tag madr:%08X wc:%04X id:%X irq:%d", + sif1.data.data & 0xffffff, sif1.data.words, DMA_TAG(sif1.data.data).ID, + DMA_TAG(sif1.data.data).IRQ); + + HW_DMA10_MADR = sif1.data.data & 0xffffff; + sif1.counter = sif1.data.words; + sif1.tagMode = (sif1.data.data >> 24) & 0xFF; done = false; } }