Misc: Purge unused code and report startup error to host

This commit is contained in:
Stenzek
2024-05-05 21:32:04 +10:00
parent ca3cfbaa99
commit fa104acdd1
17 changed files with 146 additions and 179 deletions

View File

@ -254,7 +254,7 @@ static TinyString GetTimestampStringForFileName()
return TinyString::from_format("{:%Y-%m-%d-%H-%M-%S}", fmt::localtime(std::time(nullptr)));
}
bool System::Internal::CPUThreadInitialize()
bool System::Internal::CPUThreadInitialize(Error* error)
{
#ifdef _WIN32
// On Win32, we have a bunch of things which use COM (e.g. SDL, Cubeb, etc).
@ -263,15 +263,15 @@ bool System::Internal::CPUThreadInitialize()
HRESULT hr = CoInitializeEx(nullptr, COINIT_MULTITHREADED);
if (FAILED(hr))
{
Host::ReportErrorAsync("Error", fmt::format("CoInitializeEx() failed: {:08X}", static_cast<unsigned>(hr)));
Error::SetHResult(error, "CoInitializeEx() failed: ", hr);
return false;
}
#endif
if (!Bus::AllocateMemory())
if (!Bus::AllocateMemory(error))
return false;
if (!CPU::CodeCache::ProcessStartup())
if (!CPU::CodeCache::ProcessStartup(error))
return false;
// This will call back to Host::LoadSettings() -> ReloadSources().