From c04eaf0f73ecb0be252f711de6ab9dcee3fe4556 Mon Sep 17 00:00:00 2001 From: refraction Date: Wed, 12 Oct 2011 22:54:21 +0000 Subject: [PATCH] COP2: Fix/hack for Ace Combat 4 sky, you will need to tick the VU Flag Hack Speedhack to enable it (not sure what else to put it on without adding another hack). This is more likely to do with odd COP2/VU0 sharing pipe behaviour, but ill leave that for cotton :P Also altered some of the interpreter calls so the defines in config.h can be used again (example the #define ARITHMETICIMM) git-svn-id: http://pcsx2.googlecode.com/svn/trunk@4935 96395faa-99c1-11dd-bbfe-3dabce05a288 --- pcsx2/x86/ix86-32/iR5900Arit.cpp | 28 ++++++++++++++-------------- pcsx2/x86/ix86-32/iR5900AritImm.cpp | 18 +++++++++--------- pcsx2/x86/microVU_Macro.inl | 26 ++++++++++++++++++-------- 3 files changed, 41 insertions(+), 31 deletions(-) diff --git a/pcsx2/x86/ix86-32/iR5900Arit.cpp b/pcsx2/x86/ix86-32/iR5900Arit.cpp index 258902389e..52a42517d7 100644 --- a/pcsx2/x86/ix86-32/iR5900Arit.cpp +++ b/pcsx2/x86/ix86-32/iR5900Arit.cpp @@ -38,20 +38,20 @@ namespace OpcodeImpl namespace Interp = R5900::Interpreter::OpcodeImpl; -REC_FUNC_DEL(ADD, _Rd_); -REC_FUNC_DEL(ADDU, _Rd_); -REC_FUNC_DEL(DADD, _Rd_); -REC_FUNC_DEL(DADDU, _Rd_); -REC_FUNC_DEL(SUB, _Rd_); -REC_FUNC_DEL(SUBU, _Rd_); -REC_FUNC_DEL(DSUB, _Rd_); -REC_FUNC_DEL(DSUBU, _Rd_); -REC_FUNC_DEL(AND, _Rd_); -REC_FUNC_DEL(OR, _Rd_); -REC_FUNC_DEL(XOR, _Rd_); -REC_FUNC_DEL(NOR, _Rd_); -REC_FUNC_DEL(SLT, _Rd_); -REC_FUNC_DEL(SLTU, _Rd_); +REC_FUNC(ADD); +REC_FUNC(ADDU); +REC_FUNC(DADD); +REC_FUNC(DADDU); +REC_FUNC(SUB); +REC_FUNC(SUBU); +REC_FUNC(DSUB); +REC_FUNC(DSUBU); +REC_FUNC(AND); +REC_FUNC(OR); +REC_FUNC(XOR); +REC_FUNC(NOR); +REC_FUNC(SLT); +REC_FUNC(SLTU); #else diff --git a/pcsx2/x86/ix86-32/iR5900AritImm.cpp b/pcsx2/x86/ix86-32/iR5900AritImm.cpp index 1fa9332896..5fc6f54ed6 100644 --- a/pcsx2/x86/ix86-32/iR5900AritImm.cpp +++ b/pcsx2/x86/ix86-32/iR5900AritImm.cpp @@ -34,16 +34,16 @@ namespace OpcodeImpl namespace Interp = R5900::Interpreter::OpcodeImpl; -REC_FUNC_DEL(ADDI, _Rt_); -REC_FUNC_DEL(ADDIU, _Rt_); -REC_FUNC_DEL(DADDI, _Rt_); -REC_FUNC_DEL(DADDIU, _Rt_); -REC_FUNC_DEL(ANDI, _Rt_); -REC_FUNC_DEL(ORI, _Rt_); -REC_FUNC_DEL(XORI, _Rt_); +REC_FUNC(ADDI); +REC_FUNC(ADDIU); +REC_FUNC(DADDI); +REC_FUNC(DADDIU); +REC_FUNC(ANDI); +REC_FUNC(ORI); +REC_FUNC(XORI); -REC_FUNC_DEL(SLTI, _Rt_); -REC_FUNC_DEL(SLTIU, _Rt_); +REC_FUNC(SLTI); +REC_FUNC(SLTIU); #else diff --git a/pcsx2/x86/microVU_Macro.inl b/pcsx2/x86/microVU_Macro.inl index 1030a77226..799e38dd04 100644 --- a/pcsx2/x86/microVU_Macro.inl +++ b/pcsx2/x86/microVU_Macro.inl @@ -45,13 +45,23 @@ void setupMacroOp(int mode, const char* opName) { microVU0.prog.IRinfo.info[0].cFlag.lastWrite = 0xff; } if (mode & 0x10) { // Update Status/Mac Flags - microVU0.prog.IRinfo.info[0].sFlag.doFlag = 1; - microVU0.prog.IRinfo.info[0].sFlag.doNonSticky = 1; - microVU0.prog.IRinfo.info[0].sFlag.write = 0; - microVU0.prog.IRinfo.info[0].sFlag.lastWrite = 0; - microVU0.prog.IRinfo.info[0].mFlag.doFlag = 1; - microVU0.prog.IRinfo.info[0].mFlag.write = 0xff; - xMOV(gprF0, ptr32[&vu0Regs.VI[REG_STATUS_FLAG].UL]); + if ((mode & 0x80) && CHECK_VU_FLAGHACK) + { + //Its doing a SUB and we have the hack on so Ace Combat sky will work. + //Some freaky stat flag thing going on here! + } + else + { + microVU0.prog.IRinfo.info[0].sFlag.doFlag = 1; + microVU0.prog.IRinfo.info[0].sFlag.doNonSticky = 1; + microVU0.prog.IRinfo.info[0].sFlag.write = 0; + microVU0.prog.IRinfo.info[0].sFlag.lastWrite = 0; + microVU0.prog.IRinfo.info[0].mFlag.doFlag = 1; + microVU0.prog.IRinfo.info[0].mFlag.write = 0xff; + + xMOV(gprF0, ptr32[&vu0Regs.VI[REG_STATUS_FLAG].UL]); + } + } } @@ -116,7 +126,7 @@ REC_COP2_mVU0(ADDAx, "ADDAx", 0x10); REC_COP2_mVU0(ADDAy, "ADDAy", 0x10); REC_COP2_mVU0(ADDAz, "ADDAz", 0x10); REC_COP2_mVU0(ADDAw, "ADDAw", 0x10); -REC_COP2_mVU0(SUB, "SUB", 0x10); +REC_COP2_mVU0(SUB, "SUB", 0x90); //Ace Combat sky REC_COP2_mVU0(SUBi, "SUBi", 0x10); REC_COP2_mVU0(SUBq, "SUBq", 0x11); REC_COP2_mVU0(SUBx, "SUBx", 0x10);