Move flags and eflags variables into cpu_struct.
This commit is contained in:
parent
c1565eb42f
commit
a4d3aa1912
25 changed files with 1013 additions and 958 deletions
|
|
@ -7,8 +7,8 @@ static int opBT_w_r_a16(uint32_t fetchdat)
|
|||
cpu_state.eaaddr += ((cpu_state.regs[cpu_reg].w / 16) * 2); eal_r = 0;
|
||||
temp = geteaw(); if (cpu_state.abrt) return 1;
|
||||
flags_rebuild();
|
||||
if (temp & (1 << (cpu_state.regs[cpu_reg].w & 15))) flags |= C_FLAG;
|
||||
else flags &= ~C_FLAG;
|
||||
if (temp & (1 << (cpu_state.regs[cpu_reg].w & 15))) cpu_state.flags |= C_FLAG;
|
||||
else cpu_state.flags &= ~C_FLAG;
|
||||
|
||||
CLOCK_CYCLES(3);
|
||||
PREFETCH_RUN(3, 2, rmdat, 1,0,0,0, 0);
|
||||
|
|
@ -23,8 +23,8 @@ static int opBT_w_r_a32(uint32_t fetchdat)
|
|||
cpu_state.eaaddr += ((cpu_state.regs[cpu_reg].w / 16) * 2); eal_r = 0;
|
||||
temp = geteaw(); if (cpu_state.abrt) return 1;
|
||||
flags_rebuild();
|
||||
if (temp & (1 << (cpu_state.regs[cpu_reg].w & 15))) flags |= C_FLAG;
|
||||
else flags &= ~C_FLAG;
|
||||
if (temp & (1 << (cpu_state.regs[cpu_reg].w & 15))) cpu_state.flags |= C_FLAG;
|
||||
else cpu_state.flags &= ~C_FLAG;
|
||||
|
||||
CLOCK_CYCLES(3);
|
||||
PREFETCH_RUN(3, 2, rmdat, 1,0,0,0, 1);
|
||||
|
|
@ -39,8 +39,8 @@ static int opBT_l_r_a16(uint32_t fetchdat)
|
|||
cpu_state.eaaddr += ((cpu_state.regs[cpu_reg].l / 32) * 4); eal_r = 0;
|
||||
temp = geteal(); if (cpu_state.abrt) return 1;
|
||||
flags_rebuild();
|
||||
if (temp & (1 << (cpu_state.regs[cpu_reg].l & 31))) flags |= C_FLAG;
|
||||
else flags &= ~C_FLAG;
|
||||
if (temp & (1 << (cpu_state.regs[cpu_reg].l & 31))) cpu_state.flags |= C_FLAG;
|
||||
else cpu_state.flags &= ~C_FLAG;
|
||||
|
||||
CLOCK_CYCLES(3);
|
||||
PREFETCH_RUN(3, 2, rmdat, 0,1,0,0, 0);
|
||||
|
|
@ -55,8 +55,8 @@ static int opBT_l_r_a32(uint32_t fetchdat)
|
|||
cpu_state.eaaddr += ((cpu_state.regs[cpu_reg].l / 32) * 4); eal_r = 0;
|
||||
temp = geteal(); if (cpu_state.abrt) return 1;
|
||||
flags_rebuild();
|
||||
if (temp & (1 << (cpu_state.regs[cpu_reg].l & 31))) flags |= C_FLAG;
|
||||
else flags &= ~C_FLAG;
|
||||
if (temp & (1 << (cpu_state.regs[cpu_reg].l & 31))) cpu_state.flags |= C_FLAG;
|
||||
else cpu_state.flags &= ~C_FLAG;
|
||||
|
||||
CLOCK_CYCLES(3);
|
||||
PREFETCH_RUN(3, 2, rmdat, 0,1,0,0, 1);
|
||||
|
|
@ -78,8 +78,8 @@ static int opBT_l_r_a32(uint32_t fetchdat)
|
|||
temp operation (1 << (cpu_state.regs[cpu_reg].w & 15)); \
|
||||
seteaw(temp); if (cpu_state.abrt) return 1; \
|
||||
flags_rebuild(); \
|
||||
if (tempc) flags |= C_FLAG; \
|
||||
else flags &= ~C_FLAG; \
|
||||
if (tempc) cpu_state.flags |= C_FLAG; \
|
||||
else cpu_state.flags &= ~C_FLAG; \
|
||||
\
|
||||
CLOCK_CYCLES(6); \
|
||||
PREFETCH_RUN(6, 2, rmdat, 1,0,1,0, 0); \
|
||||
|
|
@ -99,8 +99,8 @@ static int opBT_l_r_a32(uint32_t fetchdat)
|
|||
temp operation (1 << (cpu_state.regs[cpu_reg].w & 15)); \
|
||||
seteaw(temp); if (cpu_state.abrt) return 1; \
|
||||
flags_rebuild(); \
|
||||
if (tempc) flags |= C_FLAG; \
|
||||
else flags &= ~C_FLAG; \
|
||||
if (tempc) cpu_state.flags |= C_FLAG; \
|
||||
else cpu_state.flags &= ~C_FLAG; \
|
||||
\
|
||||
CLOCK_CYCLES(6); \
|
||||
PREFETCH_RUN(6, 2, rmdat, 1,0,1,0, 1); \
|
||||
|
|
@ -120,8 +120,8 @@ static int opBT_l_r_a32(uint32_t fetchdat)
|
|||
temp operation (1 << (cpu_state.regs[cpu_reg].l & 31)); \
|
||||
seteal(temp); if (cpu_state.abrt) return 1; \
|
||||
flags_rebuild(); \
|
||||
if (tempc) flags |= C_FLAG; \
|
||||
else flags &= ~C_FLAG; \
|
||||
if (tempc) cpu_state.flags |= C_FLAG; \
|
||||
else cpu_state.flags &= ~C_FLAG; \
|
||||
\
|
||||
CLOCK_CYCLES(6); \
|
||||
PREFETCH_RUN(6, 2, rmdat, 0,1,0,1, 0); \
|
||||
|
|
@ -141,8 +141,8 @@ static int opBT_l_r_a32(uint32_t fetchdat)
|
|||
temp operation (1 << (cpu_state.regs[cpu_reg].l & 31)); \
|
||||
seteal(temp); if (cpu_state.abrt) return 1; \
|
||||
flags_rebuild(); \
|
||||
if (tempc) flags |= C_FLAG; \
|
||||
else flags &= ~C_FLAG; \
|
||||
if (tempc) cpu_state.flags |= C_FLAG; \
|
||||
else cpu_state.flags &= ~C_FLAG; \
|
||||
\
|
||||
CLOCK_CYCLES(6); \
|
||||
PREFETCH_RUN(6, 2, rmdat, 0,1,0,1, 1); \
|
||||
|
|
@ -169,8 +169,8 @@ static int opBA_w_a16(uint32_t fetchdat)
|
|||
switch (rmdat & 0x38)
|
||||
{
|
||||
case 0x20: /*BT w,imm*/
|
||||
if (tempc) flags |= C_FLAG;
|
||||
else flags &= ~C_FLAG;
|
||||
if (tempc) cpu_state.flags |= C_FLAG;
|
||||
else cpu_state.flags &= ~C_FLAG;
|
||||
CLOCK_CYCLES(3);
|
||||
PREFETCH_RUN(3, 3, rmdat, (cpu_mod == 3) ? 0:1,0,0,0, 0);
|
||||
return 0;
|
||||
|
|
@ -191,8 +191,8 @@ static int opBA_w_a16(uint32_t fetchdat)
|
|||
break;
|
||||
}
|
||||
seteaw(temp); if (cpu_state.abrt) return 1;
|
||||
if (tempc) flags |= C_FLAG;
|
||||
else flags &= ~C_FLAG;
|
||||
if (tempc) cpu_state.flags |= C_FLAG;
|
||||
else cpu_state.flags &= ~C_FLAG;
|
||||
CLOCK_CYCLES(6);
|
||||
PREFETCH_RUN(6, 3, rmdat, (cpu_mod == 3) ? 0:1,0,(cpu_mod == 3) ? 0:1,0, 0);
|
||||
return 0;
|
||||
|
|
@ -213,8 +213,8 @@ static int opBA_w_a32(uint32_t fetchdat)
|
|||
switch (rmdat & 0x38)
|
||||
{
|
||||
case 0x20: /*BT w,imm*/
|
||||
if (tempc) flags |= C_FLAG;
|
||||
else flags &= ~C_FLAG;
|
||||
if (tempc) cpu_state.flags |= C_FLAG;
|
||||
else cpu_state.flags &= ~C_FLAG;
|
||||
CLOCK_CYCLES(3);
|
||||
PREFETCH_RUN(3, 3, rmdat, (cpu_mod == 3) ? 0:1,0,0,0, 1);
|
||||
return 0;
|
||||
|
|
@ -235,8 +235,8 @@ static int opBA_w_a32(uint32_t fetchdat)
|
|||
break;
|
||||
}
|
||||
seteaw(temp); if (cpu_state.abrt) return 1;
|
||||
if (tempc) flags |= C_FLAG;
|
||||
else flags &= ~C_FLAG;
|
||||
if (tempc) cpu_state.flags |= C_FLAG;
|
||||
else cpu_state.flags &= ~C_FLAG;
|
||||
CLOCK_CYCLES(6);
|
||||
PREFETCH_RUN(6, 3, rmdat, (cpu_mod == 3) ? 0:1,0,(cpu_mod == 3) ? 0:1,0, 0);
|
||||
return 0;
|
||||
|
|
@ -258,8 +258,8 @@ static int opBA_l_a16(uint32_t fetchdat)
|
|||
switch (rmdat & 0x38)
|
||||
{
|
||||
case 0x20: /*BT w,imm*/
|
||||
if (tempc) flags |= C_FLAG;
|
||||
else flags &= ~C_FLAG;
|
||||
if (tempc) cpu_state.flags |= C_FLAG;
|
||||
else cpu_state.flags &= ~C_FLAG;
|
||||
CLOCK_CYCLES(3);
|
||||
PREFETCH_RUN(3, 3, rmdat, 0,(cpu_mod == 3) ? 0:1,0,0, 0);
|
||||
return 0;
|
||||
|
|
@ -280,8 +280,8 @@ static int opBA_l_a16(uint32_t fetchdat)
|
|||
break;
|
||||
}
|
||||
seteal(temp); if (cpu_state.abrt) return 1;
|
||||
if (tempc) flags |= C_FLAG;
|
||||
else flags &= ~C_FLAG;
|
||||
if (tempc) cpu_state.flags |= C_FLAG;
|
||||
else cpu_state.flags &= ~C_FLAG;
|
||||
CLOCK_CYCLES(6);
|
||||
PREFETCH_RUN(6, 3, rmdat, 0,(cpu_mod == 3) ? 0:1,0,(cpu_mod == 3) ? 0:1, 0);
|
||||
return 0;
|
||||
|
|
@ -302,8 +302,8 @@ static int opBA_l_a32(uint32_t fetchdat)
|
|||
switch (rmdat & 0x38)
|
||||
{
|
||||
case 0x20: /*BT w,imm*/
|
||||
if (tempc) flags |= C_FLAG;
|
||||
else flags &= ~C_FLAG;
|
||||
if (tempc) cpu_state.flags |= C_FLAG;
|
||||
else cpu_state.flags &= ~C_FLAG;
|
||||
CLOCK_CYCLES(3);
|
||||
PREFETCH_RUN(3, 3, rmdat, 0,(cpu_mod == 3) ? 0:1,0,0, 1);
|
||||
return 0;
|
||||
|
|
@ -324,8 +324,8 @@ static int opBA_l_a32(uint32_t fetchdat)
|
|||
break;
|
||||
}
|
||||
seteal(temp); if (cpu_state.abrt) return 1;
|
||||
if (tempc) flags |= C_FLAG;
|
||||
else flags &= ~C_FLAG;
|
||||
if (tempc) cpu_state.flags |= C_FLAG;
|
||||
else cpu_state.flags &= ~C_FLAG;
|
||||
CLOCK_CYCLES(6);
|
||||
PREFETCH_RUN(6, 3, rmdat, 0,(cpu_mod == 3) ? 0:1,0,(cpu_mod == 3) ? 0:1, 1);
|
||||
return 0;
|
||||
|
|
|
|||
Loading…
Reference in a new issue