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
|
|
@ -13,9 +13,9 @@
|
|||
c--; \
|
||||
} \
|
||||
seteab(temp); if (cpu_state.abrt) return 1; \
|
||||
flags &= ~(C_FLAG | V_FLAG); \
|
||||
if (temp2) flags |= C_FLAG; \
|
||||
if ((flags & C_FLAG) ^ (temp >> 7)) flags |= V_FLAG; \
|
||||
cpu_state.flags &= ~(C_FLAG | V_FLAG); \
|
||||
if (temp2) cpu_state.flags |= C_FLAG; \
|
||||
if ((cpu_state.flags & C_FLAG) ^ (temp >> 7)) cpu_state.flags |= V_FLAG; \
|
||||
CLOCK_CYCLES((cpu_mod == 3) ? 3 : 7); \
|
||||
PREFETCH_RUN((cpu_mod == 3) ? 3 : 7, 2, rmdat, (cpu_mod == 3) ? 0:1,0,(cpu_mod == 3) ? 0:1,0, ea32); \
|
||||
break; \
|
||||
|
|
@ -28,14 +28,14 @@
|
|||
c--; \
|
||||
} \
|
||||
seteab(temp); if (cpu_state.abrt) return 1; \
|
||||
flags &= ~(C_FLAG | V_FLAG); \
|
||||
if (temp2) flags |= C_FLAG; \
|
||||
if ((temp ^ (temp >> 1)) & 0x40) flags |= V_FLAG; \
|
||||
cpu_state.flags &= ~(C_FLAG | V_FLAG); \
|
||||
if (temp2) cpu_state.flags |= C_FLAG; \
|
||||
if ((temp ^ (temp >> 1)) & 0x40) cpu_state.flags |= V_FLAG; \
|
||||
CLOCK_CYCLES((cpu_mod == 3) ? 3 : 7); \
|
||||
PREFETCH_RUN((cpu_mod == 3) ? 3 : 7, 2, rmdat, (cpu_mod == 3) ? 0:1,0,(cpu_mod == 3) ? 0:1,0, ea32); \
|
||||
break; \
|
||||
case 0x10: /*RCL b,CL*/ \
|
||||
temp2 = flags & C_FLAG; \
|
||||
temp2 = cpu_state.flags & C_FLAG; \
|
||||
if (is486) CLOCK_CYCLES_ALWAYS(c); \
|
||||
while (c > 0) \
|
||||
{ \
|
||||
|
|
@ -45,14 +45,14 @@
|
|||
c--; \
|
||||
} \
|
||||
seteab(temp); if (cpu_state.abrt) return 1; \
|
||||
flags &= ~(C_FLAG | V_FLAG); \
|
||||
if (temp2) flags |= C_FLAG; \
|
||||
if ((flags & C_FLAG) ^ (temp >> 7)) flags |= V_FLAG; \
|
||||
cpu_state.flags &= ~(C_FLAG | V_FLAG); \
|
||||
if (temp2) cpu_state.flags |= C_FLAG; \
|
||||
if ((cpu_state.flags & C_FLAG) ^ (temp >> 7)) cpu_state.flags |= V_FLAG; \
|
||||
CLOCK_CYCLES((cpu_mod == 3) ? 9 : 10); \
|
||||
PREFETCH_RUN((cpu_mod == 3) ? 9 : 10, 2, rmdat, (cpu_mod == 3) ? 0:1,0,(cpu_mod == 3) ? 0:1,0, ea32); \
|
||||
break; \
|
||||
case 0x18: /*RCR b,CL*/ \
|
||||
temp2 = flags & C_FLAG; \
|
||||
temp2 = cpu_state.flags & C_FLAG; \
|
||||
if (is486) CLOCK_CYCLES_ALWAYS(c); \
|
||||
while (c > 0) \
|
||||
{ \
|
||||
|
|
@ -62,9 +62,9 @@
|
|||
c--; \
|
||||
} \
|
||||
seteab(temp); if (cpu_state.abrt) return 1; \
|
||||
flags &= ~(C_FLAG | V_FLAG); \
|
||||
if (temp2) flags |= C_FLAG; \
|
||||
if ((temp ^ (temp >> 1)) & 0x40) flags |= V_FLAG; \
|
||||
cpu_state.flags &= ~(C_FLAG | V_FLAG); \
|
||||
if (temp2) cpu_state.flags |= C_FLAG; \
|
||||
if ((temp ^ (temp >> 1)) & 0x40) cpu_state.flags |= V_FLAG; \
|
||||
CLOCK_CYCLES((cpu_mod == 3) ? 9 : 10); \
|
||||
PREFETCH_RUN((cpu_mod == 3) ? 9 : 10, 2, rmdat, (cpu_mod == 3) ? 0:1,0,(cpu_mod == 3) ? 0:1,0, ea32); \
|
||||
break; \
|
||||
|
|
@ -105,9 +105,9 @@
|
|||
c--; \
|
||||
} \
|
||||
seteaw(temp); if (cpu_state.abrt) return 1; \
|
||||
flags &= ~(C_FLAG | V_FLAG); \
|
||||
if (temp2) flags |= C_FLAG; \
|
||||
if ((flags & C_FLAG) ^ (temp >> 15)) flags |= V_FLAG; \
|
||||
cpu_state.flags &= ~(C_FLAG | V_FLAG); \
|
||||
if (temp2) cpu_state.flags |= C_FLAG; \
|
||||
if ((cpu_state.flags & C_FLAG) ^ (temp >> 15)) cpu_state.flags |= V_FLAG; \
|
||||
CLOCK_CYCLES((cpu_mod == 3) ? 3 : 7); \
|
||||
PREFETCH_RUN((cpu_mod == 3) ? 3 : 7, 2, rmdat, (cpu_mod == 3) ? 0:1,0,(cpu_mod == 3) ? 0:1,0, ea32); \
|
||||
break; \
|
||||
|
|
@ -120,14 +120,14 @@
|
|||
c--; \
|
||||
} \
|
||||
seteaw(temp); if (cpu_state.abrt) return 1; \
|
||||
flags &= ~(C_FLAG | V_FLAG); \
|
||||
if (temp2) flags |= C_FLAG; \
|
||||
if ((temp ^ (temp >> 1)) & 0x4000) flags |= V_FLAG; \
|
||||
cpu_state.flags &= ~(C_FLAG | V_FLAG); \
|
||||
if (temp2) cpu_state.flags |= C_FLAG; \
|
||||
if ((temp ^ (temp >> 1)) & 0x4000) cpu_state.flags |= V_FLAG; \
|
||||
CLOCK_CYCLES((cpu_mod == 3) ? 3 : 7); \
|
||||
PREFETCH_RUN((cpu_mod == 3) ? 3 : 7, 2, rmdat, (cpu_mod == 3) ? 0:1,0,(cpu_mod == 3) ? 0:1,0, ea32); \
|
||||
break; \
|
||||
case 0x10: /*RCL w, c*/ \
|
||||
temp2 = flags & C_FLAG; \
|
||||
temp2 = cpu_state.flags & C_FLAG; \
|
||||
if (is486) CLOCK_CYCLES_ALWAYS(c); \
|
||||
while (c > 0) \
|
||||
{ \
|
||||
|
|
@ -137,14 +137,14 @@
|
|||
c--; \
|
||||
} \
|
||||
seteaw(temp); if (cpu_state.abrt) return 1; \
|
||||
flags &= ~(C_FLAG | V_FLAG); \
|
||||
if (temp2) flags |= C_FLAG; \
|
||||
if ((flags & C_FLAG) ^ (temp >> 15)) flags |= V_FLAG; \
|
||||
cpu_state.flags &= ~(C_FLAG | V_FLAG); \
|
||||
if (temp2) cpu_state.flags |= C_FLAG; \
|
||||
if ((cpu_state.flags & C_FLAG) ^ (temp >> 15)) cpu_state.flags |= V_FLAG; \
|
||||
CLOCK_CYCLES((cpu_mod == 3) ? 9 : 10); \
|
||||
PREFETCH_RUN((cpu_mod == 3) ? 9 : 10, 2, rmdat, (cpu_mod == 3) ? 0:1,0,(cpu_mod == 3) ? 0:1,0, ea32); \
|
||||
break; \
|
||||
case 0x18: /*RCR w, c*/ \
|
||||
temp2 = flags & C_FLAG; \
|
||||
temp2 = cpu_state.flags & C_FLAG; \
|
||||
if (is486) CLOCK_CYCLES_ALWAYS(c); \
|
||||
while (c > 0) \
|
||||
{ \
|
||||
|
|
@ -154,9 +154,9 @@
|
|||
c--; \
|
||||
} \
|
||||
seteaw(temp); if (cpu_state.abrt) return 1; \
|
||||
flags &= ~(C_FLAG | V_FLAG); \
|
||||
if (temp2) flags |= C_FLAG; \
|
||||
if ((temp ^ (temp >> 1)) & 0x4000) flags |= V_FLAG; \
|
||||
cpu_state.flags &= ~(C_FLAG | V_FLAG); \
|
||||
if (temp2) cpu_state.flags |= C_FLAG; \
|
||||
if ((temp ^ (temp >> 1)) & 0x4000) cpu_state.flags |= V_FLAG; \
|
||||
CLOCK_CYCLES((cpu_mod == 3) ? 9 : 10); \
|
||||
PREFETCH_RUN((cpu_mod == 3) ? 9 : 10, 2, rmdat, (cpu_mod == 3) ? 0:1,0,(cpu_mod == 3) ? 0:1,0, ea32); \
|
||||
break; \
|
||||
|
|
@ -197,9 +197,9 @@
|
|||
c--; \
|
||||
} \
|
||||
seteal(temp); if (cpu_state.abrt) return 1; \
|
||||
flags &= ~(C_FLAG | V_FLAG); \
|
||||
if (temp2) flags |= C_FLAG; \
|
||||
if ((flags & C_FLAG) ^ (temp >> 31)) flags |= V_FLAG; \
|
||||
cpu_state.flags &= ~(C_FLAG | V_FLAG); \
|
||||
if (temp2) cpu_state.flags |= C_FLAG; \
|
||||
if ((cpu_state.flags & C_FLAG) ^ (temp >> 31)) cpu_state.flags |= V_FLAG; \
|
||||
CLOCK_CYCLES((cpu_mod == 3) ? 3 : 7); \
|
||||
PREFETCH_RUN((cpu_mod == 3) ? 3 : 7, 2, rmdat, 0,(cpu_mod == 3) ? 0:1,0,(cpu_mod == 3) ? 0:1, ea32); \
|
||||
break; \
|
||||
|
|
@ -212,9 +212,9 @@
|
|||
c--; \
|
||||
} \
|
||||
seteal(temp); if (cpu_state.abrt) return 1; \
|
||||
flags &= ~(C_FLAG | V_FLAG); \
|
||||
if (temp2) flags |= C_FLAG; \
|
||||
if ((temp ^ (temp >> 1)) & 0x40000000) flags |= V_FLAG; \
|
||||
cpu_state.flags &= ~(C_FLAG | V_FLAG); \
|
||||
if (temp2) cpu_state.flags |= C_FLAG; \
|
||||
if ((temp ^ (temp >> 1)) & 0x40000000) cpu_state.flags |= V_FLAG; \
|
||||
CLOCK_CYCLES((cpu_mod == 3) ? 3 : 7); \
|
||||
PREFETCH_RUN((cpu_mod == 3) ? 3 : 7, 2, rmdat, 0,(cpu_mod == 3) ? 0:1,0,(cpu_mod == 3) ? 0:1, ea32); \
|
||||
break; \
|
||||
|
|
@ -229,14 +229,14 @@
|
|||
c--; \
|
||||
} \
|
||||
seteal(temp); if (cpu_state.abrt) return 1; \
|
||||
flags &= ~(C_FLAG | V_FLAG); \
|
||||
if (temp2) flags |= C_FLAG; \
|
||||
if ((flags & C_FLAG) ^ (temp >> 31)) flags |= V_FLAG; \
|
||||
cpu_state.flags &= ~(C_FLAG | V_FLAG); \
|
||||
if (temp2) cpu_state.flags |= C_FLAG; \
|
||||
if ((cpu_state.flags & C_FLAG) ^ (temp >> 31)) cpu_state.flags |= V_FLAG; \
|
||||
CLOCK_CYCLES((cpu_mod == 3) ? 9 : 10); \
|
||||
PREFETCH_RUN((cpu_mod == 3) ? 9 : 10, 2, rmdat, 0,(cpu_mod == 3) ? 0:1,0,(cpu_mod == 3) ? 0:1, ea32); \
|
||||
break; \
|
||||
case 0x18: /*RCR l, c*/ \
|
||||
temp2 = flags & C_FLAG; \
|
||||
temp2 = cpu_state.flags & C_FLAG; \
|
||||
if (is486) CLOCK_CYCLES_ALWAYS(c); \
|
||||
while (c > 0) \
|
||||
{ \
|
||||
|
|
@ -246,9 +246,9 @@
|
|||
c--; \
|
||||
} \
|
||||
seteal(temp); if (cpu_state.abrt) return 1; \
|
||||
flags &= ~(C_FLAG | V_FLAG); \
|
||||
if (temp2) flags |= C_FLAG; \
|
||||
if ((temp ^ (temp >> 1)) & 0x40000000) flags |= V_FLAG; \
|
||||
cpu_state.flags &= ~(C_FLAG | V_FLAG); \
|
||||
if (temp2) cpu_state.flags |= C_FLAG; \
|
||||
if ((temp ^ (temp >> 1)) & 0x40000000) cpu_state.flags |= V_FLAG; \
|
||||
CLOCK_CYCLES((cpu_mod == 3) ? 9 : 10); \
|
||||
PREFETCH_RUN((cpu_mod == 3) ? 9 : 10, 2, rmdat, 0,(cpu_mod == 3) ? 0:1,0,(cpu_mod == 3) ? 0:1, ea32); \
|
||||
break; \
|
||||
|
|
@ -541,7 +541,7 @@ static int opD3_l_a32(uint32_t fetchdat)
|
|||
seteaw(tempw); if (cpu_state.abrt) return 1; \
|
||||
setznp16(tempw); \
|
||||
flags_rebuild(); \
|
||||
if (tempc) flags |= C_FLAG; \
|
||||
if (tempc) cpu_state.flags |= C_FLAG; \
|
||||
}
|
||||
|
||||
#define SHLD_l() \
|
||||
|
|
@ -553,7 +553,7 @@ static int opD3_l_a32(uint32_t fetchdat)
|
|||
seteal(templ); if (cpu_state.abrt) return 1; \
|
||||
setznp32(templ); \
|
||||
flags_rebuild(); \
|
||||
if (tempc) flags |= C_FLAG; \
|
||||
if (tempc) cpu_state.flags |= C_FLAG; \
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -567,7 +567,7 @@ static int opD3_l_a32(uint32_t fetchdat)
|
|||
seteaw(tempw); if (cpu_state.abrt) return 1; \
|
||||
setznp16(tempw); \
|
||||
flags_rebuild(); \
|
||||
if (tempc) flags |= C_FLAG; \
|
||||
if (tempc) cpu_state.flags |= C_FLAG; \
|
||||
}
|
||||
|
||||
#define SHRD_l() \
|
||||
|
|
@ -579,7 +579,7 @@ static int opD3_l_a32(uint32_t fetchdat)
|
|||
seteal(templ); if (cpu_state.abrt) return 1; \
|
||||
setznp32(templ); \
|
||||
flags_rebuild(); \
|
||||
if (tempc) flags |= C_FLAG; \
|
||||
if (tempc) cpu_state.flags |= C_FLAG; \
|
||||
}
|
||||
|
||||
#define opSHxD(operation) \
|
||||
|
|
|
|||
Loading…
Reference in a new issue