#include #include #include CPUSettings::CPUSettings() : settings(QSettings::UserScope) { types = new QComboBox(); idleSkip = new QCheckBox("Idle skipping"); idleSkip->setToolTip("Whether to enable idle skipping.

" "Note: idle skipping is a technique used in emulators
" "that enables skipping the execution of certain blocks of guest code
" "when it's determined that the aforementioned is used to wait on a certain
" "event to occur; the code gets skipped, the event is executed immediately by
" "the emulator so that the game never actually waits, progressing immediately and making " "emulation much faster.

" "This feature is not available when the pure interpreter is selected
" "because the information regarding instructions would be too limited to
" "perform the evaluation described above."); idleSkip->setChecked(settings.value("cpu/idle_skip", false).value()); v = new QVBoxLayout(); h = new QHBoxLayout(); types->addItems({"Interpreter", "Cached Interpreter"}); if (Options::GetCpuType() == n64::PlainInterpreter) { idleSkip->hide(); } else { idleSkip->show(); } types->setCurrentIndex((int)Options::GetCpuType()); connect(types, &QComboBox::currentIndexChanged, this, [&] { int index = types->currentIndex(); if (index == 0) idleSkip->hide(); else idleSkip->show(); Options::SetCpuType((n64::CPUType)index); settings.setValue("cpu/type", (n64::CPUType)index); settings.sync(); emit cpuTypeChanged(); }); connect(idleSkip, &QCheckBox::checkStateChanged, this, [&] { Options::SetIdleSkip(idleSkip->checkState()); settings.setValue("cpu/idle_skip", idleSkip->checkState()); settings.sync(); emit idleSkipChanged(); }); h->addWidget(idleSkip); v->addWidget(types); v->addLayout(h); setLayout(v); }