mirror of https://github.com/PCSX2/pcsx2.git
wxgui: sync with trunk (microVU + ee loadstore cycles + improved plugin logging).
* Fixed crash on exit, caused by logging. * Updated versioning in main window and console. git-svn-id: http://pcsx2.googlecode.com/svn/branches/wxgui@1751 96395faa-99c1-11dd-bbfe-3dabce05a288
This commit is contained in:
commit
43d9aef534
|
@ -15,4 +15,4 @@
|
||||||
// TortoiseSVN can be downloaded from http://tortoisesvn.tigris.org
|
// TortoiseSVN can be downloaded from http://tortoisesvn.tigris.org
|
||||||
|
|
||||||
#define SVN_REV $WCREV$
|
#define SVN_REV $WCREV$
|
||||||
#define SVN_MODS $WCMODS?1:0$
|
#define SVN_MODS $WCMODS?1:0$
|
||||||
|
|
|
@ -26,8 +26,6 @@
|
||||||
//#define PSXCLK 186864000 /* 36.864 Mhz */
|
//#define PSXCLK 186864000 /* 36.864 Mhz */
|
||||||
#define PS2CLK 294912000 //hz /* 294.912 mhz */
|
#define PS2CLK 294912000 //hz /* 294.912 mhz */
|
||||||
|
|
||||||
#define PCSX2_VERSION "beta"
|
|
||||||
|
|
||||||
#include "System.h"
|
#include "System.h"
|
||||||
|
|
||||||
#include "Plugins.h"
|
#include "Plugins.h"
|
||||||
|
|
|
@ -72,7 +72,7 @@ __forceinline void gsInterrupt()
|
||||||
|
|
||||||
if ((gif->qwc > 0) || (gspath3done == 0))
|
if ((gif->qwc > 0) || (gspath3done == 0))
|
||||||
{
|
{
|
||||||
if (!(psHu32(DMAC_CTRL) & 0x1))
|
if (!dmacRegs->ctrl.DMAE)
|
||||||
{
|
{
|
||||||
Console::Notice("gs dma masked, re-scheduling...");
|
Console::Notice("gs dma masked, re-scheduling...");
|
||||||
// re-raise the int shortly in the future
|
// re-raise the int shortly in the future
|
||||||
|
@ -192,13 +192,13 @@ void GIFdma()
|
||||||
|
|
||||||
gscycles = prevcycles;
|
gscycles = prevcycles;
|
||||||
|
|
||||||
if ((psHu32(GIF_CTRL) & 8)) // temporarily stop
|
if (gifRegs->ctrl.PSE) // temporarily stop
|
||||||
{
|
{
|
||||||
Console::WriteLn("Gif dma temp paused?");
|
Console::WriteLn("Gif dma temp paused?");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (((psHu32(DMAC_CTRL) & 0xC0) == 0x80) && (prevcycles != 0)) // STD == GIF
|
if ((dmacRegs->ctrl.STD == STD_GIF) && (prevcycles != 0))
|
||||||
{
|
{
|
||||||
Console::WriteLn("GS Stall Control Source = %x, Drain = %x\n MADR = %x, STADR = %x", params (psHu32(0xe000) >> 4) & 0x3, (psHu32(0xe000) >> 6) & 0x3, gif->madr, psHu32(DMAC_STADR));
|
Console::WriteLn("GS Stall Control Source = %x, Drain = %x\n MADR = %x, STADR = %x", params (psHu32(0xe000) >> 4) & 0x3, (psHu32(0xe000) >> 6) & 0x3, gif->madr, psHu32(DMAC_STADR));
|
||||||
|
|
||||||
|
@ -217,14 +217,14 @@ void GIFdma()
|
||||||
psHu32(GIF_STAT) |= 0x10000000; // FQC=31, hack ;) [ used to be 0xE00; // OPH=1 | APATH=3]
|
psHu32(GIF_STAT) |= 0x10000000; // FQC=31, hack ;) [ used to be 0xE00; // OPH=1 | APATH=3]
|
||||||
|
|
||||||
//Path2 gets priority in intermittent mode
|
//Path2 gets priority in intermittent mode
|
||||||
if (((psHu32(GIF_STAT) & GIF_STAT_P1Q) || (vif1.cmd & 0x7f) == 0x50) && (psHu32(GIF_MODE) & GIF_MODE_IMT) && (Path3progress == IMAGE_MODE))
|
if ((gifRegs->stat.P1Q || (vif1.cmd & 0x7f) == 0x50) && gifRegs->mode.IMT && (Path3progress == IMAGE_MODE))
|
||||||
{
|
{
|
||||||
GIF_LOG("Waiting VU %x, PATH2 %x, GIFMODE %x Progress %x", psHu32(GIF_STAT) & 0x100, (vif1.cmd & 0x7f), psHu32(GIF_MODE), Path3progress);
|
GIF_LOG("Waiting VU %x, PATH2 %x, GIFMODE %x Progress %x", psHu32(GIF_STAT) & 0x100, (vif1.cmd & 0x7f), psHu32(GIF_MODE), Path3progress);
|
||||||
CPU_INT(2, 16);
|
CPU_INT(2, 16);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (vif1Regs->mskpath3 || (psHu32(GIF_MODE) & GIF_MODE_M3R))
|
if (vif1Regs->mskpath3 || gifRegs->mode.M3R)
|
||||||
{
|
{
|
||||||
if (gif->qwc == 0)
|
if (gif->qwc == 0)
|
||||||
{
|
{
|
||||||
|
@ -254,7 +254,7 @@ void GIFdma()
|
||||||
if ((gif->chcr.MOD == NORMAL_MODE) || (gif->qwc > 0)) // Normal Mode
|
if ((gif->chcr.MOD == NORMAL_MODE) || (gif->qwc > 0)) // Normal Mode
|
||||||
{
|
{
|
||||||
|
|
||||||
if (((psHu32(DMAC_CTRL) & 0xC0) == 0x80) && (gif->chcr.MOD == NORMAL_MODE))
|
if ((dmacRegs->ctrl.STD == STD_GIF) && (gif->chcr.MOD == NORMAL_MODE))
|
||||||
{
|
{
|
||||||
Console::WriteLn("DMA Stall Control on GIF normal");
|
Console::WriteLn("DMA Stall Control on GIF normal");
|
||||||
}
|
}
|
||||||
|
@ -270,7 +270,7 @@ void GIFdma()
|
||||||
if (!ReadTag(ptag, id)) return;
|
if (!ReadTag(ptag, id)) return;
|
||||||
GIF_LOG("gifdmaChain %8.8x_%8.8x size=%d, id=%d, addr=%lx", ptag[1], ptag[0], gif->qwc, id, gif->madr);
|
GIF_LOG("gifdmaChain %8.8x_%8.8x size=%d, id=%d, addr=%lx", ptag[1], ptag[0], gif->qwc, id, gif->madr);
|
||||||
|
|
||||||
if ((psHu32(DMAC_CTRL) & 0xC0) == 0x80) // STD == GIF
|
if (dmacRegs->ctrl.STD == STD_GIF)
|
||||||
{
|
{
|
||||||
// there are still bugs, need to also check if gif->madr +16*qwc >= stadr, if not, stall
|
// there are still bugs, need to also check if gif->madr +16*qwc >= stadr, if not, stall
|
||||||
if (!gspath3done && ((gif->madr + (gif->qwc * 16)) > psHu32(DMAC_STADR)) && (id == 4))
|
if (!gspath3done && ((gif->madr + (gif->qwc * 16)) > psHu32(DMAC_STADR)) && (id == 4))
|
||||||
|
@ -323,8 +323,8 @@ void dmaGIF()
|
||||||
psHu32(GIF_STAT) |= GIF_STAT_P3Q;
|
psHu32(GIF_STAT) |= GIF_STAT_P3Q;
|
||||||
psHu32(GIF_STAT) |= 0x10000000; // FQC=31, hack ;) [used to be 0xE00; // OPH=1 | APATH=3]
|
psHu32(GIF_STAT) |= 0x10000000; // FQC=31, hack ;) [used to be 0xE00; // OPH=1 | APATH=3]
|
||||||
clearFIFOstuff(true);
|
clearFIFOstuff(true);
|
||||||
|
|
||||||
if ((psHu32(DMAC_CTRL) & 0xC) == 0xC ) // GIF MFIFO
|
if (dmacRegs->ctrl.MFD == MFD_GIF) // GIF MFIFO
|
||||||
{
|
{
|
||||||
//Console::WriteLn("GIF MFIFO");
|
//Console::WriteLn("GIF MFIFO");
|
||||||
gifMFIFOInterrupt();
|
gifMFIFOInterrupt();
|
||||||
|
@ -536,7 +536,7 @@ void gifMFIFOInterrupt()
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (((psHu32(GIF_STAT) & GIF_STAT_P1Q) || (vif1.cmd & 0x7f) == 0x50) && (psHu32(GIF_MODE) & GIF_MODE_IMT) && Path3progress == 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), Path3progress);
|
//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);
|
CPU_INT(11,mfifocycles);
|
||||||
|
@ -549,7 +549,7 @@ void gifMFIFOInterrupt()
|
||||||
{
|
{
|
||||||
//Console::WriteLn("Empty");
|
//Console::WriteLn("Empty");
|
||||||
gifstate |= GIF_STATE_EMPTY;
|
gifstate |= GIF_STATE_EMPTY;
|
||||||
psHu32(GIF_STAT) &= ~GIF_STAT_IMT; // OPH=0 | APATH=0
|
gifRegs->stat.IMT = 0; // OPH=0 | APATH=0
|
||||||
hwDmacIrq(DMAC_MFIFO_EMPTY);
|
hwDmacIrq(DMAC_MFIFO_EMPTY);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
@ -98,7 +98,7 @@ __forceinline void dmacInterrupt()
|
||||||
if( ((psHu16(0xe012) & psHu16(0xe010)) == 0 ) &&
|
if( ((psHu16(0xe012) & psHu16(0xe010)) == 0 ) &&
|
||||||
( psHu16(0xe010) & 0x8000) == 0 ) return;
|
( psHu16(0xe010) & 0x8000) == 0 ) return;
|
||||||
|
|
||||||
if((psHu32(DMAC_CTRL) & 0x1) == 0) return;
|
if (!(dmacRegs->ctrl.DMAE)) return;
|
||||||
|
|
||||||
HW_LOG("dmacInterrupt %x", (psHu16(0xe012) & psHu16(0xe010) ||
|
HW_LOG("dmacInterrupt %x", (psHu16(0xe012) & psHu16(0xe010) ||
|
||||||
psHu16(0xe010) & 0x8000));
|
psHu16(0xe010) & 0x8000));
|
||||||
|
|
53
pcsx2/Hw.h
53
pcsx2/Hw.h
|
@ -62,6 +62,15 @@ union tDMA_CHCR {
|
||||||
u32 _u32;
|
u32 _u32;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
union tDMA_SADR {
|
||||||
|
struct {
|
||||||
|
u32 ADDR : 14;
|
||||||
|
u32 reserved2 : 18;
|
||||||
|
};
|
||||||
|
u32 _u32;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
struct DMACh {
|
struct DMACh {
|
||||||
tDMA_CHCR chcr;
|
tDMA_CHCR chcr;
|
||||||
u32 null0[3];
|
u32 null0[3];
|
||||||
|
@ -448,30 +457,12 @@ union tDMAC_CTRL {
|
||||||
|
|
||||||
union tDMAC_STAT {
|
union tDMAC_STAT {
|
||||||
struct {
|
struct {
|
||||||
u32 CIS0 : 1;
|
u32 CIS : 10;
|
||||||
u32 CIS1 : 1;
|
|
||||||
u32 CIS2 : 1;
|
|
||||||
u32 CIS3 : 1;
|
|
||||||
u32 CIS4 : 1;
|
|
||||||
u32 CIS5 : 1;
|
|
||||||
u32 CIS6 : 1;
|
|
||||||
u32 CIS7 : 1;
|
|
||||||
u32 CIS8 : 1;
|
|
||||||
u32 CIS9 : 1;
|
|
||||||
u32 reserved1 : 3;
|
u32 reserved1 : 3;
|
||||||
u32 SIS : 1;
|
u32 SIS : 1;
|
||||||
u32 MEIS : 1;
|
u32 MEIS : 1;
|
||||||
u32 BEIS : 1;
|
u32 BEIS : 1;
|
||||||
u32 CIM0 : 1;
|
u32 CIM : 10;
|
||||||
u32 CIM1 : 1;
|
|
||||||
u32 CIM2 : 1;
|
|
||||||
u32 CIM3 : 1;
|
|
||||||
u32 CIM4 : 1;
|
|
||||||
u32 CIM5 : 1;
|
|
||||||
u32 CIM6 : 1;
|
|
||||||
u32 CIM7 : 1;
|
|
||||||
u32 CIM8 : 1;
|
|
||||||
u32 CIM9 : 1;
|
|
||||||
u32 reserved2 : 3;
|
u32 reserved2 : 3;
|
||||||
u32 SIM : 1;
|
u32 SIM : 1;
|
||||||
u32 MEIM : 1;
|
u32 MEIM : 1;
|
||||||
|
@ -482,27 +473,9 @@ union tDMAC_STAT {
|
||||||
|
|
||||||
union tDMAC_PCR {
|
union tDMAC_PCR {
|
||||||
struct {
|
struct {
|
||||||
u32 CPC0 : 1;
|
u32 CPC : 10;
|
||||||
u32 CPC1 : 1;
|
|
||||||
u32 CPC2 : 1;
|
|
||||||
u32 CPC3 : 1;
|
|
||||||
u32 CPC4 : 1;
|
|
||||||
u32 CPC5 : 1;
|
|
||||||
u32 CPC6 : 1;
|
|
||||||
u32 CPC7 : 1;
|
|
||||||
u32 CPC8 : 1;
|
|
||||||
u32 CPC9 : 1;
|
|
||||||
u32 reserved1 : 6;
|
u32 reserved1 : 6;
|
||||||
u32 CDE0 : 1;
|
u32 CDE : 10;
|
||||||
u32 CDE1 : 1;
|
|
||||||
u32 CDE2 : 1;
|
|
||||||
u32 CDE3 : 1;
|
|
||||||
u32 CDE4 : 1;
|
|
||||||
u32 CDE5 : 1;
|
|
||||||
u32 CDE6 : 1;
|
|
||||||
u32 CDE7 : 1;
|
|
||||||
u32 CDE8 : 1;
|
|
||||||
u32 CDE9 : 1;
|
|
||||||
u32 reserved2 : 5;
|
u32 reserved2 : 5;
|
||||||
u32 PCE : 1;
|
u32 PCE : 1;
|
||||||
};
|
};
|
||||||
|
|
|
@ -43,8 +43,8 @@ static __forceinline void DmaExec8( void (*func)(), u32 mem, u8 value )
|
||||||
{
|
{
|
||||||
u32 qwcRegister = (mem | 0x20) & ~0x1; //Need to remove the lower bit else we end up clearing TADR
|
u32 qwcRegister = (mem | 0x20) & ~0x1; //Need to remove the lower bit else we end up clearing TADR
|
||||||
|
|
||||||
//Its invalid for the hardware to write a DMA while it is active, not without Suspending the DMAC
|
//It's invalid for the hardware to write a DMA while it is active, not without Suspending the DMAC
|
||||||
if ((value & 0x1) && ((psHu8(mem) & 0x1) == 0x1) && ((psHu32(DMAC_CTRL) & 0x1) == 1))
|
if ((value & 0x1) && ((psHu8(mem) & 0x1) == 0x1) && dmacRegs->ctrl.DMAE)
|
||||||
{
|
{
|
||||||
DMA_LOG( "DMAExec8 Attempt to run DMA while one is already active mem = %x", mem );
|
DMA_LOG( "DMAExec8 Attempt to run DMA while one is already active mem = %x", mem );
|
||||||
}
|
}
|
||||||
|
@ -59,7 +59,7 @@ static __forceinline void DmaExec8( void (*func)(), u32 mem, u8 value )
|
||||||
}
|
}
|
||||||
|
|
||||||
psHu8(mem) = (u8)value;
|
psHu8(mem) = (u8)value;
|
||||||
if ((psHu8(mem) & 0x1) && (psHu32(DMAC_CTRL) & 0x1))
|
if ((psHu8(mem) & 0x1) && dmacRegs->ctrl.DMAE)
|
||||||
{
|
{
|
||||||
/*Console::WriteLn("Running DMA 8 %x", params psHu32(mem & ~0x1));*/
|
/*Console::WriteLn("Running DMA 8 %x", params psHu32(mem & ~0x1));*/
|
||||||
func();
|
func();
|
||||||
|
@ -70,8 +70,8 @@ static __forceinline void DmaExec16( void (*func)(), u32 mem, u16 value )
|
||||||
{
|
{
|
||||||
u32 qwcRegister = mem | 0x20;
|
u32 qwcRegister = mem | 0x20;
|
||||||
|
|
||||||
//Its invalid for the hardware to write a DMA while it is active, not without Suspending the DMAC
|
//It's invalid for the hardware to write a DMA while it is active, not without Suspending the DMAC
|
||||||
if ((value & 0x100) && ((psHu32(mem) & 0x100) == 0x100) && ((psHu32(DMAC_CTRL) & 0x1) == 1))
|
if ((value & 0x100) && ((psHu32(mem) & 0x100) == 0x100) && dmacRegs->ctrl.DMAE)
|
||||||
{
|
{
|
||||||
DMA_LOG( "DMAExec16 Attempt to run DMA while one is already active mem = %x", mem);
|
DMA_LOG( "DMAExec16 Attempt to run DMA while one is already active mem = %x", mem);
|
||||||
}
|
}
|
||||||
|
@ -97,8 +97,8 @@ static void DmaExec( void (*func)(), u32 mem, u32 value )
|
||||||
{
|
{
|
||||||
u32 qwcRegister = mem | 0x20;
|
u32 qwcRegister = mem | 0x20;
|
||||||
|
|
||||||
//Its invalid for the hardware to write a DMA while it is active, not without Suspending the DMAC
|
//It's invalid for the hardware to write a DMA while it is active, not without Suspending the DMAC
|
||||||
if ((value & 0x100) && ((psHu32(mem) & 0x100) == 0x100) && ((psHu32(DMAC_CTRL) & 0x1) == 1))
|
if ((value & 0x100) && ((psHu32(mem) & 0x100) == 0x100) && dmacRegs->ctrl.DMAE)
|
||||||
{
|
{
|
||||||
DMA_LOG( "DMAExec32 Attempt to run DMA while one is already active mem = %x", mem );
|
DMA_LOG( "DMAExec32 Attempt to run DMA while one is already active mem = %x", mem );
|
||||||
|
|
||||||
|
@ -122,7 +122,7 @@ static void DmaExec( void (*func)(), u32 mem, u32 value )
|
||||||
else /* Else (including Normal mode etc) write whatever the hardware sends*/
|
else /* Else (including Normal mode etc) write whatever the hardware sends*/
|
||||||
psHu32(mem) = (u32)value;
|
psHu32(mem) = (u32)value;
|
||||||
|
|
||||||
if ((psHu32(mem) & 0x100) && (psHu32(DMAC_CTRL) & 0x1))
|
if ((psHu32(mem) & 0x100) && dmacRegs->ctrl.DMAE)
|
||||||
func();
|
func();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -199,7 +199,7 @@ void hwWrite8(u32 mem, u8 value)
|
||||||
// break;
|
// break;
|
||||||
case D0_CHCR + 1: // dma0 - vif0
|
case D0_CHCR + 1: // dma0 - vif0
|
||||||
DMA_LOG("VIF0dma EXECUTE, value=0x%x", value);
|
DMA_LOG("VIF0dma EXECUTE, value=0x%x", value);
|
||||||
if ((value & 0x1) && !(psHu32(DMAC_CTRL) & 0x1))
|
if ((value & 0x1) && !dmacRegs->ctrl.DMAE)
|
||||||
{
|
{
|
||||||
DevCon::Notice("8 bit VIF0 DMA Start while DMAC Disabled\n");
|
DevCon::Notice("8 bit VIF0 DMA Start while DMAC Disabled\n");
|
||||||
QueuedDMA |= 0x1;
|
QueuedDMA |= 0x1;
|
||||||
|
@ -209,7 +209,7 @@ void hwWrite8(u32 mem, u8 value)
|
||||||
|
|
||||||
case D1_CHCR + 1: // dma1 - vif1
|
case D1_CHCR + 1: // dma1 - vif1
|
||||||
DMA_LOG("VIF1dma EXECUTE, value=0x%x", value);
|
DMA_LOG("VIF1dma EXECUTE, value=0x%x", value);
|
||||||
if ((value & 0x1) && !(psHu32(DMAC_CTRL) & 0x1))
|
if ((value & 0x1) && !dmacRegs->ctrl.DMAE)
|
||||||
{
|
{
|
||||||
DevCon::Notice("8 bit VIF1 DMA Start while DMAC Disabled\n");
|
DevCon::Notice("8 bit VIF1 DMA Start while DMAC Disabled\n");
|
||||||
QueuedDMA |= 0x2;
|
QueuedDMA |= 0x2;
|
||||||
|
@ -220,7 +220,7 @@ void hwWrite8(u32 mem, u8 value)
|
||||||
|
|
||||||
case D2_CHCR + 1: // dma2 - gif
|
case D2_CHCR + 1: // dma2 - gif
|
||||||
DMA_LOG("GSdma EXECUTE, value=0x%x", value);
|
DMA_LOG("GSdma EXECUTE, value=0x%x", value);
|
||||||
if ((value & 0x1) && !(psHu32(DMAC_CTRL) & 0x1))
|
if ((value & 0x1) && !dmacRegs->ctrl.DMAE)
|
||||||
{
|
{
|
||||||
DevCon::Notice("8 bit GIF DMA Start while DMAC Disabled\n");
|
DevCon::Notice("8 bit GIF DMA Start while DMAC Disabled\n");
|
||||||
QueuedDMA |= 0x4;
|
QueuedDMA |= 0x4;
|
||||||
|
@ -230,7 +230,7 @@ void hwWrite8(u32 mem, u8 value)
|
||||||
|
|
||||||
case D3_CHCR + 1: // dma3 - fromIPU
|
case D3_CHCR + 1: // dma3 - fromIPU
|
||||||
DMA_LOG("IPU0dma EXECUTE, value=0x%x", value);
|
DMA_LOG("IPU0dma EXECUTE, value=0x%x", value);
|
||||||
if ((value & 0x1) && !(psHu32(DMAC_CTRL) & 0x1))
|
if ((value & 0x1) && !dmacRegs->ctrl.DMAE)
|
||||||
{
|
{
|
||||||
DevCon::Notice("8 bit IPU0 DMA Start while DMAC Disabled\n");
|
DevCon::Notice("8 bit IPU0 DMA Start while DMAC Disabled\n");
|
||||||
QueuedDMA |= 0x8;
|
QueuedDMA |= 0x8;
|
||||||
|
@ -240,7 +240,7 @@ void hwWrite8(u32 mem, u8 value)
|
||||||
|
|
||||||
case D4_CHCR + 1: // dma4 - toIPU
|
case D4_CHCR + 1: // dma4 - toIPU
|
||||||
DMA_LOG("IPU1dma EXECUTE, value=0x%x", value);
|
DMA_LOG("IPU1dma EXECUTE, value=0x%x", value);
|
||||||
if ((value & 0x1) && !(psHu32(DMAC_CTRL) & 0x1))
|
if ((value & 0x1) && !dmacRegs->ctrl.DMAE)
|
||||||
{
|
{
|
||||||
DevCon::Notice("8 bit IPU1 DMA Start while DMAC Disabled\n");
|
DevCon::Notice("8 bit IPU1 DMA Start while DMAC Disabled\n");
|
||||||
QueuedDMA |= 0x10;
|
QueuedDMA |= 0x10;
|
||||||
|
@ -251,7 +251,7 @@ void hwWrite8(u32 mem, u8 value)
|
||||||
case D5_CHCR + 1: // dma5 - sif0
|
case D5_CHCR + 1: // dma5 - sif0
|
||||||
DMA_LOG("SIF0dma EXECUTE, value=0x%x", value);
|
DMA_LOG("SIF0dma EXECUTE, value=0x%x", value);
|
||||||
// if (value == 0) psxSu32(0x30) = 0x40000;
|
// if (value == 0) psxSu32(0x30) = 0x40000;
|
||||||
if ((value & 0x1) && !(psHu32(DMAC_CTRL) & 0x1))
|
if ((value & 0x1) && !dmacRegs->ctrl.DMAE)
|
||||||
{
|
{
|
||||||
DevCon::Notice("8 bit SIF0 DMA Start while DMAC Disabled\n");
|
DevCon::Notice("8 bit SIF0 DMA Start while DMAC Disabled\n");
|
||||||
QueuedDMA |= 0x20;
|
QueuedDMA |= 0x20;
|
||||||
|
@ -261,7 +261,7 @@ void hwWrite8(u32 mem, u8 value)
|
||||||
|
|
||||||
case D6_CHCR + 1: // dma6 - sif1
|
case D6_CHCR + 1: // dma6 - sif1
|
||||||
DMA_LOG("SIF1dma EXECUTE, value=0x%x", value);
|
DMA_LOG("SIF1dma EXECUTE, value=0x%x", value);
|
||||||
if ((value & 0x1) && !(psHu32(DMAC_CTRL) & 0x1))
|
if ((value & 0x1) && !dmacRegs->ctrl.DMAE)
|
||||||
{
|
{
|
||||||
DevCon::Notice("8 bit SIF1 DMA Start while DMAC Disabled\n");
|
DevCon::Notice("8 bit SIF1 DMA Start while DMAC Disabled\n");
|
||||||
QueuedDMA |= 0x40;
|
QueuedDMA |= 0x40;
|
||||||
|
@ -271,7 +271,7 @@ void hwWrite8(u32 mem, u8 value)
|
||||||
|
|
||||||
case D7_CHCR + 1: // dma7 - sif2
|
case D7_CHCR + 1: // dma7 - sif2
|
||||||
DMA_LOG("SIF2dma EXECUTE, value=0x%x", value);
|
DMA_LOG("SIF2dma EXECUTE, value=0x%x", value);
|
||||||
if ((value & 0x1) && !(psHu32(DMAC_CTRL) & 0x1))
|
if ((value & 0x1) && !dmacRegs->ctrl.DMAE)
|
||||||
{
|
{
|
||||||
DevCon::Notice("8 bit SIF2 DMA Start while DMAC Disabled\n");
|
DevCon::Notice("8 bit SIF2 DMA Start while DMAC Disabled\n");
|
||||||
QueuedDMA |= 0x80;
|
QueuedDMA |= 0x80;
|
||||||
|
@ -281,7 +281,7 @@ void hwWrite8(u32 mem, u8 value)
|
||||||
|
|
||||||
case D8_CHCR + 1: // dma8 - fromSPR
|
case D8_CHCR + 1: // dma8 - fromSPR
|
||||||
DMA_LOG("fromSPRdma8 EXECUTE, value=0x%x", value);
|
DMA_LOG("fromSPRdma8 EXECUTE, value=0x%x", value);
|
||||||
if ((value & 0x1) && !(psHu32(DMAC_CTRL) & 0x1))
|
if ((value & 0x1) && !dmacRegs->ctrl.DMAE)
|
||||||
{
|
{
|
||||||
DevCon::Notice("8 bit SPR0 DMA Start while DMAC Disabled\n");
|
DevCon::Notice("8 bit SPR0 DMA Start while DMAC Disabled\n");
|
||||||
QueuedDMA |= 0x100;
|
QueuedDMA |= 0x100;
|
||||||
|
@ -291,7 +291,7 @@ void hwWrite8(u32 mem, u8 value)
|
||||||
|
|
||||||
case SPR1_CHCR + 1: // dma9 - toSPR
|
case SPR1_CHCR + 1: // dma9 - toSPR
|
||||||
DMA_LOG("toSPRdma8 EXECUTE, value=0x%x", value);
|
DMA_LOG("toSPRdma8 EXECUTE, value=0x%x", value);
|
||||||
if ((value & 0x1) && !(psHu32(DMAC_CTRL) & 0x1))
|
if ((value & 0x1) && !dmacRegs->ctrl.DMAE)
|
||||||
{
|
{
|
||||||
DevCon::Notice("8 bit SPR1 DMA Start while DMAC Disabled\n");
|
DevCon::Notice("8 bit SPR1 DMA Start while DMAC Disabled\n");
|
||||||
QueuedDMA |= 0x200;
|
QueuedDMA |= 0x200;
|
||||||
|
@ -376,7 +376,7 @@ __forceinline void hwWrite16(u32 mem, u16 value)
|
||||||
|
|
||||||
case D0_CHCR: // dma0 - vif0
|
case D0_CHCR: // dma0 - vif0
|
||||||
DMA_LOG("VIF0dma %lx", value);
|
DMA_LOG("VIF0dma %lx", value);
|
||||||
if ((value & 0x100) && !(psHu32(DMAC_CTRL) & 0x1))
|
if ((value & 0x100) && !dmacRegs->ctrl.DMAE)
|
||||||
{
|
{
|
||||||
DevCon::Notice("16 bit VIF0 DMA Start while DMAC Disabled\n");
|
DevCon::Notice("16 bit VIF0 DMA Start while DMAC Disabled\n");
|
||||||
QueuedDMA |= 0x1;
|
QueuedDMA |= 0x1;
|
||||||
|
@ -386,7 +386,7 @@ __forceinline void hwWrite16(u32 mem, u16 value)
|
||||||
|
|
||||||
case D1_CHCR: // dma1 - vif1 - chcr
|
case D1_CHCR: // dma1 - vif1 - chcr
|
||||||
DMA_LOG("VIF1dma CHCR %lx", value);
|
DMA_LOG("VIF1dma CHCR %lx", value);
|
||||||
if ((value & 0x100) && !(psHu32(DMAC_CTRL) & 0x1))
|
if ((value & 0x100) && !dmacRegs->ctrl.DMAE)
|
||||||
{
|
{
|
||||||
DevCon::Notice("16 bit VIF1 DMA Start while DMAC Disabled\n");
|
DevCon::Notice("16 bit VIF1 DMA Start while DMAC Disabled\n");
|
||||||
QueuedDMA |= 0x2;
|
QueuedDMA |= 0x2;
|
||||||
|
@ -430,7 +430,7 @@ __forceinline void hwWrite16(u32 mem, u16 value)
|
||||||
|
|
||||||
case D2_CHCR: // dma2 - gif
|
case D2_CHCR: // dma2 - gif
|
||||||
DMA_LOG("0x%8.8x hwWrite32: GSdma %lx", cpuRegs.cycle, value);
|
DMA_LOG("0x%8.8x hwWrite32: GSdma %lx", cpuRegs.cycle, value);
|
||||||
if ((value & 0x100) && !(psHu32(DMAC_CTRL) & 0x1))
|
if ((value & 0x100) && !dmacRegs->ctrl.DMAE)
|
||||||
{
|
{
|
||||||
DevCon::Notice("16 bit GIF DMA Start while DMAC Disabled\n");
|
DevCon::Notice("16 bit GIF DMA Start while DMAC Disabled\n");
|
||||||
QueuedDMA |= 0x4;
|
QueuedDMA |= 0x4;
|
||||||
|
@ -472,7 +472,7 @@ __forceinline void hwWrite16(u32 mem, u16 value)
|
||||||
|
|
||||||
case D3_CHCR: // dma3 - fromIPU
|
case D3_CHCR: // dma3 - fromIPU
|
||||||
DMA_LOG("IPU0dma %lx", value);
|
DMA_LOG("IPU0dma %lx", value);
|
||||||
if ((value & 0x100) && !(psHu32(DMAC_CTRL) & 0x1))
|
if ((value & 0x100) && !dmacRegs->ctrl.DMAE)
|
||||||
{
|
{
|
||||||
DevCon::Notice("16 bit IPU0 DMA Start while DMAC Disabled\n");
|
DevCon::Notice("16 bit IPU0 DMA Start while DMAC Disabled\n");
|
||||||
QueuedDMA |= 0x8;
|
QueuedDMA |= 0x8;
|
||||||
|
@ -504,7 +504,7 @@ __forceinline void hwWrite16(u32 mem, u16 value)
|
||||||
|
|
||||||
case D4_CHCR: // dma4 - toIPU
|
case D4_CHCR: // dma4 - toIPU
|
||||||
DMA_LOG("IPU1dma %lx", value);
|
DMA_LOG("IPU1dma %lx", value);
|
||||||
if ((value & 0x100) && !(psHu32(DMAC_CTRL) & 0x1))
|
if ((value & 0x100) && !dmacRegs->ctrl.DMAE)
|
||||||
{
|
{
|
||||||
DevCon::Notice("16 bit IPU1 DMA Start while DMAC Disabled\n");
|
DevCon::Notice("16 bit IPU1 DMA Start while DMAC Disabled\n");
|
||||||
QueuedDMA |= 0x10;
|
QueuedDMA |= 0x10;
|
||||||
|
@ -536,7 +536,7 @@ __forceinline void hwWrite16(u32 mem, u16 value)
|
||||||
case D5_CHCR: // dma5 - sif0
|
case D5_CHCR: // dma5 - sif0
|
||||||
DMA_LOG("SIF0dma %lx", value);
|
DMA_LOG("SIF0dma %lx", value);
|
||||||
// if (value == 0) psxSu32(0x30) = 0x40000;
|
// if (value == 0) psxSu32(0x30) = 0x40000;
|
||||||
if ((value & 0x100) && !(psHu32(DMAC_CTRL) & 0x1))
|
if ((value & 0x100) && !dmacRegs->ctrl.DMAE)
|
||||||
{
|
{
|
||||||
DevCon::Notice("16 bit SIF0 DMA Start while DMAC Disabled\n");
|
DevCon::Notice("16 bit SIF0 DMA Start while DMAC Disabled\n");
|
||||||
QueuedDMA |= 0x20;
|
QueuedDMA |= 0x20;
|
||||||
|
@ -550,7 +550,7 @@ __forceinline void hwWrite16(u32 mem, u16 value)
|
||||||
|
|
||||||
case D6_CHCR: // dma6 - sif1
|
case D6_CHCR: // dma6 - sif1
|
||||||
DMA_LOG("SIF1dma %lx", value);
|
DMA_LOG("SIF1dma %lx", value);
|
||||||
if ((value & 0x100) && !(psHu32(DMAC_CTRL) & 0x1))
|
if ((value & 0x100) && !dmacRegs->ctrl.DMAE)
|
||||||
{
|
{
|
||||||
DevCon::Notice("16 bit SIF1 DMA Start while DMAC Disabled\n");
|
DevCon::Notice("16 bit SIF1 DMA Start while DMAC Disabled\n");
|
||||||
QueuedDMA |= 0x40;
|
QueuedDMA |= 0x40;
|
||||||
|
@ -582,7 +582,7 @@ __forceinline void hwWrite16(u32 mem, u16 value)
|
||||||
|
|
||||||
case D7_CHCR: // dma7 - sif2
|
case D7_CHCR: // dma7 - sif2
|
||||||
DMA_LOG("SIF2dma %lx", value);
|
DMA_LOG("SIF2dma %lx", value);
|
||||||
if ((value & 0x100) && !(psHu32(DMAC_CTRL) & 0x1))
|
if ((value & 0x100) && !dmacRegs->ctrl.DMAE)
|
||||||
{
|
{
|
||||||
DevCon::Notice("16 bit SIF2 DMA Start while DMAC Disabled\n");
|
DevCon::Notice("16 bit SIF2 DMA Start while DMAC Disabled\n");
|
||||||
QueuedDMA |= 0x80;
|
QueuedDMA |= 0x80;
|
||||||
|
@ -596,7 +596,7 @@ __forceinline void hwWrite16(u32 mem, u16 value)
|
||||||
|
|
||||||
case D8_CHCR: // dma8 - fromSPR
|
case D8_CHCR: // dma8 - fromSPR
|
||||||
DMA_LOG("fromSPRdma %lx", value);
|
DMA_LOG("fromSPRdma %lx", value);
|
||||||
if ((value & 0x100) && !(psHu32(DMAC_CTRL) & 0x1))
|
if ((value & 0x100) && !dmacRegs->ctrl.DMAE)
|
||||||
{
|
{
|
||||||
DevCon::Notice("16 bit SPR0 DMA Start while DMAC Disabled\n");
|
DevCon::Notice("16 bit SPR0 DMA Start while DMAC Disabled\n");
|
||||||
QueuedDMA |= 0x100;
|
QueuedDMA |= 0x100;
|
||||||
|
@ -606,7 +606,7 @@ __forceinline void hwWrite16(u32 mem, u16 value)
|
||||||
|
|
||||||
case SPR1_CHCR: // dma9 - toSPR
|
case SPR1_CHCR: // dma9 - toSPR
|
||||||
DMA_LOG("toSPRdma %lx", value);
|
DMA_LOG("toSPRdma %lx", value);
|
||||||
if ((value & 0x100) && !(psHu32(DMAC_CTRL) & 0x1))
|
if ((value & 0x100) && !dmacRegs->ctrl.DMAE)
|
||||||
{
|
{
|
||||||
DevCon::Notice("16 bit SPR1 DMA Start while DMAC Disabled\n");
|
DevCon::Notice("16 bit SPR1 DMA Start while DMAC Disabled\n");
|
||||||
QueuedDMA |= 0x200;
|
QueuedDMA |= 0x200;
|
||||||
|
@ -763,7 +763,7 @@ void __fastcall hwWrite32_page_0B( u32 mem, u32 value )
|
||||||
{
|
{
|
||||||
case D3_CHCR: // dma3 - fromIPU
|
case D3_CHCR: // dma3 - fromIPU
|
||||||
DMA_LOG("IPU0dma EXECUTE, value=0x%x\n", value);
|
DMA_LOG("IPU0dma EXECUTE, value=0x%x\n", value);
|
||||||
if ((value & 0x100) && !(psHu32(DMAC_CTRL) & 0x1))
|
if ((value & 0x100) && !dmacRegs->ctrl.DMAE)
|
||||||
{
|
{
|
||||||
DevCon::Notice("32 bit IPU0 DMA Start while DMAC Disabled\n");
|
DevCon::Notice("32 bit IPU0 DMA Start while DMAC Disabled\n");
|
||||||
QueuedDMA |= 0x8;
|
QueuedDMA |= 0x8;
|
||||||
|
@ -780,7 +780,7 @@ void __fastcall hwWrite32_page_0B( u32 mem, u32 value )
|
||||||
|
|
||||||
case D4_CHCR: // dma4 - toIPU
|
case D4_CHCR: // dma4 - toIPU
|
||||||
DMA_LOG("IPU1dma EXECUTE, value=0x%x\n", value);
|
DMA_LOG("IPU1dma EXECUTE, value=0x%x\n", value);
|
||||||
if ((value & 0x100) && !(psHu32(DMAC_CTRL) & 0x1))
|
if ((value & 0x100) && !dmacRegs->ctrl.DMAE)
|
||||||
{
|
{
|
||||||
DevCon::Notice("32 bit IPU1 DMA Start while DMAC Disabled\n");
|
DevCon::Notice("32 bit IPU1 DMA Start while DMAC Disabled\n");
|
||||||
QueuedDMA |= 0x10;
|
QueuedDMA |= 0x10;
|
||||||
|
@ -931,7 +931,7 @@ void __fastcall hwWrite32_generic( u32 mem, u32 value )
|
||||||
case D0_CHCR: // dma0 - vif0
|
case D0_CHCR: // dma0 - vif0
|
||||||
DMA_LOG("VIF0dma EXECUTE, value=0x%x", value);
|
DMA_LOG("VIF0dma EXECUTE, value=0x%x", value);
|
||||||
|
|
||||||
if ((value & 0x100) && !(psHu32(DMAC_CTRL) & 0x1))
|
if ((value & 0x100) && !dmacRegs->ctrl.DMAE)
|
||||||
{
|
{
|
||||||
DevCon::Notice("32 bit VIF0 DMA Start while DMAC Disabled\n");
|
DevCon::Notice("32 bit VIF0 DMA Start while DMAC Disabled\n");
|
||||||
QueuedDMA |= 0x1;
|
QueuedDMA |= 0x1;
|
||||||
|
@ -944,7 +944,7 @@ void __fastcall hwWrite32_generic( u32 mem, u32 value )
|
||||||
case D1_CHCR: // dma1 - vif1 - chcr
|
case D1_CHCR: // dma1 - vif1 - chcr
|
||||||
DMA_LOG("VIF1dma EXECUTE, value=0x%x", value);
|
DMA_LOG("VIF1dma EXECUTE, value=0x%x", value);
|
||||||
|
|
||||||
if ((value & 0x100) && !(psHu32(DMAC_CTRL) & 0x1))
|
if ((value & 0x100) && !dmacRegs->ctrl.DMAE)
|
||||||
{
|
{
|
||||||
DevCon::Notice("32 bit VIF1 DMA Start while DMAC Disabled\n");
|
DevCon::Notice("32 bit VIF1 DMA Start while DMAC Disabled\n");
|
||||||
QueuedDMA |= 0x2;
|
QueuedDMA |= 0x2;
|
||||||
|
@ -968,7 +968,7 @@ void __fastcall hwWrite32_generic( u32 mem, u32 value )
|
||||||
//------------------------------------------------------------------
|
//------------------------------------------------------------------
|
||||||
case D2_CHCR: // dma2 - gif
|
case D2_CHCR: // dma2 - gif
|
||||||
DMA_LOG("GIFdma EXECUTE, value=0x%x", value);
|
DMA_LOG("GIFdma EXECUTE, value=0x%x", value);
|
||||||
if ((value & 0x100) && !(psHu32(DMAC_CTRL) & 0x1))
|
if ((value & 0x100) && !dmacRegs->ctrl.DMAE)
|
||||||
{
|
{
|
||||||
DevCon::Notice("32 bit GIF DMA Start while DMAC Disabled\n");
|
DevCon::Notice("32 bit GIF DMA Start while DMAC Disabled\n");
|
||||||
QueuedDMA |= 0x4;
|
QueuedDMA |= 0x4;
|
||||||
|
@ -987,7 +987,7 @@ void __fastcall hwWrite32_generic( u32 mem, u32 value )
|
||||||
case D5_CHCR: // dma5 - sif0
|
case D5_CHCR: // dma5 - sif0
|
||||||
DMA_LOG("SIF0dma EXECUTE, value=0x%x", value);
|
DMA_LOG("SIF0dma EXECUTE, value=0x%x", value);
|
||||||
//if (value == 0) psxSu32(0x30) = 0x40000;
|
//if (value == 0) psxSu32(0x30) = 0x40000;
|
||||||
if ((value & 0x100) && !(psHu32(DMAC_CTRL) & 0x1))
|
if ((value & 0x100) && !dmacRegs->ctrl.DMAE)
|
||||||
{
|
{
|
||||||
DevCon::Notice("32 bit SIF0 DMA Start while DMAC Disabled\n");
|
DevCon::Notice("32 bit SIF0 DMA Start while DMAC Disabled\n");
|
||||||
QueuedDMA |= 0x20;
|
QueuedDMA |= 0x20;
|
||||||
|
@ -997,7 +997,7 @@ void __fastcall hwWrite32_generic( u32 mem, u32 value )
|
||||||
//------------------------------------------------------------------
|
//------------------------------------------------------------------
|
||||||
case D6_CHCR: // dma6 - sif1
|
case D6_CHCR: // dma6 - sif1
|
||||||
DMA_LOG("SIF1dma EXECUTE, value=0x%x", value);
|
DMA_LOG("SIF1dma EXECUTE, value=0x%x", value);
|
||||||
if ((value & 0x100) && !(psHu32(DMAC_CTRL) & 0x1))
|
if ((value & 0x100) && !dmacRegs->ctrl.DMAE)
|
||||||
{
|
{
|
||||||
DevCon::Notice("32 bit SIF1 DMA Start while DMAC Disabled\n");
|
DevCon::Notice("32 bit SIF1 DMA Start while DMAC Disabled\n");
|
||||||
QueuedDMA |= 0x40;
|
QueuedDMA |= 0x40;
|
||||||
|
@ -1012,7 +1012,7 @@ void __fastcall hwWrite32_generic( u32 mem, u32 value )
|
||||||
//------------------------------------------------------------------
|
//------------------------------------------------------------------
|
||||||
case D7_CHCR: // dma7 - sif2
|
case D7_CHCR: // dma7 - sif2
|
||||||
DMA_LOG("SIF2dma EXECUTE, value=0x%x", value);
|
DMA_LOG("SIF2dma EXECUTE, value=0x%x", value);
|
||||||
if ((value & 0x100) && !(psHu32(DMAC_CTRL) & 0x1))
|
if ((value & 0x100) && !dmacRegs->ctrl.DMAE)
|
||||||
{
|
{
|
||||||
DevCon::Notice("32 bit SIF2 DMA Start while DMAC Disabled\n");
|
DevCon::Notice("32 bit SIF2 DMA Start while DMAC Disabled\n");
|
||||||
QueuedDMA |= 0x80;
|
QueuedDMA |= 0x80;
|
||||||
|
@ -1022,7 +1022,7 @@ void __fastcall hwWrite32_generic( u32 mem, u32 value )
|
||||||
//------------------------------------------------------------------
|
//------------------------------------------------------------------
|
||||||
case D8_CHCR: // dma8 - fromSPR
|
case D8_CHCR: // dma8 - fromSPR
|
||||||
DMA_LOG("SPR0dma EXECUTE (fromSPR), value=0x%x", value);
|
DMA_LOG("SPR0dma EXECUTE (fromSPR), value=0x%x", value);
|
||||||
if ((value & 0x100) && !(psHu32(DMAC_CTRL) & 0x1))
|
if ((value & 0x100) && !dmacRegs->ctrl.DMAE)
|
||||||
{
|
{
|
||||||
DevCon::Notice("32 bit SPR0 DMA Start while DMAC Disabled\n");
|
DevCon::Notice("32 bit SPR0 DMA Start while DMAC Disabled\n");
|
||||||
QueuedDMA |= 0x100;
|
QueuedDMA |= 0x100;
|
||||||
|
@ -1032,7 +1032,7 @@ void __fastcall hwWrite32_generic( u32 mem, u32 value )
|
||||||
//------------------------------------------------------------------
|
//------------------------------------------------------------------
|
||||||
case SPR1_CHCR: // dma9 - toSPR
|
case SPR1_CHCR: // dma9 - toSPR
|
||||||
DMA_LOG("SPR1dma EXECUTE (toSPR), value=0x%x", value);
|
DMA_LOG("SPR1dma EXECUTE (toSPR), value=0x%x", value);
|
||||||
if ((value & 0x100) && !(psHu32(DMAC_CTRL) & 0x1))
|
if ((value & 0x100) && !dmacRegs->ctrl.DMAE)
|
||||||
{
|
{
|
||||||
DevCon::Notice("32 bit SPR1 DMA Start while DMAC Disabled\n");
|
DevCon::Notice("32 bit SPR1 DMA Start while DMAC Disabled\n");
|
||||||
QueuedDMA |= 0x200;
|
QueuedDMA |= 0x200;
|
||||||
|
@ -1077,9 +1077,9 @@ void __fastcall hwWrite64_page_03( u32 mem, const mem64_t* srcval )
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if( value & 8 )
|
if( value & 8 )
|
||||||
psHu32(GIF_STAT) |= GIF_STAT_PSE;
|
gifRegs->stat.PSE = 1;
|
||||||
else
|
else
|
||||||
psHu32(GIF_STAT) &= ~GIF_STAT_PSE;
|
gifRegs->stat.PSE = 0;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
|
@ -528,7 +528,9 @@ static const LegacyApi_OptMethod* const s_MethMessOpt[] =
|
||||||
|
|
||||||
PluginManager *g_plugins = NULL;
|
PluginManager *g_plugins = NULL;
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////////////////////////
|
// ---------------------------------------------------------------------------------
|
||||||
|
// Plugin-related Exception Implementations
|
||||||
|
// ---------------------------------------------------------------------------------
|
||||||
|
|
||||||
Exception::PluginLoadError::PluginLoadError( PluginsEnum_t pid, const wxString& objname, const char* eng )
|
Exception::PluginLoadError::PluginLoadError( PluginsEnum_t pid, const wxString& objname, const char* eng )
|
||||||
{
|
{
|
||||||
|
@ -567,15 +569,21 @@ wxString Exception::PluginError::FormatDisplayMessage() const
|
||||||
return wxsFormat( m_message_user, tbl_PluginInfo[PluginId].GetShortname().c_str() );
|
return wxsFormat( m_message_user, tbl_PluginInfo[PluginId].GetShortname().c_str() );
|
||||||
}
|
}
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////////////////////////
|
// ---------------------------------------------------------------------------------
|
||||||
|
// Plugin Manager Implementation
|
||||||
|
// ---------------------------------------------------------------------------------
|
||||||
|
|
||||||
PluginManager::PluginManager( const wxString (&folders)[PluginId_Count] )
|
PluginManager::PluginManager( const wxString (&folders)[PluginId_Count] )
|
||||||
{
|
{
|
||||||
|
Console::Status( "Loading plugins..." );
|
||||||
|
|
||||||
const PluginInfo* pi = tbl_PluginInfo-1;
|
const PluginInfo* pi = tbl_PluginInfo-1;
|
||||||
while( ++pi, pi->shortname != NULL )
|
while( ++pi, pi->shortname != NULL )
|
||||||
{
|
{
|
||||||
const PluginsEnum_t pid = pi->id;
|
const PluginsEnum_t pid = pi->id;
|
||||||
|
|
||||||
|
Console::WriteLn( "\tBinding %s\t: %s ", params tbl_PluginInfo[pid].shortname, folders[pid].ToUTF8().data() );
|
||||||
|
|
||||||
if( folders[pid].IsEmpty() )
|
if( folders[pid].IsEmpty() )
|
||||||
throw Exception::InvalidArgument( "Empty plugin filename." );
|
throw Exception::InvalidArgument( "Empty plugin filename." );
|
||||||
|
|
||||||
|
@ -610,6 +618,8 @@ PluginManager::PluginManager( const wxString (&folders)[PluginId_Count] )
|
||||||
// Hack for PAD's stupid parameter passed on Init
|
// Hack for PAD's stupid parameter passed on Init
|
||||||
PADinit = (_PADinit)m_info[PluginId_PAD].CommonBindings.Init;
|
PADinit = (_PADinit)m_info[PluginId_PAD].CommonBindings.Init;
|
||||||
m_info[PluginId_PAD].CommonBindings.Init = _hack_PADinit;
|
m_info[PluginId_PAD].CommonBindings.Init = _hack_PADinit;
|
||||||
|
|
||||||
|
Console::Status( "Plugins loaded successfully.\n" );
|
||||||
}
|
}
|
||||||
|
|
||||||
PluginManager::~PluginManager()
|
PluginManager::~PluginManager()
|
||||||
|
@ -767,6 +777,8 @@ void PluginManager::Open( PluginsEnum_t pid )
|
||||||
{
|
{
|
||||||
if( m_info[pid].IsOpened ) return;
|
if( m_info[pid].IsOpened ) return;
|
||||||
|
|
||||||
|
Console::WriteLn( "\tOpening %s", params tbl_PluginInfo[pid].shortname );
|
||||||
|
|
||||||
// Each Open needs to be called explicitly. >_<
|
// Each Open needs to be called explicitly. >_<
|
||||||
|
|
||||||
bool result = true;
|
bool result = true;
|
||||||
|
@ -788,17 +800,20 @@ void PluginManager::Open( PluginsEnum_t pid )
|
||||||
|
|
||||||
void PluginManager::Open()
|
void PluginManager::Open()
|
||||||
{
|
{
|
||||||
|
Console::Status( "Opening plugins..." );
|
||||||
|
|
||||||
const PluginInfo* pi = tbl_PluginInfo-1;
|
const PluginInfo* pi = tbl_PluginInfo-1;
|
||||||
while( ++pi, pi->shortname != NULL )
|
while( ++pi, pi->shortname != NULL )
|
||||||
g_plugins->Open( pi->id );
|
g_plugins->Open( pi->id );
|
||||||
|
|
||||||
cdvdDetectDisk();
|
Console::Status( "Plugins opened successfully." );
|
||||||
}
|
}
|
||||||
|
|
||||||
void PluginManager::Close( PluginsEnum_t pid )
|
void PluginManager::Close( PluginsEnum_t pid )
|
||||||
{
|
{
|
||||||
if( !m_info[pid].IsOpened ) return;
|
if( !m_info[pid].IsOpened ) return;
|
||||||
|
|
||||||
|
DevCon::Status( "\tClosing %s", params tbl_PluginInfo[pid].shortname );
|
||||||
if( pid == PluginId_GS )
|
if( pid == PluginId_GS )
|
||||||
{
|
{
|
||||||
if( mtgsThread == NULL ) return;
|
if( mtgsThread == NULL ) return;
|
||||||
|
@ -824,6 +839,8 @@ void PluginManager::Close( PluginsEnum_t pid )
|
||||||
|
|
||||||
void PluginManager::Close( bool closegs )
|
void PluginManager::Close( bool closegs )
|
||||||
{
|
{
|
||||||
|
Console::Status( "Closing plugins..." );
|
||||||
|
|
||||||
// Close plugins in reverse order of the initialization procedure.
|
// Close plugins in reverse order of the initialization procedure.
|
||||||
|
|
||||||
for( int i=PluginId_Count-1; i>=0; --i )
|
for( int i=PluginId_Count-1; i>=0; --i )
|
||||||
|
@ -831,6 +848,8 @@ void PluginManager::Close( bool closegs )
|
||||||
if( closegs || (tbl_PluginInfo[i].id != PluginId_GS) )
|
if( closegs || (tbl_PluginInfo[i].id != PluginId_GS) )
|
||||||
Close( tbl_PluginInfo[i].id );
|
Close( tbl_PluginInfo[i].id );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Console::Status( "Plugins closed successfully." );
|
||||||
}
|
}
|
||||||
|
|
||||||
// Initializes all plugins. Plugin initialization should be done once for every new emulation
|
// Initializes all plugins. Plugin initialization should be done once for every new emulation
|
||||||
|
@ -843,16 +862,25 @@ void PluginManager::Close( bool closegs )
|
||||||
//
|
//
|
||||||
void PluginManager::Init()
|
void PluginManager::Init()
|
||||||
{
|
{
|
||||||
|
bool printlog = false;
|
||||||
const PluginInfo* pi = tbl_PluginInfo-1;
|
const PluginInfo* pi = tbl_PluginInfo-1;
|
||||||
while( ++pi, pi->shortname != NULL )
|
while( ++pi, pi->shortname != NULL )
|
||||||
{
|
{
|
||||||
const PluginsEnum_t pid = pi->id;
|
const PluginsEnum_t pid = pi->id;
|
||||||
|
|
||||||
if( m_info[pid].IsInitialized ) continue;
|
if( m_info[pid].IsInitialized ) continue;
|
||||||
|
if( !printlog )
|
||||||
|
{
|
||||||
|
Console::Status( "Initializing plugins..." );
|
||||||
|
printlog = true;
|
||||||
|
}
|
||||||
|
Console::WriteLn( "\tInit %s", params tbl_PluginInfo[pid].shortname );
|
||||||
m_info[pid].IsInitialized = true;
|
m_info[pid].IsInitialized = true;
|
||||||
if( 0 != m_info[pid].CommonBindings.Init() )
|
if( 0 != m_info[pid].CommonBindings.Init() )
|
||||||
throw Exception::PluginInitError( pid );
|
throw Exception::PluginInitError( pid );
|
||||||
}
|
}
|
||||||
|
if( printlog )
|
||||||
|
Console::Status( "Plugins initialized successfully.\n" );
|
||||||
}
|
}
|
||||||
|
|
||||||
// Shuts down all plugins. Plugins are closed first, if necessary.
|
// Shuts down all plugins. Plugins are closed first, if necessary.
|
||||||
|
@ -865,6 +893,7 @@ void PluginManager::Shutdown()
|
||||||
{
|
{
|
||||||
Close();
|
Close();
|
||||||
|
|
||||||
|
Console::Status( "Shutting down plugins..." );
|
||||||
// Shutdown plugins in reverse order (probably doesn't matter...
|
// Shutdown plugins in reverse order (probably doesn't matter...
|
||||||
// ... but what the heck, right?)
|
// ... but what the heck, right?)
|
||||||
|
|
||||||
|
@ -872,9 +901,11 @@ void PluginManager::Shutdown()
|
||||||
{
|
{
|
||||||
const PluginsEnum_t pid = tbl_PluginInfo[i].id;
|
const PluginsEnum_t pid = tbl_PluginInfo[i].id;
|
||||||
if( !m_info[pid].IsInitialized ) continue;
|
if( !m_info[pid].IsInitialized ) continue;
|
||||||
|
DevCon::WriteLn( "\tShutdown %s", params tbl_PluginInfo[pid].shortname );
|
||||||
m_info[pid].IsInitialized = false;
|
m_info[pid].IsInitialized = false;
|
||||||
m_info[pid].CommonBindings.Shutdown();
|
m_info[pid].CommonBindings.Shutdown();
|
||||||
}
|
}
|
||||||
|
Console::Status( "Plugins shutdown successfully." );
|
||||||
}
|
}
|
||||||
|
|
||||||
void PluginManager::Freeze( PluginsEnum_t pid, int mode, freezeData* data )
|
void PluginManager::Freeze( PluginsEnum_t pid, int mode, freezeData* data )
|
||||||
|
|
|
@ -108,8 +108,8 @@ namespace R5900
|
||||||
|
|
||||||
static const int FPU_Mult = 4*8;
|
static const int FPU_Mult = 4*8;
|
||||||
|
|
||||||
static const int Store = 8;
|
static const int Store = 14;
|
||||||
static const int Load = 8;
|
static const int Load = 14;
|
||||||
}
|
}
|
||||||
|
|
||||||
using namespace Cycles;
|
using namespace Cycles;
|
||||||
|
|
121
pcsx2/SPR.cpp
121
pcsx2/SPR.cpp
|
@ -61,30 +61,32 @@ int _SPR0chain()
|
||||||
pMem = (u32*)dmaGetAddr(spr0->madr);
|
pMem = (u32*)dmaGetAddr(spr0->madr);
|
||||||
if (pMem == NULL) return -1;
|
if (pMem == NULL) return -1;
|
||||||
|
|
||||||
if ((psHu32(DMAC_CTRL) & 0xC) >= 0x8) // 0x8 VIF1 MFIFO, 0xC GIF MFIFO
|
switch (dmacRegs->ctrl.MFD)
|
||||||
{
|
{
|
||||||
if ((spr0->madr & ~psHu32(DMAC_RBSR)) != psHu32(DMAC_RBOR))
|
case MFD_VIF1:
|
||||||
Console::WriteLn("SPR MFIFO Write outside MFIFO area");
|
case MFD_GIF:
|
||||||
else
|
if ((spr0->madr & ~psHu32(DMAC_RBSR)) != psHu32(DMAC_RBOR))
|
||||||
mfifotransferred += spr0->qwc;
|
Console::WriteLn("SPR MFIFO Write outside MFIFO area");
|
||||||
|
else
|
||||||
hwMFIFOWrite(spr0->madr, (u8*)&PS2MEM_SCRATCH[spr0->sadr & 0x3fff], spr0->qwc << 4);
|
mfifotransferred += spr0->qwc;
|
||||||
spr0->madr += spr0->qwc << 4;
|
|
||||||
spr0->madr = psHu32(DMAC_RBOR) + (spr0->madr & psHu32(DMAC_RBSR));
|
hwMFIFOWrite(spr0->madr, (u8*)&PS2MEM_SCRATCH[spr0->sadr & 0x3fff], spr0->qwc << 4);
|
||||||
|
spr0->madr += spr0->qwc << 4;
|
||||||
}
|
spr0->madr = psHu32(DMAC_RBOR) + (spr0->madr & psHu32(DMAC_RBSR));
|
||||||
else
|
break;
|
||||||
{
|
|
||||||
memcpy_fast((u8*)pMem, &PS2MEM_SCRATCH[spr0->sadr & 0x3fff], spr0->qwc << 4);
|
case NO_MFD:
|
||||||
|
case MFD_RESERVED:
|
||||||
// clear VU mem also!
|
memcpy_fast((u8*)pMem, &PS2MEM_SCRATCH[spr0->sadr & 0x3fff], spr0->qwc << 4);
|
||||||
TestClearVUs(spr0->madr, spr0->qwc << 2); // Wtf is going on here? AFAIK, only VIF should affect VU micromem (cottonvibes)
|
|
||||||
|
// clear VU mem also!
|
||||||
spr0->madr += spr0->qwc << 4;
|
TestClearVUs(spr0->madr, spr0->qwc << 2); // Wtf is going on here? AFAIK, only VIF should affect VU micromem (cottonvibes)
|
||||||
|
spr0->madr += spr0->qwc << 4;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
spr0->sadr += spr0->qwc << 4;
|
spr0->sadr += spr0->qwc << 4;
|
||||||
|
|
||||||
|
|
||||||
return (spr0->qwc) * BIAS; // bus is 1/2 the ee speed
|
return (spr0->qwc) * BIAS; // bus is 1/2 the ee speed
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -98,8 +100,8 @@ __forceinline void SPR0chain()
|
||||||
void _SPR0interleave()
|
void _SPR0interleave()
|
||||||
{
|
{
|
||||||
int qwc = spr0->qwc;
|
int qwc = spr0->qwc;
|
||||||
int sqwc = psHu32(DMAC_SQWC) & 0xff;
|
int sqwc = dmacRegs->sqwc.SQWC;
|
||||||
int tqwc = (psHu32(DMAC_SQWC) >> 16) & 0xff;
|
int tqwc = dmacRegs->sqwc.TQWC;
|
||||||
u32 *pMem;
|
u32 *pMem;
|
||||||
|
|
||||||
if (tqwc == 0) tqwc = qwc;
|
if (tqwc == 0) tqwc = qwc;
|
||||||
|
@ -112,18 +114,22 @@ void _SPR0interleave()
|
||||||
spr0->qwc = std::min(tqwc, qwc);
|
spr0->qwc = std::min(tqwc, qwc);
|
||||||
qwc -= spr0->qwc;
|
qwc -= spr0->qwc;
|
||||||
pMem = (u32*)dmaGetAddr(spr0->madr);
|
pMem = (u32*)dmaGetAddr(spr0->madr);
|
||||||
if ((((psHu32(DMAC_CTRL) & 0xC) == 0xC) || // GIF MFIFO
|
|
||||||
(psHu32(DMAC_CTRL) & 0xC) == 0x8)) // VIF1 MFIFO
|
switch (dmacRegs->ctrl.MFD)
|
||||||
{
|
{
|
||||||
hwMFIFOWrite(spr0->madr, (u8*)&PS2MEM_SCRATCH[spr0->sadr & 0x3fff], spr0->qwc << 4);
|
case MFD_VIF1:
|
||||||
mfifotransferred += spr0->qwc;
|
case MFD_GIF:
|
||||||
}
|
hwMFIFOWrite(spr0->madr, (u8*)&PS2MEM_SCRATCH[spr0->sadr & 0x3fff], spr0->qwc << 4);
|
||||||
else
|
mfifotransferred += spr0->qwc;
|
||||||
{
|
break;
|
||||||
// clear VU mem also!
|
|
||||||
TestClearVUs(spr0->madr, spr0->qwc << 2);
|
case NO_MFD:
|
||||||
memcpy_fast((u8*)pMem, &PS2MEM_SCRATCH[spr0->sadr & 0x3fff], spr0->qwc << 4);
|
case MFD_RESERVED:
|
||||||
}
|
// clear VU mem also!
|
||||||
|
TestClearVUs(spr0->madr, spr0->qwc << 2);
|
||||||
|
memcpy_fast((u8*)pMem, &PS2MEM_SCRATCH[spr0->sadr & 0x3fff], spr0->qwc << 4);
|
||||||
|
break;
|
||||||
|
}
|
||||||
spr0->sadr += spr0->qwc * 16;
|
spr0->sadr += spr0->qwc * 16;
|
||||||
spr0->madr += (sqwc + spr0->qwc) * 16;
|
spr0->madr += (sqwc + spr0->qwc) * 16;
|
||||||
}
|
}
|
||||||
|
@ -134,7 +140,7 @@ void _SPR0interleave()
|
||||||
|
|
||||||
static __forceinline void _dmaSPR0()
|
static __forceinline void _dmaSPR0()
|
||||||
{
|
{
|
||||||
if ((psHu32(DMAC_CTRL) & 0x30) == 0x20) // STS == fromSPR
|
if (dmacRegs->ctrl.STS == STS_fromSPR) // STS == fromSPR
|
||||||
{
|
{
|
||||||
Console::WriteLn("SPR0 stall %d", params(psHu32(DMAC_CTRL) >> 6)&3);
|
Console::WriteLn("SPR0 stall %d", params(psHu32(DMAC_CTRL) >> 6)&3);
|
||||||
}
|
}
|
||||||
|
@ -172,7 +178,7 @@ static __forceinline void _dmaSPR0()
|
||||||
SPR_LOG("spr0 dmaChain %8.8x_%8.8x size=%d, id=%d, addr=%lx spr=%lx",
|
SPR_LOG("spr0 dmaChain %8.8x_%8.8x size=%d, id=%d, addr=%lx spr=%lx",
|
||||||
ptag[1], ptag[0], spr0->qwc, id, spr0->madr, spr0->sadr);
|
ptag[1], ptag[0], spr0->qwc, id, spr0->madr, spr0->sadr);
|
||||||
|
|
||||||
if ((psHu32(DMAC_CTRL) & 0x30) == 0x20) // STS == fromSPR
|
if (dmacRegs->ctrl.STS == STS_fromSPR) // STS == fromSPR
|
||||||
{
|
{
|
||||||
Console::WriteLn("SPR stall control");
|
Console::WriteLn("SPR stall control");
|
||||||
}
|
}
|
||||||
|
@ -225,23 +231,30 @@ void SPRFROMinterrupt()
|
||||||
|
|
||||||
if(mfifotransferred != 0)
|
if(mfifotransferred != 0)
|
||||||
{
|
{
|
||||||
if ((psHu32(DMAC_CTRL) & 0xC) == 0xC) // GIF MFIFO
|
switch (dmacRegs->ctrl.MFD)
|
||||||
{
|
{
|
||||||
if ((spr0->madr & ~psHu32(DMAC_RBSR)) != psHu32(DMAC_RBOR)) Console::WriteLn("GIF MFIFO Write outside MFIFO area");
|
case MFD_GIF:
|
||||||
spr0->madr = psHu32(DMAC_RBOR) + (spr0->madr & psHu32(DMAC_RBSR));
|
{
|
||||||
//Console::WriteLn("mfifoGIFtransfer %x madr %x, tadr %x", params gif->chcr._u32, gif->madr, gif->tadr);
|
if ((spr0->madr & ~psHu32(DMAC_RBSR)) != psHu32(DMAC_RBOR)) Console::WriteLn("GIF MFIFO Write outside MFIFO area");
|
||||||
mfifoGIFtransfer(mfifotransferred);
|
spr0->madr = psHu32(DMAC_RBOR) + (spr0->madr & psHu32(DMAC_RBSR));
|
||||||
mfifotransferred = 0;
|
//Console::WriteLn("mfifoGIFtransfer %x madr %x, tadr %x", params gif->chcr._u32, gif->madr, gif->tadr);
|
||||||
if (gif->chcr.STR) return;
|
mfifoGIFtransfer(mfifotransferred);
|
||||||
}
|
mfifotransferred = 0;
|
||||||
else if ((psHu32(DMAC_CTRL) & 0xC) == 0x8) // VIF1 MFIFO
|
if (gif->chcr.STR) return;
|
||||||
{
|
break;
|
||||||
if ((spr0->madr & ~psHu32(DMAC_RBSR)) != psHu32(DMAC_RBOR)) Console::WriteLn("VIF MFIFO Write outside MFIFO area");
|
}
|
||||||
spr0->madr = psHu32(DMAC_RBOR) + (spr0->madr & psHu32(DMAC_RBSR));
|
case MFD_VIF1:
|
||||||
//Console::WriteLn("mfifoVIF1transfer %x madr %x, tadr %x", params vif1ch->chcr._u32, vif1ch->madr, vif1ch->tadr);
|
{
|
||||||
mfifoVIF1transfer(mfifotransferred);
|
if ((spr0->madr & ~psHu32(DMAC_RBSR)) != psHu32(DMAC_RBOR)) Console::WriteLn("VIF MFIFO Write outside MFIFO area");
|
||||||
mfifotransferred = 0;
|
spr0->madr = psHu32(DMAC_RBOR) + (spr0->madr & psHu32(DMAC_RBSR));
|
||||||
if (vif1ch->chcr.STR) return;
|
//Console::WriteLn("mfifoVIF1transfer %x madr %x, tadr %x", params vif1ch->chcr._u32, vif1ch->madr, vif1ch->tadr);
|
||||||
|
mfifoVIF1transfer(mfifotransferred);
|
||||||
|
mfifotransferred = 0;
|
||||||
|
if (vif1ch->chcr.STR) return;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
default:
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (spr0finished == 0) return;
|
if (spr0finished == 0) return;
|
||||||
|
@ -300,8 +313,8 @@ __forceinline void SPR1chain()
|
||||||
void _SPR1interleave()
|
void _SPR1interleave()
|
||||||
{
|
{
|
||||||
int qwc = spr1->qwc;
|
int qwc = spr1->qwc;
|
||||||
int sqwc = psHu32(DMAC_SQWC) & 0xff;
|
int sqwc = dmacRegs->sqwc.SQWC;
|
||||||
int tqwc = (psHu32(DMAC_SQWC) >> 16) & 0xff;
|
int tqwc = dmacRegs->sqwc.TQWC;
|
||||||
u32 *pMem;
|
u32 *pMem;
|
||||||
|
|
||||||
if (tqwc == 0) tqwc = qwc;
|
if (tqwc == 0) tqwc = qwc;
|
||||||
|
|
|
@ -32,6 +32,10 @@
|
||||||
#include "CDVD/CDVD.h"
|
#include "CDVD/CDVD.h"
|
||||||
#include "ps2/CoreEmuThread.h"
|
#include "ps2/CoreEmuThread.h"
|
||||||
|
|
||||||
|
#ifndef __LINUX__
|
||||||
|
#include "svnrev.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
using namespace std;
|
using namespace std;
|
||||||
|
|
||||||
Pcsx2Config EmuConfig;
|
Pcsx2Config EmuConfig;
|
||||||
|
@ -49,10 +53,9 @@ void SysDetect()
|
||||||
{
|
{
|
||||||
using namespace Console;
|
using namespace Console;
|
||||||
|
|
||||||
if( sysInitialized ) return;
|
Notice("PCSX2 %d.%d.%d.r%d %s - compiled on " __DATE__, params PCSX2_VersionHi, PCSX2_VersionMid, PCSX2_VersionLo,
|
||||||
sysInitialized = true;
|
SVN_REV, SVN_MODS ? "(modded)" : ""
|
||||||
|
);
|
||||||
Notice("PCSX2 " PCSX2_VERSION " - compiled on " __DATE__ );
|
|
||||||
Notice("Savestate version: %x", params g_SaveVersion);
|
Notice("Savestate version: %x", params g_SaveVersion);
|
||||||
|
|
||||||
cpudetectInit();
|
cpudetectInit();
|
||||||
|
@ -64,7 +67,7 @@ void SysDetect()
|
||||||
L"\tCPU vendor name = %s\n"
|
L"\tCPU vendor name = %s\n"
|
||||||
L"\tFamilyID = %x\n"
|
L"\tFamilyID = %x\n"
|
||||||
L"\tx86Family = %s\n"
|
L"\tx86Family = %s\n"
|
||||||
L"\tCPU speed = %d.%03d Ghz\n"
|
L"\tCPU speed = %d.%03d ghz\n"
|
||||||
L"\tCores = %d physical [%d logical]\n"
|
L"\tCores = %d physical [%d logical]\n"
|
||||||
L"\tx86PType = %s\n"
|
L"\tx86PType = %s\n"
|
||||||
L"\tx86Flags = %8.8x %8.8x\n"
|
L"\tx86Flags = %8.8x %8.8x\n"
|
||||||
|
@ -424,6 +427,9 @@ static void InitFolderStructure()
|
||||||
// Returns FALSE if the core/recompiler memory allocations failed.
|
// Returns FALSE if the core/recompiler memory allocations failed.
|
||||||
bool SysInit()
|
bool SysInit()
|
||||||
{
|
{
|
||||||
|
if( sysInitialized ) return true;
|
||||||
|
sysInitialized = true;
|
||||||
|
|
||||||
PCSX2_MEM_PROTECT_BEGIN();
|
PCSX2_MEM_PROTECT_BEGIN();
|
||||||
SysDetect();
|
SysDetect();
|
||||||
if( !SysAllocateMem() )
|
if( !SysAllocateMem() )
|
||||||
|
|
|
@ -24,6 +24,11 @@
|
||||||
#include "Misc.h"
|
#include "Misc.h"
|
||||||
#include "CDVD/CDVDaccess.h"
|
#include "CDVD/CDVDaccess.h"
|
||||||
|
|
||||||
|
static const int PCSX2_VersionHi = 0;
|
||||||
|
static const int PCSX2_VersionMid = 9;
|
||||||
|
static const int PCSX2_VersionLo = 7;
|
||||||
|
|
||||||
|
|
||||||
class CoreEmuThread;
|
class CoreEmuThread;
|
||||||
|
|
||||||
extern bool SysInit();
|
extern bool SysInit();
|
||||||
|
|
|
@ -22,6 +22,7 @@
|
||||||
#include "Vif.h"
|
#include "Vif.h"
|
||||||
#include "VUmicro.h"
|
#include "VUmicro.h"
|
||||||
#include "GS.h"
|
#include "GS.h"
|
||||||
|
#include "Gif.h"
|
||||||
#include "VifDma.h"
|
#include "VifDma.h"
|
||||||
#include "Tags.h"
|
#include "Tags.h"
|
||||||
|
|
||||||
|
@ -1447,7 +1448,7 @@ void vif0Interrupt()
|
||||||
if ((vif0ch->chcr.MOD == CHAIN_MODE) && (!vif0.done) && (!vif0.vifstalled))
|
if ((vif0ch->chcr.MOD == CHAIN_MODE) && (!vif0.done) && (!vif0.vifstalled))
|
||||||
{
|
{
|
||||||
|
|
||||||
if (!(psHu32(DMAC_CTRL) & 0x1))
|
if (!(dmacRegs->ctrl.DMAE))
|
||||||
{
|
{
|
||||||
Console::WriteLn("vif0 dma masked");
|
Console::WriteLn("vif0 dma masked");
|
||||||
return;
|
return;
|
||||||
|
@ -2331,7 +2332,7 @@ void vif1TransferFromMemory()
|
||||||
if (pMem == NULL) //Is vif0ptag empty?
|
if (pMem == NULL) //Is vif0ptag empty?
|
||||||
{
|
{
|
||||||
Console::WriteLn("Vif1 Tag BUSERR");
|
Console::WriteLn("Vif1 Tag BUSERR");
|
||||||
psHu32(DMAC_STAT) |= DMAC_STAT_BEIS; //If yes, set BEIS (BUSERR) in DMAC_STAT register
|
dmacRegs->stat.BEIS = 1; //If yes, set BEIS (BUSERR) in DMAC_STAT register
|
||||||
vif1.done = true;
|
vif1.done = true;
|
||||||
vif1Regs->stat &= ~VIF1_STAT_FQC;
|
vif1Regs->stat &= ~VIF1_STAT_FQC;
|
||||||
vif1ch->qwc = 0;
|
vif1ch->qwc = 0;
|
||||||
|
@ -2448,7 +2449,7 @@ __forceinline void vif1SetupTransfer()
|
||||||
VIF_LOG("VIF1 Tag %8.8x_%8.8x size=%d, id=%d, madr=%lx, tadr=%lx\n",
|
VIF_LOG("VIF1 Tag %8.8x_%8.8x size=%d, id=%d, madr=%lx, tadr=%lx\n",
|
||||||
vif1ptag[1], vif1ptag[0], vif1ch->qwc, id, vif1ch->madr, vif1ch->tadr);
|
vif1ptag[1], vif1ptag[0], vif1ch->qwc, id, vif1ch->madr, vif1ch->tadr);
|
||||||
|
|
||||||
if (!vif1.done && ((psHu32(DMAC_CTRL) & 0xC0) == 0x40) && (id == 4)) // STD == VIF1
|
if (!vif1.done && ((dmacRegs->ctrl.STD == STD_VIF1) && (id == 4))) // STD == VIF1
|
||||||
{
|
{
|
||||||
// there are still bugs, need to also check if gif->madr +16*qwc >= stadr, if not, stall
|
// there are still bugs, need to also check if gif->madr +16*qwc >= stadr, if not, stall
|
||||||
if ((vif1ch->madr + vif1ch->qwc * 16) >= psHu32(DMAC_STADR))
|
if ((vif1ch->madr + vif1ch->qwc * 16) >= psHu32(DMAC_STADR))
|
||||||
|
@ -2544,7 +2545,7 @@ __forceinline void vif1Interrupt()
|
||||||
if (!vif1.done)
|
if (!vif1.done)
|
||||||
{
|
{
|
||||||
|
|
||||||
if (!(psHu32(DMAC_CTRL) & 0x1))
|
if (!(dmacRegs->ctrl.DMAE))
|
||||||
{
|
{
|
||||||
Console::WriteLn("vif1 dma masked");
|
Console::WriteLn("vif1 dma masked");
|
||||||
return;
|
return;
|
||||||
|
@ -2588,7 +2589,7 @@ void dmaVIF1()
|
||||||
g_vifCycles = 0;
|
g_vifCycles = 0;
|
||||||
vif1.inprogress = 0;
|
vif1.inprogress = 0;
|
||||||
|
|
||||||
if (((psHu32(DMAC_CTRL) & 0xC) == 0x8)) // VIF MFIFO
|
if (dmacRegs->ctrl.MFD == MFD_VIF1) // VIF MFIFO
|
||||||
{
|
{
|
||||||
//Console::WriteLn("VIFMFIFO\n");
|
//Console::WriteLn("VIFMFIFO\n");
|
||||||
// Test changed because the Final Fantasy 12 opening somehow has the tag in *Undefined* mode, which is not in the documentation that I saw.
|
// Test changed because the Final Fantasy 12 opening somehow has the tag in *Undefined* mode, which is not in the documentation that I saw.
|
||||||
|
@ -2598,7 +2599,7 @@ void dmaVIF1()
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef PCSX2_DEVBUILD
|
#ifdef PCSX2_DEVBUILD
|
||||||
if ((psHu32(DMAC_CTRL) & 0xC0) == 0x40) // STD == VIF1
|
if (dmacRegs->ctrl.STD == STD_VIF1)
|
||||||
{
|
{
|
||||||
//DevCon::WriteLn("VIF Stall Control Source = %x, Drain = %x", params (psHu32(0xe000) >> 4) & 0x3, (psHu32(0xe000) >> 6) & 0x3);
|
//DevCon::WriteLn("VIF Stall Control Source = %x, Drain = %x", params (psHu32(0xe000) >> 4) & 0x3, (psHu32(0xe000) >> 6) & 0x3);
|
||||||
}
|
}
|
||||||
|
@ -2607,7 +2608,7 @@ void dmaVIF1()
|
||||||
if ((vif1ch->chcr.MOD == NORMAL_MODE) || vif1ch->qwc > 0) // Normal Mode
|
if ((vif1ch->chcr.MOD == NORMAL_MODE) || vif1ch->qwc > 0) // Normal Mode
|
||||||
{
|
{
|
||||||
|
|
||||||
if ((psHu32(DMAC_CTRL) & 0xC0) == 0x40)
|
if (dmacRegs->ctrl.STD == STD_VIF1)
|
||||||
Console::WriteLn("DMA Stall Control on VIF1 normal");
|
Console::WriteLn("DMA Stall Control on VIF1 normal");
|
||||||
|
|
||||||
if (vif1ch->chcr.DIR) // to Memory
|
if (vif1ch->chcr.DIR) // to Memory
|
||||||
|
@ -2658,7 +2659,7 @@ void vif1Write32(u32 mem, u32 value)
|
||||||
if(vif1Regs->mskpath3)
|
if(vif1Regs->mskpath3)
|
||||||
{
|
{
|
||||||
vif1Regs->mskpath3 = 0;
|
vif1Regs->mskpath3 = 0;
|
||||||
psHu32(GIF_STAT) &= ~GIF_STAT_IMT;
|
gifRegs->stat.IMT = 0;
|
||||||
if (gif->chcr.STR) CPU_INT(2, 4);
|
if (gif->chcr.STR) CPU_INT(2, 4);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -32,6 +32,7 @@
|
||||||
|
|
||||||
class IniInterface;
|
class IniInterface;
|
||||||
|
|
||||||
|
|
||||||
// ------------------------------------------------------------------------
|
// ------------------------------------------------------------------------
|
||||||
// All Menu Options for the Main Window! :D
|
// All Menu Options for the Main Window! :D
|
||||||
// ------------------------------------------------------------------------
|
// ------------------------------------------------------------------------
|
||||||
|
|
|
@ -275,7 +275,6 @@ namespace FilenameDefs
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
// ------------------------------------------------------------------------
|
|
||||||
wxFileName wxDirName::Combine( const wxFileName& right ) const
|
wxFileName wxDirName::Combine( const wxFileName& right ) const
|
||||||
{
|
{
|
||||||
wxASSERT_MSG( IsDir(), L"Warning: Malformed directory name detected during wxDirName concatenation." );
|
wxASSERT_MSG( IsDir(), L"Warning: Malformed directory name detected during wxDirName concatenation." );
|
||||||
|
@ -291,7 +290,6 @@ wxFileName wxDirName::Combine( const wxFileName& right ) const
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------
|
|
||||||
wxDirName wxDirName::Combine( const wxDirName& right ) const
|
wxDirName wxDirName::Combine( const wxDirName& right ) const
|
||||||
{
|
{
|
||||||
wxASSERT_MSG( IsDir() && right.IsDir(), L"Warning: Malformed directory name detected during wDirName concatenation." );
|
wxASSERT_MSG( IsDir() && right.IsDir(), L"Warning: Malformed directory name detected during wDirName concatenation." );
|
||||||
|
@ -301,7 +299,6 @@ wxDirName wxDirName::Combine( const wxDirName& right ) const
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------
|
|
||||||
wxDirName& wxDirName::Normalize( int flags, const wxString& cwd )
|
wxDirName& wxDirName::Normalize( int flags, const wxString& cwd )
|
||||||
{
|
{
|
||||||
wxASSERT_MSG( IsDir(), L"Warning: Malformed directory name detected during wDirName normalization." );
|
wxASSERT_MSG( IsDir(), L"Warning: Malformed directory name detected during wDirName normalization." );
|
||||||
|
@ -310,7 +307,6 @@ wxDirName& wxDirName::Normalize( int flags, const wxString& cwd )
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------
|
|
||||||
wxDirName& wxDirName::MakeRelativeTo( const wxString& pathBase )
|
wxDirName& wxDirName::MakeRelativeTo( const wxString& pathBase )
|
||||||
{
|
{
|
||||||
wxASSERT_MSG( IsDir(), L"Warning: Malformed directory name detected during wDirName normalization." );
|
wxASSERT_MSG( IsDir(), L"Warning: Malformed directory name detected during wDirName normalization." );
|
||||||
|
@ -319,7 +315,6 @@ wxDirName& wxDirName::MakeRelativeTo( const wxString& pathBase )
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------
|
|
||||||
wxDirName& wxDirName::MakeAbsolute( const wxString& cwd )
|
wxDirName& wxDirName::MakeAbsolute( const wxString& cwd )
|
||||||
{
|
{
|
||||||
wxASSERT_MSG( IsDir(), L"Warning: Malformed directory name detected during wDirName normalization." );
|
wxASSERT_MSG( IsDir(), L"Warning: Malformed directory name detected during wDirName normalization." );
|
||||||
|
@ -328,7 +323,6 @@ wxDirName& wxDirName::MakeAbsolute( const wxString& cwd )
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------
|
|
||||||
void wxDirName::Rmdir()
|
void wxDirName::Rmdir()
|
||||||
{
|
{
|
||||||
if( !Exists() ) return;
|
if( !Exists() ) return;
|
||||||
|
@ -342,7 +336,6 @@ bool wxDirName::Mkdir()
|
||||||
return wxFileName::Mkdir();
|
return wxFileName::Mkdir();
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------
|
|
||||||
wxString AppConfig::FullpathTo( PluginsEnum_t pluginidx ) const
|
wxString AppConfig::FullpathTo( PluginsEnum_t pluginidx ) const
|
||||||
{
|
{
|
||||||
return Path::Combine( Folders.Plugins, BaseFilenames[pluginidx] );
|
return Path::Combine( Folders.Plugins, BaseFilenames[pluginidx] );
|
||||||
|
@ -482,7 +475,7 @@ AppConfig::ConsoleLogOptions::ConsoleLogOptions() :
|
||||||
Visible( false )
|
Visible( false )
|
||||||
, AutoDock( true )
|
, AutoDock( true )
|
||||||
, DisplayPosition( wxDefaultPosition )
|
, DisplayPosition( wxDefaultPosition )
|
||||||
, DisplaySize( wxSize( 540, 540 ) )
|
, DisplaySize( wxSize( 680, 560 ) )
|
||||||
, FontSize( 8 )
|
, FontSize( 8 )
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
|
@ -590,6 +590,8 @@ namespace Console
|
||||||
|
|
||||||
void __fastcall SetTitle( const wxString& title )
|
void __fastcall SetTitle( const wxString& title )
|
||||||
{
|
{
|
||||||
|
if( wxTheApp == NULL ) return;
|
||||||
|
|
||||||
wxCommandEvent evt( wxEVT_SetTitleText );
|
wxCommandEvent evt( wxEVT_SetTitleText );
|
||||||
evt.SetString( title );
|
evt.SetString( title );
|
||||||
wxGetApp().ProgramLog_PostEvent( evt );
|
wxGetApp().ProgramLog_PostEvent( evt );
|
||||||
|
@ -609,6 +611,8 @@ namespace Console
|
||||||
{
|
{
|
||||||
_immediate_logger( "\n" );
|
_immediate_logger( "\n" );
|
||||||
|
|
||||||
|
if( wxTheApp == NULL ) return false;
|
||||||
|
|
||||||
wxCommandEvent evt( wxEVT_LOG_Newline );
|
wxCommandEvent evt( wxEVT_LOG_Newline );
|
||||||
wxGetApp().ProgramLog_PostEvent( evt );
|
wxGetApp().ProgramLog_PostEvent( evt );
|
||||||
wxGetApp().ProgramLog_CountMsg();
|
wxGetApp().ProgramLog_CountMsg();
|
||||||
|
@ -620,6 +624,8 @@ namespace Console
|
||||||
{
|
{
|
||||||
_immediate_logger( fmt );
|
_immediate_logger( fmt );
|
||||||
|
|
||||||
|
if( wxTheApp == NULL ) return false;
|
||||||
|
|
||||||
wxCommandEvent evt( wxEVT_LOG_Write );
|
wxCommandEvent evt( wxEVT_LOG_Write );
|
||||||
evt.SetString( wxString::FromAscii( fmt ) );
|
evt.SetString( wxString::FromAscii( fmt ) );
|
||||||
evt.SetExtraLong( th_CurrentColor );
|
evt.SetExtraLong( th_CurrentColor );
|
||||||
|
@ -633,6 +639,8 @@ namespace Console
|
||||||
{
|
{
|
||||||
_immediate_logger( fmt );
|
_immediate_logger( fmt );
|
||||||
|
|
||||||
|
if( wxTheApp == NULL ) return false;
|
||||||
|
|
||||||
wxCommandEvent evt( wxEVT_LOG_Write );
|
wxCommandEvent evt( wxEVT_LOG_Write );
|
||||||
evt.SetString( fmt );
|
evt.SetString( fmt );
|
||||||
evt.SetExtraLong( th_CurrentColor );
|
evt.SetExtraLong( th_CurrentColor );
|
||||||
|
@ -653,6 +661,7 @@ namespace Console
|
||||||
// Implementation note: I've duplicated Write+Newline behavior here to avoid polluting
|
// Implementation note: I've duplicated Write+Newline behavior here to avoid polluting
|
||||||
// the message pump with lots of erroneous messages (Newlines can be bound into Write message).
|
// the message pump with lots of erroneous messages (Newlines can be bound into Write message).
|
||||||
|
|
||||||
|
if( wxTheApp == NULL ) return false;
|
||||||
wxCommandEvent evt( wxEVT_LOG_Write );
|
wxCommandEvent evt( wxEVT_LOG_Write );
|
||||||
evt.SetString( fmtline );
|
evt.SetString( fmtline );
|
||||||
evt.SetExtraLong( th_CurrentColor );
|
evt.SetExtraLong( th_CurrentColor );
|
||||||
|
@ -673,6 +682,7 @@ namespace Console
|
||||||
// Implementation note: I've duplicated Write+Newline behavior here to avoid polluting
|
// Implementation note: I've duplicated Write+Newline behavior here to avoid polluting
|
||||||
// the message pump with lots of erroneous messages (Newlines can be bound into Write message).
|
// the message pump with lots of erroneous messages (Newlines can be bound into Write message).
|
||||||
|
|
||||||
|
if( wxTheApp == NULL ) return false;
|
||||||
wxCommandEvent evt( wxEVT_LOG_Write );
|
wxCommandEvent evt( wxEVT_LOG_Write );
|
||||||
evt.SetString( fmtline );
|
evt.SetString( fmtline );
|
||||||
evt.SetExtraLong( th_CurrentColor );
|
evt.SetExtraLong( th_CurrentColor );
|
||||||
|
|
|
@ -22,6 +22,10 @@
|
||||||
#include "Resources/EmbeddedImage.h"
|
#include "Resources/EmbeddedImage.h"
|
||||||
#include "Resources/AppIcon.h"
|
#include "Resources/AppIcon.h"
|
||||||
|
|
||||||
|
#ifdef _WIN32
|
||||||
|
#include "svnrev.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
// ------------------------------------------------------------------------
|
// ------------------------------------------------------------------------
|
||||||
/*wxMenu* MainEmuFrame::MakeStatesMenu()
|
/*wxMenu* MainEmuFrame::MakeStatesMenu()
|
||||||
{
|
{
|
||||||
|
@ -275,7 +279,22 @@ MainEmuFrame::MainEmuFrame(wxWindow* parent, const wxString& title):
|
||||||
|
|
||||||
wxSize backsize( m_background.GetSize() );
|
wxSize backsize( m_background.GetSize() );
|
||||||
|
|
||||||
SetTitle(_("PCSX2"));
|
wxString wintitle;
|
||||||
|
if( PCSX2_VersionLo & 1 )
|
||||||
|
{
|
||||||
|
// Odd versions: beta / development editions, which feature revision number and compile date.
|
||||||
|
wintitle.Printf( _("PCSX2 %d.%d.%d.%d%s (svn) %s"), PCSX2_VersionHi, PCSX2_VersionMid, PCSX2_VersionLo,
|
||||||
|
SVN_REV, SVN_MODS ? L"m" : wxEmptyString, wxString::FromUTF8(__DATE__).c_str() );
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// evens: stable releases, with a simpler title.
|
||||||
|
wintitle.Printf( _("PCSX2 %d.%d.%d %s"), PCSX2_VersionHi, PCSX2_VersionMid, PCSX2_VersionLo,
|
||||||
|
SVN_MODS ? _("(modded)") : wxEmptyString
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
SetTitle( wintitle );
|
||||||
|
|
||||||
wxIcon myIcon;
|
wxIcon myIcon;
|
||||||
myIcon.CopyFromBitmap( wxBitmap( EmbeddedImage<png_AppIcon>().Rescale( 32, 32 ) ) );
|
myIcon.CopyFromBitmap( wxBitmap( EmbeddedImage<png_AppIcon>().Rescale( 32, 32 ) ) );
|
||||||
|
|
|
@ -302,6 +302,8 @@ bool Pcsx2App::OnInit()
|
||||||
m_MainFrame->Show();
|
m_MainFrame->Show();
|
||||||
|
|
||||||
SysInit();
|
SysInit();
|
||||||
|
ApplySettings();
|
||||||
|
InitPlugins();
|
||||||
}
|
}
|
||||||
catch( Exception::StartupAborted& )
|
catch( Exception::StartupAborted& )
|
||||||
{
|
{
|
||||||
|
@ -310,8 +312,6 @@ bool Pcsx2App::OnInit()
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
ApplySettings();
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -280,24 +280,25 @@ u32* recGetImm64(u32 hi, u32 lo)
|
||||||
u32 *imm64; // returned pointer
|
u32 *imm64; // returned pointer
|
||||||
static u32 *imm64_cache[509];
|
static u32 *imm64_cache[509];
|
||||||
int cacheidx = lo % (sizeof imm64_cache / sizeof *imm64_cache);
|
int cacheidx = lo % (sizeof imm64_cache / sizeof *imm64_cache);
|
||||||
//static int count; count++;
|
|
||||||
|
|
||||||
imm64 = imm64_cache[cacheidx];
|
imm64 = imm64_cache[cacheidx];
|
||||||
if (imm64 && imm64[0] == lo && imm64[1] == hi)
|
if (imm64 && imm64[0] == lo && imm64[1] == hi)
|
||||||
return imm64;
|
return imm64;
|
||||||
|
|
||||||
if (recConstBufPtr >= recConstBuf + RECCONSTBUF_SIZE) {
|
if (recConstBufPtr >= recConstBuf + RECCONSTBUF_SIZE)
|
||||||
// TODO: flag an error in recompilation which would reset the recompiler
|
{
|
||||||
// immediately and recompile the current block again. There is currently
|
Console::Status( "EErec const buffer filled; Resetting..." );
|
||||||
// no way to do this, so have a last ditch attempt at making things sane
|
throw Exception::RecompilerReset();
|
||||||
// and return some nonsense if that fails.
|
|
||||||
for (u32 *p = recConstBuf; p < recConstBuf + RECCONSTBUF_SIZE; p += 2)
|
/*for (u32 *p = recConstBuf; p < recConstBuf + RECCONSTBUF_SIZE; p += 2)
|
||||||
|
{
|
||||||
if (p[0] == lo && p[1] == hi) {
|
if (p[0] == lo && p[1] == hi) {
|
||||||
imm64_cache[cacheidx] = p;
|
imm64_cache[cacheidx] = p;
|
||||||
return p;
|
return p;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return recConstBuf;
|
return recConstBuf;*/
|
||||||
}
|
}
|
||||||
|
|
||||||
imm64 = recConstBufPtr;
|
imm64 = recConstBufPtr;
|
||||||
|
|
|
@ -88,7 +88,7 @@ microVUt(void) mVUreset(mV) {
|
||||||
u8* z = (mVU->cache + 0x1000); // Dispatcher Code is in first page of cache
|
u8* z = (mVU->cache + 0x1000); // Dispatcher Code is in first page of cache
|
||||||
mVU->prog.x86start = z;
|
mVU->prog.x86start = z;
|
||||||
mVU->prog.x86ptr = z;
|
mVU->prog.x86ptr = z;
|
||||||
mVU->prog.x86end = (u8*)((uptr)z + (uptr)(mVU->cacheSize - (mVU->cacheSize*.05)));
|
mVU->prog.x86end = (u8*)((uptr)z + (uptr)(mVU->cacheSize - (_1mb * 3))); // 3mb "Safe Zone"
|
||||||
|
|
||||||
for (int i = 0; i <= mVU->prog.max; i++) {
|
for (int i = 0; i <= mVU->prog.max; i++) {
|
||||||
if (!mVU->index) mVUclearProg<0>(i);
|
if (!mVU->index) mVUclearProg<0>(i);
|
||||||
|
|
|
@ -96,11 +96,12 @@ public:
|
||||||
}
|
}
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
void printInfo() {
|
void printInfo(int pc) {
|
||||||
|
if (listI < 7) return;
|
||||||
microBlockLink* linkI = &blockList;
|
microBlockLink* linkI = &blockList;
|
||||||
for (int i = 0; i <= listI; i++) {
|
for (int i = 0; i <= listI; i++) {
|
||||||
DevCon::Status("[Block #%d][q=%02d][p=%02d][xgkick=%d][vi15=%08x][viBackup=%02d][flags=%02x][exactMatch=%x]",
|
DevCon::Status("[%04x][Block #%d][q=%02d][p=%02d][xgkick=%d][vi15=%08x][viBackup=%02d][flags=%02x][exactMatch=%x]",
|
||||||
params i, linkI->block->pState.q, linkI->block->pState.p, linkI->block->pState.xgkick, linkI->block->pState.vi15,
|
params pc, i, linkI->block->pState.q, linkI->block->pState.p, linkI->block->pState.xgkick, linkI->block->pState.vi15,
|
||||||
linkI->block->pState.viBackUp, linkI->block->pState.flags, linkI->block->pState.needExactMatch);
|
linkI->block->pState.viBackUp, linkI->block->pState.flags, linkI->block->pState.needExactMatch);
|
||||||
linkI = linkI->next;
|
linkI = linkI->next;
|
||||||
}
|
}
|
||||||
|
@ -142,7 +143,7 @@ struct microProgManager {
|
||||||
microRegInfo lpState; // Pipeline state from where program left off (useful for continuing execution)
|
microRegInfo lpState; // Pipeline state from where program left off (useful for continuing execution)
|
||||||
};
|
};
|
||||||
|
|
||||||
#define mVUcacheSize (mMaxProg * (0x100000 * 0.5)) // 0.5mb per program
|
#define mVUcacheSize ((mMaxProg < 20) ? (_1mb * 10) : (mMaxProg * (_1mb * 0.5))) // 0.5mb per program
|
||||||
struct microVU {
|
struct microVU {
|
||||||
|
|
||||||
PCSX2_ALIGNED16(u32 macFlag[4]); // 4 instances of mac flag (used in execution)
|
PCSX2_ALIGNED16(u32 macFlag[4]); // 4 instances of mac flag (used in execution)
|
||||||
|
|
|
@ -315,7 +315,7 @@ microVUt(void) mVUanalyzeMflag(mV, int Is, int It) {
|
||||||
analyzeVIreg1(Is, mVUlow.VI_read[0]);
|
analyzeVIreg1(Is, mVUlow.VI_read[0]);
|
||||||
analyzeVIreg2(It, mVUlow.VI_write, 1);
|
analyzeVIreg2(It, mVUlow.VI_write, 1);
|
||||||
if (!It) { mVUlow.isNOP = 1; }
|
if (!It) { mVUlow.isNOP = 1; }
|
||||||
else { // Need set _doMac for 4 previous Ops (need to do all 4 because stalls could change the result needed)
|
else {
|
||||||
mVUinfo.swapOps = 1;
|
mVUinfo.swapOps = 1;
|
||||||
flagSet(mVU, 1);
|
flagSet(mVU, 1);
|
||||||
if (mVUcount < 4) { mVUpBlock->pState.needExactMatch |= 2; }
|
if (mVUcount < 4) { mVUpBlock->pState.needExactMatch |= 2; }
|
||||||
|
|
|
@ -123,7 +123,7 @@ microVUx(void) mVUcleanUp() {
|
||||||
//if (!(ax % 100000)) {
|
//if (!(ax % 100000)) {
|
||||||
// for (u32 i = 0; i < (mVU->progSize / 2); i++) {
|
// for (u32 i = 0; i < (mVU->progSize / 2); i++) {
|
||||||
// if (mVUcurProg.block[i]) {
|
// if (mVUcurProg.block[i]) {
|
||||||
// mVUcurProg.block[i]->printInfo();
|
// mVUcurProg.block[i]->printInfo(i*8);
|
||||||
// }
|
// }
|
||||||
// }
|
// }
|
||||||
//}
|
//}
|
||||||
|
|
|
@ -99,127 +99,127 @@ void endMacroOp(int mode) {
|
||||||
// Macro VU - Redirect Upper Instructions
|
// Macro VU - Redirect Upper Instructions
|
||||||
//------------------------------------------------------------------
|
//------------------------------------------------------------------
|
||||||
|
|
||||||
REC_COP2_mVU0(ABS, "ABS", 0);
|
REC_COP2_mVU0(ABS, "ABS", 0x00);
|
||||||
REC_COP2_mVU0(ITOF0, "ITOF0", 0);
|
REC_COP2_mVU0(ITOF0, "ITOF0", 0x00);
|
||||||
REC_COP2_mVU0(ITOF4, "ITOF4", 0);
|
REC_COP2_mVU0(ITOF4, "ITOF4", 0x00);
|
||||||
REC_COP2_mVU0(ITOF12, "ITOF12", 0);
|
REC_COP2_mVU0(ITOF12, "ITOF12", 0x00);
|
||||||
REC_COP2_mVU0(ITOF15, "ITOF15", 0);
|
REC_COP2_mVU0(ITOF15, "ITOF15", 0x00);
|
||||||
REC_COP2_mVU0(FTOI0, "FTOI0", 0);
|
REC_COP2_mVU0(FTOI0, "FTOI0", 0x00);
|
||||||
REC_COP2_mVU0(FTOI4, "FTOI4", 0);
|
REC_COP2_mVU0(FTOI4, "FTOI4", 0x00);
|
||||||
REC_COP2_mVU0(FTOI12, "FTOI12", 0);
|
REC_COP2_mVU0(FTOI12, "FTOI12", 0x00);
|
||||||
REC_COP2_mVU0(FTOI15, "FTOI15", 0);
|
REC_COP2_mVU0(FTOI15, "FTOI15", 0x00);
|
||||||
REC_COP2_mVU0(ADD, "ADD", 0);
|
REC_COP2_mVU0(ADD, "ADD", 0x10);
|
||||||
REC_COP2_mVU0(ADDi, "ADDi", 0);
|
REC_COP2_mVU0(ADDi, "ADDi", 0x10);
|
||||||
REC_COP2_mVU0(ADDq, "ADDq", 1);
|
REC_COP2_mVU0(ADDq, "ADDq", 0x11);
|
||||||
REC_COP2_mVU0(ADDx, "ADDx", 0);
|
REC_COP2_mVU0(ADDx, "ADDx", 0x10);
|
||||||
REC_COP2_mVU0(ADDy, "ADDy", 0);
|
REC_COP2_mVU0(ADDy, "ADDy", 0x10);
|
||||||
REC_COP2_mVU0(ADDz, "ADDz", 0);
|
REC_COP2_mVU0(ADDz, "ADDz", 0x10);
|
||||||
REC_COP2_mVU0(ADDw, "ADDw", 0);
|
REC_COP2_mVU0(ADDw, "ADDw", 0x10);
|
||||||
REC_COP2_mVU0(ADDA, "ADDA", 0);
|
REC_COP2_mVU0(ADDA, "ADDA", 0x10);
|
||||||
REC_COP2_mVU0(ADDAi, "ADDAi", 0);
|
REC_COP2_mVU0(ADDAi, "ADDAi", 0x10);
|
||||||
REC_COP2_mVU0(ADDAq, "ADDAq", 1);
|
REC_COP2_mVU0(ADDAq, "ADDAq", 0x11);
|
||||||
REC_COP2_mVU0(ADDAx, "ADDAx", 0);
|
REC_COP2_mVU0(ADDAx, "ADDAx", 0x10);
|
||||||
REC_COP2_mVU0(ADDAy, "ADDAy", 0);
|
REC_COP2_mVU0(ADDAy, "ADDAy", 0x10);
|
||||||
REC_COP2_mVU0(ADDAz, "ADDAz", 0);
|
REC_COP2_mVU0(ADDAz, "ADDAz", 0x10);
|
||||||
REC_COP2_mVU0(ADDAw, "ADDAw", 0);
|
REC_COP2_mVU0(ADDAw, "ADDAw", 0x10);
|
||||||
REC_COP2_mVU0(SUB, "SUB", 0);
|
REC_COP2_mVU0(SUB, "SUB", 0x10);
|
||||||
REC_COP2_mVU0(SUBi, "SUBi", 0);
|
REC_COP2_mVU0(SUBi, "SUBi", 0x10);
|
||||||
REC_COP2_mVU0(SUBq, "SUBq", 1);
|
REC_COP2_mVU0(SUBq, "SUBq", 0x11);
|
||||||
REC_COP2_mVU0(SUBx, "SUBx", 0);
|
REC_COP2_mVU0(SUBx, "SUBx", 0x10);
|
||||||
REC_COP2_mVU0(SUBy, "SUBy", 0);
|
REC_COP2_mVU0(SUBy, "SUBy", 0x10);
|
||||||
REC_COP2_mVU0(SUBz, "SUBz", 0);
|
REC_COP2_mVU0(SUBz, "SUBz", 0x10);
|
||||||
REC_COP2_mVU0(SUBw, "SUBw", 0);
|
REC_COP2_mVU0(SUBw, "SUBw", 0x10);
|
||||||
REC_COP2_mVU0(SUBA, "SUBA", 0);
|
REC_COP2_mVU0(SUBA, "SUBA", 0x10);
|
||||||
REC_COP2_mVU0(SUBAi, "SUBAi", 0);
|
REC_COP2_mVU0(SUBAi, "SUBAi", 0x10);
|
||||||
REC_COP2_mVU0(SUBAq, "SUBAq", 1);
|
REC_COP2_mVU0(SUBAq, "SUBAq", 0x11);
|
||||||
REC_COP2_mVU0(SUBAx, "SUBAx", 0);
|
REC_COP2_mVU0(SUBAx, "SUBAx", 0x10);
|
||||||
REC_COP2_mVU0(SUBAy, "SUBAy", 0);
|
REC_COP2_mVU0(SUBAy, "SUBAy", 0x10);
|
||||||
REC_COP2_mVU0(SUBAz, "SUBAz", 0);
|
REC_COP2_mVU0(SUBAz, "SUBAz", 0x10);
|
||||||
REC_COP2_mVU0(SUBAw, "SUBAw", 0);
|
REC_COP2_mVU0(SUBAw, "SUBAw", 0x10);
|
||||||
REC_COP2_mVU0(MUL, "MUL", 0);
|
REC_COP2_mVU0(MUL, "MUL", 0x10);
|
||||||
REC_COP2_mVU0(MULi, "MULi", 0);
|
REC_COP2_mVU0(MULi, "MULi", 0x10);
|
||||||
REC_COP2_mVU0(MULq, "MULq", 1);
|
REC_COP2_mVU0(MULq, "MULq", 0x11);
|
||||||
REC_COP2_mVU0(MULx, "MULx", 0);
|
REC_COP2_mVU0(MULx, "MULx", 0x10);
|
||||||
REC_COP2_mVU0(MULy, "MULy", 0);
|
REC_COP2_mVU0(MULy, "MULy", 0x10);
|
||||||
REC_COP2_mVU0(MULz, "MULz", 0);
|
REC_COP2_mVU0(MULz, "MULz", 0x10);
|
||||||
REC_COP2_mVU0(MULw, "MULw", 0);
|
REC_COP2_mVU0(MULw, "MULw", 0x10);
|
||||||
REC_COP2_mVU0(MULA, "MULA", 0);
|
REC_COP2_mVU0(MULA, "MULA", 0x10);
|
||||||
REC_COP2_mVU0(MULAi, "MULAi", 0);
|
REC_COP2_mVU0(MULAi, "MULAi", 0x10);
|
||||||
REC_COP2_mVU0(MULAq, "MULAq", 1);
|
REC_COP2_mVU0(MULAq, "MULAq", 0x11);
|
||||||
REC_COP2_mVU0(MULAx, "MULAx", 0);
|
REC_COP2_mVU0(MULAx, "MULAx", 0x10);
|
||||||
REC_COP2_mVU0(MULAy, "MULAy", 0);
|
REC_COP2_mVU0(MULAy, "MULAy", 0x10);
|
||||||
REC_COP2_mVU0(MULAz, "MULAz", 0);
|
REC_COP2_mVU0(MULAz, "MULAz", 0x10);
|
||||||
REC_COP2_mVU0(MULAw, "MULAw", 0);
|
REC_COP2_mVU0(MULAw, "MULAw", 0x10);
|
||||||
REC_COP2_mVU0(MAX, "MAX", 0);
|
REC_COP2_mVU0(MAX, "MAX", 0x00);
|
||||||
REC_COP2_mVU0(MAXi, "MAXi", 0);
|
REC_COP2_mVU0(MAXi, "MAXi", 0x00);
|
||||||
REC_COP2_mVU0(MAXx, "MAXx", 0);
|
REC_COP2_mVU0(MAXx, "MAXx", 0x00);
|
||||||
REC_COP2_mVU0(MAXy, "MAXy", 0);
|
REC_COP2_mVU0(MAXy, "MAXy", 0x00);
|
||||||
REC_COP2_mVU0(MAXz, "MAXz", 0);
|
REC_COP2_mVU0(MAXz, "MAXz", 0x00);
|
||||||
REC_COP2_mVU0(MAXw, "MAXw", 0);
|
REC_COP2_mVU0(MAXw, "MAXw", 0x00);
|
||||||
REC_COP2_mVU0(MINI, "MINI", 0);
|
REC_COP2_mVU0(MINI, "MINI", 0x00);
|
||||||
REC_COP2_mVU0(MINIi, "MINIi", 0);
|
REC_COP2_mVU0(MINIi, "MINIi", 0x00);
|
||||||
REC_COP2_mVU0(MINIx, "MINIx", 0);
|
REC_COP2_mVU0(MINIx, "MINIx", 0x00);
|
||||||
REC_COP2_mVU0(MINIy, "MINIy", 0);
|
REC_COP2_mVU0(MINIy, "MINIy", 0x00);
|
||||||
REC_COP2_mVU0(MINIz, "MINIz", 0);
|
REC_COP2_mVU0(MINIz, "MINIz", 0x00);
|
||||||
REC_COP2_mVU0(MINIw, "MINIw", 0);
|
REC_COP2_mVU0(MINIw, "MINIw", 0x00);
|
||||||
REC_COP2_mVU0(MADD, "MADD", 0);
|
REC_COP2_mVU0(MADD, "MADD", 0x10);
|
||||||
REC_COP2_mVU0(MADDi, "MADDi", 0);
|
REC_COP2_mVU0(MADDi, "MADDi", 0x10);
|
||||||
REC_COP2_mVU0(MADDq, "MADDq", 1);
|
REC_COP2_mVU0(MADDq, "MADDq", 0x11);
|
||||||
REC_COP2_mVU0(MADDx, "MADDx", 0);
|
REC_COP2_mVU0(MADDx, "MADDx", 0x10);
|
||||||
REC_COP2_mVU0(MADDy, "MADDy", 0);
|
REC_COP2_mVU0(MADDy, "MADDy", 0x10);
|
||||||
REC_COP2_mVU0(MADDz, "MADDz", 0);
|
REC_COP2_mVU0(MADDz, "MADDz", 0x10);
|
||||||
REC_COP2_mVU0(MADDw, "MADDw", 0);
|
REC_COP2_mVU0(MADDw, "MADDw", 0x10);
|
||||||
REC_COP2_mVU0(MADDA, "MADDA", 0);
|
REC_COP2_mVU0(MADDA, "MADDA", 0x10);
|
||||||
REC_COP2_mVU0(MADDAi, "MADDAi", 0);
|
REC_COP2_mVU0(MADDAi, "MADDAi", 0x10);
|
||||||
REC_COP2_mVU0(MADDAq, "MADDAq", 1);
|
REC_COP2_mVU0(MADDAq, "MADDAq", 0x11);
|
||||||
REC_COP2_mVU0(MADDAx, "MADDAx", 0);
|
REC_COP2_mVU0(MADDAx, "MADDAx", 0x10);
|
||||||
REC_COP2_mVU0(MADDAy, "MADDAy", 0);
|
REC_COP2_mVU0(MADDAy, "MADDAy", 0x10);
|
||||||
REC_COP2_mVU0(MADDAz, "MADDAz", 0);
|
REC_COP2_mVU0(MADDAz, "MADDAz", 0x10);
|
||||||
REC_COP2_mVU0(MADDAw, "MADDAw", 0);
|
REC_COP2_mVU0(MADDAw, "MADDAw", 0x10);
|
||||||
REC_COP2_mVU0(MSUB, "MSUB", 0);
|
REC_COP2_mVU0(MSUB, "MSUB", 0x10);
|
||||||
REC_COP2_mVU0(MSUBi, "MSUBi", 0);
|
REC_COP2_mVU0(MSUBi, "MSUBi", 0x10);
|
||||||
REC_COP2_mVU0(MSUBq, "MSUBq", 1);
|
REC_COP2_mVU0(MSUBq, "MSUBq", 0x11);
|
||||||
REC_COP2_mVU0(MSUBx, "MSUBx", 0);
|
REC_COP2_mVU0(MSUBx, "MSUBx", 0x10);
|
||||||
REC_COP2_mVU0(MSUBy, "MSUBy", 0);
|
REC_COP2_mVU0(MSUBy, "MSUBy", 0x10);
|
||||||
REC_COP2_mVU0(MSUBz, "MSUBz", 0);
|
REC_COP2_mVU0(MSUBz, "MSUBz", 0x10);
|
||||||
REC_COP2_mVU0(MSUBw, "MSUBw", 0);
|
REC_COP2_mVU0(MSUBw, "MSUBw", 0x10);
|
||||||
REC_COP2_mVU0(MSUBA, "MSUBA", 0);
|
REC_COP2_mVU0(MSUBA, "MSUBA", 0x10);
|
||||||
REC_COP2_mVU0(MSUBAi, "MSUBAi", 0);
|
REC_COP2_mVU0(MSUBAi, "MSUBAi", 0x10);
|
||||||
REC_COP2_mVU0(MSUBAq, "MSUBAq", 1);
|
REC_COP2_mVU0(MSUBAq, "MSUBAq", 0x11);
|
||||||
REC_COP2_mVU0(MSUBAx, "MSUBAx", 0);
|
REC_COP2_mVU0(MSUBAx, "MSUBAx", 0x10);
|
||||||
REC_COP2_mVU0(MSUBAy, "MSUBAy", 0);
|
REC_COP2_mVU0(MSUBAy, "MSUBAy", 0x10);
|
||||||
REC_COP2_mVU0(MSUBAz, "MSUBAz", 0);
|
REC_COP2_mVU0(MSUBAz, "MSUBAz", 0x10);
|
||||||
REC_COP2_mVU0(MSUBAw, "MSUBAw", 0);
|
REC_COP2_mVU0(MSUBAw, "MSUBAw", 0x10);
|
||||||
REC_COP2_mVU0(OPMULA, "OPMULA", 0);
|
REC_COP2_mVU0(OPMULA, "OPMULA", 0x10);
|
||||||
REC_COP2_mVU0(OPMSUB, "OPMSUB", 0);
|
REC_COP2_mVU0(OPMSUB, "OPMSUB", 0x10);
|
||||||
REC_COP2_mVU0(CLIP, "CLIP", 8);
|
REC_COP2_mVU0(CLIP, "CLIP", 0x08);
|
||||||
|
|
||||||
//------------------------------------------------------------------
|
//------------------------------------------------------------------
|
||||||
// Macro VU - Redirect Lower Instructions
|
// Macro VU - Redirect Lower Instructions
|
||||||
//------------------------------------------------------------------
|
//------------------------------------------------------------------
|
||||||
|
|
||||||
REC_COP2_mVU0(DIV, "DIV", 2);
|
REC_COP2_mVU0(DIV, "DIV", 0x02);
|
||||||
REC_COP2_mVU0(SQRT, "SQRT", 2);
|
REC_COP2_mVU0(SQRT, "SQRT", 0x02);
|
||||||
REC_COP2_mVU0(RSQRT, "RSQRT", 2);
|
REC_COP2_mVU0(RSQRT, "RSQRT", 0x02);
|
||||||
REC_COP2_mVU0(IADD, "IADD", 4);
|
REC_COP2_mVU0(IADD, "IADD", 0x04);
|
||||||
REC_COP2_mVU0(IADDI, "IADDI", 4);
|
REC_COP2_mVU0(IADDI, "IADDI", 0x04);
|
||||||
REC_COP2_mVU0(IAND, "IAND", 4);
|
REC_COP2_mVU0(IAND, "IAND", 0x04);
|
||||||
REC_COP2_mVU0(IOR, "IOR", 4);
|
REC_COP2_mVU0(IOR, "IOR", 0x04);
|
||||||
REC_COP2_mVU0(ISUB, "ISUB", 4);
|
REC_COP2_mVU0(ISUB, "ISUB", 0x04);
|
||||||
REC_COP2_mVU0(ILWR, "ILWR", 4);
|
REC_COP2_mVU0(ILWR, "ILWR", 0x04);
|
||||||
REC_COP2_mVU0(ISWR, "ISWR", 0);
|
REC_COP2_mVU0(ISWR, "ISWR", 0x00);
|
||||||
REC_COP2_mVU0(LQI, "LQI", 4);
|
REC_COP2_mVU0(LQI, "LQI", 0x04);
|
||||||
REC_COP2_mVU0(LQD, "LQD", 4);
|
REC_COP2_mVU0(LQD, "LQD", 0x04);
|
||||||
REC_COP2_mVU0(SQI, "SQI", 0);
|
REC_COP2_mVU0(SQI, "SQI", 0x00);
|
||||||
REC_COP2_mVU0(SQD, "SQD", 0);
|
REC_COP2_mVU0(SQD, "SQD", 0x00);
|
||||||
REC_COP2_mVU0(MFIR, "MFIR", 4);
|
REC_COP2_mVU0(MFIR, "MFIR", 0x04);
|
||||||
REC_COP2_mVU0(MTIR, "MTIR", 4);
|
REC_COP2_mVU0(MTIR, "MTIR", 0x04);
|
||||||
REC_COP2_mVU0(MOVE, "MOVE", 0);
|
REC_COP2_mVU0(MOVE, "MOVE", 0x00);
|
||||||
REC_COP2_mVU0(MR32, "MR32", 0);
|
REC_COP2_mVU0(MR32, "MR32", 0x00);
|
||||||
REC_COP2_mVU0(RINIT, "RINIT", 0);
|
REC_COP2_mVU0(RINIT, "RINIT", 0x00);
|
||||||
REC_COP2_mVU0(RGET, "RGET", 4);
|
REC_COP2_mVU0(RGET, "RGET", 0x04);
|
||||||
REC_COP2_mVU0(RNEXT, "RNEXT", 4);
|
REC_COP2_mVU0(RNEXT, "RNEXT", 0x04);
|
||||||
REC_COP2_mVU0(RXOR, "RXOR", 0);
|
REC_COP2_mVU0(RXOR, "RXOR", 0x00);
|
||||||
|
|
||||||
//------------------------------------------------------------------
|
//------------------------------------------------------------------
|
||||||
// Macro VU - Misc...
|
// Macro VU - Misc...
|
||||||
|
|
|
@ -221,6 +221,7 @@ typedef u32 (__fastcall *mVUCall)(void*, void*);
|
||||||
#define Rmem (uptr)&mVU->regs->VI[REG_R].UL
|
#define Rmem (uptr)&mVU->regs->VI[REG_R].UL
|
||||||
#define aWrap(x, m) ((x > m) ? 0 : x)
|
#define aWrap(x, m) ((x > m) ? 0 : x)
|
||||||
#define shuffleSS(x) ((x==1)?(0x27):((x==2)?(0xc6):((x==4)?(0xe1):(0xe4))))
|
#define shuffleSS(x) ((x==1)?(0x27):((x==2)?(0xc6):((x==4)?(0xe1):(0xe4))))
|
||||||
|
#define _1mb (0x100000)
|
||||||
|
|
||||||
// Flag Info
|
// Flag Info
|
||||||
#define __Status (mVUregs.needExactMatch & 1)
|
#define __Status (mVUregs.needExactMatch & 1)
|
||||||
|
|
|
@ -118,6 +118,20 @@ void setupPass1(microVU* mVU, int opCase, bool isACC, bool noFlagUpdate) {
|
||||||
if (noFlagUpdate) { sFLAG.doFlag = 0; }
|
if (noFlagUpdate) { sFLAG.doFlag = 0; }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Safer to force 0 as the result for X minus X than to do actual subtraction
|
||||||
|
bool doSafeSub(microVU* mVU, int opCase, int opType, bool isACC) {
|
||||||
|
opCase1 {
|
||||||
|
if ((opType == 1) && (_Ft_ == _Fs_)) {
|
||||||
|
int Fs = mVU->regAlloc->allocReg(-1, isACC ? 32 : _Fd_, _X_Y_Z_W);
|
||||||
|
SSE2_PXOR_XMM_to_XMM(Fs, Fs); // Set to Positive 0
|
||||||
|
mVUupdateFlags(mVU, Fs, -1);
|
||||||
|
mVU->regAlloc->clearNeeded(Fs);
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
// Sets Up Ft Reg for Normal, BC, I, and Q Cases
|
// Sets Up Ft Reg for Normal, BC, I, and Q Cases
|
||||||
void setupFtReg(microVU* mVU, int& Ft, int& tempFt, int opCase) {
|
void setupFtReg(microVU* mVU, int& Ft, int& tempFt, int opCase) {
|
||||||
opCase1 {
|
opCase1 {
|
||||||
|
@ -142,6 +156,8 @@ void setupFtReg(microVU* mVU, int& Ft, int& tempFt, int opCase) {
|
||||||
void mVU_FMACa(microVU* mVU, int recPass, int opCase, int opType, bool isACC, const char* opName) {
|
void mVU_FMACa(microVU* mVU, int recPass, int opCase, int opType, bool isACC, const char* opName) {
|
||||||
pass1 { setupPass1(mVU, opCase, isACC, ((opType == 3) || (opType == 4))); }
|
pass1 { setupPass1(mVU, opCase, isACC, ((opType == 3) || (opType == 4))); }
|
||||||
pass2 {
|
pass2 {
|
||||||
|
if (doSafeSub(mVU, opCase, opType, isACC)) return;
|
||||||
|
|
||||||
int Fs, Ft, ACC, tempFt;
|
int Fs, Ft, ACC, tempFt;
|
||||||
setupFtReg(mVU, Ft, tempFt, opCase);
|
setupFtReg(mVU, Ft, tempFt, opCase);
|
||||||
|
|
||||||
|
@ -152,7 +168,9 @@ void mVU_FMACa(microVU* mVU, int recPass, int opCase, int opType, bool isACC, co
|
||||||
}
|
}
|
||||||
else { Fs = mVU->regAlloc->allocReg(_Fs_, _Fd_, _X_Y_Z_W); }
|
else { Fs = mVU->regAlloc->allocReg(_Fs_, _Fd_, _X_Y_Z_W); }
|
||||||
|
|
||||||
opCase1 { if((opType == 2) && _XYZW_PS) { mVUclamp2(mVU, Ft, -1, _X_Y_Z_W); } } // Clamp Needed for Ice Age 3 (VU0)
|
opCase1 { if((opType == 1) && _XYZW_PS) { mVUclamp2(mVU, Ft, -1, _X_Y_Z_W); } } // Clamp Needed for Kingdom Hearts I (VU0)
|
||||||
|
opCase1 { if((opType == 1) && _XYZW_PS) { mVUclamp2(mVU, Fs, -1, _X_Y_Z_W); } } // Clamp Needed for Kingdom Hearts I (VU0)
|
||||||
|
opCase1 { if((opType == 2) && _XYZW_PS) { mVUclamp2(mVU, Ft, -1, _X_Y_Z_W); } } // Clamp Needed for Ice Age 3 (VU0)
|
||||||
opCase1 { if((opType == 2) && _XYZW_PS) { mVUclamp2(mVU, Fs, -1, _X_Y_Z_W); } } // Clamp Needed for Ice Age 3 (VU0)
|
opCase1 { if((opType == 2) && _XYZW_PS) { mVUclamp2(mVU, Fs, -1, _X_Y_Z_W); } } // Clamp Needed for Ice Age 3 (VU0)
|
||||||
opCase2 { if (opType == 2) { mVUclamp2(mVU, Fs, -1, _X_Y_Z_W); } } // Clamp Needed for alot of games (TOTA, DoM, etc...)
|
opCase2 { if (opType == 2) { mVUclamp2(mVU, Fs, -1, _X_Y_Z_W); } } // Clamp Needed for alot of games (TOTA, DoM, etc...)
|
||||||
|
|
||||||
|
|
|
@ -25,6 +25,8 @@
|
||||||
#include "Windows/GSwin.h"
|
#include "Windows/GSwin.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#include "Registers.h"
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C"
|
extern "C"
|
||||||
{
|
{
|
||||||
|
@ -39,7 +41,6 @@ extern "C"
|
||||||
#include "Linux/GSLinux.h"
|
#include "Linux/GSLinux.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "GifTransfer.h"
|
|
||||||
#include "null/GSnull.h"
|
#include "null/GSnull.h"
|
||||||
|
|
||||||
/*#ifdef _MSC_VER
|
/*#ifdef _MSC_VER
|
||||||
|
|
|
@ -62,6 +62,65 @@ enum GIF_REG
|
||||||
GIF_REG_NOP = 0x0f,
|
GIF_REG_NOP = 0x0f,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
enum GIF_A_D_REG
|
||||||
|
{
|
||||||
|
GIF_A_D_REG_PRIM = 0x00,
|
||||||
|
GIF_A_D_REG_RGBAQ = 0x01,
|
||||||
|
GIF_A_D_REG_ST = 0x02,
|
||||||
|
GIF_A_D_REG_UV = 0x03,
|
||||||
|
GIF_A_D_REG_XYZF2 = 0x04,
|
||||||
|
GIF_A_D_REG_XYZ2 = 0x05,
|
||||||
|
GIF_A_D_REG_TEX0_1 = 0x06,
|
||||||
|
GIF_A_D_REG_TEX0_2 = 0x07,
|
||||||
|
GIF_A_D_REG_CLAMP_1 = 0x08,
|
||||||
|
GIF_A_D_REG_CLAMP_2 = 0x09,
|
||||||
|
GIF_A_D_REG_FOG = 0x0a,
|
||||||
|
GIF_A_D_REG_XYZF3 = 0x0c,
|
||||||
|
GIF_A_D_REG_XYZ3 = 0x0d,
|
||||||
|
GIF_A_D_REG_NOP = 0x0f,
|
||||||
|
GIF_A_D_REG_TEX1_1 = 0x14,
|
||||||
|
GIF_A_D_REG_TEX1_2 = 0x15,
|
||||||
|
GIF_A_D_REG_TEX2_1 = 0x16,
|
||||||
|
GIF_A_D_REG_TEX2_2 = 0x17,
|
||||||
|
GIF_A_D_REG_XYOFFSET_1 = 0x18,
|
||||||
|
GIF_A_D_REG_XYOFFSET_2 = 0x19,
|
||||||
|
GIF_A_D_REG_PRMODECONT = 0x1a,
|
||||||
|
GIF_A_D_REG_PRMODE = 0x1b,
|
||||||
|
GIF_A_D_REG_TEXCLUT = 0x1c,
|
||||||
|
GIF_A_D_REG_SCANMSK = 0x22,
|
||||||
|
GIF_A_D_REG_MIPTBP1_1 = 0x34,
|
||||||
|
GIF_A_D_REG_MIPTBP1_2 = 0x35,
|
||||||
|
GIF_A_D_REG_MIPTBP2_1 = 0x36,
|
||||||
|
GIF_A_D_REG_MIPTBP2_2 = 0x37,
|
||||||
|
GIF_A_D_REG_TEXA = 0x3b,
|
||||||
|
GIF_A_D_REG_FOGCOL = 0x3d,
|
||||||
|
GIF_A_D_REG_TEXFLUSH = 0x3f,
|
||||||
|
GIF_A_D_REG_SCISSOR_1 = 0x40,
|
||||||
|
GIF_A_D_REG_SCISSOR_2 = 0x41,
|
||||||
|
GIF_A_D_REG_ALPHA_1 = 0x42,
|
||||||
|
GIF_A_D_REG_ALPHA_2 = 0x43,
|
||||||
|
GIF_A_D_REG_DIMX = 0x44,
|
||||||
|
GIF_A_D_REG_DTHE = 0x45,
|
||||||
|
GIF_A_D_REG_COLCLAMP = 0x46,
|
||||||
|
GIF_A_D_REG_TEST_1 = 0x47,
|
||||||
|
GIF_A_D_REG_TEST_2 = 0x48,
|
||||||
|
GIF_A_D_REG_PABE = 0x49,
|
||||||
|
GIF_A_D_REG_FBA_1 = 0x4a,
|
||||||
|
GIF_A_D_REG_FBA_2 = 0x4b,
|
||||||
|
GIF_A_D_REG_FRAME_1 = 0x4c,
|
||||||
|
GIF_A_D_REG_FRAME_2 = 0x4d,
|
||||||
|
GIF_A_D_REG_ZBUF_1 = 0x4e,
|
||||||
|
GIF_A_D_REG_ZBUF_2 = 0x4f,
|
||||||
|
GIF_A_D_REG_BITBLTBUF = 0x50,
|
||||||
|
GIF_A_D_REG_TRXPOS = 0x51,
|
||||||
|
GIF_A_D_REG_TRXREG = 0x52,
|
||||||
|
GIF_A_D_REG_TRXDIR = 0x53,
|
||||||
|
GIF_A_D_REG_HWREG = 0x54,
|
||||||
|
GIF_A_D_REG_SIGNAL = 0x60,
|
||||||
|
GIF_A_D_REG_FINISH = 0x61,
|
||||||
|
GIF_A_D_REG_LABEL = 0x62,
|
||||||
|
};
|
||||||
|
|
||||||
struct GIFTAG
|
struct GIFTAG
|
||||||
{
|
{
|
||||||
u32 nloop : 15;
|
u32 nloop : 15;
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -36,9 +36,9 @@ then
|
||||||
CCASFLAGS+=" -m32 "
|
CCASFLAGS+=" -m32 "
|
||||||
else
|
else
|
||||||
AC_DEFINE(NDEBUG,1,[NDEBUG])
|
AC_DEFINE(NDEBUG,1,[NDEBUG])
|
||||||
CFLAGS+="-O3 -fomit-frame-pointer -fPIC -Wall -Wno-unused-value -m32 "
|
CFLAGS+="-O3 -fomit-frame-pointer -msse -msse2 -fPIC -Wall -Wno-unused-value -m32 "
|
||||||
CPPFLAGS+="-O3 -fomit-frame-pointer -fPIC -Wall -Wno-unused-value -m32 "
|
CPPFLAGS+="-O3 -fomit-frame-pointer -msse -msse2 -fPIC -Wall -Wno-unused-value -m32 "
|
||||||
CXXFLAGS+="-O3 -fomit-frame-pointer -fPIC -Wall -Wno-unused-value -m32 "
|
CXXFLAGS+="-O3 -fomit-frame-pointer -msse -msse2 -fPIC -Wall -Wno-unused-value -m32 "
|
||||||
CCASFLAGS+=" -m32 "
|
CCASFLAGS+=" -m32 "
|
||||||
fi
|
fi
|
||||||
AM_CONDITIONAL(DEBUGBUILD, test x$debug = xyes)
|
AM_CONDITIONAL(DEBUGBUILD, test x$debug = xyes)
|
||||||
|
|
|
@ -83,7 +83,7 @@ bool dspPluginEnabled = false;
|
||||||
int dspPluginModule = 0;
|
int dspPluginModule = 0;
|
||||||
wchar_t dspPlugin[256];
|
wchar_t dspPlugin[256];
|
||||||
|
|
||||||
bool StereoExpansionDisabled = true;
|
bool StereoExpansionEnabled = false;
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
|
|
|
@ -78,7 +78,7 @@ extern int dspPluginModule;
|
||||||
|
|
||||||
extern bool dspPluginEnabled;
|
extern bool dspPluginEnabled;
|
||||||
extern bool timeStretchDisabled;
|
extern bool timeStretchDisabled;
|
||||||
extern bool StereoExpansionDisabled;
|
extern bool StereoExpansionEnabled;
|
||||||
|
|
||||||
class SoundtouchCfg
|
class SoundtouchCfg
|
||||||
{
|
{
|
||||||
|
|
|
@ -296,7 +296,6 @@ void SndBuffer::Cleanup()
|
||||||
}
|
}
|
||||||
|
|
||||||
int SndBuffer::m_dsp_progress = 0;
|
int SndBuffer::m_dsp_progress = 0;
|
||||||
int SndBuffer::m_dsp_writepos = 0;
|
|
||||||
|
|
||||||
int SndBuffer::m_timestretch_progress = 0;
|
int SndBuffer::m_timestretch_progress = 0;
|
||||||
int SndBuffer::ssFreeze = 0;
|
int SndBuffer::ssFreeze = 0;
|
||||||
|
@ -333,7 +332,7 @@ void SndBuffer::Write( const StereoOut32& Sample )
|
||||||
{
|
{
|
||||||
// Convert in, send to winamp DSP, and convert out.
|
// Convert in, send to winamp DSP, and convert out.
|
||||||
|
|
||||||
for( int i=0; i<SndOutPacketSize; ++i, ++m_dsp_writepos ) { sndTempBuffer16[m_dsp_writepos] = sndTempBuffer[i].DownSample(); }
|
for( int i=0; i<SndOutPacketSize; ++i ) { sndTempBuffer16[i] = sndTempBuffer[i].DownSample(); }
|
||||||
m_dsp_progress += DspProcess( (s16*)sndTempBuffer16, SndOutPacketSize );
|
m_dsp_progress += DspProcess( (s16*)sndTempBuffer16, SndOutPacketSize );
|
||||||
|
|
||||||
// Some ugly code to ensure full packet handling:
|
// Some ugly code to ensure full packet handling:
|
||||||
|
@ -386,4 +385,3 @@ void SndBuffer::Configure(uptr parent, u32 module )
|
||||||
|
|
||||||
mods[module]->Configure(parent);
|
mods[module]->Configure(parent);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -172,6 +172,125 @@ struct Stereo51Out16
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
struct Stereo51Out16DplII
|
||||||
|
{
|
||||||
|
s16 Left;
|
||||||
|
s16 Right;
|
||||||
|
s16 Center;
|
||||||
|
s16 LFE;
|
||||||
|
s16 LeftBack;
|
||||||
|
s16 RightBack;
|
||||||
|
|
||||||
|
void ResampleFrom( const StereoOut32& src )
|
||||||
|
{
|
||||||
|
static const u8 sLogTable[256] = {
|
||||||
|
0x00,0x3C,0x60,0x78,0x8C,0x9C,0xA8,0xB4,0xBE,0xC8,0xD0,0xD8,0xDE,0xE4,0xEA,0xF0,
|
||||||
|
0xF6,0xFA,0xFE,0x04,0x08,0x0C,0x10,0x14,0x16,0x1A,0x1E,0x20,0x24,0x26,0x2A,0x2C,
|
||||||
|
0x2E,0x32,0x34,0x36,0x38,0x3A,0x3E,0x40,0x42,0x44,0x46,0x48,0x4A,0x4C,0x4E,0x50,
|
||||||
|
0x50,0x52,0x54,0x56,0x58,0x5A,0x5A,0x5C,0x5E,0x60,0x60,0x62,0x64,0x66,0x66,0x68,
|
||||||
|
0x6A,0x6A,0x6C,0x6E,0x6E,0x70,0x70,0x72,0x74,0x74,0x76,0x76,0x78,0x7A,0x7A,0x7C,
|
||||||
|
0x7C,0x7E,0x7E,0x80,0x80,0x82,0x82,0x84,0x84,0x86,0x86,0x88,0x88,0x8A,0x8A,0x8C,
|
||||||
|
0x8C,0x8C,0x8E,0x8E,0x90,0x90,0x92,0x92,0x92,0x94,0x94,0x96,0x96,0x96,0x98,0x98,
|
||||||
|
0x9A,0x9A,0x9A,0x9C,0x9C,0x9C,0x9E,0x9E,0xA0,0xA0,0xA0,0xA2,0xA2,0xA2,0xA4,0xA4,
|
||||||
|
0xA4,0xA6,0xA6,0xA6,0xA8,0xA8,0xA8,0xAA,0xAA,0xAA,0xAC,0xAC,0xAC,0xAC,0xAE,0xAE,
|
||||||
|
0xAE,0xB0,0xB0,0xB0,0xB2,0xB2,0xB2,0xB2,0xB4,0xB4,0xB4,0xB6,0xB6,0xB6,0xB6,0xB8,
|
||||||
|
0xB8,0xB8,0xB8,0xBA,0xBA,0xBA,0xBC,0xBC,0xBC,0xBC,0xBE,0xBE,0xBE,0xBE,0xC0,0xC0,
|
||||||
|
0xC0,0xC0,0xC2,0xC2,0xC2,0xC2,0xC2,0xC4,0xC4,0xC4,0xC4,0xC6,0xC6,0xC6,0xC6,0xC8,
|
||||||
|
0xC8,0xC8,0xC8,0xC8,0xCA,0xCA,0xCA,0xCA,0xCC,0xCC,0xCC,0xCC,0xCC,0xCE,0xCE,0xCE,
|
||||||
|
0xCE,0xCE,0xD0,0xD0,0xD0,0xD0,0xD0,0xD2,0xD2,0xD2,0xD2,0xD2,0xD4,0xD4,0xD4,0xD4,
|
||||||
|
0xD4,0xD6,0xD6,0xD6,0xD6,0xD6,0xD8,0xD8,0xD8,0xD8,0xD8,0xD8,0xDA,0xDA,0xDA,0xDA,
|
||||||
|
0xDA,0xDC,0xDC,0xDC,0xDC,0xDC,0xDC,0xDE,0xDE,0xDE,0xDE,0xDE,0xDE,0xE0,0xE0,0xE0,
|
||||||
|
};
|
||||||
|
|
||||||
|
static s32 Gfl=0,Gfr=0;
|
||||||
|
static s32 LMax=0,RMax=0;
|
||||||
|
|
||||||
|
static s32 LAccum;
|
||||||
|
static s32 RAccum;
|
||||||
|
static s32 ANum;
|
||||||
|
|
||||||
|
s32 ValL = src.Left >> (SndOutVolumeShift-8);
|
||||||
|
s32 ValR = src.Right >> (SndOutVolumeShift-8);
|
||||||
|
|
||||||
|
s32 XL = abs(ValL>>8);
|
||||||
|
s32 XR = abs(ValR>>8);
|
||||||
|
|
||||||
|
if(XL>LMax) LMax = XL;
|
||||||
|
if(XR>RMax) RMax = XR;
|
||||||
|
|
||||||
|
ANum++;
|
||||||
|
if(ANum>=128)
|
||||||
|
{
|
||||||
|
ANum=0;
|
||||||
|
LAccum = 1+((LAccum * 224 + LMax * 31)>>8);
|
||||||
|
RAccum = 1+((RAccum * 224 + RMax * 31)>>8);
|
||||||
|
|
||||||
|
LMax = 0;
|
||||||
|
RMax = 0;
|
||||||
|
|
||||||
|
s32 Tfl=(RAccum)*255/(LAccum);
|
||||||
|
s32 Tfr=(LAccum)*255/(RAccum);
|
||||||
|
|
||||||
|
int gMax = max(Tfl,Tfr);
|
||||||
|
Tfl=Tfl*255/gMax;
|
||||||
|
Tfr=Tfr*255/gMax;
|
||||||
|
|
||||||
|
if(Tfl>255) Tfl=255;
|
||||||
|
if(Tfr>255) Tfr=255;
|
||||||
|
if(Tfl<1) Tfl=1;
|
||||||
|
if(Tfr<1) Tfr=1;
|
||||||
|
|
||||||
|
Gfl = (Gfl * 200 + Tfl * 56)>>8;
|
||||||
|
Gfr = (Gfr * 200 + Tfr * 56)>>8;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
s32 L,R,C,SUB,SL,SR;
|
||||||
|
|
||||||
|
C=(ValL+ValR)>>1; //16.8
|
||||||
|
|
||||||
|
ValL-=C;//16.8
|
||||||
|
ValR-=C;//16.8
|
||||||
|
|
||||||
|
L=ValL>>8; //16.0
|
||||||
|
R=ValR>>8; //16.0
|
||||||
|
C=C>>8; //16.0
|
||||||
|
SUB = C;
|
||||||
|
|
||||||
|
{
|
||||||
|
s32 Cfl = 1+sLogTable[Gfl];
|
||||||
|
s32 Cfr = 1+sLogTable[Gfr];
|
||||||
|
|
||||||
|
s32 VL=(ValL>>4) * Cfl; //16.12
|
||||||
|
s32 VR=(ValR>>4) * Cfr;
|
||||||
|
|
||||||
|
s32 SC = (VL-VR)>>15;
|
||||||
|
|
||||||
|
SL = (((VR/148 - VL/209)>>4)*Cfr)>>8;
|
||||||
|
SR = (((VR/209 - VL/148)>>4)*Cfl)>>8;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
// Random-ish values to get it to compile
|
||||||
|
int GainL = 200;
|
||||||
|
int GainR = 200;
|
||||||
|
int GainC = 180;
|
||||||
|
int GainSL = 230;
|
||||||
|
int GainSR = 230;
|
||||||
|
int GainLFE = 200;
|
||||||
|
int AddCLR = 55;
|
||||||
|
|
||||||
|
int AddCX = (C * AddCLR)>>8;
|
||||||
|
|
||||||
|
Left = (((L * GainL ))>>8) + AddCX;
|
||||||
|
Right = (((R * GainL ))>>8) + AddCX;
|
||||||
|
Center = (((C * GainC ))>>8);
|
||||||
|
LFE = (((SUB * GainLFE))>>8);
|
||||||
|
LeftBack = (((SL * GainSL ))>>8);
|
||||||
|
RightBack = (((SR * GainSR ))>>8);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
struct Stereo71Out16
|
struct Stereo71Out16
|
||||||
{
|
{
|
||||||
s16 Left;
|
s16 Left;
|
||||||
|
@ -236,7 +355,6 @@ private:
|
||||||
|
|
||||||
static int sndTempProgress;
|
static int sndTempProgress;
|
||||||
static int m_dsp_progress;
|
static int m_dsp_progress;
|
||||||
static int m_dsp_writepos;
|
|
||||||
|
|
||||||
static int m_timestretch_progress;
|
static int m_timestretch_progress;
|
||||||
static int m_timestretch_writepos;
|
static int m_timestretch_writepos;
|
||||||
|
|
|
@ -51,7 +51,7 @@ bool dspPluginEnabled = false;
|
||||||
int dspPluginModule = 0;
|
int dspPluginModule = 0;
|
||||||
wchar_t dspPlugin[256];
|
wchar_t dspPlugin[256];
|
||||||
|
|
||||||
bool StereoExpansionDisabled = true;
|
bool StereoExpansionEnabled = false;
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
|
@ -65,7 +65,7 @@ void ReadSettings()
|
||||||
timeStretchDisabled = CfgReadBool( L"OUTPUT", L"Disable_Timestretch", false );
|
timeStretchDisabled = CfgReadBool( L"OUTPUT", L"Disable_Timestretch", false );
|
||||||
EffectsDisabled = CfgReadBool( L"MIXING", L"Disable_Effects", false );
|
EffectsDisabled = CfgReadBool( L"MIXING", L"Disable_Effects", false );
|
||||||
|
|
||||||
StereoExpansionDisabled = CfgReadBool( L"OUTPUT", L"Disable_StereoExpansion", false );
|
StereoExpansionEnabled = CfgReadBool( L"OUTPUT", L"Enable_StereoExpansion", false );
|
||||||
SndOutLatencyMS = CfgReadInt(L"OUTPUT",L"Latency", 160);
|
SndOutLatencyMS = CfgReadInt(L"OUTPUT",L"Latency", 160);
|
||||||
|
|
||||||
wchar_t omodid[128];
|
wchar_t omodid[128];
|
||||||
|
@ -115,7 +115,7 @@ void WriteSettings()
|
||||||
CfgWriteStr(L"OUTPUT",L"Output_Module", mods[OutputModule]->GetIdent() );
|
CfgWriteStr(L"OUTPUT",L"Output_Module", mods[OutputModule]->GetIdent() );
|
||||||
CfgWriteInt(L"OUTPUT",L"Latency", SndOutLatencyMS);
|
CfgWriteInt(L"OUTPUT",L"Latency", SndOutLatencyMS);
|
||||||
CfgWriteBool(L"OUTPUT",L"Disable_Timestretch", timeStretchDisabled);
|
CfgWriteBool(L"OUTPUT",L"Disable_Timestretch", timeStretchDisabled);
|
||||||
CfgWriteBool(L"OUTPUT",L"Disable_StereoExpansion", StereoExpansionDisabled);
|
CfgWriteBool(L"OUTPUT",L"Enable_StereoExpansion", StereoExpansionEnabled);
|
||||||
|
|
||||||
if( Config_WaveOut.Device.empty() ) Config_WaveOut.Device = L"default";
|
if( Config_WaveOut.Device.empty() ) Config_WaveOut.Device = L"default";
|
||||||
CfgWriteStr(L"WAVEOUT",L"Device",Config_WaveOut.Device);
|
CfgWriteStr(L"WAVEOUT",L"Device",Config_WaveOut.Device);
|
||||||
|
@ -172,7 +172,7 @@ BOOL CALLBACK ConfigProc(HWND hWnd,UINT uMsg,WPARAM wParam,LPARAM lParam)
|
||||||
EnableWindow( GetDlgItem( hWnd, IDC_OPEN_CONFIG_DEBUG ), DebugEnabled );
|
EnableWindow( GetDlgItem( hWnd, IDC_OPEN_CONFIG_DEBUG ), DebugEnabled );
|
||||||
|
|
||||||
SET_CHECK(IDC_EFFECTS_DISABLE, EffectsDisabled);
|
SET_CHECK(IDC_EFFECTS_DISABLE, EffectsDisabled);
|
||||||
SET_CHECK(IDC_EXPANSION_DISABLE,StereoExpansionDisabled);
|
SET_CHECK(IDC_EXPANSION_ENABLE,StereoExpansionEnabled);
|
||||||
SET_CHECK(IDC_TS_DISABLE, timeStretchDisabled);
|
SET_CHECK(IDC_TS_DISABLE, timeStretchDisabled);
|
||||||
SET_CHECK(IDC_DEBUG_ENABLE, DebugEnabled);
|
SET_CHECK(IDC_DEBUG_ENABLE, DebugEnabled);
|
||||||
SET_CHECK(IDC_DSP_ENABLE, dspPluginEnabled);
|
SET_CHECK(IDC_DSP_ENABLE, dspPluginEnabled);
|
||||||
|
@ -226,7 +226,7 @@ BOOL CALLBACK ConfigProc(HWND hWnd,UINT uMsg,WPARAM wParam,LPARAM lParam)
|
||||||
|
|
||||||
HANDLE_CHECK(IDC_EFFECTS_DISABLE,EffectsDisabled);
|
HANDLE_CHECK(IDC_EFFECTS_DISABLE,EffectsDisabled);
|
||||||
HANDLE_CHECK(IDC_DSP_ENABLE,dspPluginEnabled);
|
HANDLE_CHECK(IDC_DSP_ENABLE,dspPluginEnabled);
|
||||||
HANDLE_CHECK(IDC_EXPANSION_DISABLE,StereoExpansionDisabled);
|
HANDLE_CHECK(IDC_EXPANSION_ENABLE,StereoExpansionEnabled);
|
||||||
HANDLE_CHECKNB(IDC_TS_DISABLE,timeStretchDisabled);
|
HANDLE_CHECKNB(IDC_TS_DISABLE,timeStretchDisabled);
|
||||||
EnableWindow( GetDlgItem( hWnd, IDC_OPEN_CONFIG_SOUNDTOUCH ), !timeStretchDisabled );
|
EnableWindow( GetDlgItem( hWnd, IDC_OPEN_CONFIG_SOUNDTOUCH ), !timeStretchDisabled );
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -77,7 +77,7 @@ extern int dspPluginModule;
|
||||||
|
|
||||||
extern bool dspPluginEnabled;
|
extern bool dspPluginEnabled;
|
||||||
extern bool timeStretchDisabled;
|
extern bool timeStretchDisabled;
|
||||||
extern bool StereoExpansionDisabled;
|
extern bool StereoExpansionEnabled;
|
||||||
|
|
||||||
class SoundtouchCfg
|
class SoundtouchCfg
|
||||||
{
|
{
|
||||||
|
|
|
@ -109,24 +109,25 @@ private:
|
||||||
// virtual calls can't be made from the constructor's context.
|
// virtual calls can't be made from the constructor's context.
|
||||||
void _init( IXAudio2* pXAudio2, uint chanConfig )
|
void _init( IXAudio2* pXAudio2, uint chanConfig )
|
||||||
{
|
{
|
||||||
WAVEFORMATEX wfx;
|
WAVEFORMATEXTENSIBLE wfx;
|
||||||
|
|
||||||
wfx.wFormatTag = WAVE_FORMAT_PCM;
|
memset(&wfx, 0, sizeof(WAVEFORMATEXTENSIBLE));
|
||||||
wfx.nSamplesPerSec = SampleRate;
|
wfx.Format.wFormatTag = WAVE_FORMAT_EXTENSIBLE;
|
||||||
wfx.nChannels = m_nChannels;
|
wfx.Format.nSamplesPerSec = SampleRate;
|
||||||
wfx.wBitsPerSample = 16;
|
wfx.Format.nChannels = m_nChannels;
|
||||||
wfx.nBlockAlign = 2*m_nChannels;
|
wfx.Format.wBitsPerSample = 16;
|
||||||
wfx.nAvgBytesPerSec = SampleRate * wfx.nBlockAlign;
|
wfx.Format.nBlockAlign = wfx.Format.nChannels*wfx.Format.wBitsPerSample/8;
|
||||||
wfx.cbSize = 0;
|
wfx.Format.nAvgBytesPerSec = SampleRate * wfx.Format.nBlockAlign;
|
||||||
|
wfx.Format.cbSize = 22;
|
||||||
//wfx.SubFormat = KSDATAFORMAT_SUBTYPE_PCM;
|
wfx.Samples.wValidBitsPerSample = 0;
|
||||||
//wfx.dwChannelMask = chanConfig;
|
wfx.dwChannelMask = chanConfig;
|
||||||
|
wfx.SubFormat = KSDATAFORMAT_SUBTYPE_PCM;
|
||||||
|
|
||||||
//
|
//
|
||||||
// Create an XAudio2 voice to stream this wave
|
// Create an XAudio2 voice to stream this wave
|
||||||
//
|
//
|
||||||
HRESULT hr;
|
HRESULT hr;
|
||||||
if( FAILED(hr = pXAudio2->CreateSourceVoice( &pSourceVoice, &wfx,
|
if( FAILED(hr = pXAudio2->CreateSourceVoice( &pSourceVoice, (WAVEFORMATEX*)&wfx,
|
||||||
XAUDIO2_VOICE_NOSRC, 1.0f, this ) ) )
|
XAUDIO2_VOICE_NOSRC, 1.0f, this ) ) )
|
||||||
{
|
{
|
||||||
throw Exception::XAudio2Error( hr, "XAudio2 CreateSourceVoice failure." );
|
throw Exception::XAudio2Error( hr, "XAudio2 CreateSourceVoice failure." );
|
||||||
|
@ -187,7 +188,17 @@ private:
|
||||||
|
|
||||||
void Init( IXAudio2* pXAudio2 )
|
void Init( IXAudio2* pXAudio2 )
|
||||||
{
|
{
|
||||||
_init( pXAudio2, SPEAKER_FRONT_LEFT | SPEAKER_FRONT_RIGHT );
|
int chanMask = 0;
|
||||||
|
switch(m_nChannels)
|
||||||
|
{
|
||||||
|
case 1: chanMask |= SPEAKER_FRONT_CENTER; break;
|
||||||
|
case 2: chanMask |= SPEAKER_FRONT_LEFT | SPEAKER_FRONT_RIGHT; break;
|
||||||
|
case 3: chanMask |= SPEAKER_FRONT_LEFT | SPEAKER_FRONT_RIGHT | SPEAKER_LOW_FREQUENCY; break;
|
||||||
|
case 4: chanMask |= SPEAKER_FRONT_LEFT | SPEAKER_FRONT_RIGHT | SPEAKER_BACK_LEFT | SPEAKER_BACK_RIGHT; break;
|
||||||
|
case 5: chanMask |= SPEAKER_FRONT_LEFT | SPEAKER_FRONT_RIGHT | SPEAKER_FRONT_CENTER | SPEAKER_BACK_LEFT | SPEAKER_BACK_RIGHT; break;
|
||||||
|
case 6: chanMask |= SPEAKER_FRONT_LEFT | SPEAKER_FRONT_RIGHT | SPEAKER_FRONT_CENTER | SPEAKER_BACK_LEFT | SPEAKER_BACK_RIGHT | SPEAKER_LOW_FREQUENCY; break;
|
||||||
|
}
|
||||||
|
_init( pXAudio2, chanMask );
|
||||||
}
|
}
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
@ -247,22 +258,22 @@ public:
|
||||||
XAUDIO2_DEVICE_DETAILS deviceDetails;
|
XAUDIO2_DEVICE_DETAILS deviceDetails;
|
||||||
pXAudio2->GetDeviceDetails( 0, &deviceDetails );
|
pXAudio2->GetDeviceDetails( 0, &deviceDetails );
|
||||||
|
|
||||||
|
if( StereoExpansionEnabled )
|
||||||
|
deviceDetails.OutputFormat.Format.nChannels = 6;
|
||||||
|
|
||||||
|
// Any windows driver should support stereo at the software level, I should think!
|
||||||
|
jASSUME( deviceDetails.OutputFormat.Format.nChannels > 1 );
|
||||||
|
|
||||||
//
|
//
|
||||||
// Create a mastering voice
|
// Create a mastering voice
|
||||||
//
|
//
|
||||||
if ( FAILED(hr = pXAudio2->CreateMasteringVoice( &pMasteringVoice, 0, SampleRate ) ) )
|
if ( FAILED(hr = pXAudio2->CreateMasteringVoice( &pMasteringVoice, deviceDetails.OutputFormat.Format.nChannels, SampleRate ) ) )
|
||||||
{
|
{
|
||||||
SysMessage( "Failed creating mastering voice: %#X\n", hr );
|
SysMessage( "Failed creating mastering voice: %#X\n", hr );
|
||||||
CoUninitialize();
|
CoUninitialize();
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if( StereoExpansionDisabled )
|
|
||||||
deviceDetails.OutputFormat.Format.nChannels = 2;
|
|
||||||
|
|
||||||
// Any windows driver should support stereo at the software level, I should think!
|
|
||||||
jASSUME( deviceDetails.OutputFormat.Format.nChannels > 1 );
|
|
||||||
|
|
||||||
switch( deviceDetails.OutputFormat.Format.nChannels )
|
switch( deviceDetails.OutputFormat.Format.nChannels )
|
||||||
{
|
{
|
||||||
case 2:
|
case 2:
|
||||||
|
@ -288,7 +299,8 @@ public:
|
||||||
case 6:
|
case 6:
|
||||||
case 7:
|
case 7:
|
||||||
ConLog( "* SPU2 > 5.1 speaker expansion enabled.\n" );
|
ConLog( "* SPU2 > 5.1 speaker expansion enabled.\n" );
|
||||||
voiceContext = new StreamingVoice<Stereo51Out16>( pXAudio2 );
|
voiceContext = new StreamingVoice<Stereo51Out16>( pXAudio2 ); //"normal" stereo upmix
|
||||||
|
//voiceContext = new StreamingVoice<Stereo51Out16DplII>( pXAudio2 ); //gigas PLII
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default: // anything 8 or more gets the 7.1 treatment!
|
default: // anything 8 or more gets the 7.1 treatment!
|
||||||
|
|
|
@ -95,8 +95,8 @@ public:
|
||||||
#if 0
|
#if 0
|
||||||
int speakerConfig;
|
int speakerConfig;
|
||||||
|
|
||||||
if( StereoExpansionDisabled )
|
if( StereoExpansionEnabled )
|
||||||
speakerConfig = 2;
|
speakerConfig = 2; // better not mess with this in wavout :p (rama)
|
||||||
|
|
||||||
// Any windows driver should support stereo at the software level, I should think!
|
// Any windows driver should support stereo at the software level, I should think!
|
||||||
jASSUME( speakerConfig > 1 );
|
jASSUME( speakerConfig > 1 );
|
||||||
|
|
|
@ -7,6 +7,7 @@
|
||||||
//
|
//
|
||||||
// Generated from the TEXTINCLUDE 2 resource.
|
// Generated from the TEXTINCLUDE 2 resource.
|
||||||
//
|
//
|
||||||
|
#include "svnrev.h"
|
||||||
#include "afxresmw.h"
|
#include "afxresmw.h"
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
@ -72,8 +73,8 @@ BEGIN
|
||||||
PUSHBUTTON "Configure Debug Options...",IDC_OPEN_CONFIG_DEBUG,14,131,108,14
|
PUSHBUTTON "Configure Debug Options...",IDC_OPEN_CONFIG_DEBUG,14,131,108,14
|
||||||
CHECKBOX "Enable Debug Options",IDC_DEBUG_ENABLE,14,117,104,10,NOT WS_TABSTOP
|
CHECKBOX "Enable Debug Options",IDC_DEBUG_ENABLE,14,117,104,10,NOT WS_TABSTOP
|
||||||
GROUPBOX "",IDC_STATIC,6,107,129,46
|
GROUPBOX "",IDC_STATIC,6,107,129,46
|
||||||
CONTROL "Disable Audio Expansion",IDC_EXPANSION_DISABLE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,150,152,135,10
|
CONTROL "Enable Audio Expansion",IDC_EXPANSION_ENABLE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,150,152,135,10
|
||||||
LTEXT "Audio expansion detects extended speaker setups like 5.1 and 2.1 audio, and expand the SPU2's stereo stream so that all speakers are used. Disable this if the detection causes problems on your sound system.",IDC_STATIC,162,164,146,44
|
LTEXT "Audio expansion to 5.1. Currently for XAudio2 only. WIP.",IDC_STATIC,162,164,146,44
|
||||||
END
|
END
|
||||||
|
|
||||||
IDD_DEBUG DIALOGEX 0, 0, 326, 525
|
IDD_DEBUG DIALOGEX 0, 0, 326, 525
|
||||||
|
@ -268,9 +269,14 @@ IDB_SPU2X_SMALL BITMAP "..\\..\\spu2-x-sm.bmp"
|
||||||
//
|
//
|
||||||
|
|
||||||
VS_VERSION_INFO VERSIONINFO
|
VS_VERSION_INFO VERSIONINFO
|
||||||
FILEVERSION 1,1,1,0
|
FILEVERSION 1,3,0,SVN_REV
|
||||||
PRODUCTVERSION 1,1,1,0
|
PRODUCTVERSION 1,3,0,SVN_REV
|
||||||
FILEFLAGSMASK 0x17L
|
FILEFLAGSMASK 0x17L
|
||||||
|
#ifdef _DEBUG
|
||||||
|
FILEFLAGS 0x1L
|
||||||
|
#else
|
||||||
|
FILEFLAGS 0x0L
|
||||||
|
#endif
|
||||||
FILEOS 0x4L
|
FILEOS 0x4L
|
||||||
FILETYPE 0x2L
|
FILETYPE 0x2L
|
||||||
FILESUBTYPE 0x0L
|
FILESUBTYPE 0x0L
|
||||||
|
@ -280,14 +286,14 @@ BEGIN
|
||||||
BLOCK "040904b0"
|
BLOCK "040904b0"
|
||||||
BEGIN
|
BEGIN
|
||||||
VALUE "Comments", "SPU2 Plugin for PS2 Emulators"
|
VALUE "Comments", "SPU2 Plugin for PS2 Emulators"
|
||||||
VALUE "CompanyName", "Pcsx2 Dev Team"
|
VALUE "CompanyName", "PCSX2 Dev Team"
|
||||||
VALUE "FileDescription", "SPU2-X Plugin v1.1"
|
VALUE "FileDescription", "SPU2-X Plugin (svn build)"
|
||||||
VALUE "FileVersion", "1, 1, 1, 0"
|
VALUE "FileVersion", "1.3.SVN"
|
||||||
VALUE "InternalName", "SPU2-X"
|
VALUE "InternalName", "SPU2-X"
|
||||||
VALUE "LegalCopyright", "Copyright (C) 2009"
|
VALUE "LegalCopyright", "Copyright (C) 2009"
|
||||||
VALUE "OriginalFilename", "SPU2-X-1.1.dll"
|
VALUE "OriginalFilename", "SPU2-X-1.3.dll"
|
||||||
VALUE "ProductName", "SPU2-X"
|
VALUE "ProductName", "SPU2-X"
|
||||||
VALUE "ProductVersion", "1, 1, 1, 0"
|
VALUE "ProductVersion", "1.3.SVN"
|
||||||
END
|
END
|
||||||
END
|
END
|
||||||
BLOCK "VarFileInfo"
|
BLOCK "VarFileInfo"
|
||||||
|
@ -322,7 +328,8 @@ END
|
||||||
|
|
||||||
2 TEXTINCLUDE
|
2 TEXTINCLUDE
|
||||||
BEGIN
|
BEGIN
|
||||||
"#include ""afxresmw.h""\r\0"
|
"#include ""svnrev.h""\r\n"
|
||||||
|
"#include ""afxresmw.h""\0"
|
||||||
END
|
END
|
||||||
|
|
||||||
3 TEXTINCLUDE
|
3 TEXTINCLUDE
|
||||||
|
|
|
@ -43,7 +43,7 @@
|
||||||
#define IDC_OVERLAP_SLIDER 1045
|
#define IDC_OVERLAP_SLIDER 1045
|
||||||
#define IDC_MSG_PUBLIC_BUILD 1048
|
#define IDC_MSG_PUBLIC_BUILD 1048
|
||||||
#define IDC_XA2_TRIBLE_BUFFER 1050
|
#define IDC_XA2_TRIBLE_BUFFER 1050
|
||||||
#define IDC_EXPANSION_DISABLE 1051
|
#define IDC_EXPANSION_ENABLE 1051
|
||||||
#define IDC_LABEL_VERSION_INFO 1054
|
#define IDC_LABEL_VERSION_INFO 1054
|
||||||
#define IDC_LINK_WEBSITE 1055
|
#define IDC_LINK_WEBSITE 1055
|
||||||
#define IDC_LINK_GOOGLECODE 1056
|
#define IDC_LINK_GOOGLECODE 1056
|
||||||
|
|
Loading…
Reference in New Issue