Fix superVU xgkick stuffs.

git-svn-id: http://pcsx2.googlecode.com/svn/trunk@3535 96395faa-99c1-11dd-bbfe-3dabce05a288
This commit is contained in:
Jake.Stine 2010-07-19 12:35:03 +00:00
parent 4c03fb26d3
commit c7096a1d53
3 changed files with 13 additions and 29 deletions

View File

@ -240,20 +240,6 @@ extern BaseVUmicroCPU* CpuVU0;
extern BaseVUmicroCPU* CpuVU1; extern BaseVUmicroCPU* CpuVU1;
/////////////////////////////////////////////////////////////////
// These functions initialize memory for both VUs.
//
void vuMicroMemAlloc();
void vuMicroMemShutdown();
void vuMicroMemReset();
/////////////////////////////////////////////////////////////////
// Everything else does stuff on a per-VU basis.
//
void iDumpVU0Registers();
void iDumpVU1Registers();
extern void (*VU0_LOWER_OPCODE[128])(); extern void (*VU0_LOWER_OPCODE[128])();
extern void (*VU0_UPPER_OPCODE[64])(); extern void (*VU0_UPPER_OPCODE[64])();
@ -286,18 +272,24 @@ extern void (*VU1regs_UPPER_FD_01_TABLE[32])(_VURegsNum *VUregsn);
extern void (*VU1regs_UPPER_FD_10_TABLE[32])(_VURegsNum *VUregsn); extern void (*VU1regs_UPPER_FD_10_TABLE[32])(_VURegsNum *VUregsn);
extern void (*VU1regs_UPPER_FD_11_TABLE[32])(_VURegsNum *VUregsn); extern void (*VU1regs_UPPER_FD_11_TABLE[32])(_VURegsNum *VUregsn);
extern void vuMicroMemAlloc();
extern void vuMicroMemShutdown();
extern void vuMicroMemReset();
// VU0 // VU0
extern void vu0ResetRegs(); extern void vu0ResetRegs();
extern void __fastcall vu0ExecMicro(u32 addr); extern void __fastcall vu0ExecMicro(u32 addr);
extern void vu0Exec(VURegs* VU); extern void vu0Exec(VURegs* VU);
extern void vu0Finish(); extern void vu0Finish();
extern void recResetVU0( void ); extern void recResetVU0( void );
extern void iDumpVU0Registers();
// VU1 // VU1
extern void vu1Finish(); extern void vu1Finish();
extern void vu1ResetRegs(); extern void vu1ResetRegs();
extern void __fastcall vu1ExecMicro(u32 addr); extern void __fastcall vu1ExecMicro(u32 addr);
extern void vu1Exec(VURegs* VU); extern void vu1Exec(VURegs* VU);
extern void iDumpVU1Registers();
void VU0_UPPER_FD_00(); void VU0_UPPER_FD_00();
void VU0_UPPER_FD_01(); void VU0_UPPER_FD_01();

View File

@ -1128,9 +1128,7 @@ void __fastcall mVU_XGKICK_(u32 addr) {
if (size > diff) { if (size > diff) {
//DevCon.Status("XGkick Wrap!"); //DevCon.Status("XGkick Wrap!");
memcpy_qwc(pDest, microVU1.regs->Mem + (addr*16), diff); memcpy_qwc(pDest, microVU1.regs->Mem + (addr*16), diff);
size -= diff; memcpy_qwc(pDest+(diff*16), microVU1.regs->Mem, size-diff);
pDest += diff*16;
memcpy_qwc(pDest, microVU1.regs->Mem, size);
} }
else { else {
memcpy_qwc(pDest, microVU1.regs->Mem + (addr*16), size); memcpy_qwc(pDest, microVU1.regs->Mem + (addr*16), size);

View File

@ -1976,13 +1976,12 @@ void __fastcall VU1XGKICK_MTGSTransfer(u32 *pMem, u32 addr)
{ {
addr &= 0x3fff; addr &= 0x3fff;
u8* data = VU1.Mem + (addr); u8* data = VU1.Mem + (addr);
u32 diff = 0x400 - (addr >> 4); u32 diff = 0x400 - (addr / 16);
u32 size; u32 size;
u8* pDest; u8* pDest;
if(gifRegs->stat.APATH <= GIF_APATH1 || (gifRegs->stat.APATH == GIF_APATH3 && gifRegs->stat.IP3 == true) && SIGNAL_IMR_Pending == false) if(gifRegs->stat.APATH <= GIF_APATH1 || (gifRegs->stat.APATH == GIF_APATH3 && gifRegs->stat.IP3 == true) && SIGNAL_IMR_Pending == false)
{ {
if(Path1WritePos != 0) if(Path1WritePos != 0)
{ {
//Flush any pending transfers so things dont go up in the wrong order //Flush any pending transfers so things dont go up in the wrong order
@ -2003,22 +2002,17 @@ void __fastcall VU1XGKICK_MTGSTransfer(u32 *pMem, u32 addr)
size = GIFPath_ParseTagQuick(GIF_PATH_1, data, diff); size = GIFPath_ParseTagQuick(GIF_PATH_1, data, diff);
pDest = &Path1Buffer[Path1WritePos*16]; pDest = &Path1Buffer[Path1WritePos*16];
Path1WritePos += size;
pxAssumeMsg((Path1WritePos+size < sizeof(Path1Buffer)), "XGKick Buffer Overflow detected on Path1Buffer!"); pxAssumeMsg((Path1WritePos+size < sizeof(Path1Buffer)), "XGKick Buffer Overflow detected on Path1Buffer!");
//DevCon.Warning("Storing size %x PATH 1", size);
if (size > diff) { if (size > diff) {
// fixme: one of these days the following *16's will get cleaned up when we introduce
// a special qwc/simd16 optimized version of memcpy_aligned. :)
//DevCon.Status("XGkick Wrap!"); //DevCon.Status("XGkick Wrap!");
memcpy_aligned(pDest, VU1.Mem + addr, diff); memcpy_qwc(pDest, VU1.Mem + addr, diff);
Path1WritePos += size; memcpy_qwc(pDest+(diff*16), VU1.Mem, size-diff);
size -= diff;
pDest += diff*16;
memcpy_aligned(pDest, VU1.Mem, size);
} }
else { else {
memcpy_aligned(pDest, VU1.Mem + addr, size); memcpy_qwc(pDest, VU1.Mem + addr, size);
Path1WritePos += size;
} }
//if(!gifRegs->stat.P1Q) CPU_INT(28, 128); //if(!gifRegs->stat.P1Q) CPU_INT(28, 128);
gifRegs->stat.P1Q = true; gifRegs->stat.P1Q = true;