mirror of
https://github.com/RetroDECK/Duckstation.git
synced 2024-11-26 15:45:42 +00:00
System: Tidy up some unused code
This commit is contained in:
parent
278c3ab2a5
commit
e517581041
|
@ -102,7 +102,7 @@ static std::string GetExecutableNameForImage(IsoReader& iso, bool strip_subdirec
|
||||||
static bool ReadExecutableFromImage(IsoReader& iso, std::string* out_executable_name,
|
static bool ReadExecutableFromImage(IsoReader& iso, std::string* out_executable_name,
|
||||||
std::vector<u8>* out_executable_data);
|
std::vector<u8>* out_executable_data);
|
||||||
|
|
||||||
static bool LoadBIOS(const std::string& override_bios_path, Error* error);
|
static bool LoadBIOS(Error* error);
|
||||||
static void InternalReset();
|
static void InternalReset();
|
||||||
static void ClearRunningGame();
|
static void ClearRunningGame();
|
||||||
static void DestroySystem();
|
static void DestroySystem();
|
||||||
|
@ -127,7 +127,6 @@ static void SaveRunaheadState();
|
||||||
static bool DoRunahead();
|
static bool DoRunahead();
|
||||||
|
|
||||||
static bool Initialize(bool force_software_renderer, Error* error);
|
static bool Initialize(bool force_software_renderer, Error* error);
|
||||||
static bool FastForwardToFirstFrame();
|
|
||||||
|
|
||||||
static bool UpdateGameSettingsLayer();
|
static bool UpdateGameSettingsLayer();
|
||||||
static void UpdateRunningGame(const char* path, CDImage* image, bool booting);
|
static void UpdateRunningGame(const char* path, CDImage* image, bool booting);
|
||||||
|
@ -1465,7 +1464,7 @@ bool System::BootSystem(SystemBootParameters parameters, Error* error)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Load BIOS image.
|
// Load BIOS image.
|
||||||
if (!LoadBIOS(parameters.override_bios, error))
|
if (!LoadBIOS(error))
|
||||||
{
|
{
|
||||||
s_state = State::Shutdown;
|
s_state = State::Shutdown;
|
||||||
ClearRunningGame();
|
ClearRunningGame();
|
||||||
|
@ -1566,9 +1565,6 @@ bool System::BootSystem(SystemBootParameters parameters, Error* error)
|
||||||
if (parameters.load_image_to_ram || g_settings.cdrom_load_image_to_ram)
|
if (parameters.load_image_to_ram || g_settings.cdrom_load_image_to_ram)
|
||||||
CDROM::PrecacheMedia();
|
CDROM::PrecacheMedia();
|
||||||
|
|
||||||
if (parameters.fast_forward_to_first_frame)
|
|
||||||
FastForwardToFirstFrame();
|
|
||||||
|
|
||||||
if (parameters.start_audio_dump)
|
if (parameters.start_audio_dump)
|
||||||
StartDumpingAudio();
|
StartDumpingAudio();
|
||||||
|
|
||||||
|
@ -1766,25 +1762,6 @@ void System::ClearRunningGame()
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
bool System::FastForwardToFirstFrame()
|
|
||||||
{
|
|
||||||
// If we're taking more than 60 seconds to load the game, oof..
|
|
||||||
static constexpr u32 MAX_FRAMES_TO_SKIP = 30 * 60;
|
|
||||||
const u32 current_frame_number = s_frame_number;
|
|
||||||
const u32 current_internal_frame_number = s_internal_frame_number;
|
|
||||||
|
|
||||||
SPU::SetAudioOutputMuted(true);
|
|
||||||
while (s_internal_frame_number == current_internal_frame_number &&
|
|
||||||
(s_frame_number - current_frame_number) <= MAX_FRAMES_TO_SKIP)
|
|
||||||
{
|
|
||||||
Panic("Fixme");
|
|
||||||
// System::RunFrame();
|
|
||||||
}
|
|
||||||
SPU::SetAudioOutputMuted(false);
|
|
||||||
|
|
||||||
return (s_internal_frame_number != current_internal_frame_number);
|
|
||||||
}
|
|
||||||
|
|
||||||
void System::Execute()
|
void System::Execute()
|
||||||
{
|
{
|
||||||
for (;;)
|
for (;;)
|
||||||
|
@ -2251,31 +2228,11 @@ bool System::DoState(StateWrapper& sw, GPUTexture** host_texture, bool update_di
|
||||||
return !sw.HasError();
|
return !sw.HasError();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool System::LoadBIOS(const std::string& override_bios_path, Error* error)
|
bool System::LoadBIOS(Error* error)
|
||||||
{
|
{
|
||||||
std::optional<BIOS::Image> bios_image;
|
std::optional<BIOS::Image> bios_image = BIOS::GetBIOSImage(s_region, error);
|
||||||
if (!override_bios_path.empty())
|
if (!bios_image.has_value())
|
||||||
{
|
|
||||||
bios_image = FileSystem::ReadBinaryFile(override_bios_path.c_str(), error);
|
|
||||||
if (!bios_image.has_value())
|
|
||||||
{
|
|
||||||
Error::AddPrefixFmt(error, TRANSLATE_FS("System", "Failed to load {} BIOS."),
|
|
||||||
Settings::GetConsoleRegionName(s_region));
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
bios_image = BIOS::GetBIOSImage(s_region, error);
|
|
||||||
if (!bios_image.has_value())
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (bios_image->size() != static_cast<u32>(Bus::BIOS_SIZE))
|
|
||||||
{
|
|
||||||
Error::SetStringView(error, TRANSLATE_SV("System", "Incorrect BIOS image size"));
|
|
||||||
return false;
|
return false;
|
||||||
}
|
|
||||||
|
|
||||||
s_bios_hash = BIOS::GetImageHash(bios_image.value());
|
s_bios_hash = BIOS::GetImageHash(bios_image.value());
|
||||||
s_bios_image_info = BIOS::GetInfoForImage(bios_image.value(), s_bios_hash);
|
s_bios_image_info = BIOS::GetInfoForImage(bios_image.value(), s_bios_hash);
|
||||||
|
|
|
@ -47,14 +47,12 @@ struct SystemBootParameters
|
||||||
std::string filename;
|
std::string filename;
|
||||||
std::string save_state;
|
std::string save_state;
|
||||||
std::string override_exe;
|
std::string override_exe;
|
||||||
std::string override_bios;
|
|
||||||
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_start_paused;
|
std::optional<bool> override_start_paused;
|
||||||
u32 media_playlist_index = 0;
|
u32 media_playlist_index = 0;
|
||||||
bool load_image_to_ram = false;
|
bool load_image_to_ram = false;
|
||||||
bool force_software_renderer = false;
|
bool force_software_renderer = false;
|
||||||
bool fast_forward_to_first_frame = false;
|
|
||||||
bool disable_achievements_hardcore_mode = false;
|
bool disable_achievements_hardcore_mode = false;
|
||||||
bool start_audio_dump = false;
|
bool start_audio_dump = false;
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue