Added prefetch timing approximation for 286/386 CPUs, with configurable memory timing.

This commit is contained in:
SarahW 2016-11-25 21:32:02 +00:00
commit 1b73963997
33 changed files with 1139 additions and 261 deletions

View file

@ -3,6 +3,7 @@ static int opCMC(uint32_t fetchdat)
flags_rebuild();
flags ^= C_FLAG;
CLOCK_CYCLES(2);
PREFETCH_RUN(2, 1, -1, 0,0,0,0, 0);
return 0;
}
@ -12,12 +13,14 @@ static int opCLC(uint32_t fetchdat)
flags_rebuild();
flags &= ~C_FLAG;
CLOCK_CYCLES(2);
PREFETCH_RUN(2, 1, -1, 0,0,0,0, 0);
return 0;
}
static int opCLD(uint32_t fetchdat)
{
flags &= ~D_FLAG;
CLOCK_CYCLES(2);
PREFETCH_RUN(2, 1, -1, 0,0,0,0, 0);
return 0;
}
static int opCLI(uint32_t fetchdat)
@ -33,6 +36,7 @@ static int opCLI(uint32_t fetchdat)
CPU_BLOCK_END();
CLOCK_CYCLES(3);
PREFETCH_RUN(3, 1, -1, 0,0,0,0, 0);
return 0;
}
@ -41,12 +45,14 @@ static int opSTC(uint32_t fetchdat)
flags_rebuild();
flags |= C_FLAG;
CLOCK_CYCLES(2);
PREFETCH_RUN(2, 1, -1, 0,0,0,0, 0);
return 0;
}
static int opSTD(uint32_t fetchdat)
{
flags |= D_FLAG;
CLOCK_CYCLES(2);
PREFETCH_RUN(2, 1, -1, 0,0,0,0, 0);
return 0;
}
static int opSTI(uint32_t fetchdat)
@ -62,6 +68,7 @@ static int opSTI(uint32_t fetchdat)
CPU_BLOCK_END();
CLOCK_CYCLES(2);
PREFETCH_RUN(2, 1, -1, 0,0,0,0, 0);
return 0;
}
@ -70,7 +77,8 @@ static int opSAHF(uint32_t fetchdat)
flags_rebuild();
flags = (flags & 0xff00) | (AH & 0xd5) | 2;
CLOCK_CYCLES(3);
PREFETCH_RUN(3, 1, -1, 0,0,0,0, 0);
codegen_flags_changed = 0;
return 0;
@ -80,6 +88,7 @@ static int opLAHF(uint32_t fetchdat)
flags_rebuild();
AH = flags & 0xff;
CLOCK_CYCLES(3);
PREFETCH_RUN(3, 1, -1, 0,0,0,0, 0);
return 0;
}
@ -93,6 +102,7 @@ static int opPUSHF(uint32_t fetchdat)
flags_rebuild();
PUSH_W(flags);
CLOCK_CYCLES(4);
PREFETCH_RUN(4, 1, -1, 0,0,1,0, 0);
return cpu_state.abrt;
}
static int opPUSHFD(uint32_t fetchdat)
@ -108,6 +118,7 @@ static int opPUSHFD(uint32_t fetchdat)
flags_rebuild();
PUSH_L(flags | (tempw << 16));
CLOCK_CYCLES(4);
PREFETCH_RUN(4, 1, -1, 0,0,0,1, 0);
return cpu_state.abrt;
}
@ -130,7 +141,8 @@ static int opPOPF_286(uint32_t fetchdat)
flags_extract();
CLOCK_CYCLES(5);
PREFETCH_RUN(5, 1, -1, 1,0,0,0, 0);
codegen_flags_changed = 0;
return 0;
@ -153,7 +165,8 @@ static int opPOPF(uint32_t fetchdat)
flags_extract();
CLOCK_CYCLES(5);
PREFETCH_RUN(5, 1, -1, 1,0,0,0, 0);
codegen_flags_changed = 0;
return 0;
@ -183,7 +196,8 @@ static int opPOPFD(uint32_t fetchdat)
flags_extract();
CLOCK_CYCLES(5);
PREFETCH_RUN(5, 1, -1, 0,1,0,0, 0);
codegen_flags_changed = 0;
return 0;