summaryrefslogtreecommitdiffstatshomepage
path: root/src
diff options
context:
space:
mode:
author Miodrag Milanovic <mmicko@gmail.com>2012-08-21 10:09:35 +0000
committer Miodrag Milanovic <mmicko@gmail.com>2012-08-21 10:09:35 +0000
commit67c425e90757876a6716b7867df30c0149912e74 (patch)
tree7d4d549c19fdf2543ca586914959f39a54914e10 /src
parent5e694d69c2854b21f71324efccd42630e9657abf (diff)
Sync with MESS (nw)
Diffstat (limited to 'src')
-rw-r--r--src/emu/cpu/v810/v810.c79
1 files changed, 76 insertions, 3 deletions
diff --git a/src/emu/cpu/v810/v810.c b/src/emu/cpu/v810/v810.c
index 9d56d2d6eb4..2d1fbf6ea2c 100644
--- a/src/emu/cpu/v810/v810.c
+++ b/src/emu/cpu/v810/v810.c
@@ -285,9 +285,75 @@ static UINT32 opCMPi(v810_state *cpustate,UINT32 op) // cmpi imm5,r2
static UINT32 opSETFi(v810_state *cpustate,UINT32 op) // setf imm5,r2
{
UINT32 op1=I5(op);
- UINT32 op2=cpustate->PSW&0xf;
+ UINT8 res=0;
op1&=0xf;
- SETREG(cpustate,GET2,(op1==op2)?1:0);
+ switch(op1)
+ {
+ case 0: //bv
+ res=GET_OV;
+ break;
+
+ case 1: //bl
+ res=GET_CY;
+ break;
+
+ case 2: //be
+ res=GET_Z;
+ break;
+
+ case 3: //bnh
+ res=GET_Z||GET_CY;
+ break;
+
+ case 4: //bn
+ res=GET_S;
+ break;
+
+ case 5: //br
+ res=1;
+ break;
+
+ case 6: //blt
+ res=GET_S^GET_OV;
+ break;
+
+ case 7: //ble
+ res=GET_Z||(GET_S^GET_OV);
+ break;
+
+ case 8: //bnv
+ res=!GET_OV;
+ break;
+
+ case 9: //bnl
+ res=!GET_CY;
+ break;
+
+ case 10: //bne
+ res=!GET_Z;
+ break;
+
+ case 11: //bh
+ res=!(GET_Z||GET_CY);
+ break;
+
+ case 12: //bp
+ res=!GET_S;
+ break;
+
+ case 13: //nop
+
+ break;
+
+ case 14: //bge
+ res=!(GET_OV^GET_S);
+ break;
+
+ case 15: //bgt
+ res=!(GET_Z||(GET_OV^GET_S));
+ break;
+ }
+ SETREG(cpustate,GET2,res);
return clkIF;
}
@@ -563,7 +629,7 @@ static UINT32 opRETI(v810_state *cpustate,UINT32 op)
static UINT32 opHALT(v810_state *cpustate,UINT32 op)
{
- logerror("V810: HALT @ %X",cpustate->PC-2);
+ printf("V810: HALT @ %X",cpustate->PC-2);
return clkIF;
}
@@ -691,6 +757,7 @@ static UINT32 opINB(v810_state *cpustate,UINT32 op) // in.b disp16[reg1],reg2
static UINT32 opCAXI(v810_state *cpustate,UINT32 op) // caxi disp16[reg1],reg2
{
+ printf("V810 CAXI execute\n");
cpustate->PC+=2;
return clkIF;
}
@@ -822,6 +889,8 @@ static UINT32 opDIVr(v810_state *cpustate,UINT32 op) // div r1,r2
SET_OV((op1^op2^GETREG(cpustate,GET2)) == 0x80000000);
CHECK_ZS(GETREG(cpustate,GET2));
}
+ else
+ printf("DIVr divide by zero?\n");
return clkIF;
}
@@ -836,6 +905,8 @@ static UINT32 opDIVUr(v810_state *cpustate,UINT32 op) // divu r1,r2
SET_OV((op1^op2^GETREG(cpustate,GET2)) == 0x80000000);
CHECK_ZS(GETREG(cpustate,GET2));
}
+ else
+ printf("DIVUr divide by zero?\n");
return clkIF;
}
@@ -883,6 +954,8 @@ static void opDIVF(v810_state *cpustate,UINT32 op)
SET_OV(0);
if(val1!=0)
val2/=val1;
+ else
+ printf("DIVF divide by zero?\n");
SET_Z((val2==0.0)?1:0);
SET_S((val2<0.0)?1:0);
SETREG(cpustate,GET2,f2u(val2));