upd7725: dpl bits of the instruction field are ignored if dp is the destination register of the current opcode. similarly, rpdcr bit is ignored if rp is the destination register of the current opcode. [Jonas Quinn]

This commit is contained in:
Lord-Nightmare 2017-09-03 14:21:57 -04:00
parent 5f9329a081
commit 1b75c5e87f

View File

@ -508,15 +508,17 @@ void necdsp_device::exec_op(uint32_t opcode) {
exec_ld((regs.idb << 6) + dst);
switch(dpl) {
case 1: regs.dp = (regs.dp & 0xf0) + ((regs.dp + 1) & 0x0f); break; //DPINC
case 2: regs.dp = (regs.dp & 0xf0) + ((regs.dp - 1) & 0x0f); break; //DPDEC
case 3: regs.dp = (regs.dp & 0xf0); break; //DPCLR
if (dst != 4) {
switch(dpl) {
case 1: regs.dp = (regs.dp & 0xf0) + ((regs.dp + 1) & 0x0f); break; //DPINC
case 2: regs.dp = (regs.dp & 0xf0) + ((regs.dp - 1) & 0x0f); break; //DPDEC
case 3: regs.dp = (regs.dp & 0xf0); break; //DPCLR
}
regs.dp ^= dphm << 4;
}
regs.dp ^= dphm << 4;
if(rpdcr) regs.rp--;
if(rpdcr && (dst != 5)) regs.rp--;
}
void necdsp_device::exec_rt(uint32_t opcode) {