implemented mulcmv mulcmvz and fixed mulcac to actually add to the acc

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@2880 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
nakeee 2009-04-05 16:50:15 +00:00
parent 51aa5d75fa
commit 4832ffa377
2 changed files with 27 additions and 9 deletions

View File

@ -360,16 +360,33 @@ void mulc(const UDSPInstruction& opc)
Update_SR_Register64(prod);
}
// TODO: Implement
void mulcmvz(const UDSPInstruction& opc)
{
ERROR_LOG(DSPHLE, "dsp_opc.hex_mulcmvz ni");
s64 TempProd = dsp_get_long_prod();
// update prod
u8 sreg = (opc.hex >> 12) & 0x1;
s64 Prod = (s64)dsp_get_acc_m(sreg) * (s64)dsp_get_acc_h(sreg) * GetMultiplyModifier();
dsp_set_long_prod(Prod);
// update acc
u8 rreg = (opc.hex >> 8) & 0x1;
s64 acc = TempProd & ~0xffff; // clear lower 4 bytes
dsp_set_long_acc(rreg, acc);
}
// TODO: Implement
void mulcmv(const UDSPInstruction& opc)
{
ERROR_LOG(DSPHLE, "dsp_opc.hex_mulcmv ni");
s64 TempProd = dsp_get_long_prod();
// update prod
u8 sreg = (opc.hex >> 12) & 0x1;
s64 Prod = (s64)dsp_get_acc_m(sreg) * (s64)dsp_get_acc_h(sreg) * GetMultiplyModifier();
dsp_set_long_prod(Prod);
// update acc
u8 rreg = (opc.hex >> 8) & 0x1;
dsp_set_long_acc(rreg, TempProd);
}
void cmpar(const UDSPInstruction& opc)
@ -436,7 +453,7 @@ void mulcac(const UDSPInstruction& opc)
// update acc
u8 rreg = (opc.hex >> 8) & 0x1;
dsp_set_long_acc(rreg, TempProd);
dsp_set_long_acc(rreg, TempProd + g_dsp.r[rreg]);
}
void movr(const UDSPInstruction& opc)

View File

@ -89,7 +89,6 @@ void dar(const UDSPInstruction& opc);
void iar(const UDSPInstruction& opc);
void sbclr(const UDSPInstruction& opc);
void sbset(const UDSPInstruction& opc);
void mov(const UDSPInstruction& opc);
void movp(const UDSPInstruction& opc);
void mul(const UDSPInstruction& opc);
void mulac(const UDSPInstruction& opc);
@ -99,6 +98,9 @@ void mulx(const UDSPInstruction& opc);
void mulxac(const UDSPInstruction& opc);
void mulxmv(const UDSPInstruction& opc);
void mulxmvz(const UDSPInstruction& opc);
void mulcmvz(const UDSPInstruction& opc);
void mulcmv(const UDSPInstruction& opc);
void movnp(const UDSPInstruction& opc);
void sub(const UDSPInstruction& opc);
void maddx(const UDSPInstruction& opc);
void msubx(const UDSPInstruction& opc);
@ -122,9 +124,8 @@ void ori(const UDSPInstruction& opc);
// END OF FIXMEs
// TODO: PENDING IMPLEMENTATION / UNIMPLEMENTED
void mulcmvz(const UDSPInstruction& opc);
void mulcmv(const UDSPInstruction& opc);
void movnp(const UDSPInstruction& opc);
void mov(const UDSPInstruction& opc);
// END OF UNIMPLEMENTED
};