microVU: fixed some problems from my last revision. (fixes problems in DQ8)

git-svn-id: http://pcsx2.googlecode.com/svn/trunk@1444 96395faa-99c1-11dd-bbfe-3dabce05a288
This commit is contained in:
cottonvibes 2009-06-30 04:45:22 +00:00
parent 8f74247b4f
commit 95579258db
3 changed files with 12 additions and 10 deletions

View File

@ -219,7 +219,7 @@ microVUf(bool) mVUcmpPartial(int progIndex) {
microVUf(bool) mVUcmpProg(int progIndex, bool progUsed, const bool cmpWholeProg) {
microVU* mVU = mVUx;
if (progUsed) {
if (cmpWholeProg && (!memcmp_mmx((u8*)mVUprogI.data, mVU->regs->Micro, mVU->microMemSize))
if ((cmpWholeProg && !memcmp_mmx((u8*)mVUprogI.data, mVU->regs->Micro, mVU->microMemSize))
|| (!cmpWholeProg && mVUcmpPartial<vuIndex>(progIndex))) {
mVU->prog.cur = progIndex;
mVU->prog.cleared = 0;

View File

@ -79,7 +79,7 @@
microVUt(void) mVUcheckIsSame(mV) {
if (mVU->prog.isSame == -1) {
mVU->prog.isSame = !memcmp_mmx(mVUcurProg.data, mVU->regs->Micro, mVU->microMemSize);
mVU->prog.isSame = !memcmp_mmx((u8*)mVUcurProg.data, mVU->regs->Micro, mVU->microMemSize);
}
if (mVU->prog.isSame == 0) {
if (!isVU1) mVUcacheProg<0>(mVU->prog.cur);
@ -96,6 +96,7 @@ microVUt(void) mVUsetupRange(mV, s32 pc, bool isStartPC) {
&& (pc <= mVUcurProg.ranges.range[i][1])) { return; }
}
const u32 endMem = mVU->microMemSize-8;
mVUcheckIsSame(mVU);
if (isStartPC) {
@ -106,16 +107,17 @@ microVUt(void) mVUsetupRange(mV, s32 pc, bool isStartPC) {
else {
mVUcurProg.ranges.total = 0;
mVUrange[0] = 0;
mVUrange[1] = mVU->microMemSize - 8;
mVUrange[1] = endMem;
DevCon::Status("microVU%d: Prog Range List Full", params mVU->index);
}
}
else {
if (mVUrange[1] != -1) return;
if (mVUrange[0] <= pc) {
mVUrange[1] = pc;
for (int i = 0; i <= (mVUcurProg.ranges.total-1); i++) {
if ((mVUrange[0]-8) == mVUcurProg.ranges.range[i][1]) {
if ((mVUrange[0] == mVUcurProg.ranges.range[i][1])
||(((mVUrange[0]-8)&endMem) == mVUcurProg.ranges.range[i][1])) {
if (mVUcurProg.ranges.range[i][1] > pc) { continue; }
mVUcurProg.ranges.range[i][1] = pc;
mVUrange[0] = -1;
mVUrange[1] = -1;
@ -125,7 +127,7 @@ microVUt(void) mVUsetupRange(mV, s32 pc, bool isStartPC) {
}
}
else {
DevCon::Status("microVU%d: Prog Range Wrap", params mVU->index);
DevCon::Status("microVU%d: Prog Range Wrap [%04x] [%d]", params mVU->index, mVUrange[0], mVUrange[1]);
mVUrange[1] = mVU->microMemSize - 8;
if (mVUcurProg.ranges.total < mVUcurProg.ranges.max) {
mVUcurProg.ranges.total++;
@ -135,7 +137,7 @@ microVUt(void) mVUsetupRange(mV, s32 pc, bool isStartPC) {
else {
mVUcurProg.ranges.total = 0;
mVUrange[0] = 0;
mVUrange[1] = mVU->microMemSize - 8;
mVUrange[1] = endMem;
DevCon::Status("microVU%d: Prog Range List Full", params mVU->index);
}
}
@ -477,7 +479,7 @@ microVUr(void*) mVUcompile(microVU* mVU, u32 startPC, uptr pState) {
if (x == endCount) { Console::Error("microVU%d: Possible infinite compiling loop!", params mVU->index); }
// E-bit End
mVUsetupRange(mVU, xPC, 0);
mVUsetupRange(mVU, xPC-8, 0);
mVUendProgram(mVU, 1, xStatus, xMac, xClip);
return thisPtr;
}

View File

@ -215,7 +215,7 @@ typedef u32 (__fastcall *mVUCall)(void*, void*);
#define bSaveAddr (((xPC + (2 * 8)) & ((isVU1) ? 0x3ff8:0xff8)) / 8)
#define branchAddr ((xPC + 8 + (_Imm11_ * 8)) & (mVU->microMemSize-8))
#define shufflePQ (((mVU->p) ? 0xb0 : 0xe0) | ((mVU->q) ? 0x01 : 0x04))
#define cmpOffset(x) (&(((u8*)x)[mVUprogI.ranges.range[i][0]]))
#define cmpOffset(x) ((u8*)&(((u8*)x)[mVUprogI.ranges.range[i][0]]))
#define Rmem (uptr)&mVU->regs->VI[REG_R].UL
#define Roffset (uptr)&mVU->regs->VI[9].UL