mirror of
https://github.com/RetroDECK/Duckstation.git
synced 2025-01-18 22:35:39 +00:00
System: Add an option to preload CD image to RAM
This commit is contained in:
parent
3187d07d03
commit
9496c992f7
|
@ -362,6 +362,7 @@ void HostInterface::SetDefaultSettings(SettingsInterface& si)
|
||||||
|
|
||||||
si.SetBoolValue("CDROM", "ReadThread", true);
|
si.SetBoolValue("CDROM", "ReadThread", true);
|
||||||
si.SetBoolValue("CDROM", "RegionCheck", true);
|
si.SetBoolValue("CDROM", "RegionCheck", true);
|
||||||
|
si.SetBoolValue("CDROM", "LoadImageToRAM", false);
|
||||||
|
|
||||||
si.SetStringValue("Audio", "Backend", Settings::GetAudioBackendName(Settings::DEFAULT_AUDIO_BACKEND));
|
si.SetStringValue("Audio", "Backend", Settings::GetAudioBackendName(Settings::DEFAULT_AUDIO_BACKEND));
|
||||||
si.SetIntValue("Audio", "OutputVolume", 100);
|
si.SetIntValue("Audio", "OutputVolume", 100);
|
||||||
|
|
|
@ -118,6 +118,7 @@ void Settings::Load(SettingsInterface& si)
|
||||||
|
|
||||||
cdrom_read_thread = si.GetBoolValue("CDROM", "ReadThread", true);
|
cdrom_read_thread = si.GetBoolValue("CDROM", "ReadThread", true);
|
||||||
cdrom_region_check = si.GetBoolValue("CDROM", "RegionCheck", true);
|
cdrom_region_check = si.GetBoolValue("CDROM", "RegionCheck", true);
|
||||||
|
cdrom_load_image_to_ram = si.GetBoolValue("CDROM", "LoadImageToRAM", false);
|
||||||
|
|
||||||
audio_backend =
|
audio_backend =
|
||||||
ParseAudioBackend(si.GetStringValue("Audio", "Backend", GetAudioBackendName(DEFAULT_AUDIO_BACKEND)).c_str())
|
ParseAudioBackend(si.GetStringValue("Audio", "Backend", GetAudioBackendName(DEFAULT_AUDIO_BACKEND)).c_str())
|
||||||
|
@ -213,6 +214,7 @@ void Settings::Save(SettingsInterface& si) const
|
||||||
|
|
||||||
si.SetBoolValue("CDROM", "ReadThread", cdrom_read_thread);
|
si.SetBoolValue("CDROM", "ReadThread", cdrom_read_thread);
|
||||||
si.SetBoolValue("CDROM", "RegionCheck", cdrom_region_check);
|
si.SetBoolValue("CDROM", "RegionCheck", cdrom_region_check);
|
||||||
|
si.SetBoolValue("CDROM", "LoadImageToRAM", cdrom_load_image_to_ram);
|
||||||
|
|
||||||
si.SetStringValue("Audio", "Backend", GetAudioBackendName(audio_backend));
|
si.SetStringValue("Audio", "Backend", GetAudioBackendName(audio_backend));
|
||||||
si.SetIntValue("Audio", "OutputVolume", audio_output_volume);
|
si.SetIntValue("Audio", "OutputVolume", audio_output_volume);
|
||||||
|
|
|
@ -100,6 +100,7 @@ struct Settings
|
||||||
|
|
||||||
bool cdrom_read_thread = true;
|
bool cdrom_read_thread = true;
|
||||||
bool cdrom_region_check = true;
|
bool cdrom_region_check = true;
|
||||||
|
bool cdrom_load_image_to_ram = false;
|
||||||
|
|
||||||
AudioBackend audio_backend = AudioBackend::Cubeb;
|
AudioBackend audio_backend = AudioBackend::Cubeb;
|
||||||
s32 audio_output_volume = 100;
|
s32 audio_output_volume = 100;
|
||||||
|
|
|
@ -14,6 +14,7 @@
|
||||||
#include "gpu.h"
|
#include "gpu.h"
|
||||||
#include "host_display.h"
|
#include "host_display.h"
|
||||||
#include "host_interface.h"
|
#include "host_interface.h"
|
||||||
|
#include "host_interface_progress_callback.h"
|
||||||
#include "interrupt_controller.h"
|
#include "interrupt_controller.h"
|
||||||
#include "mdec.h"
|
#include "mdec.h"
|
||||||
#include "memory_card.h"
|
#include "memory_card.h"
|
||||||
|
@ -163,6 +164,14 @@ bool System::Boot(const SystemBootParameters& params)
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (params.override_load_image_to_ram.value_or(GetSettings().cdrom_load_image_to_ram))
|
||||||
|
{
|
||||||
|
HostInterfaceProgressCallback callback(m_host_interface);
|
||||||
|
std::unique_ptr<CDImage> memory_image = CDImage::CreateMemoryImage(media.get(), &callback);
|
||||||
|
if (memory_image)
|
||||||
|
media = std::move(memory_image);
|
||||||
|
}
|
||||||
|
|
||||||
if (m_region == ConsoleRegion::Auto)
|
if (m_region == ConsoleRegion::Auto)
|
||||||
{
|
{
|
||||||
const DiscRegion disc_region = GameList::GetRegionForImage(media.get());
|
const DiscRegion disc_region = GameList::GetRegionForImage(media.get());
|
||||||
|
|
|
@ -38,6 +38,7 @@ struct SystemBootParameters
|
||||||
std::string filename;
|
std::string filename;
|
||||||
std::optional<bool> override_fast_boot;
|
std::optional<bool> override_fast_boot;
|
||||||
std::optional<bool> override_fullscreen;
|
std::optional<bool> override_fullscreen;
|
||||||
|
std::optional<bool> override_load_image_to_ram;
|
||||||
std::unique_ptr<ByteStream> state_stream;
|
std::unique_ptr<ByteStream> state_stream;
|
||||||
bool force_software_renderer = false;
|
bool force_software_renderer = false;
|
||||||
};
|
};
|
||||||
|
|
|
@ -26,6 +26,7 @@ ConsoleSettingsWidget::ConsoleSettingsWidget(QtHostInterface* host_interface, QW
|
||||||
Settings::DEFAULT_CPU_EXECUTION_MODE);
|
Settings::DEFAULT_CPU_EXECUTION_MODE);
|
||||||
SettingWidgetBinder::BindWidgetToBoolSetting(m_host_interface, m_ui.cdromReadThread, "CDROM", "ReadThread");
|
SettingWidgetBinder::BindWidgetToBoolSetting(m_host_interface, m_ui.cdromReadThread, "CDROM", "ReadThread");
|
||||||
SettingWidgetBinder::BindWidgetToBoolSetting(m_host_interface, m_ui.cdromRegionCheck, "CDROM", "RegionCheck");
|
SettingWidgetBinder::BindWidgetToBoolSetting(m_host_interface, m_ui.cdromRegionCheck, "CDROM", "RegionCheck");
|
||||||
|
SettingWidgetBinder::BindWidgetToBoolSetting(m_host_interface, m_ui.cdromLoadImageToRAM, "CDROM", "LoadImageToRAM", false);
|
||||||
|
|
||||||
connect(m_ui.biosPathBrowse, &QPushButton::pressed, this, &ConsoleSettingsWidget::onBrowseBIOSPathButtonClicked);
|
connect(m_ui.biosPathBrowse, &QPushButton::pressed, this, &ConsoleSettingsWidget::onBrowseBIOSPathButtonClicked);
|
||||||
}
|
}
|
||||||
|
|
|
@ -119,6 +119,13 @@
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
<item row="2" column="0" colspan="2">
|
||||||
|
<widget class="QCheckBox" name="cdromLoadImageToRAM">
|
||||||
|
<property name="text">
|
||||||
|
<string>Preload Image To RAM</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
|
|
@ -1109,6 +1109,7 @@ void SDLHostInterface::DrawSettingsWindow()
|
||||||
{
|
{
|
||||||
settings_changed |= ImGui::Checkbox("Use Read Thread (Asynchronous)", &m_settings_copy.cdrom_read_thread);
|
settings_changed |= ImGui::Checkbox("Use Read Thread (Asynchronous)", &m_settings_copy.cdrom_read_thread);
|
||||||
settings_changed |= ImGui::Checkbox("Enable Region Check", &m_settings_copy.cdrom_region_check);
|
settings_changed |= ImGui::Checkbox("Enable Region Check", &m_settings_copy.cdrom_region_check);
|
||||||
|
settings_changed |= ImGui::Checkbox("Preload Image To RAM", &m_settings_copy.cdrom_load_image_to_ram);
|
||||||
}
|
}
|
||||||
|
|
||||||
ImGui::NewLine();
|
ImGui::NewLine();
|
||||||
|
|
Loading…
Reference in a new issue