mirror of https://github.com/PCSX2/pcsx2.git
Decided after discussion amongst the team to let the BIOS bugs run wild. Altered microVU to just ignore these problems and end silently (The real VU would probably do this anyway)
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@5575 96395faa-99c1-11dd-bbfe-3dabce05a288
This commit is contained in:
parent
ef6cc1d715
commit
f984c7027f
|
@ -523,21 +523,15 @@ template<int vunum> static void __fc vuMicroWrite32(u32 addr, mem32_t data) {
|
|||
template<int vunum> static void __fc vuMicroWrite64(u32 addr, const mem64_t* data) {
|
||||
VURegs* vu = vunum ? &VU1 : &VU0;
|
||||
addr &= vunum ? 0x3fff: 0xfff;
|
||||
u64 tempdata;
|
||||
|
||||
if(cpuRegs.pc >= 0x80000000 && cpuRegs.pc < 0x82000000)
|
||||
tempdata = (data[0] >> 32) | (data[0] << 32); //BIOS writes them in the wrong order apparently...
|
||||
else
|
||||
tempdata = data[0];
|
||||
|
||||
if (vunum && THREAD_VU1) {
|
||||
vu1Thread.WriteMicroMem(addr, &tempdata, sizeof(u64));
|
||||
vu1Thread.WriteMicroMem(addr, (void*)data, sizeof(u64));
|
||||
return;
|
||||
}
|
||||
|
||||
if (*(u64*)&vu->Micro[addr]!=tempdata) {
|
||||
if (*(u64*)&vu->Micro[addr]!=data[0]) {
|
||||
ClearVuFunc<vunum>(addr, 8);
|
||||
*(u64*)&vu->Micro[addr] =tempdata;
|
||||
*(u64*)&vu->Micro[addr] =data[0];
|
||||
}
|
||||
}
|
||||
template<int vunum> static void __fc vuMicroWrite128(u32 addr, const mem128_t* data) {
|
||||
|
@ -548,7 +542,7 @@ template<int vunum> static void __fc vuMicroWrite128(u32 addr, const mem128_t* d
|
|||
vu1Thread.WriteMicroMem(addr, (void*)data, sizeof(u128));
|
||||
return;
|
||||
}
|
||||
if ((u128&)vu->Micro[addr]!=*data) { //Hmm, is that right?
|
||||
if ((u128&)vu->Micro[addr]!=*data) {
|
||||
ClearVuFunc<vunum>(addr, 16);
|
||||
CopyQWC(&vu->Micro[addr],data);
|
||||
}
|
||||
|
|
|
@ -19,8 +19,8 @@
|
|||
// Messages Called at Execution Time...
|
||||
//------------------------------------------------------------------
|
||||
|
||||
static void __fc mVUbadOp0 (u32 prog, u32 pc) { Console.Error("microVU0 Warning: Exiting... Block started with illegal opcode. [%04x] [%03d]", pc, prog); }
|
||||
static void __fc mVUbadOp1 (u32 prog, u32 pc) { Console.Error("microVU1 Warning: Exiting... Block started with illegal opcode. [%04x] [%03d]", pc, prog); }
|
||||
static void __fc mVUbadOp0 (u32 prog, u32 pc) { Console.Error("microVU0 Warning: Exiting... Block contains an illegal opcode. [%04x] [%03d]", pc, prog); }
|
||||
static void __fc mVUbadOp1 (u32 prog, u32 pc) { Console.Error("microVU1 Warning: Exiting... Block contains an illegal opcode. [%04x] [%03d]", pc, prog); }
|
||||
static void __fc mVUwarning0(u32 prog, u32 pc) { Console.Error("microVU0 Warning: Exiting from Possible Infinite Loop [%04x] [%03d]", pc, prog); }
|
||||
static void __fc mVUwarning1(u32 prog, u32 pc) { Console.Error("microVU1 Warning: Exiting from Possible Infinite Loop [%04x] [%03d]", pc, prog); }
|
||||
static void __fc mVUprintPC1(u32 pc) { Console.WriteLn("Block Start PC = 0x%04x", pc); }
|
||||
|
@ -160,15 +160,22 @@ void mVUexecuteInstruction(mV) {
|
|||
|
||||
// If 1st op in block is a bad opcode, then don't compile rest of block (Dawn of Mana Level 2)
|
||||
__fi void mVUcheckBadOp(mV) {
|
||||
if (mVUinfo.isBadOp && mVUcount == 0) {
|
||||
if (mVUinfo.isBadOp) {
|
||||
mVUinfo.isEOB = true;
|
||||
Console.Warning("microVU Warning: First Instruction of block contains illegal opcode...");
|
||||
|
||||
// The BIOS writes upper and lower NOPs in reversed slots (bug)
|
||||
//So to prevent spamming we ignore these, however its possible the real VU will bomb out if
|
||||
//this happens, so we will bomb out without warning.
|
||||
if(mVU.code != 0x8000033c)
|
||||
DevCon.Warning("microVU Warning: First Instruction of block contains illegal opcode...");
|
||||
else
|
||||
mVUinfo.isBadOp = false; //End quietly
|
||||
}
|
||||
}
|
||||
|
||||
// Prints msg when exiting block early if 1st op was a bad opcode (Dawn of Mana Level 2)
|
||||
__fi void handleBadOp(mV, int count) {
|
||||
if (mVUinfo.isBadOp && count == 0) {
|
||||
if (mVUinfo.isBadOp) {
|
||||
mVUbackupRegs(mVU, true);
|
||||
xMOV(gprT2, mVU.prog.cur->idx);
|
||||
xMOV(gprT3, xPC);
|
||||
|
@ -504,6 +511,7 @@ void* mVUcompile(microVU& mVU, u32 startPC, uptr pState) {
|
|||
if (branch >= 2) { mVUinfo.isEOB = 1; if (branch == 3) { mVUinfo.isBdelay = 1; } branchWarning(mVU); break; }
|
||||
elif (branch == 1) { branch = 2; }
|
||||
if (mVUbranch) { mVUsetFlagInfo(mVU); eBitWarning(mVU); branch = 3; mVUbranch = 0; }
|
||||
if (mVUinfo.isEOB) break;
|
||||
incPC(1);
|
||||
}
|
||||
|
||||
|
|
|
@ -212,7 +212,7 @@ mVUop(mVUopU) { mVU_UPPER_OPCODE [ (mVU.code & 0x3f) ](mX); } // Gets Upper
|
|||
mVUop(mVUopL) { mVULOWER_OPCODE [ (mVU.code >> 25) ](mX); } // Gets Lower Opcode
|
||||
mVUop(mVUunknown) {
|
||||
pass1 { mVUinfo.isBadOp = true; }
|
||||
pass2 { Console.Error("microVU%d: Unknown Micro VU opcode called (%x) [%04x]\n", getIndex, mVU.code, xPC); }
|
||||
pass2 { if(mVU.code != 0x8000033c) Console.Error("microVU%d: Unknown Micro VU opcode called (%x) [%04x]\n", getIndex, mVU.code, xPC); }
|
||||
pass3 { mVUlog("Unknown", mVU.code); }
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue