mirror of https://github.com/PCSX2/pcsx2.git
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:
parent
d82c3653ce
commit
43e41bf160
|
@ -132,7 +132,6 @@ microVUf(void) mVUclearProg(int progIndex) {
|
||||||
microVU* mVU = mVUx;
|
microVU* mVU = mVUx;
|
||||||
mVUprogI.used = 1;
|
mVUprogI.used = 1;
|
||||||
mVUprogI.last_used = 3;
|
mVUprogI.last_used = 3;
|
||||||
//mVUprogI.x86ptr = mVUprogI.x86start;
|
|
||||||
for (int j = 0; j <= mVUprogI.ranges.max; j++) {
|
for (int j = 0; j <= mVUprogI.ranges.max; j++) {
|
||||||
mVUprogI.ranges.range[j][0] = -1; // Set range to
|
mVUprogI.ranges.range[j][0] = -1; // Set range to
|
||||||
mVUprogI.ranges.range[j][1] = -1; // indeterminable status
|
mVUprogI.ranges.range[j][1] = -1; // indeterminable status
|
||||||
|
@ -235,6 +234,8 @@ microVUt(void) mVUvsyncUpdate(mV) {
|
||||||
microVUf(bool) mVUcmpPartial(int progIndex) {
|
microVUf(bool) mVUcmpPartial(int progIndex) {
|
||||||
microVU* mVU = mVUx;
|
microVU* mVU = mVUx;
|
||||||
for (int i = 0; i <= mVUprogI.ranges.total; i++) {
|
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]))) {
|
if (memcmp_mmx(cmpOffset(mVUprogI.data), cmpOffset(mVU->regs->Micro), ((mVUprogI.ranges.range[i][1] + 8) - mVUprogI.ranges.range[i][0]))) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -92,9 +92,11 @@ microVUt(void) mVUcheckIsSame(mV) {
|
||||||
// Sets up microProgram PC ranges based on whats been recompiled
|
// Sets up microProgram PC ranges based on whats been recompiled
|
||||||
microVUt(void) mVUsetupRange(mV, s32 pc, bool isStartPC) {
|
microVUt(void) mVUsetupRange(mV, s32 pc, bool isStartPC) {
|
||||||
|
|
||||||
for (int i = 0; i <= mVUcurProg.ranges.total; i++) {
|
if (isStartPC || !(mVUrange[1] == -1)) {
|
||||||
if ((pc >= mVUcurProg.ranges.range[i][0])
|
for (int i = 0; i <= mVUcurProg.ranges.total; i++) {
|
||||||
&& (pc <= mVUcurProg.ranges.range[i][1])) { return; }
|
if ((pc >= mVUcurProg.ranges.range[i][0])
|
||||||
|
&& (pc <= mVUcurProg.ranges.range[i][1])) { return; }
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
mVUcheckIsSame(mVU);
|
mVUcheckIsSame(mVU);
|
||||||
|
@ -114,18 +116,22 @@ microVUt(void) mVUsetupRange(mV, s32 pc, bool isStartPC) {
|
||||||
else {
|
else {
|
||||||
if (mVUrange[0] <= pc) {
|
if (mVUrange[0] <= pc) {
|
||||||
mVUrange[1] = pc;
|
mVUrange[1] = pc;
|
||||||
|
bool mergedRange = 0;
|
||||||
for (int i = 0; i <= (mVUcurProg.ranges.total-1); i++) {
|
for (int i = 0; i <= (mVUcurProg.ranges.total-1); i++) {
|
||||||
int rStart = (mVUrange[0] < 8) ? 0 : (mVUrange[0] - 8);
|
int rStart = (mVUrange[0] < 8) ? 0 : (mVUrange[0] - 8);
|
||||||
int rEnd = pc;
|
int rEnd = pc;
|
||||||
if((mVUcurProg.ranges.range[i][1] >= rStart)
|
if((mVUcurProg.ranges.range[i][1] >= rStart)
|
||||||
&& (mVUcurProg.ranges.range[i][1] <= rEnd)){
|
&& (mVUcurProg.ranges.range[i][1] <= rEnd)){
|
||||||
mVUcurProg.ranges.range[i][1] = pc;
|
mVUcurProg.ranges.range[i][1] = pc;
|
||||||
mVUrange[0] = -1;
|
mergedRange = 1;
|
||||||
mVUrange[1] = -1;
|
|
||||||
mVUcurProg.ranges.total--;
|
|
||||||
//DevCon::Status("microVU%d: Prog Range Merging", params mVU->index);
|
//DevCon::Status("microVU%d: Prog Range Merging", params mVU->index);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (mergedRange) {
|
||||||
|
mVUrange[0] = -1;
|
||||||
|
mVUrange[1] = -1;
|
||||||
|
mVUcurProg.ranges.total--;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
DevCon::Status("microVU%d: Prog Range Wrap [%04x] [%d]", params mVU->index, mVUrange[0], mVUrange[1]);
|
DevCon::Status("microVU%d: Prog Range Wrap [%04x] [%d]", params mVU->index, mVUrange[0], mVUrange[1]);
|
||||||
|
|
Loading…
Reference in New Issue