static void update_68k_cycles (void)
{
cycles_mult = 0;
- if (currprefs.m68k_speed >= 0 && !currprefs.cpu_cycle_exact) {
+ 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) {
}
if (cpucycleunit < 1)
cpucycleunit = 1;
- if (currprefs.cpu_cycle_exact)
+ if (!currprefs.cpu_cycle_exact && currprefs.cpu_compatible) {
+ if (cpucycleunit == CYCLE_UNIT / 2) {
+ cycles_mult = 0;
+ } else {
+ cycles_mult = cpucycleunit * (CYCLES_DIV / (CYCLE_UNIT / 2));
+ }
+ }
+
+ if (currprefs.cpu_cycle_exact || currprefs.cpu_compatible)
write_log (_T("CPU cycleunit: %d (%.3f)\n"), cpucycleunit, (float)cpucycleunit / CYCLE_UNIT);
set_config_changed ();
}
if (debug_opcode_watch) {
debug_trainer_match();
}
- do_cycles (cpu_cycles);
r->instruction_pc = m68k_getpc ();
cpu_cycles = (*cpufunctbl[r->opcode])(r->opcode) & 0xffff;
if (!regs.loop_mode)
regs.ird = regs.opcode;
cpu_cycles = adjust_cycles (cpu_cycles);
+ do_cycles(cpu_cycles);
regs.instruction_cnt++;
if (r->spcflags) {
if (do_specialties (cpu_cycles))
} else {
- cpu_cycles = (*cpufunctbl[r->opcode])(r->opcode) >> 16;
+ cpu_cycles = (*cpufunctbl[r->opcode])(r->opcode);
cpu_cycles = adjust_cycles (cpu_cycles);
regs.instruction_cnt++;
#if 0
ew(hDlg, IDC_CPU_MULTIPLIER, workprefs.cpu_cycle_exact);
#endif
- ew(hDlg, IDC_CPU_FREQUENCY, workprefs.cpu_cycle_exact && workprefs.m68k_speed >= 0);
+ ew(hDlg, IDC_CPU_FREQUENCY, (workprefs.cpu_cycle_exact || workprefs.cpu_compatible) && workprefs.m68k_speed >= 0);
ew(hDlg, IDC_CPU_FREQUENCY2, workprefs.cpu_cycle_exact && !workprefs.cpu_clock_multiplier && workprefs.m68k_speed >= 0);
ew(hDlg, IDC_FPU1, workprefs.cpu_model < 68040 && (workprefs.cpu_model >= 68020 || !workprefs.cpu_compatible));
CheckRadioButton (hDlg, IDC_MMUENABLEOFF, IDC_MMUENABLE, mmu == 0 ? IDC_MMUENABLEOFF : (mmu && workprefs.mmu_ec) ? IDC_MMUENABLEEC : IDC_MMUENABLE);
CheckDlgButton(hDlg, IDC_CPU_PPC, workprefs.ppc_mode || is_ppc_cpu(&workprefs));
- if (workprefs.cpu_cycle_exact) {
- if (workprefs.cpu_clock_multiplier) {
- TCHAR txt[20];
- double f = getcpufreq (workprefs.cpu_clock_multiplier);
- _stprintf (txt, _T("%.6f"), f / 1000000.0);
- SendDlgItemMessage (hDlg, IDC_CPU_FREQUENCY2, WM_SETTEXT, 0, (LPARAM)txt);
- }
+ if ((workprefs.cpu_cycle_exact || workprefs.cpu_compatible) && workprefs.cpu_clock_multiplier) {
+ TCHAR txt[20];
+ double f = getcpufreq (workprefs.cpu_clock_multiplier);
+ _stprintf (txt, _T("%.6f"), f / 1000000.0);
+ SendDlgItemMessage (hDlg, IDC_CPU_FREQUENCY2, WM_SETTEXT, 0, (LPARAM)txt);
} else {
SendDlgItemMessage (hDlg, IDC_CPU_FREQUENCY2, WM_SETTEXT, 0, (LPARAM)_T(""));
}
workprefs.cpu_clock_multiplier = 0;
if (idx < 4) {
workprefs.cpu_clock_multiplier = (1 << 8) << idx;
- } else {
+ } else if (workprefs.cpu_cycle_exact) {
TCHAR txt[20];
txt[0] = 0;
- SendDlgItemMessage (hDlg, IDC_CPU_FREQUENCY2, WM_GETTEXT, (WPARAM)sizeof (txt) / sizeof (TCHAR), (LPARAM)txt);
+ SendDlgItemMessage(hDlg, IDC_CPU_FREQUENCY2, WM_GETTEXT, (WPARAM)sizeof(txt) / sizeof(TCHAR), (LPARAM)txt);
workprefs.cpu_clock_multiplier = 0;
- workprefs.cpu_frequency = (int)(_tstof (txt) * 1000000.0);
+ workprefs.cpu_frequency = (int)(_tstof(txt) * 1000000.0);
if (workprefs.cpu_frequency < 1 * 1000000)
workprefs.cpu_frequency = 0;
if (workprefs.cpu_frequency >= 99 * 1000000)
SendDlgItemMessage (hDlg, IDC_CPU_FREQUENCY, CB_ADDSTRING, 0, (LPARAM)_T("2x (A500)"));
SendDlgItemMessage (hDlg, IDC_CPU_FREQUENCY, CB_ADDSTRING, 0, (LPARAM)_T("4x (A1200)"));
SendDlgItemMessage (hDlg, IDC_CPU_FREQUENCY, CB_ADDSTRING, 0, (LPARAM)_T("8x"));
- SendDlgItemMessage (hDlg, IDC_CPU_FREQUENCY, CB_ADDSTRING, 0, (LPARAM)_T("Custom"));
+ if (workprefs.cpu_cycle_exact) {
+ SendDlgItemMessage(hDlg, IDC_CPU_FREQUENCY, CB_ADDSTRING, 0, (LPARAM)_T("Custom"));
+ }
SendDlgItemMessage(hDlg, IDC_FPU_MODE, CB_RESETCONTENT, 0, 0);
SendDlgItemMessage(hDlg, IDC_FPU_MODE, CB_ADDSTRING, 0, (LPARAM)_T("Host (64-bit)"));
idx = 2; // A1200
}
if (!workprefs.cpu_cycle_exact) {
- idx = 3;
- workprefs.cpu_clock_multiplier = 0;
workprefs.cpu_frequency = 0;
+ if (!workprefs.cpu_clock_multiplier && (idx == 1 || idx == 2)) {
+ workprefs.cpu_clock_multiplier = (1 << idx) << 8;
+ }
} else {
- if (!workprefs.cpu_frequency && (idx == 1 || idx == 2))
+ if (!workprefs.cpu_frequency && (idx == 1 || idx == 2)) {
workprefs.cpu_clock_multiplier = (1 << idx) << 8;
+ }
}
SendDlgItemMessage (hDlg, IDC_CPU_FREQUENCY, CB_SETCURSEL, idx, 0);
if (!workprefs.cpu_clock_multiplier) {