From 32ade84138fe44ab8a7e5c43cc5a0708ba72ed01 Mon Sep 17 00:00:00 2001 From: LegendOfDragoon Date: Sun, 22 May 2016 23:37:45 -0700 Subject: [PATCH] Implement COP1_D_ROUND_L in cpu interpreter --- .../N64System/Interpreter/InterpreterOps.cpp | 8 +++++++- .../Project64-core/N64System/Interpreter/InterpreterOps.h | 1 + .../N64System/Interpreter/InterpreterOps32.cpp | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/Source/Project64-core/N64System/Interpreter/InterpreterOps.cpp b/Source/Project64-core/N64System/Interpreter/InterpreterOps.cpp index 946387469..af100bf17 100644 --- a/Source/Project64-core/N64System/Interpreter/InterpreterOps.cpp +++ b/Source/Project64-core/N64System/Interpreter/InterpreterOps.cpp @@ -546,7 +546,7 @@ R4300iOp::Func * R4300iOp::BuildInterpreter() Jump_CoP1_D[5] = COP1_D_ABS; Jump_CoP1_D[6] = COP1_D_MOV; Jump_CoP1_D[7] = COP1_D_NEG; - Jump_CoP1_D[8] = UnknownOpcode; + Jump_CoP1_D[8] = COP1_D_ROUND_L; Jump_CoP1_D[9] = COP1_D_TRUNC_L; //added by Witten Jump_CoP1_D[10] = COP1_D_CEIL_L; //added by Witten Jump_CoP1_D[11] = COP1_D_FLOOR_L; //added by Witten @@ -2658,6 +2658,12 @@ void R4300iOp::COP1_D_NEG() *(double *)_FPR_D[m_Opcode.fd] = (*(double *)_FPR_D[m_Opcode.fs] * -1.0); } +void R4300iOp::COP1_D_ROUND_L() +{ + TEST_COP1_USABLE_EXCEPTION(); + Double_RoundToInteger64(&*(uint64_t *)_FPR_S[m_Opcode.fd], &*(double *)_FPR_D[m_Opcode.fs], FE_TONEAREST); +} + void R4300iOp::COP1_D_TRUNC_L() { //added by Witten TEST_COP1_USABLE_EXCEPTION(); diff --git a/Source/Project64-core/N64System/Interpreter/InterpreterOps.h b/Source/Project64-core/N64System/Interpreter/InterpreterOps.h index 12f2d9b9d..cf370db61 100644 --- a/Source/Project64-core/N64System/Interpreter/InterpreterOps.h +++ b/Source/Project64-core/N64System/Interpreter/InterpreterOps.h @@ -182,6 +182,7 @@ public: static void COP1_D_ABS(); static void COP1_D_MOV(); static void COP1_D_NEG(); + static void COP1_D_ROUND_L(); static void COP1_D_TRUNC_L(); //added by Witten static void COP1_D_CEIL_L(); //added by Witten static void COP1_D_FLOOR_L(); //added by Witten diff --git a/Source/Project64-core/N64System/Interpreter/InterpreterOps32.cpp b/Source/Project64-core/N64System/Interpreter/InterpreterOps32.cpp index a459f3b9e..6d8324b36 100644 --- a/Source/Project64-core/N64System/Interpreter/InterpreterOps32.cpp +++ b/Source/Project64-core/N64System/Interpreter/InterpreterOps32.cpp @@ -441,7 +441,7 @@ R4300iOp32::Func * R4300iOp32::BuildInterpreter() Jump_CoP1_D[5] = R4300iOp::COP1_D_ABS; Jump_CoP1_D[6] = R4300iOp::COP1_D_MOV; Jump_CoP1_D[7] = R4300iOp::COP1_D_NEG; - Jump_CoP1_D[8] = R4300iOp::UnknownOpcode; + Jump_CoP1_D[8] = R4300iOp::COP1_D_ROUND_L; Jump_CoP1_D[9] = R4300iOp::COP1_D_TRUNC_L; //added by Witten Jump_CoP1_D[10] = R4300iOp::COP1_D_CEIL_L; //added by Witten Jump_CoP1_D[11] = R4300iOp::COP1_D_FLOOR_L; //added by Witten