mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-03-12 14:46:49 +01:00
DSP: Fix opcode masking for ops with extensions.
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@2886 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
parent
5508e5e718
commit
8b6b8b61c3
@ -410,6 +410,8 @@ void cmp(const UDSPInstruction& opc)
|
|||||||
Update_SR_Register64(acc0 - acc1);
|
Update_SR_Register64(acc0 - acc1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// WARNING - this instruction is being called by other instructions!!!!!
|
||||||
|
// Is that sane?
|
||||||
void tsta(const UDSPInstruction& opc)
|
void tsta(const UDSPInstruction& opc)
|
||||||
{
|
{
|
||||||
u8 reg = (opc.hex >> 11) & 0x1;
|
u8 reg = (opc.hex >> 11) & 0x1;
|
||||||
|
@ -223,7 +223,8 @@ DSPOPCTemplate opcodes[] =
|
|||||||
|
|
||||||
{"CMP", 0x8200, 0xffff, DSPInterpreter::cmp, nop, 1 | P_EXT, 0, {}, dsp_op_ext_ops_pro, dsp_op_ext_ops_epi},
|
{"CMP", 0x8200, 0xffff, DSPInterpreter::cmp, nop, 1 | P_EXT, 0, {}, dsp_op_ext_ops_pro, dsp_op_ext_ops_epi},
|
||||||
|
|
||||||
// {"CMPAR" , 0xc100, 0xe7ff, DSPInterpreter::cmpar, nop, 1 | P_EXT, 2, {{P_ACCM, 1, 0, 12, 0x1000}, {P_REG1A, 1, 0, 11, 0x0800}}, dsp_op_ext_ops_pro, dsp_op_ext_ops_epi},
|
// This op does NOT exist, at least not under this name, in duddie's docs!
|
||||||
|
{"CMPAR" , 0xc100, 0xe7ff, DSPInterpreter::cmpar, nop, 1 | P_EXT, 2, {{P_ACCM, 1, 0, 12, 0x1000}, {P_REG1A, 1, 0, 11, 0x0800}}, dsp_op_ext_ops_pro, dsp_op_ext_ops_epi},
|
||||||
|
|
||||||
{"CLRAL0", 0xfc00, 0xffff, nop, nop, 1 | P_EXT, 0, {}, dsp_op_ext_ops_pro, dsp_op_ext_ops_epi}, // clear acl0
|
{"CLRAL0", 0xfc00, 0xffff, nop, nop, 1 | P_EXT, 0, {}, dsp_op_ext_ops_pro, dsp_op_ext_ops_epi}, // clear acl0
|
||||||
{"CLRAL1", 0xfd00, 0xffff, nop, nop, 1 | P_EXT, 0, {}, dsp_op_ext_ops_pro, dsp_op_ext_ops_epi}, // clear acl1
|
{"CLRAL1", 0xfd00, 0xffff, nop, nop, 1 | P_EXT, 0, {}, dsp_op_ext_ops_pro, dsp_op_ext_ops_epi}, // clear acl1
|
||||||
@ -322,24 +323,38 @@ dspInstFunc epilogueTable[OPTABLE_SIZE];
|
|||||||
|
|
||||||
void InitInstructionTable()
|
void InitInstructionTable()
|
||||||
{
|
{
|
||||||
for (u32 i = 0; i < OPTABLE_SIZE; i++) {
|
for (u32 i = 0; i < OPTABLE_SIZE; i++)
|
||||||
|
{
|
||||||
opTable[i] = DSPInterpreter::unknown;
|
opTable[i] = DSPInterpreter::unknown;
|
||||||
prologueTable[i] = NULL;
|
prologueTable[i] = NULL;
|
||||||
epilogueTable[i] = NULL;
|
epilogueTable[i] = NULL;
|
||||||
|
opSize[i] = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (u32 i = 0; i < OPTABLE_SIZE; i++) {
|
for (u32 i = 0; i < OPTABLE_SIZE; i++)
|
||||||
for (u32 j = 0; j < opcodes_size; j++)
|
{
|
||||||
if ((opcodes[j].opcode_mask & i) == opcodes[j].opcode) {
|
for (u32 j = 0; j < opcodes_size; j++)
|
||||||
if (opTable[i] == DSPInterpreter::unknown) {
|
{
|
||||||
|
u16 mask = opcodes[j].opcode_mask;
|
||||||
|
if (opcodes[j].size & P_EXT) {
|
||||||
|
// Ignore extension bits.
|
||||||
|
mask &= 0xFF00;
|
||||||
|
}
|
||||||
|
if ((mask & i) == opcodes[j].opcode)
|
||||||
|
{
|
||||||
|
if (opTable[i] == DSPInterpreter::unknown)
|
||||||
|
{
|
||||||
opTable[i] = opcodes[j].interpFunc;
|
opTable[i] = opcodes[j].interpFunc;
|
||||||
opSize[i] = opcodes[j].size;
|
opSize[i] = opcodes[j].size & 3;
|
||||||
prologueTable[i] = opcodes[j].prologue;
|
prologueTable[i] = opcodes[j].prologue;
|
||||||
epilogueTable[i] = opcodes[j].epilogue;
|
epilogueTable[i] = opcodes[j].epilogue;
|
||||||
} else {
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
ERROR_LOG(DSPHLE, "opcode table place %d already in use for %s", i, opcodes[j].name);
|
ERROR_LOG(DSPHLE, "opcode table place %d already in use for %s", i, opcodes[j].name);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user