diff options
| author | XTra.KrazzY <XTra.KrazzY@gmail.com> | 2009-04-01 22:41:16 +0000 |
|---|---|---|
| committer | XTra.KrazzY <XTra.KrazzY@gmail.com> | 2009-04-01 22:41:16 +0000 |
| commit | 44db8cd0b8c86f28a89365a5ff8db284cea67d0f (patch) | |
| tree | 9a2952e24133e6e04b58cb3a910a6ce606360384 | |
| parent | 9915533c3cc8a99de1ff1d3d89ae0301e1a44970 (diff) | |
LLE-WIP: More progress on the opcode lookup table. Still haven't put the correct interpreter functions into the opcode table.
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@2822 8ced0084-cf51-0410-be5f-012b33b47a6e
4 files changed, 15 insertions, 15 deletions
diff --git a/Source/Plugins/Plugin_DSP_LLE-testing/Src/DSPInterpreter.cpp b/Source/Plugins/Plugin_DSP_LLE-testing/Src/DSPInterpreter.cpp index 2445757273..80128e6096 100644 --- a/Source/Plugins/Plugin_DSP_LLE-testing/Src/DSPInterpreter.cpp +++ b/Source/Plugins/Plugin_DSP_LLE-testing/Src/DSPInterpreter.cpp @@ -177,9 +177,10 @@ bool CheckCondition(u8 _Condition) void unknown(const UDSPInstruction& opc)
{
- _assert_msg_(MASTER_LOG, !g_dsp.exception_in_progress_hack, "assert while exception");
+ //_assert_msg_(MASTER_LOG, !g_dsp.exception_in_progress_hack, "assert while exception");
+ PanicAlert("Unimplemented instruction %d", opc.hex);
ERROR_LOG(DSPHLE, "unknown opcode %d", opc.hex);
- g_dsp.pc = g_dsp.err_pc;
+ //g_dsp.pc = g_dsp.err_pc;
}
void call(const UDSPInstruction& opc)
diff --git a/Source/Plugins/Plugin_DSP_LLE-testing/Src/DSPTables.cpp b/Source/Plugins/Plugin_DSP_LLE-testing/Src/DSPTables.cpp index 646e8aa151..26d8f05afa 100644 --- a/Source/Plugins/Plugin_DSP_LLE-testing/Src/DSPTables.cpp +++ b/Source/Plugins/Plugin_DSP_LLE-testing/Src/DSPTables.cpp @@ -23,10 +23,6 @@ #include "DSPInterpreter.h"
#include "DSPJit.h"
-void unimplementedInst(const UDSPInstruction& inst) {
- PanicAlert("Unimplemented instruction %d", inst.hex);
-}
-
void nop(const UDSPInstruction&) {}
// TODO(XK): Fill up the tables with the corresponding instructions
@@ -239,15 +235,16 @@ DSPOPCTemplate opcodes_ext[] = const u32 opcodes_size = sizeof(opcodes) / sizeof(DSPOPCTemplate);
const u32 opcodes_ext_size = sizeof(opcodes_ext) / sizeof(DSPOPCTemplate);
+dspInstFunc opTable[OPTABLE_SIZE];
+
void InitInstructionTable() {
- // TODO(XK): Fill
-}
+ for(int i = 0; i < OPTABLE_SIZE; i++)
+ opTable[i] = DSPInterpreter::unknown;
-void DestroyInstructionTable() {
- // TODO(XK): Fill
-}
+ for(int i = 0; i < opcodes_size; i++)
+ opTable[opcodes[i].opcode] = opcodes[i].interpFunc;
+}
void ComputeInstruction(const UDSPInstruction& inst) {
- // TODO(XK): Fill
- DSPInterpreter::unknown(inst);
+ opTable[inst.hex](inst);
}
diff --git a/Source/Plugins/Plugin_DSP_LLE-testing/Src/DSPTables.h b/Source/Plugins/Plugin_DSP_LLE-testing/Src/DSPTables.h index f9202873d5..6b434c4040 100644 --- a/Source/Plugins/Plugin_DSP_LLE-testing/Src/DSPTables.h +++ b/Source/Plugins/Plugin_DSP_LLE-testing/Src/DSPTables.h @@ -48,6 +48,8 @@ enum parameterType #define P_EXT 0x80
+#define OPTABLE_SIZE 65536
+
union UDSPInstruction
{
u16 hex;
@@ -101,8 +103,9 @@ extern const u32 opcodes_size; extern DSPOPCTemplate opcodes_ext[];
extern const u32 opcodes_ext_size;
+extern dspInstFunc opTable[];
+
void InitInstructionTable();
-void DestroyInstructionTable();
void ComputeInstruction(const UDSPInstruction& inst);
diff --git a/Source/Plugins/Plugin_DSP_LLE-testing/Src/main.cpp b/Source/Plugins/Plugin_DSP_LLE-testing/Src/main.cpp index 3a4d93e2e0..ad661732fa 100644 --- a/Source/Plugins/Plugin_DSP_LLE-testing/Src/main.cpp +++ b/Source/Plugins/Plugin_DSP_LLE-testing/Src/main.cpp @@ -259,7 +259,6 @@ void Shutdown(void) { bIsRunning = false; gdsp_stop(); - DestroyInstructionTable(); AudioCommon::ShutdownSoundStream(); } |
