Fixes for r2853.

- BIOS works again, Issue involving GIF Tag looping from the VU (which must have never worked!)
- Fixed KH freeze issue, possibly fixes Onimusha 2 as well. Thx Arcum for spotting it, thanks Rama for trying to bring fast resolution to the issue (however it wasnt quite right)

git-svn-id: http://pcsx2.googlecode.com/svn/trunk@2856 96395faa-99c1-11dd-bbfe-3dabce05a288
This commit is contained in:
refraction 2010-04-15 10:48:44 +00:00
parent e0bbb8f59d
commit 40bdbf9748
4 changed files with 31 additions and 5 deletions

View File

@ -23,7 +23,7 @@
vifStruct vif0;
vifStruct vif1;
tGSTransferStatus GSTransferStatus = (STOPPED_MODE<<4) | (STOPPED_MODE<<2) | STOPPED_MODE;
tGSTransferStatus GSTransferStatus((STOPPED_MODE<<4) | (STOPPED_MODE<<2) | STOPPED_MODE);
void vif0Init() { initNewVif(0); }
void vif1Init() { initNewVif(1); }

View File

@ -115,7 +115,7 @@ template<int idx> _f int _vifCode_Direct(int pass, u8* data, bool isDirectHL) {
{
/*if(!isDirectHL) DevCon.WriteLn("Direct: Waiting for Path3 to finish!");
else DevCon.WriteLn("DirectHL: Waiting for Path3 to finish!");*/
VIF_LOG("Mask %x, GIF STR %x, PTH1 %x, PTH2 %x, PTH3 %x", vif1Regs->mskpath3, gif->chcr.STR, GSTransferStatus.PTH1, GSTransferStatus.PTH2, GSTransferStatus.PTH3);
vif1Regs->stat.VGW = true; // PATH3 is in image mode, so wait for end of transfer
vif1.vifstalled = true;
return 0;

View File

@ -72,7 +72,7 @@ _vifT void vifTransferLoop(u32* &data) {
vifXRegs->code = data[0];
vifX.cmd = data[0] >> 24;
iBit = data[0] >> 31;
VIF_LOG("New VifCMD %x tagsize %x", vifX.cmd, vifX.tag.size);
vifXCode[vifX.cmd & 0x7f](0, data);
data++; pSize--;
if (analyzeIbit<idx>(data, iBit)) break;

View File

@ -337,7 +337,7 @@ __forceinline int GIFPath::ParseTag(GIF_PATH pathidx, const u8* pMem, u32 size)
{
const u8* vuMemEnd = pMem + (size<<4); // End of VU1 Mem
if (pathidx==GIF_PATH_1) size = 0x400; // VU1 mem size
const u32 startSize = size; // Start Size
u32 startSize = size; // Start Size
while (size > 0) {
if (!nloop) {
@ -363,7 +363,8 @@ __forceinline int GIFPath::ParseTag(GIF_PATH pathidx, const u8* pMem, u32 size)
}
//}
}
else {
else
{
switch(tag.FLG) {
case GIF_FLG_PACKED:
GIF_LOG("Packed Mode");
@ -398,7 +399,32 @@ __forceinline int GIFPath::ParseTag(GIF_PATH pathidx, const u8* pMem, u32 size)
break;
}
}
if(pathidx == GIF_PATH_1)
{
if(nloop > 0 && size == 0 && !tag.EOP) //Need to check all of this, some cases VU will send info (like the BIOS) but be incomplete
{
switch(tag.FLG)
{
case GIF_FLG_PACKED:
size = nloop * numregs;
break;
case GIF_FLG_REGLIST:
size = (nloop * numregs) / 2;
break;
default:
size = nloop;
break;
}
startSize += size;
if(startSize >= 0x3fff)
{
size = 0;
Console.Warning("GIFTAG error, size exceeded VU memory size");
}
}
}
if (tag.EOP && !nloop) {
if (pathidx != GIF_PATH_2) {
break;