microVU: bug fixes on some flag handling stuff.

git-svn-id: http://pcsx2.googlecode.com/svn/trunk@970 96395faa-99c1-11dd-bbfe-3dabce05a288
This commit is contained in:
cottonvibes 2009-04-14 00:15:18 +00:00
parent 44446b47e7
commit 2711d14f0c
3 changed files with 14 additions and 17 deletions

View File

@ -46,7 +46,7 @@ private:
microBlock callersList[mMaxBlocks]; // Foreign Blocks that call Local Blocks
public:
microBlockManager() { init(); }
microBlockManager() { init(); }
~microBlockManager() { close(); }
void init() {
listSize = -1;

View File

@ -265,19 +265,16 @@ microVUt(void) mVUanalyzeFSSET() {
microVUt(void) mVUanalyzeMflag(int Is, int It) {
microVU* mVU = mVUx;
if (!It) { mVUinfo |= _isNOP; }
else if (mVUcount >= 4) {
incPC2(-8);
if (doStatus) { mVUinfo |= _doMac; }
else {
else { // Need set _doMac for 4 previous Ops (need to do all 4 because stalls could change the result needed)
mVUinfo |= _swapOps;
if (mVUcount > 1) {
int curPC = iPC;
int i = mVUcount;
for (; i > 0; i--) {
incPC2(-2);
if (doStatus) { mVUinfo |= _doMac; break; }
for (int i = mVUcount, j = 0; i > 1; i--, j++) {
incPC(-2);
if (doStatus) { mVUinfo |= _doMac; if (j >= 3) { break; } }
}
iPC = curPC;
}
incPC2(8);
}
analyzeVIreg1(Is);
analyzeVIreg2(It, 1);

View File

@ -82,8 +82,8 @@ microVUt(void) mVUsetFlags(int* bStatus, int* bMac) {
// Ensure last ~4+ instructions update mac flags
int endPC = iPC;
int aCount = 1; // Amount of instructions needed to get 4 valid status/mac flag instances
for (int i = mVUcount; i > 0; i--, aCount++) {
if (doStatus) { mVUinfo |= _doMac; if (i >= 4) { break; } }
for (int i = mVUcount, int iX = 0; i > 0; i--, aCount++) {
if (doStatus) { mVUinfo |= _doMac; iX++; if ((iX >= 4) || (aCount > 4)) { break; } }
incPC2(-2);
}
@ -99,9 +99,7 @@ microVUt(void) mVUsetFlags(int* bStatus, int* bMac) {
iPC = mVUstartPC;
for (mVUcount = 0; mVUcount < xCount; mVUcount++) {
if ((xCount - mVUcount) > aCount) mVUstatusFlagOp<vuIndex>(); // Don't Optimize out on the last ~4+ instructions
if (doStatus||isFSSET||doDivFlag) { mVUinfo |= (xStatus&3) << 12; } // _fsInstance
if (doMac) { mVUinfo |= (xMac&3) << 10; } // _fmInstance
yS += (mVUstall > 3) ? 3 : mVUstall;
if (yS > zS) {
pStatus += (yS-zS);
@ -124,8 +122,10 @@ microVUt(void) mVUsetFlags(int* bStatus, int* bMac) {
}
yM++;
mVUinfo |= (pStatus&3) << 18; // _fvsInstance
mVUinfo |= (pMac&3) << 16; // _fvmInstance
mVUinfo |= (xStatus&3) << 12; // _fsInstance
mVUinfo |= (xMac&3) << 10; // _fmInstance
mVUinfo |= (pStatus&3) << 18; // _fvsInstance
mVUinfo |= (pMac&3) << 16; // _fvmInstance
if (doStatus||isFSSET||doDivFlag) { xStatus = (xStatus+1); }
if (doMac) { xMac = (xMac+1); }