From 04eb79093dff2425539894ccefe13051e131168b Mon Sep 17 00:00:00 2001 From: ramapcsx2 Date: Fri, 9 Apr 2010 15:15:43 +0000 Subject: [PATCH] Revision 2822 contains a bug somewhere that we need to figure out. So this reverts all VIF and GIF related code of that revision, leaving only the changes that were made to IPU. Compatibility should be fixed again, with the added bonus of lots more videos working. git-svn-id: http://pcsx2.googlecode.com/svn/trunk@2828 96395faa-99c1-11dd-bbfe-3dabce05a288 --- pcsx2/FiFo.cpp | 11 ++---- pcsx2/Gif.cpp | 42 +++++++++++++-------- pcsx2/Gif.h | 22 ++--------- pcsx2/IPU/IPU.cpp | 9 ++--- pcsx2/Vif.cpp | 18 +++------ pcsx2/Vif0_Dma.cpp | 4 +- pcsx2/Vif1_Dma.cpp | 14 +++---- pcsx2/Vif_Codes.cpp | 15 ++++---- pcsx2/Vif_Dma.h | 16 +------- pcsx2/Vif_Transfer.cpp | 3 +- pcsx2/ps2/GIFpath.cpp | 83 +++++------------------------------------- 11 files changed, 68 insertions(+), 169 deletions(-) diff --git a/pcsx2/FiFo.cpp b/pcsx2/FiFo.cpp index 90ac8c6d01..d8c5c75ba6 100644 --- a/pcsx2/FiFo.cpp +++ b/pcsx2/FiFo.cpp @@ -60,15 +60,10 @@ void __fastcall ReadFIFO_page_5(u32 mem, u64 *out) if (vif1Regs->stat.test(VIF1_STAT_INT | VIF1_STAT_VSS | VIF1_STAT_VIS | VIF1_STAT_VFS) ) DevCon.Warning( "Reading from vif1 fifo when stalled" ); - if(vif1Regs->stat.FQC == 0) Console.Warning("FQC = 0 on VIF FIFO READ!"); if (vif1Regs->stat.FDR) { - if (vif1Regs->stat.FQC > 0) - { - GetMTGS().WaitGS(); - GSreadFIFO(&psHu64(VIF1_FIFO)); - } - if(vif1Regs->stat.FQC > 0)--vif1Regs->stat.FQC; + if (--psHu32(D1_QWC) == 0) + vif1Regs->stat.FQC = 0; } out[0] = psHu64(VIF1_FIFO); @@ -189,4 +184,4 @@ void __fastcall WriteFIFO_page_7(u32 mem, const mem128_t *value) Threading::Timeslice(); } } -} +} \ No newline at end of file diff --git a/pcsx2/Gif.cpp b/pcsx2/Gif.cpp index 939f7084d2..dfa555cb48 100644 --- a/pcsx2/Gif.cpp +++ b/pcsx2/Gif.cpp @@ -56,7 +56,22 @@ __forceinline void gsInterrupt() } - if (GSTransferStatus.PTH3 == STOPPED_MODE) + + if ((vif1.cmd & 0x7e) == 0x50) // DIRECT/HL + { + + //original behaviour here - if (Path3progress != IMAGE_MODE) vif1Regs->stat.VGW = false; + + // Transfer in progress on VIF and GIF has finished so let VIF do its bit + if (Path3progress == STOPPED_MODE) + { + vif1Regs->stat.VGW = false; + CPU_INT( DMAC_GIF, 4 ); + return; + } + } + + if (Path3progress == STOPPED_MODE) { gifRegs->stat.clear_flags(GIF_STAT_APATH3 | GIF_STAT_OPH); } @@ -204,15 +219,12 @@ void GIFdma() gifRegs->stat.FQC |= 0x10;// FQC=31, hack ;) (for values of 31 that equal 16) [ used to be 0xE00; // OPH=1 | APATH=3] //Path2 gets priority in intermittent mode - if (GSTransferStatus.PTH1 != STOPPED_MODE || GSTransferStatus.PTH2 != STOPPED_MODE) + if ((gifRegs->stat.P1Q || (vif1.cmd & 0x7e) == 0x50) && gifRegs->mode.IMT && (Path3progress == STOPPED_MODE)) { // We are in image mode doing DIRECTHL, Path 1 is in queue, and in intermittant mode. - GIF_LOG("Waiting VU %x, PATH2 %x, GIFMODE %x Progress %x", gifRegs->stat.P1Q, (vif1.cmd & 0x7f), gifRegs->mode._u32, GSTransferStatus.PTH3); - if(GSTransferStatus.PTH3 == STOPPED_MODE) - { - CPU_INT(DMAC_GIF, 16); - return; - } + GIF_LOG("Waiting VU %x, PATH2 %x, GIFMODE %x Progress %x", gifRegs->stat.P1Q, (vif1.cmd & 0x7f), gifRegs->mode._u32, Path3progress); + CPU_INT(DMAC_GIF, 16); + return; } if (vif1Regs->mskpath3 || gifRegs->mode.M3R) @@ -230,9 +242,8 @@ void GIFdma() } } - if (GSTransferStatus.PTH3 == STOPPED_MODE) /*|| (vif1Regs->stat._u32 |= VIF1_STAT_VGW) == 0*/ + if (Path3progress == STOPPED_MODE) /*|| (vif1Regs->stat._u32 |= VIF1_STAT_VGW) == 0*/ { - GIF_LOG("PTH3 MASK Continuing VIF"); vif1Regs->stat.VGW = false; if (gif->qwc == 0) CPU_INT(DMAC_GIF, 16); return; @@ -240,7 +251,6 @@ void GIFdma() //Check with Path3 masking games if (gif->qwc > 0) { - GIF_LOG("PTH3 MASK Transferring", ptag[1]._u32, ptag[0]._u32, gif->qwc, ptag->ID, gif->madr); GIFchain(); CPU_INT(DMAC_GIF, gscycles * BIAS); return; @@ -323,7 +333,7 @@ void dmaGIF() //It takes the time of 24 QW for the BUS to become ready - The Punisher And Streetball GIF_LOG("dmaGIFstart chcr = %lx, madr = %lx, qwc = %lx\n tadr = %lx, asr0 = %lx, asr1 = %lx", gif->chcr._u32, gif->madr, gif->qwc, gif->tadr, gif->asr0, gif->asr1); - GSTransferStatus.PTH3 = STOPPED_MODE; + Path3progress = STOPPED_MODE; gspath3done = false; // For some reason this doesn't clear? So when the system starts the thread, we will clear it :) gifRegs->stat.P3Q = true; @@ -536,7 +546,7 @@ void gifMFIFOInterrupt() //Console.WriteLn("gifMFIFOInterrupt"); mfifocycles = 0; - if (GSTransferStatus.PTH3 == STOPPED_MODE) + if (Path3progress == STOPPED_MODE) { gifRegs->stat.APATH = GIF_APATH_IDLE; gifRegs->stat.OPH = false; @@ -555,9 +565,9 @@ void gifMFIFOInterrupt() return; } - if ((gifRegs->stat.P1Q || (vif1.cmd & 0x7f) == 0x50) && gifRegs->mode.IMT && GSTransferStatus.PTH3 == IMAGE_MODE) //Path2 gets priority in intermittent mode + if ((gifRegs->stat.P1Q || (vif1.cmd & 0x7f) == 0x50) && gifRegs->mode.IMT && Path3progress == IMAGE_MODE) //Path2 gets priority in intermittent mode { - //GIF_LOG("Waiting VU %x, PATH2 %x, GIFMODE %x Progress %x", psHu32(GIF_STAT) & 0x100, (vif1.cmd & 0x7f), psHu32(GIF_MODE), GSTransferStatus.PTH3); + //GIF_LOG("Waiting VU %x, PATH2 %x, GIFMODE %x Progress %x", psHu32(GIF_STAT) & 0x100, (vif1.cmd & 0x7f), psHu32(GIF_MODE), Path3progress); CPU_INT(11,mfifocycles); return; } @@ -610,4 +620,4 @@ void SaveStateBase::gifFreeze() Freeze( gscycles ); //Freeze(gifempty); // Note: mfifocycles is not a persistent var, so no need to save it here. -} +} \ No newline at end of file diff --git a/pcsx2/Gif.h b/pcsx2/Gif.h index c79a1cc949..d4f08c72fd 100644 --- a/pcsx2/Gif.h +++ b/pcsx2/Gif.h @@ -26,29 +26,13 @@ enum gifstate_t GIF_STATE_EMPTY = 0x10 }; -enum GSTransferModes //0 = Image Mode (DirectHL), 1 = transferring, 2 = Stopped at End of Packet +enum Path3Modes //0 = Image Mode (DirectHL), 1 = transferring, 2 = Stopped at End of Packet { IMAGE_MODE = 0, TRANSFER_MODE = 1, STOPPED_MODE = 2 }; -union tGSTransferStatus { - struct { - u32 PTH1 : 2; // Resets Vif(0/1) when written. - u32 PTH2 : 2; // Causes a Forcebreak to Vif((0/1) when true. (Stall) - u32 PTH3 : 2; // Stops after the end of the Vifcode in progress when true. (Stall) - u32 reserved : 26; - }; - u32 _u32; - - tGSTransferStatus(u32 val) { _u32 = val; } - bool test (u32 flags) const { return !!(_u32 & flags); } - void set_flags (u32 flags) { _u32 |= flags; } - void clear_flags(u32 flags) { _u32 &= ~flags; } - void reset() { _u32 = 0; } - wxString desc() const { return wxsFormat(L"GSTransferStatus.PTH3: 0x%x", _u32); } -}; //GIF_STAT enum gif_stat_flags { @@ -278,7 +262,7 @@ struct GIFregisters #define gifRegs ((GIFregisters*)(PS2MEM_HW+0x3000)) -extern tGSTransferStatus GSTransferStatus; +extern Path3Modes Path3progress; extern void gsInterrupt(); extern int _GIFchain(); @@ -287,4 +271,4 @@ extern void dmaGIF(); extern void mfifoGIFtransfer(int qwc); extern void gifMFIFOInterrupt(); -#endif +#endif \ No newline at end of file diff --git a/pcsx2/IPU/IPU.cpp b/pcsx2/IPU/IPU.cpp index bf497a608a..e6e1da108d 100644 --- a/pcsx2/IPU/IPU.cpp +++ b/pcsx2/IPU/IPU.cpp @@ -1313,7 +1313,6 @@ static __forceinline int IPU1chain() { return totalqwc; } - //static __forceinline bool flushGIF() //{ // //Wait for all GS paths to be clear @@ -1329,9 +1328,9 @@ static __forceinline int IPU1chain() { static __forceinline void flushGIF() { - if (dmacRegs->ctrl.STD != STD_GIF || (gif->madr + (gif->qwc * 16)) < dmacRegs->stadr.ADDR) + if (dmacRegs->ctrl.STD != STD_GIF || (gif->madr + (gif->qwc * 16)) < dmacRegs->stadr.ADDR) { - while(gif->chcr.STR && (vif1Regs->mskpath3 == 0) && GSTransferStatus.PTH3 != STOPPED_MODE) + while(gif->chcr.STR && (vif1Regs->mskpath3 == 0) && Path3progress != STOPPED_MODE) { GIF_LOG("Flushing gif chcr %x tadr %x madr %x qwc %x", gif->chcr._u32, gif->tadr, gif->madr, gif->qwc); gsInterrupt(); @@ -1339,7 +1338,6 @@ static __forceinline void flushGIF() } } - int IPU1dma() { bool done = FALSE; @@ -1348,7 +1346,8 @@ int IPU1dma() //We need to make sure GIF has flushed before sending IPU data, it seems to REALLY screw FFX videos //if(!flushGIF()) return totalqwc; - flushGIF(); + + flushGIF(); // legacy flushGIF() for now DMA_LOG("IPU1 DMA Called QWC %x Finished %d In Progress %d tadr %x", ipu1dma->qwc, IPU1Status.DMAFinished, IPU1Status.InProgress, ipu1dma->tadr); diff --git a/pcsx2/Vif.cpp b/pcsx2/Vif.cpp index eec195c605..a52268276c 100644 --- a/pcsx2/Vif.cpp +++ b/pcsx2/Vif.cpp @@ -23,7 +23,7 @@ vifStruct vif0; vifStruct vif1; -tGSTransferStatus GSTransferStatus = (STOPPED_MODE<<4) | (STOPPED_MODE<<2) | STOPPED_MODE; +Path3Modes Path3progress = STOPPED_MODE; void vif0Init() { initNewVif(0); } void vif1Init() { initNewVif(1); } @@ -253,23 +253,15 @@ _f void vif1STAT(u32 value) { if (vif1Regs->stat.FDR) // Vif transferring to memory. { // Hack but it checks this is true before transfer? (fatal frame) - // Update Refraction: Use of this function has been investigated and understood. - // Before this ever happens, a DIRECT/HL command takes place sending the transfer info to the GS - // One of the registers told about this is TRXREG which tells us how much data is going to transfer (th x tw) in words - // As far as the GS is concerned, the transfer starts as soon as TRXREG is accessed, which is why fatal frame - // was expecting data, the GS should already be sending it over (buffering in the FIFO) - - vif1Regs->stat.FQC = max((u32)16, vif1.GSLastTRXPOS); - //Console.Warning("Reversing VIF Transfer for %x QWC", vif1.GSLastTRXPOS); - + vif1Regs->stat.FQC = 0x1; } - /*else // Memory transferring to Vif. + else // Memory transferring to Vif. { vif1ch->qwc = 0; vif1.vifstalled = false; vif1.done = true; vif1Regs->stat.FQC = 0; - }*/ + } } #define caseVif(x) (idx ? VIF1_##x : VIF0_##x) @@ -333,4 +325,4 @@ _vifT void vifWrite32(u32 mem, u32 value) { } void vif0Write32(u32 mem, u32 value) { vifWrite32<0>(mem, value); } -void vif1Write32(u32 mem, u32 value) { vifWrite32<1>(mem, value); } +void vif1Write32(u32 mem, u32 value) { vifWrite32<1>(mem, value); } \ No newline at end of file diff --git a/pcsx2/Vif0_Dma.cpp b/pcsx2/Vif0_Dma.cpp index 0c5f563716..4fe446f57a 100644 --- a/pcsx2/Vif0_Dma.cpp +++ b/pcsx2/Vif0_Dma.cpp @@ -152,7 +152,7 @@ __forceinline void vif0Interrupt() // VIF_NORMAL_FROM_MEM_MODE is a very slow operation. // Timesplitters 2 depends on this beeing a bit higher than 128. if (vif0.dmamode == VIF_NORMAL_FROM_MEM_MODE ) CPU_INT(DMAC_VIF0, 1024); - else CPU_INT(DMAC_VIF0, g_vifCycles/*VifCycleVoodoo*/); + else CPU_INT(DMAC_VIF0, /*g_vifCycles*/ VifCycleVoodoo); return; } @@ -167,7 +167,7 @@ __forceinline void vif0Interrupt() if ((vif0.inprogress & 0x1) == 0) vif0SetupTransfer(); - CPU_INT(DMAC_VIF0, g_vifCycles /*VifCycleVoodoo*/); + CPU_INT(DMAC_VIF0, /*g_vifCycles*/ VifCycleVoodoo); return; } diff --git a/pcsx2/Vif1_Dma.cpp b/pcsx2/Vif1_Dma.cpp index cf191bdf56..22aab79652 100644 --- a/pcsx2/Vif1_Dma.cpp +++ b/pcsx2/Vif1_Dma.cpp @@ -195,12 +195,12 @@ __forceinline void vif1Interrupt() VIF_LOG("vif1Interrupt: %8.8x", cpuRegs.cycle); g_vifCycles = 0; - + if (schedulepath3msk) Vif1MskPath3(); if ((vif1Regs->stat.VGW)) { - if ((gif->chcr.STR && (GSTransferStatus.PTH3 != STOPPED_MODE)) || (GSTransferStatus.PTH1 != STOPPED_MODE)) + if (gif->chcr.STR && (Path3progress != STOPPED_MODE)) { CPU_INT(DMAC_VIF1, 4); return; @@ -240,10 +240,8 @@ __forceinline void vif1Interrupt() _VIF1chain(); // VIF_NORMAL_FROM_MEM_MODE is a very slow operation. // Timesplitters 2 depends on this beeing a bit higher than 128. - - // Refraction - Removing voodoo timings for now, completely messes a lot of Path3 masked games. - /*if (vif1.dmamode == VIF_NORMAL_FROM_MEM_MODE ) CPU_INT(DMAC_VIF1, 1024); - else */CPU_INT(DMAC_VIF1, g_vifCycles /*VifCycleVoodoo*/); + if (vif1.dmamode == VIF_NORMAL_FROM_MEM_MODE ) CPU_INT(DMAC_VIF1, 1024); + else CPU_INT(DMAC_VIF1, /*g_vifCycles*/ VifCycleVoodoo); return; } @@ -258,7 +256,7 @@ __forceinline void vif1Interrupt() if ((vif1.inprogress & 0x1) == 0) vif1SetupTransfer(); - CPU_INT(DMAC_VIF1, g_vifCycles /*VifCycleVoodoo*/); + CPU_INT(DMAC_VIF1, /*g_vifCycles*/ VifCycleVoodoo); return; } @@ -335,4 +333,4 @@ void dmaVIF1() // Chain Mode vif1.done = false; vif1Interrupt(); -} +} \ No newline at end of file diff --git a/pcsx2/Vif_Codes.cpp b/pcsx2/Vif_Codes.cpp index c44b312a8c..2fcdf19185 100644 --- a/pcsx2/Vif_Codes.cpp +++ b/pcsx2/Vif_Codes.cpp @@ -78,9 +78,9 @@ void Vif1MskPath3() { if (!vif1Regs->mskpath3) { //Let the Gif know it can transfer again (making sure any vif stall isnt unset prematurely) - GSTransferStatus.PTH3 = TRANSFER_MODE; + Path3progress = TRANSFER_MODE; gifRegs->stat.IMT = false; - if(gif->chcr.STR == true) CPU_INT(DMAC_GIF, 4); + CPU_INT(DMAC_GIF, 4); } else gifRegs->stat.M3P = true; @@ -111,7 +111,7 @@ template _f int _vifCode_Direct(int pass, u8* data, bool isDirectHL) { //Should probably do this for both types of transfer seen as the GS hates taking 2 seperate chunks //if (isDirectHL) { - if (gif->chcr.STR && (!vif1Regs->mskpath3 && (GSTransferStatus.PTH3 != STOPPED_MODE))) + if (gif->chcr.STR && (!vif1Regs->mskpath3 && (Path3progress != STOPPED_MODE))) { /*if(!isDirectHL) DevCon.WriteLn("Direct: Waiting for Path3 to finish!"); else DevCon.WriteLn("DirectHL: Waiting for Path3 to finish!");*/ @@ -125,7 +125,7 @@ template _f int _vifCode_Direct(int pass, u8* data, bool isDirectHL) { Registers::Freeze(); nVifStruct& v = nVif[1]; const int ret = aMin(vif1.vifpacketsize, vif1.tag.size); - u32 size = ret << 2; + s32 size = ret << 2; if (ret == v.vif->tag.size) { // Full Transfer if (v.bSize) { // Last transfer was partial @@ -138,14 +138,13 @@ template _f int _vifCode_Direct(int pass, u8* data, bool isDirectHL) { const uint count = GetMTGS().PrepDataPacket(GIF_PATH_2, data, size >> 4); memcpy_fast(GetMTGS().GetDataPacketPtr(), data, count << 4); GetMTGS().SendDataPacket(); - if((count << 4) < size) Console.Warning("PATH2 end early, count %x, size %x", count << 4, size); vif1.tag.size = 0; vif1.cmd = 0; v.bSize = 0; gifRegs->stat.clear_flags(GIF_STAT_APATH2 | GIF_STAT_OPH); } else { // Partial Transfer - DevCon.WriteLn("DirectHL: Partial Transfer [%d]", size); + //DevCon.WriteLn("DirectHL: Partial Transfer [%d]", size); gifRegs->stat.set_flags(GIF_STAT_APATH2 | GIF_STAT_OPH); memcpy_fast(&v.buffer[v.bSize], data, size); v.bSize += size; @@ -181,7 +180,7 @@ vifOp(vifCode_FlushA) { vif1Only(); pass1 { // Gif is already transferring so wait for it. - if (((GSTransferStatus.PTH3 != STOPPED_MODE) || !vif1Regs->mskpath3) && gif->chcr.STR) { + if (((Path3progress != STOPPED_MODE) || !vif1Regs->mskpath3) && gif->chcr.STR) { //DevCon.WriteLn("FlushA path3 Wait!"); vif1Regs->stat.VGW = true; vifX.vifstalled = true; @@ -468,4 +467,4 @@ int (__fastcall *vif1Code[128])(int pass, u32 *data) = { vifCode_Unpack<1> , vifCode_Unpack<1> , vifCode_Unpack<1> , vifCode_Unpack<1> , vifCode_Unpack<1> , vifCode_Unpack<1> , vifCode_Unpack<1> , vifCode_Unpack<1>, /*0x68*/ vifCode_Unpack<1> , vifCode_Unpack<1> , vifCode_Unpack<1> , vifCode_Unpack<1> , vifCode_Unpack<1> , vifCode_Unpack<1> , vifCode_Unpack<1> , vifCode_Null<1>, /*0x70*/ vifCode_Unpack<1> , vifCode_Unpack<1> , vifCode_Unpack<1> , vifCode_Null<1> , vifCode_Unpack<1> , vifCode_Unpack<1> , vifCode_Unpack<1> , vifCode_Unpack<1> /*0x78*/ -}; +}; \ No newline at end of file diff --git a/pcsx2/Vif_Dma.h b/pcsx2/Vif_Dma.h index 13c8d19bb6..75887a82c6 100644 --- a/pcsx2/Vif_Dma.h +++ b/pcsx2/Vif_Dma.h @@ -24,18 +24,6 @@ struct vifCode { u16 cl; }; -union tBITBLT { - struct { - u32 reserved : 8; - u32 BLTDIVIDE : 8; // This is the value we want to work out the divider for the reverse transfer - u32 reserved2 : 6; - u32 TRXPOS : 16; - }; - u32 _u32; - - -}; - // NOTE, if debugging vif stalls, use sega classics, spyro, gt4, and taito struct vifStruct { vifCode tag; @@ -48,8 +36,6 @@ struct vifStruct { bool done; bool vifstalled; bool stallontag; - tBITBLT TRXPOS; //used for reversed fifo operations, sometimes only the GS knows how big (like on HW register fifo read)! - u32 GSLastTRXPOS; u8 irqoffset; // 32bit offset where next vif code is u32 savedtag; // need this for backwards compat with save states @@ -108,4 +94,4 @@ struct VifMaskTypes u32 Row1[4], Col1[4]; }; -extern __aligned16 VifMaskTypes g_vifmask; // This struct is used by newVif +extern __aligned16 VifMaskTypes g_vifmask; // This struct is used by newVif \ No newline at end of file diff --git a/pcsx2/Vif_Transfer.cpp b/pcsx2/Vif_Transfer.cpp index 26f58da1c1..8c97fed5c1 100644 --- a/pcsx2/Vif_Transfer.cpp +++ b/pcsx2/Vif_Transfer.cpp @@ -74,7 +74,6 @@ _vifT void vifTransferLoop(u32* &data) { iBit = data[0] >> 31; vifXCode[vifX.cmd & 0x7f](0, data); - VIF_LOG("New Vif%d CMD, CMD = %x, iBit = %x, data %x", idx, vifX.cmd, iBit, data[0]); data++; pSize--; if (analyzeIbit(data, iBit)) break; continue; @@ -131,4 +130,4 @@ bool VIF0transfer(u32 *data, int size, bool istag) { } bool VIF1transfer(u32 *data, int size, bool istag) { return vifTransfer<1>(data, size); -} +} \ No newline at end of file diff --git a/pcsx2/ps2/GIFpath.cpp b/pcsx2/ps2/GIFpath.cpp index 93b11c0b4f..2f18a0a62b 100644 --- a/pcsx2/ps2/GIFpath.cpp +++ b/pcsx2/ps2/GIFpath.cpp @@ -236,7 +236,7 @@ __forceinline bool GIFPath::StepReg() return true; } -__forceinline u8 GIFPath::GetReg() { GIF_LOG("Checking reg %x", regs[curreg]); return regs[curreg]; } +__forceinline u8 GIFPath::GetReg() { return regs[curreg]; } // Unpack the registers - registers are stored as a sequence of 4 bit values in the // upper 64 bits of the GIFTAG. That sucks for us when handling partialized GIF packets @@ -277,40 +277,6 @@ void SaveStateBase::gifPathFreeze() static __forceinline void gsHandler(const u8* pMem) { const int handler = pMem[8]; - - if(handler == 0x50) - { - const u16* pMem16 = (const u16*)pMem; - - vif1.TRXPOS._u32 = pMem16[1]; - //Console.Warning("BLITBUF = %x %x_%x_%x_%x", vif1.TRXPOS.BLTDIVIDE, pMem16[0], pMem16[1], pMem16[2], pMem16[3]); - switch(vif1.TRXPOS.BLTDIVIDE & 0x3) - { - case 0x3: - //Console.Warning("8bit"); - vif1.TRXPOS.BLTDIVIDE = 16; //8bit - break; - case 0x2: - //Console.Warning("16bit"); - vif1.TRXPOS.BLTDIVIDE = 8; //16bit - break; - case 0x1: - //Console.Warning("16bit"); - vif1.TRXPOS.BLTDIVIDE = 6; //16bit - break; - default: - //Console.Warning("32bit"); - vif1.TRXPOS.BLTDIVIDE = 4; //32bit - break; - } - } - if(handler == 0x52) - { - const u16* pMem16 = (const u16*)pMem; - //Console.Warning("TRX REG = %x_%x_%x_%x", pMem16[0], pMem16[1], pMem16[2], pMem16[3]); - vif1.GSLastTRXPOS = (pMem16[0] * pMem16[2]) / (u8)vif1.TRXPOS.BLTDIVIDE; - - } if (handler >= 0x60) { // Question: What happens if an app writes to uncharted register space on real PS2 @@ -344,28 +310,14 @@ __forceinline int GIFPath::ParseTag(GIF_PATH pathidx, const u8* pMem, u32 size) SetTag(pMem); incTag(16, 1); - //if (pathidx == GIF_PATH_3) { - switch(pathidx) - { - case GIF_PATH_1: - if (tag.FLG&2) GSTransferStatus.PTH1 = IMAGE_MODE; - else GSTransferStatus.PTH1 = TRANSFER_MODE; - break; - case GIF_PATH_2: - if (tag.FLG&2) GSTransferStatus.PTH2 = IMAGE_MODE; - else GSTransferStatus.PTH2 = TRANSFER_MODE; - break; - case GIF_PATH_3: - if (tag.FLG&2) GSTransferStatus.PTH3 = IMAGE_MODE; - else GSTransferStatus.PTH3 = TRANSFER_MODE; - break; + if (pathidx == GIF_PATH_3) { + if (tag.FLG&2) Path3progress = IMAGE_MODE; + else Path3progress = TRANSFER_MODE; } - //} } else { switch(tag.FLG) { case GIF_FLG_PACKED: - GIF_LOG("Packed Mode"); PrepPackedRegs(); do { if (GetReg() == 0xe) { @@ -376,7 +328,6 @@ __forceinline int GIFPath::ParseTag(GIF_PATH pathidx, const u8* pMem, u32 size) break; case GIF_FLG_REGLIST: { - GIF_LOG("Reglist Mode"); size *= 2; do { incTag(8, 1); } @@ -389,7 +340,6 @@ __forceinline int GIFPath::ParseTag(GIF_PATH pathidx, const u8* pMem, u32 size) case GIF_FLG_IMAGE: case GIF_FLG_IMAGE2: { - GIF_LOG("IMAGE Mode"); int len = aMin(size, nloop); incTag(( len * 16 ), len); nloop -= len; @@ -407,27 +357,14 @@ __forceinline int GIFPath::ParseTag(GIF_PATH pathidx, const u8* pMem, u32 size) size = (startSize - size); - - if (tag.EOP && !nloop) { - //Console.Warning("Finishing path %x", pathidx); - switch(pathidx) - { - case GIF_PATH_1: - GSTransferStatus.PTH1 = STOPPED_MODE; - break; - case GIF_PATH_2: - GSTransferStatus.PTH2 = STOPPED_MODE; - break; - case GIF_PATH_3: - GSTransferStatus.PTH3 = STOPPED_MODE; - break; - } - } if (pathidx == GIF_PATH_3) { + if (tag.EOP && !nloop) { + Path3progress = STOPPED_MODE; + } gif->madr += size * 16; gif->qwc -= size; - } - + } + return size; } @@ -477,4 +414,4 @@ __forceinline void GIFPath_Clear( GIF_PATH pathidx ) memzero(s_gifPath.path[pathidx]); if( GSgifSoftReset == NULL ) return; GetMTGS().SendSimplePacket( GS_RINGTYPE_SOFTRESET, (1<