microVU: fixed a bug in program comparison algorithm.

git-svn-id: http://pcsx2.googlecode.com/svn/trunk@1458 96395faa-99c1-11dd-bbfe-3dabce05a288
This commit is contained in:
cottonvibes 2009-07-03 19:27:48 +00:00
parent d82c3653ce
commit 43e41bf160
2 changed files with 14 additions and 7 deletions

View File

@ -132,7 +132,6 @@ microVUf(void) mVUclearProg(int progIndex) {
microVU* mVU = mVUx;
mVUprogI.used = 1;
mVUprogI.last_used = 3;
//mVUprogI.x86ptr = mVUprogI.x86start;
for (int j = 0; j <= mVUprogI.ranges.max; j++) {
mVUprogI.ranges.range[j][0] = -1; // Set range to
mVUprogI.ranges.range[j][1] = -1; // indeterminable status
@ -235,6 +234,8 @@ microVUt(void) mVUvsyncUpdate(mV) {
microVUf(bool) mVUcmpPartial(int progIndex) {
microVU* mVU = mVUx;
for (int i = 0; i <= mVUprogI.ranges.total; i++) {
if ((mVUprogI.ranges.range[i][0] < 0)
|| (mVUprogI.ranges.range[i][1] < 0)) { DevCon::Error("microVU%d: Negative Range![%d][%d]", params mVU->index, i, mVUprogI.ranges.total); }
if (memcmp_mmx(cmpOffset(mVUprogI.data), cmpOffset(mVU->regs->Micro), ((mVUprogI.ranges.range[i][1] + 8) - mVUprogI.ranges.range[i][0]))) {
return 0;
}

View File

@ -92,9 +92,11 @@ microVUt(void) mVUcheckIsSame(mV) {
// Sets up microProgram PC ranges based on whats been recompiled
microVUt(void) mVUsetupRange(mV, s32 pc, bool isStartPC) {
for (int i = 0; i <= mVUcurProg.ranges.total; i++) {
if ((pc >= mVUcurProg.ranges.range[i][0])
&& (pc <= mVUcurProg.ranges.range[i][1])) { return; }
if (isStartPC || !(mVUrange[1] == -1)) {
for (int i = 0; i <= mVUcurProg.ranges.total; i++) {
if ((pc >= mVUcurProg.ranges.range[i][0])
&& (pc <= mVUcurProg.ranges.range[i][1])) { return; }
}
}
mVUcheckIsSame(mVU);
@ -114,18 +116,22 @@ microVUt(void) mVUsetupRange(mV, s32 pc, bool isStartPC) {
else {
if (mVUrange[0] <= pc) {
mVUrange[1] = pc;
bool mergedRange = 0;
for (int i = 0; i <= (mVUcurProg.ranges.total-1); i++) {
int rStart = (mVUrange[0] < 8) ? 0 : (mVUrange[0] - 8);
int rEnd = pc;
if((mVUcurProg.ranges.range[i][1] >= rStart)
&& (mVUcurProg.ranges.range[i][1] <= rEnd)){
mVUcurProg.ranges.range[i][1] = pc;
mVUrange[0] = -1;
mVUrange[1] = -1;
mVUcurProg.ranges.total--;
mergedRange = 1;
//DevCon::Status("microVU%d: Prog Range Merging", params mVU->index);
}
}
if (mergedRange) {
mVUrange[0] = -1;
mVUrange[1] = -1;
mVUcurProg.ranges.total--;
}
}
else {
DevCon::Status("microVU%d: Prog Range Wrap [%04x] [%d]", params mVU->index, mVUrange[0], mVUrange[1]);