mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-23 06:09:50 -06:00
DSP: Document in a comment what CLR15/SET15 appears to do. (unsigned multiplication)
minor fix in op table. git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@3133 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
@ -1452,14 +1452,13 @@ void srbith(const UDSPInstruction& opc)
|
||||
g_dsp.r[DSP_REG_SR] |= SR_MUL_MODIFY;
|
||||
break;
|
||||
|
||||
// 15-bit precision? clamping? no idea :(
|
||||
// CLR15 seems to be the default.
|
||||
// It seems to come around mul operation,
|
||||
// If set, treat multiplicands as unsigned 16-bit ints.
|
||||
// If clear, treat them as signed.
|
||||
case 0xc: // CLR15
|
||||
g_dsp.r[DSP_REG_SR] &= ~SR_TOP_BIT_UNK;
|
||||
g_dsp.r[DSP_REG_SR] &= ~SR_MUL_UNSIGNED;
|
||||
break;
|
||||
case 0xd: // SET15
|
||||
g_dsp.r[DSP_REG_SR] |= SR_TOP_BIT_UNK;
|
||||
g_dsp.r[DSP_REG_SR] |= SR_MUL_UNSIGNED;
|
||||
break;
|
||||
|
||||
// Automatic 40-bit sign extension when loading ACx.M.
|
||||
|
@ -154,10 +154,10 @@ const DSPOPCTemplate opcodes[] =
|
||||
{"SBSET", 0x1300, 0xfff8, DSPInterpreter::sbset, nop, 1, 1, {{P_IMM, 1, 0, 0, 0x0007}}, NULL, NULL},
|
||||
|
||||
// actually, given the masks these should probably be 0x3f. need investigation.
|
||||
{"LSL", 0x1400, 0xfec0, DSPInterpreter::lsl, nop, 1, 2, {{P_ACCM, 1, 0, 8, 0x0100}, {P_IMM, 1, 0, 0, 0x003f}}, NULL, NULL},
|
||||
{"LSR", 0x1440, 0xfec0, DSPInterpreter::lsr, nop, 1, 2, {{P_ACCM, 1, 0, 8, 0x0100}, {P_IMM, 1, 0, 0, 0x003f}}, NULL, NULL},
|
||||
{"ASL", 0x1480, 0xfec0, DSPInterpreter::asl, nop, 1, 2, {{P_ACCM, 1, 0, 8, 0x0100}, {P_IMM, 1, 0, 0, 0x003f}}, NULL, NULL},
|
||||
{"ASR", 0x14c0, 0xfec0, DSPInterpreter::asr, nop, 1, 2, {{P_ACCM, 1, 0, 8, 0x0100}, {P_IMM, 1, 0, 0, 0x003f}}, NULL, NULL},
|
||||
{"LSL", 0x1400, 0xfec0, DSPInterpreter::lsl, nop, 1, 2, {{P_ACC, 1, 0, 8, 0x0100}, {P_IMM, 1, 0, 0, 0x003f}}, NULL, NULL},
|
||||
{"LSR", 0x1440, 0xfec0, DSPInterpreter::lsr, nop, 1, 2, {{P_ACC, 1, 0, 8, 0x0100}, {P_IMM, 1, 0, 0, 0x003f}}, NULL, NULL},
|
||||
{"ASL", 0x1480, 0xfec0, DSPInterpreter::asl, nop, 1, 2, {{P_ACC, 1, 0, 8, 0x0100}, {P_IMM, 1, 0, 0, 0x003f}}, NULL, NULL},
|
||||
{"ASR", 0x14c0, 0xfec0, DSPInterpreter::asr, nop, 1, 2, {{P_ACC, 1, 0, 8, 0x0100}, {P_IMM, 1, 0, 0, 0x003f}}, NULL, NULL},
|
||||
|
||||
{"LRI", 0x0080, 0xffe0, DSPInterpreter::lri, nop, 2, 2, {{P_REG, 1, 0, 0, 0x001f}, {P_IMM, 2, 1, 0, 0xffff}}, NULL, NULL},
|
||||
{"LR", 0x00c0, 0xffe0, DSPInterpreter::lr, nop, 2, 2, {{P_REG, 1, 0, 0, 0x001f}, {P_MEM, 2, 1, 0, 0xffff}}, NULL, NULL},
|
||||
|
@ -98,18 +98,18 @@
|
||||
#define CR_EXTERNAL_INT 0x0002
|
||||
|
||||
// SR bits
|
||||
#define SR_CARRY 0x0001
|
||||
#define SR_2 0x0002 // overflow???
|
||||
#define SR_ARITH_ZERO 0x0004
|
||||
#define SR_SIGN 0x0008
|
||||
#define SR_10 0x0010 // seem to be set by tst
|
||||
#define SR_TOP2BITS 0x0020 // this is an odd one. (set by tst)
|
||||
#define SR_LOGIC_ZERO 0x0040
|
||||
#define SR_INT_ENABLE 0x0200 // Not 100% sure but duddie says so. This should replace the hack, if so.
|
||||
#define SR_800 0x0800 // Appears in zelda
|
||||
#define SR_MUL_MODIFY 0x2000 // 1 = normal. 0 = x2 (M0, M2)
|
||||
#define SR_40_MODE_BIT 0x4000 // 0 = "16", 1 = "40" (SET16, SET40) Controls sign extension when loading mid accums.
|
||||
#define SR_TOP_BIT_UNK 0x8000 // 1 = normal. 0 = x2 (CLR15, SET15) ????????
|
||||
#define SR_CARRY 0x0001
|
||||
#define SR_2 0x0002 // overflow???
|
||||
#define SR_ARITH_ZERO 0x0004
|
||||
#define SR_SIGN 0x0008
|
||||
#define SR_10 0x0010 // seem to be set by tst
|
||||
#define SR_TOP2BITS 0x0020 // this is an odd one. (set by tst)
|
||||
#define SR_LOGIC_ZERO 0x0040
|
||||
#define SR_INT_ENABLE 0x0200 // Not 100% sure but duddie says so. This should replace the hack, if so.
|
||||
#define SR_800 0x0800 // Appears in zelda - what is it? where in the zelda ucode?
|
||||
#define SR_MUL_MODIFY 0x2000 // 1 = normal. 0 = x2 (M0, M2)
|
||||
#define SR_40_MODE_BIT 0x4000 // 0 = "16", 1 = "40" (SET16, SET40) Controls sign extension when loading mid accums.
|
||||
#define SR_MUL_UNSIGNED 0x8000 // 0 = normal. 1 = unsigned (CLR15, SET15) If set, treats operands as unsigned. Tested with mulx only so far.
|
||||
|
||||
void dsp_reg_store_stack(u8 stack_reg, u16 val);
|
||||
u16 dsp_reg_load_stack(u8 stack_reg);
|
||||
|
Reference in New Issue
Block a user