diff --git a/src/duckstation-qt/gamepropertiesdialog.cpp b/src/duckstation-qt/gamepropertiesdialog.cpp index e08bfceed..d5f0846bb 100644 --- a/src/duckstation-qt/gamepropertiesdialog.cpp +++ b/src/duckstation-qt/gamepropertiesdialog.cpp @@ -319,6 +319,12 @@ void GamePropertiesDialog::populateGameSettings() m_ui.userCDROMReadSpeedup->setCurrentIndex(static_cast(gs.cdrom_read_speedup.value())); } + if (gs.cdrom_seek_speedup.has_value()) + { + QSignalBlocker sb(m_ui.userCDROMSeekSpeedup); + m_ui.userCDROMSeekSpeedup->setCurrentIndex(static_cast(gs.cdrom_seek_speedup.value()) + 1); + } + if (gs.display_active_start_offset.has_value()) { QSignalBlocker sb(m_ui.displayActiveStartOffset); @@ -589,6 +595,14 @@ void GamePropertiesDialog::connectUi() saveGameSettings(); }); + connect(m_ui.userCDROMSeekSpeedup, QOverload::of(&QComboBox::currentIndexChanged), [this](int index) { + if (index <= 0) + m_game_settings.cdrom_seek_speedup.reset(); + else + m_game_settings.cdrom_seek_speedup = static_cast(index - 1); + saveGameSettings(); + }); + connect(m_ui.userAspectRatio, QOverload::of(&QComboBox::currentIndexChanged), [this](int index) { if (index <= 0) m_game_settings.display_aspect_ratio.reset(); diff --git a/src/duckstation-qt/gamepropertiesdialog.ui b/src/duckstation-qt/gamepropertiesdialog.ui index e98d5e3e4..4c1b02cdd 100644 --- a/src/duckstation-qt/gamepropertiesdialog.ui +++ b/src/duckstation-qt/gamepropertiesdialog.ui @@ -6,8 +6,8 @@ 0 0 - 769 - 706 + 692 + 562 @@ -262,6 +262,246 @@ + + + + Other Settings + + + + + + CD-ROM Read Speedup: + + + + + + + + (unchanged) + + + + + None (Double Speed) + + + + + 2x (Quad Speed) + + + + + 3x (6x Speed) + + + + + 4x (8x Speed) + + + + + 5x (10x Speed) + + + + + 6x (12x Speed) + + + + + 7x (14x Speed) + + + + + 8x (16x Speed) + + + + + 9x (18x Speed) + + + + + 10x (20x Speed) + + + + + + + + CD-ROM Seek Speedup: + + + + + + + 0 + + + + (unchanged) + + + + + Infinite/Instantaneous + + + + + None (Normal Speed) + + + + + 2x + + + + + 3x + + + + + 4x + + + + + 5x + + + + + 6x + + + + + 7x + + + + + 8x + + + + + 9x + + + + + 10x + + + + + + + + Runahead Frames: + + + + + + + + (unchanged) + + + + + Disabled + + + + + 1 Frame + + + + + 2 Frames + + + + + 3 Frames + + + + + 4 Frames + + + + + 5 Frames + + + + + 6 Frames + + + + + 7 Frames + + + + + 8 Frames + + + + + 9 Frames + + + + + 10 Frames + + + + + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + + User Settings (Graphics) + + @@ -490,153 +730,7 @@ - - - Other Settings - - - - - - CD-ROM Read Speedup: - - - - - - - - (unchanged) - - - - - None (Double Speed) - - - - - 2x (Quad Speed) - - - - - 3x (6x Speed) - - - - - 4x (8x Speed) - - - - - 5x (10x Speed) - - - - - 6x (12x Speed) - - - - - 7x (14x Speed) - - - - - 8x (16x Speed) - - - - - 9x (18x Speed) - - - - - 10x (20x Speed) - - - - - - - - Runahead Frames: - - - - - - - - (unchanged) - - - - - Disabled - - - - - 1 Frame - - - - - 2 Frames - - - - - 3 Frames - - - - - 4 Frames - - - - - 5 Frames - - - - - 6 Frames - - - - - 7 Frames - - - - - 8 Frames - - - - - 9 Frames - - - - - 10 Frames - - - - - - - - - + Qt::Vertical diff --git a/src/frontend-common/game_list.h b/src/frontend-common/game_list.h index 573f4254e..12baf0605 100644 --- a/src/frontend-common/game_list.h +++ b/src/frontend-common/game_list.h @@ -133,7 +133,7 @@ private: enum : u32 { GAME_LIST_CACHE_SIGNATURE = 0x45434C47, - GAME_LIST_CACHE_VERSION = 30 + GAME_LIST_CACHE_VERSION = 31 }; using CacheMap = std::unordered_map; diff --git a/src/frontend-common/game_settings.cpp b/src/frontend-common/game_settings.cpp index fb6149cdc..674f44ef0 100644 --- a/src/frontend-common/game_settings.cpp +++ b/src/frontend-common/game_settings.cpp @@ -110,7 +110,7 @@ bool Entry::LoadFromStream(ByteStream* stream) !ReadOptionalFromStream(stream, &cpu_overclock_numerator) || !ReadOptionalFromStream(stream, &cpu_overclock_denominator) || !ReadOptionalFromStream(stream, &cpu_overclock_enable) || !ReadOptionalFromStream(stream, &enable_8mb_ram) || - !ReadOptionalFromStream(stream, &cdrom_read_speedup) || + !ReadOptionalFromStream(stream, &cdrom_read_speedup) || !ReadOptionalFromStream(stream, &cdrom_seek_speedup) || !ReadOptionalFromStream(stream, &display_active_start_offset) || !ReadOptionalFromStream(stream, &display_active_end_offset) || !ReadOptionalFromStream(stream, &display_line_start_offset) || @@ -166,7 +166,7 @@ bool Entry::SaveToStream(ByteStream* stream) const WriteOptionalToStream(stream, cpu_overclock_numerator) && WriteOptionalToStream(stream, cpu_overclock_denominator) && WriteOptionalToStream(stream, cpu_overclock_enable) && WriteOptionalToStream(stream, enable_8mb_ram) && - WriteOptionalToStream(stream, cdrom_read_speedup) && + WriteOptionalToStream(stream, cdrom_read_speedup) && WriteOptionalToStream(stream, cdrom_seek_speedup) && WriteOptionalToStream(stream, display_active_start_offset) && WriteOptionalToStream(stream, display_active_end_offset) && WriteOptionalToStream(stream, display_line_start_offset) && @@ -221,6 +221,9 @@ static void ParseIniSection(Entry* entry, const char* section, const CSimpleIniA cvalue = ini.GetValue(section, "CDROMReadSpeedup", nullptr); if (cvalue) entry->cdrom_read_speedup = StringUtil::FromChars(cvalue); + cvalue = ini.GetValue(section, "CDROMSeekSpeedup", nullptr); + if (cvalue) + entry->cdrom_seek_speedup = StringUtil::FromChars(cvalue); long lvalue = ini.GetLongValue(section, "DisplayActiveStartOffset", 0); if (lvalue != 0) @@ -370,6 +373,8 @@ static void StoreIniSection(const Entry& entry, const char* section, CSimpleIniA if (entry.cdrom_read_speedup.has_value()) ini.SetLongValue(section, "CDROMReadSpeedup", static_cast(entry.cdrom_read_speedup.value())); + if (entry.cdrom_seek_speedup.has_value()) + ini.SetLongValue(section, "CDROMSeekSpeedup", static_cast(entry.cdrom_seek_speedup.value())); if (entry.display_active_start_offset.has_value()) ini.SetLongValue(section, "DisplayActiveStartOffset", entry.display_active_start_offset.value()); @@ -473,6 +478,7 @@ u32 Entry::GetUserSettingsCount() const count += BoolToUInt32(cpu_overclock_enable.has_value()); count += BoolToUInt32(enable_8mb_ram.has_value()); count += BoolToUInt32(cdrom_read_speedup.has_value()); + count += BoolToUInt32(cdrom_seek_speedup.has_value()); count += BoolToUInt32(display_crop_mode.has_value()); count += BoolToUInt32(display_aspect_ratio.has_value()); count += BoolToUInt32(gpu_downsample_mode.has_value()); @@ -534,6 +540,13 @@ static std::optional GetEntryValueForKey(const Entry& entry, const else return std::to_string(entry.cdrom_read_speedup.value()); } + else if (key == "CDROMSeekSpeedup") + { + if (!entry.cdrom_seek_speedup.has_value()) + return std::nullopt; + else + return std::to_string(entry.cdrom_seek_speedup.value()); + } else if (key == "DisplayCropMode") { if (!entry.display_crop_mode.has_value()) @@ -796,6 +809,13 @@ static void SetEntryValueForKey(Entry& entry, const std::string_view& key, const else entry.cdrom_read_speedup = StringUtil::FromChars(value.value()); } + else if (key == "CDROMSeekSpeedup") + { + if (!value.has_value()) + entry.cdrom_seek_speedup.reset(); + else + entry.cdrom_seek_speedup = StringUtil::FromChars(value.value()); + } else if (key == "DisplayCropMode") { if (!value.has_value()) @@ -1160,6 +1180,8 @@ void Entry::ApplySettings(bool display_osd_messages) const if (cdrom_read_speedup.has_value()) g_settings.cdrom_read_speedup = cdrom_read_speedup.value(); + if (cdrom_seek_speedup.has_value()) + g_settings.cdrom_seek_speedup = cdrom_seek_speedup.value(); if (display_active_start_offset.has_value()) g_settings.display_active_start_offset = display_active_start_offset.value(); diff --git a/src/frontend-common/game_settings.h b/src/frontend-common/game_settings.h index 8daf57d5b..5ad1b1347 100644 --- a/src/frontend-common/game_settings.h +++ b/src/frontend-common/game_settings.h @@ -57,6 +57,7 @@ struct Entry std::optional cpu_overclock_enable; std::optional enable_8mb_ram; std::optional cdrom_read_speedup; + std::optional cdrom_seek_speedup; std::optional display_crop_mode; std::optional display_aspect_ratio; std::optional gpu_renderer;