diff --git a/src/86box.c b/src/86box.c index d7344e723..c6d68fda2 100644 --- a/src/86box.c +++ b/src/86box.c @@ -1184,11 +1184,10 @@ pc_full_speed(void) /* Initialize modules, ran once, after pc_init. */ int -pc_init_modules(void) +pc_init_roms(void) { int c; int m; - wchar_t temp[512]; char tempc[512]; if (dump_missing) { @@ -1227,6 +1226,16 @@ pc_init_modules(void) } pc_log("A total of %d ROM sets have been loaded.\n", c); + return 1; +} + +int +pc_init_modules(void) +{ + int c; + wchar_t temp[512]; + char tempc[512]; + /* Load the ROMs for the selected machine. */ if (!machine_available(machine)) { swprintf(temp, sizeof_w(temp), plat_get_string(STRING_HW_NOT_AVAILABLE_MACHINE), machine_getname()); diff --git a/src/include/86box/86box.h b/src/include/86box/86box.h index 99436786a..0f850f6f4 100644 --- a/src/include/86box/86box.h +++ b/src/include/86box/86box.h @@ -214,6 +214,7 @@ extern void update_mouse_msg(void); #if 0 extern void pc_reload(wchar_t *fn); #endif +extern int pc_init_roms(void); extern int pc_init_modules(void); extern int pc_init(int argc, char *argv[]); extern void pc_close(void *threadid); diff --git a/src/qt/qt_main.cpp b/src/qt/qt_main.cpp index f1f0b3b20..374b0f4fb 100644 --- a/src/qt/qt_main.cpp +++ b/src/qt/qt_main.cpp @@ -616,7 +616,7 @@ main(int argc, char *argv[]) # endif #endif - if (!pc_init_modules()) { + if (!pc_init_roms()) { QMessageBox fatalbox(QMessageBox::Icon::Critical, QObject::tr("No ROMs found"), QObject::tr("86Box could not find any usable ROM images.\n\nPlease download a ROM set and extract it into the \"roms\" directory."), QMessageBox::Ok); @@ -625,6 +625,9 @@ main(int argc, char *argv[]) return 6; } + if (!vmm_enabled) + pc_init_modules(); + if (vmm_enabled) { // VMManagerMain vmm; // // Hackish until there is a proper solution diff --git a/src/unix/unix.c b/src/unix/unix.c index 551bde26b..a28c4fc47 100644 --- a/src/unix/unix.c +++ b/src/unix/unix.c @@ -1228,11 +1228,12 @@ main(int argc, char **argv) ret = pc_init(argc, argv); if (ret == 0) return 0; - if (!pc_init_modules()) { + if (!pc_init_roms()) { ui_msgbox_header(MBX_FATAL, L"No ROMs found.", L"86Box could not find any usable ROM images.\n\nPlease download a ROM set and extract it into the \"roms\" directory."); SDL_Quit(); return 6; } + pc_init_modules(); for (uint8_t i = 1; i < GFXCARD_MAX; i++) gfxcard[i] = 0;