Add VISkip

This commit is contained in:
Sam Belliveau
2023-01-14 01:56:37 -05:00
parent 8a1cac9be1
commit 23ad07b368
15 changed files with 53 additions and 3 deletions

View File

@ -106,11 +106,13 @@ void HacksWidget::CreateWidgets()
m_vertex_rounding = new GraphicsBool(tr("Vertex Rounding"), Config::GFX_HACK_VERTEX_ROUNDING);
m_save_texture_cache_state =
new GraphicsBool(tr("Save Texture Cache to State"), Config::GFX_SAVE_TEXTURE_CACHE_TO_STATE);
m_vi_skip = new GraphicsBool(tr("VI Skip"), Config::GFX_HACK_VI_SKIP);
other_layout->addWidget(m_fast_depth_calculation, 0, 0);
other_layout->addWidget(m_disable_bounding_box, 0, 1);
other_layout->addWidget(m_vertex_rounding, 1, 0);
other_layout->addWidget(m_save_texture_cache_state, 1, 1);
other_layout->addWidget(m_vi_skip, 2, 0);
main_layout->addWidget(efb_box);
main_layout->addWidget(texture_cache_box);
@ -148,6 +150,8 @@ void HacksWidget::ConnectWidgets()
[this](int) { UpdateDeferEFBCopiesEnabled(); });
connect(m_immediate_xfb, &QCheckBox::stateChanged,
[this](int) { UpdateSkipPresentingDuplicateFramesEnabled(); });
connect(m_vi_skip, &QCheckBox::stateChanged,
[this](int) { UpdateSkipPresentingDuplicateFramesEnabled(); });
}
void HacksWidget::LoadSettings()
@ -280,6 +284,12 @@ void HacksWidget::AddDescriptions()
"Fixes graphical problems in some games at higher internal resolutions. This setting has no "
"effect when native internal resolution is used.<br><br>"
"<dolphin_emphasis>If unsure, leave this unchecked.</dolphin_emphasis>");
static const char TR_VI_SKIP_DESCRIPTION[] =
QT_TR_NOOP("Skips VI interrupts when lag is detected, allowing for "
"smooth audio playback when emulation speed is not 100%. <br><br>"
"<dolphin_emphasis>WARNING: Can cause freezes and compatibility "
"issues.</dolphin_emphasis> <br><br>"
"<dolphin_emphasis>If unsure, leave this unchecked.</dolphin_emphasis>");
m_skip_efb_cpu->SetDescription(tr(TR_SKIP_EFB_CPU_ACCESS_DESCRIPTION));
m_ignore_format_changes->SetDescription(tr(TR_IGNORE_FORMAT_CHANGE_DESCRIPTION));
@ -295,6 +305,7 @@ void HacksWidget::AddDescriptions()
m_disable_bounding_box->SetDescription(tr(TR_DISABLE_BOUNDINGBOX_DESCRIPTION));
m_save_texture_cache_state->SetDescription(tr(TR_SAVE_TEXTURE_CACHE_TO_STATE_DESCRIPTION));
m_vertex_rounding->SetDescription(tr(TR_VERTEX_ROUNDING_DESCRIPTION));
m_vi_skip->SetDescription(tr(TR_VI_SKIP_DESCRIPTION));
}
void HacksWidget::UpdateDeferEFBCopiesEnabled()
@ -309,5 +320,12 @@ void HacksWidget::UpdateSkipPresentingDuplicateFramesEnabled()
{
// If Immediate XFB is on, there's no point to skipping duplicate XFB copies as immediate presents
// when the XFB is created, therefore all XFB copies will be unique.
m_skip_duplicate_xfbs->setEnabled(!m_immediate_xfb->isChecked());
// This setting is also required for VI skip to work.
const bool disabled = m_immediate_xfb->isChecked() || m_vi_skip->isChecked();
if (disabled)
m_skip_duplicate_xfbs->setChecked(true);
m_skip_duplicate_xfbs->setEnabled(!disabled);
}