mirror of https://github.com/PCSX2/pcsx2.git
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:
parent
7532c2969e
commit
cbc4ee26f6
|
@ -75,6 +75,7 @@ microVUt(void) mVUinit(VURegs* vuRegsPtr, int vuIndex) {
|
||||||
|
|
||||||
mVU->regs = vuRegsPtr;
|
mVU->regs = vuRegsPtr;
|
||||||
mVU->index = vuIndex;
|
mVU->index = vuIndex;
|
||||||
|
mVU->cop2 = 0;
|
||||||
mVU->vuMemSize = (vuIndex ? 0x4000 : 0x1000);
|
mVU->vuMemSize = (vuIndex ? 0x4000 : 0x1000);
|
||||||
mVU->microMemSize = (vuIndex ? 0x4000 : 0x1000);
|
mVU->microMemSize = (vuIndex ? 0x4000 : 0x1000);
|
||||||
mVU->progSize = (vuIndex ? 0x4000 : 0x1000) / 4;
|
mVU->progSize = (vuIndex ? 0x4000 : 0x1000) / 4;
|
||||||
|
|
|
@ -146,6 +146,7 @@ struct microVU {
|
||||||
__aligned16 u32 xmmPQb[4]; // Backup for xmmPQ
|
__aligned16 u32 xmmPQb[4]; // Backup for xmmPQ
|
||||||
|
|
||||||
u32 index; // VU Index (VU0 or VU1)
|
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 vuMemSize; // VU Main Memory Size (in bytes)
|
||||||
u32 microMemSize; // VU Micro Memory Size (in bytes)
|
u32 microMemSize; // VU Micro Memory Size (in bytes)
|
||||||
u32 progSize; // VU Micro Memory Size (in u32's)
|
u32 progSize; // VU Micro Memory Size (in u32's)
|
||||||
|
|
|
@ -33,6 +33,7 @@ using namespace R5900::Dynarec;
|
||||||
|
|
||||||
void setupMacroOp(int mode, const char* opName) {
|
void setupMacroOp(int mode, const char* opName) {
|
||||||
printCOP2(opName);
|
printCOP2(opName);
|
||||||
|
microVU0.cop2 = 1;
|
||||||
microVU0.prog.IRinfo.curPC = 0;
|
microVU0.prog.IRinfo.curPC = 0;
|
||||||
microVU0.code = cpuRegs.code;
|
microVU0.code = cpuRegs.code;
|
||||||
memset(µVU0.prog.IRinfo.info[0], 0, sizeof(microVU0.prog.IRinfo.info[0]));
|
memset(µVU0.prog.IRinfo.info[0], 0, sizeof(microVU0.prog.IRinfo.info[0]));
|
||||||
|
@ -64,6 +65,7 @@ void endMacroOp(int mode) {
|
||||||
MOV32RtoM((uptr)µVU0.regs->VI[REG_STATUS_FLAG].UL, gprF0);
|
MOV32RtoM((uptr)µVU0.regs->VI[REG_STATUS_FLAG].UL, gprF0);
|
||||||
}
|
}
|
||||||
microVU0.regAlloc->flushAll();
|
microVU0.regAlloc->flushAll();
|
||||||
|
microVU0.cop2 = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
#define REC_COP2_mVU0(f, opName, mode) \
|
#define REC_COP2_mVU0(f, opName, mode) \
|
||||||
|
|
|
@ -80,6 +80,7 @@ extern const __aligned(32) mVU_Globals mVUglob;
|
||||||
#define divI 0x1040000
|
#define divI 0x1040000
|
||||||
#define divD 0x2080000
|
#define divD 0x2080000
|
||||||
|
|
||||||
|
#define isCOP2 (mVU->cop2 != 0)
|
||||||
#define isVU1 (mVU->index != 0)
|
#define isVU1 (mVU->index != 0)
|
||||||
#define getIndex (isVU1 ? 1 : 0)
|
#define getIndex (isVU1 ? 1 : 0)
|
||||||
#define getVUmem(x) (((isVU1) ? (x & 0x3ff) : ((x >= 0x400) ? (x & 0x43f) : (x & 0xff))) * 16)
|
#define getVUmem(x) (((isVU1) ? (x & 0x3ff) : ((x >= 0x400) ? (x & 0x43f) : (x & 0xff))) * 16)
|
||||||
|
|
|
@ -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_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_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_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_MADDA) { mVU_FMACb(mVU, recPass, 1, 0, "MADDA", 0); }
|
||||||
mVUop(mVU_MADDAi) { mVU_FMACb(mVU, recPass, 3, 0, "MADDAi", 0); }
|
mVUop(mVU_MADDAi) { mVU_FMACb(mVU, recPass, 3, 0, "MADDAi", 0); }
|
||||||
mVUop(mVU_MADDAq) { mVU_FMACb(mVU, recPass, 4, 0, "MADDAq", 0); }
|
mVUop(mVU_MADDAq) { mVU_FMACb(mVU, recPass, 4, 0, "MADDAq", 0); }
|
||||||
|
|
Loading…
Reference in New Issue