microVU: added a flag to tell when its in COP2 mode.

macroVU: some clamping that may fix the ICO camera bug (not tested)

git-svn-id: http://pcsx2.googlecode.com/svn/trunk@2312 96395faa-99c1-11dd-bbfe-3dabce05a288
This commit is contained in:
cottonvibes 2009-12-05 09:04:20 +00:00
parent 7532c2969e
commit cbc4ee26f6
5 changed files with 6 additions and 1 deletions

View File

@ -75,6 +75,7 @@ microVUt(void) mVUinit(VURegs* vuRegsPtr, int vuIndex) {
mVU->regs = vuRegsPtr;
mVU->index = vuIndex;
mVU->cop2 = 0;
mVU->vuMemSize = (vuIndex ? 0x4000 : 0x1000);
mVU->microMemSize = (vuIndex ? 0x4000 : 0x1000);
mVU->progSize = (vuIndex ? 0x4000 : 0x1000) / 4;

View File

@ -146,6 +146,7 @@ struct microVU {
__aligned16 u32 xmmPQb[4]; // Backup for xmmPQ
u32 index; // VU Index (VU0 or VU1)
u32 cop2; // VU is in COP2 mode? (No/Yes)
u32 vuMemSize; // VU Main Memory Size (in bytes)
u32 microMemSize; // VU Micro Memory Size (in bytes)
u32 progSize; // VU Micro Memory Size (in u32's)

View File

@ -33,6 +33,7 @@ using namespace R5900::Dynarec;
void setupMacroOp(int mode, const char* opName) {
printCOP2(opName);
microVU0.cop2 = 1;
microVU0.prog.IRinfo.curPC = 0;
microVU0.code = cpuRegs.code;
memset(&microVU0.prog.IRinfo.info[0], 0, sizeof(microVU0.prog.IRinfo.info[0]));
@ -64,6 +65,7 @@ void endMacroOp(int mode) {
MOV32RtoM((uptr)&microVU0.regs->VI[REG_STATUS_FLAG].UL, gprF0);
}
microVU0.regAlloc->flushAll();
microVU0.cop2 = 0;
}
#define REC_COP2_mVU0(f, opName, mode) \

View File

@ -80,6 +80,7 @@ extern const __aligned(32) mVU_Globals mVUglob;
#define divI 0x1040000
#define divD 0x2080000
#define isCOP2 (mVU->cop2 != 0)
#define isVU1 (mVU->index != 0)
#define getIndex (isVU1 ? 1 : 0)
#define getVUmem(x) (((isVU1) ? (x & 0x3ff) : ((x >= 0x400) ? (x & 0x43f) : (x & 0xff))) * 16)

View File

@ -481,7 +481,7 @@ mVUop(mVU_MADDq) { mVU_FMACc(mVU, recPass, 4, "MADDq", 0); }
mVUop(mVU_MADDx) { mVU_FMACc(mVU, recPass, 2, "MADDx", cFs);} // Clamp (TOTA, DoM, ...)
mVUop(mVU_MADDy) { mVU_FMACc(mVU, recPass, 2, "MADDy", cFs);} // Clamp (TOTA, DoM, ...)
mVUop(mVU_MADDz) { mVU_FMACc(mVU, recPass, 2, "MADDz", cFs);} // Clamp (TOTA, DoM, ...)
mVUop(mVU_MADDw) { mVU_FMACc(mVU, recPass, 2, "MADDw", cFs);} // Clamp (TOTA, DoM, ...)
mVUop(mVU_MADDw) { mVU_FMACc(mVU, recPass, 2, "MADDw", (isCOP2)?(cACC|cFt|cFs):cFs);} // Clamp (ICO (COP2), TOTA, DoM)
mVUop(mVU_MADDA) { mVU_FMACb(mVU, recPass, 1, 0, "MADDA", 0); }
mVUop(mVU_MADDAi) { mVU_FMACb(mVU, recPass, 3, 0, "MADDAi", 0); }
mVUop(mVU_MADDAq) { mVU_FMACb(mVU, recPass, 4, 0, "MADDAq", 0); }