DSPLLE: make ext opcodes to use table as well (tell me if you get

unknown opcodes or the like). LD changes are reverted until we get the 
right code.


git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@3880 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
nakeee
2009-07-24 16:04:29 +00:00
parent 873190d148
commit 3b0e949c93
5 changed files with 452 additions and 496 deletions
File diff suppressed because it is too large Load Diff
+9 -7
View File
@@ -34,9 +34,6 @@
// is handled as a prologue, the ones that must be executed afterwards
// is handled as an epilogue.
void dsp_op_ext_ops_pro(const UDSPInstruction& opc); // run any prologs
void dsp_op_ext_ops_epi(const UDSPInstruction& opc); // run any epilogs
namespace DSPInterpreter
{
namespace Ext
@@ -51,12 +48,16 @@ void sl(const UDSPInstruction& opc);
void sln(const UDSPInstruction& opc);
void slm(const UDSPInstruction& opc);
void slnm(const UDSPInstruction& opc);
void ls_epi(const UDSPInstruction& opc);
void lsn_epi(const UDSPInstruction& opc);
void lsm_epi(const UDSPInstruction& opc);
void lsnm_epi(const UDSPInstruction& opc);
void sl_epi(const UDSPInstruction& opc);
void sln_epi(const UDSPInstruction& opc);
void slm_epi(const UDSPInstruction& opc);
void slnm_epi(const UDSPInstruction& opc);
void s(const UDSPInstruction& opc);
void sn(const UDSPInstruction& opc);
void ldx(const UDSPInstruction& opc);
void ldxn(const UDSPInstruction& opc);
void ldxm(const UDSPInstruction& opc);
void ldxnm(const UDSPInstruction& opc);
void ld(const UDSPInstruction& opc);
void ldn(const UDSPInstruction& opc);
void ldm(const UDSPInstruction& opc);
@@ -65,6 +66,7 @@ void mv(const UDSPInstruction& opc);
void dr(const UDSPInstruction& opc);
void ir(const UDSPInstruction& opc);
void nr(const UDSPInstruction& opc);
void nop(const UDSPInstruction& opc);
} // end namespace Ext
} // end namespace DSPinterpeter
File diff suppressed because it is too large Load Diff
+10 -10
View File
@@ -67,6 +67,7 @@ enum partype_t
#define P_EXT 0x80
#define OPTABLE_SIZE 65536
#define EXT_OPTABLE_SIZE 0xff
union UDSPInstruction
{
@@ -114,8 +115,7 @@ typedef struct
u8 size;
u8 param_count;
param2_t params[8];
dspInstFunc prologue;
dspInstFunc epilogue;
bool extended;
} DSPOPCTemplate;
typedef DSPOPCTemplate opc_t;
@@ -129,8 +129,10 @@ extern u8 opSize[OPTABLE_SIZE];
extern const DSPOPCTemplate cw;
extern dspInstFunc opTable[];
extern dspInstFunc prologueTable[OPTABLE_SIZE];
extern dspInstFunc epilogueTable[OPTABLE_SIZE];
extern bool opTableUseExt[OPTABLE_SIZE];
extern dspInstFunc extOpTable[EXT_OPTABLE_SIZE];
extern dspInstFunc currentEpilogeFunc;
// Predefined labels
struct pdlabel_t
@@ -152,13 +154,11 @@ void InitInstructionTable();
inline void ExecuteInstruction(const UDSPInstruction& inst)
{
// TODO: Move the prologuetable calls into the relevant instructions themselves.
// Better not do things like this until things work correctly though.
if (prologueTable[inst.hex])
prologueTable[inst.hex](inst);
if (opTableUseExt[inst.hex])
extOpTable[inst.hex & 0xFF](inst);
opTable[inst.hex](inst);
if (epilogueTable[inst.hex])
epilogueTable[inst.hex](inst);
if (currentEpilogeFunc)
currentEpilogeFunc(inst);
}
// This one's pretty slow, try to use it only at init or seldomly.
+1 -1
View File
@@ -229,7 +229,7 @@ bool DSPDisassembler::DisOpcode(const u16 *binbuf, int base_addr, int pass, u16
break;
}
}
const DSPOPCTemplate fake_op = {"CW", 0x0000, 0x0000, nop, nop, 1, 1, {{P_VAL, 2, 0, 0, 0xffff}}, NULL, NULL,};
const DSPOPCTemplate fake_op = {"CW", 0x0000, 0x0000, nop, nop, 1, 1, {{P_VAL, 2, 0, 0, 0xffff}}, false};
if (!opc)
opc = &fake_op;