From 021dbf7efaabca8c93925e6de1a1736b5e4e83eb Mon Sep 17 00:00:00 2001 From: "Joakim L. Gilje" Date: Mon, 6 Dec 2021 21:24:53 +0100 Subject: [PATCH] run init before mainwindow is constructed, so 86box internals are loaded and ready --- src/qt/qt_main.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/qt/qt_main.cpp b/src/qt/qt_main.cpp index 40d8680eb..fcd317e54 100644 --- a/src/qt/qt_main.cpp +++ b/src/qt/qt_main.cpp @@ -92,6 +92,12 @@ int main(int argc, char* argv[]) { elapsed_timer.start(); SDL_Init(SDL_INIT_TIMER); + pc_init(argc, argv); + if (! pc_init_modules()) { + ui_msgbox_header(MBX_FATAL, VC(L"No ROMs found."), VC(L"86Box could not find any usable ROM images.\n\nPlease download a ROM set and extract it into the \"roms\" directory.")); + return 6; + } + main_window = new MainWindow(); main_window->show(); main_window->setFocus(); @@ -103,11 +109,6 @@ int main(int argc, char* argv[]) { } main_window->setFocusPolicy(Qt::StrongFocus); - pc_init(argc, argv); - if (! pc_init_modules()) { - ui_msgbox_header(MBX_FATAL, VC(L"No ROMs found."), VC(L"86Box could not find any usable ROM images.\n\nPlease download a ROM set and extract it into the \"roms\" directory.")); - return 6; - } pc_reset_hard_init(); /* Set the PAUSE mode depending on the renderer. */