mirror of
https://github.com/WinampDesktop/winamp.git
synced 2025-06-19 19:35:41 -04:00
System: Check host page size on startup
This commit is contained in:
@ -85,6 +85,7 @@ static constexpr u32 FULLSCREEN_UI_CONTROLLER_POLLING_INTERVAL = 8;
|
||||
// Local function declarations
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
namespace QtHost {
|
||||
static bool PerformEarlyHardwareChecks();
|
||||
static void RegisterTypes();
|
||||
static bool InitializeConfig(std::string settings_filename);
|
||||
static bool ShouldUsePortableMode();
|
||||
@ -124,6 +125,27 @@ EmuThread::EmuThread(QThread* ui_thread) : QThread(), m_ui_thread(ui_thread)
|
||||
|
||||
EmuThread::~EmuThread() = default;
|
||||
|
||||
bool QtHost::PerformEarlyHardwareChecks()
|
||||
{
|
||||
Error error;
|
||||
const bool okay = System::Internal::PerformEarlyHardwareChecks(&error);
|
||||
if (okay && !error.IsValid())
|
||||
return true;
|
||||
|
||||
if (okay)
|
||||
{
|
||||
QMessageBox::warning(nullptr, QStringLiteral("Hardware Check Warning"),
|
||||
QString::fromStdString(error.GetDescription()));
|
||||
}
|
||||
else
|
||||
{
|
||||
QMessageBox::critical(nullptr, QStringLiteral("Hardware Check Failed"),
|
||||
QString::fromStdString(error.GetDescription()));
|
||||
}
|
||||
|
||||
return okay;
|
||||
}
|
||||
|
||||
void QtHost::RegisterTypes()
|
||||
{
|
||||
// Register any standard types we need elsewhere
|
||||
@ -1700,8 +1722,8 @@ void EmuThread::run()
|
||||
Error startup_error;
|
||||
if (!System::Internal::CPUThreadInitialize(&startup_error))
|
||||
{
|
||||
Host::ReportFatalError("Fatal Startup Error", startup_error.GetDescription());
|
||||
moveToThread(m_ui_thread);
|
||||
Host::ReportFatalError("Fatal Startup Error", startup_error.GetDescription());
|
||||
return;
|
||||
}
|
||||
}
|
||||
@ -2482,6 +2504,9 @@ int main(int argc, char* argv[])
|
||||
|
||||
QApplication app(argc, argv);
|
||||
|
||||
if (!QtHost::PerformEarlyHardwareChecks())
|
||||
return EXIT_FAILURE;
|
||||
|
||||
std::shared_ptr<SystemBootParameters> autoboot;
|
||||
if (!QtHost::ParseCommandLineParametersAndInitializeConfig(app, autoboot))
|
||||
return EXIT_FAILURE;
|
||||
|
Reference in New Issue
Block a user