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
This commit is contained in:
XTra.KrazzY 2009-04-01 22:41:16 +00:00
parent 9915533c3c
commit 44db8cd0b8
4 changed files with 16 additions and 16 deletions

View File

@ -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)

View File

@ -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);
void InitInstructionTable() {
// TODO(XK): Fill
}
dspInstFunc opTable[OPTABLE_SIZE];
void DestroyInstructionTable() {
// TODO(XK): Fill
void InitInstructionTable() {
for(int i = 0; i < OPTABLE_SIZE; i++)
opTable[i] = DSPInterpreter::unknown;
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);
}

View File

@ -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);

View File

@ -259,7 +259,6 @@ void Shutdown(void)
{
bIsRunning = false;
gdsp_stop();
DestroyInstructionTable();
AudioCommon::ShutdownSoundStream();
}