Split off ROM set checking from pc_init_modules()

Everything else isn't needed for the manager
This commit is contained in:
Alexander Babikov
2025-08-14 07:04:51 +05:00
parent 20259c0fa8
commit 05120bfb70
4 changed files with 18 additions and 4 deletions

View File

@@ -1184,11 +1184,10 @@ pc_full_speed(void)
/* Initialize modules, ran once, after pc_init. */ /* Initialize modules, ran once, after pc_init. */
int int
pc_init_modules(void) pc_init_roms(void)
{ {
int c; int c;
int m; int m;
wchar_t temp[512];
char tempc[512]; char tempc[512];
if (dump_missing) { if (dump_missing) {
@@ -1227,6 +1226,16 @@ pc_init_modules(void)
} }
pc_log("A total of %d ROM sets have been loaded.\n", c); 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. */ /* Load the ROMs for the selected machine. */
if (!machine_available(machine)) { if (!machine_available(machine)) {
swprintf(temp, sizeof_w(temp), plat_get_string(STRING_HW_NOT_AVAILABLE_MACHINE), machine_getname()); swprintf(temp, sizeof_w(temp), plat_get_string(STRING_HW_NOT_AVAILABLE_MACHINE), machine_getname());

View File

@@ -214,6 +214,7 @@ extern void update_mouse_msg(void);
#if 0 #if 0
extern void pc_reload(wchar_t *fn); extern void pc_reload(wchar_t *fn);
#endif #endif
extern int pc_init_roms(void);
extern int pc_init_modules(void); extern int pc_init_modules(void);
extern int pc_init(int argc, char *argv[]); extern int pc_init(int argc, char *argv[]);
extern void pc_close(void *threadid); extern void pc_close(void *threadid);

View File

@@ -616,7 +616,7 @@ main(int argc, char *argv[])
# endif # endif
#endif #endif
if (!pc_init_modules()) { if (!pc_init_roms()) {
QMessageBox fatalbox(QMessageBox::Icon::Critical, QObject::tr("No ROMs found"), QMessageBox fatalbox(QMessageBox::Icon::Critical, QObject::tr("No ROMs found"),
QObject::tr("86Box could not find any usable ROM images.\n\nPlease <a href=\"https://github.com/86Box/roms/releases/latest\">download</a> a ROM set and extract it into the \"roms\" directory."), QObject::tr("86Box could not find any usable ROM images.\n\nPlease <a href=\"https://github.com/86Box/roms/releases/latest\">download</a> a ROM set and extract it into the \"roms\" directory."),
QMessageBox::Ok); QMessageBox::Ok);
@@ -625,6 +625,9 @@ main(int argc, char *argv[])
return 6; return 6;
} }
if (!vmm_enabled)
pc_init_modules();
if (vmm_enabled) { if (vmm_enabled) {
// VMManagerMain vmm; // VMManagerMain vmm;
// // Hackish until there is a proper solution // // Hackish until there is a proper solution

View File

@@ -1228,11 +1228,12 @@ main(int argc, char **argv)
ret = pc_init(argc, argv); ret = pc_init(argc, argv);
if (ret == 0) if (ret == 0)
return 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."); 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(); SDL_Quit();
return 6; return 6;
} }
pc_init_modules();
for (uint8_t i = 1; i < GFXCARD_MAX; i++) for (uint8_t i = 1; i < GFXCARD_MAX; i++)
gfxcard[i] = 0; gfxcard[i] = 0;