From a77c4f808bc0c2084437300f7e87634bc56971e8 Mon Sep 17 00:00:00 2001 From: nakeee Date: Tue, 14 Apr 2009 12:37:44 +0000 Subject: [PATCH] guessing unknown extension (seems not to crash anything while other guesses did) git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@2964 8ced0084-cf51-0410-be5f-012b33b47a6e --- Source/Core/DSPCore/Src/DSPTables.cpp | 3 +++ Source/Core/DSPCore/Src/gdsp_ext_op.cpp | 12 +++++++++++- Source/Core/DSPCore/Src/gdsp_ext_op.h | 1 + 3 files changed, 15 insertions(+), 1 deletion(-) diff --git a/Source/Core/DSPCore/Src/DSPTables.cpp b/Source/Core/DSPCore/Src/DSPTables.cpp index cbd0ed5ea8..747a8978b1 100644 --- a/Source/Core/DSPCore/Src/DSPTables.cpp +++ b/Source/Core/DSPCore/Src/DSPTables.cpp @@ -314,6 +314,9 @@ const DSPOPCTemplate cw = const DSPOPCTemplate opcodes_ext[] = { + + // FIXME: guessing this is cr need checking + {"CR", 0x0000, 0x00fc, DSPInterpreter::Ext::cr, nop, 1, 1, {{P_REG, 1, 0, 0, 0x0003}}, NULL, NULL,}, {"DR", 0x0004, 0x00fc, DSPInterpreter::Ext::dr, nop, 1, 1, {{P_REG, 1, 0, 0, 0x0003}}, NULL, NULL,}, {"IR", 0x0008, 0x00fc, DSPInterpreter::Ext::ir, nop, 1, 1, {{P_REG, 1, 0, 0, 0x0003}}, NULL, NULL,}, {"NR", 0x000c, 0x00fc, DSPInterpreter::Ext::nr, nop, 1, 1, {{P_REG, 1, 0, 0, 0x0003}}, NULL, NULL,}, diff --git a/Source/Core/DSPCore/Src/gdsp_ext_op.cpp b/Source/Core/DSPCore/Src/gdsp_ext_op.cpp index 57a1b12286..fa9d9692b8 100644 --- a/Source/Core/DSPCore/Src/gdsp_ext_op.cpp +++ b/Source/Core/DSPCore/Src/gdsp_ext_op.cpp @@ -35,6 +35,16 @@ namespace DSPInterpreter namespace Ext { +// CR $arR +// xxxx xxxx 0000 00rr +// Clearing addressing register $arR. +// This is not in any doc and as such just a guess +void cr(const UDSPInstruction& opc) { + u8 reg = opc.hex & 0x3; + + g_dsp.r[reg] = 0; +} + // DR $arR // xxxx xxxx 0000 01rr // Decrement addressing register $arR. @@ -201,7 +211,7 @@ void dsp_op_ext_r_epi(const UDSPInstruction& opc) switch (op) { case 0x00: // - ERROR_LOG(DSPLLE, "dsp_op_ext_r_epi"); + //g_dsp.r[reg] = 0; break; case 0x01: // DR diff --git a/Source/Core/DSPCore/Src/gdsp_ext_op.h b/Source/Core/DSPCore/Src/gdsp_ext_op.h index 7040980bd3..6601059fac 100644 --- a/Source/Core/DSPCore/Src/gdsp_ext_op.h +++ b/Source/Core/DSPCore/Src/gdsp_ext_op.h @@ -62,6 +62,7 @@ void ldn(const UDSPInstruction& opc); void ldm(const UDSPInstruction& opc); void ldnm(const UDSPInstruction& opc); void mv(const UDSPInstruction& opc); +void cr(const UDSPInstruction& opc); void dr(const UDSPInstruction& opc); void ir(const UDSPInstruction& opc); void nr(const UDSPInstruction& opc);