Implement COP1_S_ROUND_L in cpu recompiler

This commit is contained in:
LegendOfDragoon 2016-05-22 23:28:07 -07:00
parent b2b10969c9
commit de00171747
3 changed files with 14 additions and 0 deletions

View File

@ -1292,6 +1292,7 @@ bool CCodeSection::GenerateX86Code(uint32_t Test)
case R4300i_COP1_FUNCT_NEG: COP1_S_NEG(); break;
case R4300i_COP1_FUNCT_SQRT: COP1_S_SQRT(); break;
case R4300i_COP1_FUNCT_MOV: COP1_S_MOV(); break;
case R4300i_COP1_FUNCT_ROUND_L: COP1_S_ROUND_L(); break;
case R4300i_COP1_FUNCT_TRUNC_L: COP1_S_TRUNC_L(); break;
case R4300i_COP1_FUNCT_CEIL_L: COP1_S_CEIL_L(); break; //added by Witten
case R4300i_COP1_FUNCT_FLOOR_L: COP1_S_FLOOR_L(); break; //added by Witten

View File

@ -5946,6 +5946,18 @@ void CRecompilerOps::COP1_S_MOV()
Load_FPR_ToTop(m_Opcode.fd, m_Opcode.fs, CRegInfo::FPU_Float);
}
void CRecompilerOps::COP1_S_ROUND_L()
{
CPU_Message(" %X %s", m_CompilePC, R4300iOpcodeName(m_Opcode.Hex, m_CompilePC));
m_Section->CompileCop1Test();
if (m_Opcode.fd != m_Opcode.fs || !RegInStack(m_Opcode.fd, CRegInfo::FPU_Float))
{
Load_FPR_ToTop(m_Opcode.fd, m_Opcode.fs, CRegInfo::FPU_Float);
}
ChangeFPURegFormat(m_Opcode.fd, CRegInfo::FPU_Float, CRegInfo::FPU_Qword, CRegInfo::RoundNearest);
}
void CRecompilerOps::COP1_S_TRUNC_L()
{
CPU_Message(" %X %s", m_CompilePC, R4300iOpcodeName(m_Opcode.Hex, m_CompilePC));

View File

@ -160,6 +160,7 @@ protected:
static void COP1_S_NEG ();
static void COP1_S_SQRT ();
static void COP1_S_MOV ();
static void COP1_S_ROUND_L ();
static void COP1_S_TRUNC_L ();
static void COP1_S_CEIL_L (); //added by Witten
static void COP1_S_FLOOR_L (); //added by Witten