static void addcycles_020(int cycles)
{
- if (using_prefetch_020 || using_ce020) {
+ if (using_ce020) {
out("%s(%d);\n", do_cycles, cycles);
+ } else if (using_prefetch_020) {
+ out("count_cycles += %d;\n", cycles);
}
}
int total = count_readl + count_readw + count_writel + count_writew - count_readp;
if (!total)
total++;
- out("return (%d * CYCLE_UNIT / 2 + count_cycles) | (((%d * 4 * CYCLE_UNIT / 2 + count_cycles) * 3) << 16);\n",
- cycles, total);
+ if (using_mmu || using_prefetch_020) {
+ out("return (%d * 4 * CYCLE_UNIT / 2 + count_cycles) * 4;\n", total);
+ } else {
+ out("return (%d * CYCLE_UNIT / 2 + count_cycles) | (((%d * 4 * CYCLE_UNIT / 2 + count_cycles) * 4) << 16);\n",
+ cycles, total);
+ }
} else if (using_simple_cycles) {
out("return %d * CYCLE_UNIT / 2 + count_cycles;\n", cycles);
} else {
count_cycles += cycles;
insn_n_cycles += cycles;
}
+#if 0
static void addcycles000_2(int cycles)
{
if (using_ce) {
count_cycles += cycles;
insn_n_cycles += cycles;
}
-
+#endif
static void addcycles000_3(void)
{
if (using_ce) {
}
}
+#if 0
static void fill_prefetch_full_2 (void)
{
if (using_prefetch) {
insn_n_cycles += 4;
}
}
+#endif
// don't check trace bits
static void fill_prefetch_full_ntx(int beopcode)
}
}
+#if 0
static void fill_prefetch_next_skipopcode(void)
{
if (using_prefetch) {
insn_n_cycles += 4;
}
}
-
+#endif
static void fill_prefetch_next_empty(void)
{
}
}
- do_always_dynamic_cycles = !using_simple_cycles && !using_prefetch && !using_prefetch_020 && using_always_dynamic_cycles;
+ do_always_dynamic_cycles = !using_simple_cycles && !using_prefetch && using_always_dynamic_cycles;
if (!using_indirect)
using_indirect = using_ce || using_ce020 || using_prefetch_020 || id >= 50;
static void update_68k_cycles (void)
{
cycles_mult = 0;
- if (currprefs.m68k_speed >= 0 && !currprefs.cpu_cycle_exact && !currprefs.cpu_compatible) {
- if (currprefs.m68k_speed_throttle < 0) {
- cycles_mult = (unsigned long)(CYCLES_DIV * 1000 / (1000 + currprefs.m68k_speed_throttle));
- } else if (currprefs.m68k_speed_throttle > 0) {
- cycles_mult = (unsigned long)(CYCLES_DIV * 1000 / (1000 + currprefs.m68k_speed_throttle));
- }
- }
- if (currprefs.m68k_speed == 0) {
+
+ if (currprefs.m68k_speed == 0) { // aproximate
+ cycles_mult = CYCLES_DIV;
if (currprefs.cpu_model >= 68040) {
- if (!cycles_mult)
- cycles_mult = CYCLES_DIV / 8;
- else
- cycles_mult /= 8;
+ cycles_mult = CYCLES_DIV / 12;
} else if (currprefs.cpu_model >= 68020) {
- if (!cycles_mult)
- cycles_mult = CYCLES_DIV / 4;
- else
- cycles_mult /= 4;
+ cycles_mult = CYCLES_DIV / 6;
+ }
+ if (!currprefs.cpu_cycle_exact) {
+ if (currprefs.m68k_speed_throttle < 0) {
+ cycles_mult = (cycles_mult * 1000) / (1000 + currprefs.m68k_speed_throttle);
+ } else if (currprefs.m68k_speed_throttle > 0) {
+ cycles_mult = (cycles_mult * 1000) / (1000 + currprefs.m68k_speed_throttle);
+ }
+ }
+ } else {
+ if (currprefs.m68k_speed >= 0 && !currprefs.cpu_cycle_exact && !currprefs.cpu_compatible) {
+ if (currprefs.m68k_speed_throttle < 0) {
+ cycles_mult = (unsigned long)(CYCLES_DIV * 1000 / (1000 + currprefs.m68k_speed_throttle));
+ } else if (currprefs.m68k_speed_throttle > 0) {
+ cycles_mult = (unsigned long)(CYCLES_DIV * 1000 / (1000 + currprefs.m68k_speed_throttle));
+ }
}
}
} else {
cpucycleunit = CYCLE_UNIT * currprefs.cpu_clock_multiplier;
}
- if (currprefs.cpu_model >= 68040)
+ if (currprefs.cpu_model >= 68040) {
cpucycleunit /= 2;
+ }
} else if (currprefs.cpu_frequency) {
cpucycleunit = CYCLE_UNIT * baseclock / currprefs.cpu_frequency;
} else if (currprefs.cpu_memory_cycle_exact && currprefs.cpu_clock_multiplier == 0) {
mmu060_state = 1;
count_instr (regs.opcode);
- cpu_cycles = (*cpufunctbl[regs.opcode])(regs.opcode) >> 16;
+ cpu_cycles = (*cpufunctbl[regs.opcode])(regs.opcode);
cpu_cycles = adjust_cycles (cpu_cycles);
regs.instruction_cnt++;
mmu_opcode = -1;
mmu_opcode = regs.opcode = x_prefetch (0);
count_instr (regs.opcode);
- cpu_cycles = (*cpufunctbl[regs.opcode])(regs.opcode) >> 16;
+ cpu_cycles = (*cpufunctbl[regs.opcode])(regs.opcode);
cpu_cycles = adjust_cycles (cpu_cycles);
regs.instruction_cnt++;
count_instr (regs.opcode);
do_cycles (cpu_cycles);
- cpu_cycles = (*cpufunctbl[regs.opcode])(regs.opcode) >> 16;
+ cpu_cycles = (*cpufunctbl[regs.opcode])(regs.opcode);
} else {