Moved integer registers, PC and flags_* variables into new cpu_state structure. Reduces recompiled code size slightly, small speedup (1-3%).

This commit is contained in:
SarahW 2016-04-20 21:39:41 +01:00
commit c81a91fd72
52 changed files with 1494 additions and 1408 deletions

View file

@ -1,9 +1,9 @@
#define op_seg(name, seg) \
static int op ## name ## _w_a16(uint32_t fetchdat) \
{ \
fetchdat = fastreadl(cs + pc); \
fetchdat = fastreadl(cs + cpu_state.pc); \
if (abrt) return 1; \
pc++; \
cpu_state.pc++; \
\
ea_seg = &seg; \
ssegs = 1; \
@ -14,9 +14,9 @@ static int op ## name ## _w_a16(uint32_t fetchdat) \
\
static int op ## name ## _l_a16(uint32_t fetchdat) \
{ \
fetchdat = fastreadl(cs + pc); \
fetchdat = fastreadl(cs + cpu_state.pc); \
if (abrt) return 1; \
pc++; \
cpu_state.pc++; \
\
ea_seg = &seg; \
ssegs = 1; \
@ -27,9 +27,9 @@ static int op ## name ## _l_a16(uint32_t fetchdat) \
\
static int op ## name ## _w_a32(uint32_t fetchdat) \
{ \
fetchdat = fastreadl(cs + pc); \
fetchdat = fastreadl(cs + cpu_state.pc); \
if (abrt) return 1; \
pc++; \
cpu_state.pc++; \
\
ea_seg = &seg; \
ssegs = 1; \
@ -40,9 +40,9 @@ static int op ## name ## _w_a32(uint32_t fetchdat) \
\
static int op ## name ## _l_a32(uint32_t fetchdat) \
{ \
fetchdat = fastreadl(cs + pc); \
fetchdat = fastreadl(cs + cpu_state.pc); \
if (abrt) return 1; \
pc++; \
cpu_state.pc++; \
\
ea_seg = &seg; \
ssegs = 1; \
@ -60,9 +60,9 @@ op_seg(SS, _ss)
static int op_66(uint32_t fetchdat) /*Data size select*/
{
fetchdat = fastreadl(cs + pc);
fetchdat = fastreadl(cs + cpu_state.pc);
if (abrt) return 1;
pc++;
cpu_state.pc++;
op32 = ((use32 & 0x100) ^ 0x100) | (op32 & 0x200);
CLOCK_CYCLES(2);
@ -70,9 +70,9 @@ static int op_66(uint32_t fetchdat) /*Data size select*/
}
static int op_67(uint32_t fetchdat) /*Address size select*/
{
fetchdat = fastreadl(cs + pc);
fetchdat = fastreadl(cs + cpu_state.pc);
if (abrt) return 1;
pc++;
cpu_state.pc++;
op32 = ((use32 & 0x200) ^ 0x200) | (op32 & 0x100);
CLOCK_CYCLES(2);