diff --git a/src/menu/menu_state.h b/src/menu/menu_state.h index eaeb83ecc..b34b6d1ad 100644 --- a/src/menu/menu_state.h +++ b/src/menu/menu_state.h @@ -103,6 +103,7 @@ typedef struct { rom_info_t rom_info; path_t *disk_path; disk_info_t disk_info; + bool combined_disk_rom; } load; struct { diff --git a/src/menu/views/load_disk.c b/src/menu/views/load_disk.c index 9d7f0e0e6..a49d14bac 100644 --- a/src/menu/views/load_disk.c +++ b/src/menu/views/load_disk.c @@ -7,7 +7,6 @@ #include "utils/fs.h" -static bool load_disk_with_rom; static component_boxart_t *boxart; @@ -42,7 +41,7 @@ static void set_autoload_type (menu_t *menu, void *arg) { static void set_load_with_rom_type(menu_t *menu, void *arg) { menu->boot_pending.disk_file = true; - load_disk_with_rom = true; + menu->load.combined_disk_rom = true; } static component_context_menu_t options_context_menu = { .list = { @@ -55,7 +54,7 @@ static component_context_menu_t options_context_menu = { .list = { static void process (menu_t *menu) { if (menu->actions.enter) { menu->boot_pending.disk_file = true; - load_disk_with_rom = false; + menu->load.combined_disk_rom = false; } else if (menu->actions.options) { ui_components_context_menu_show(&options_context_menu); sound_play_effect(SFX_SETTING); @@ -151,7 +150,7 @@ static void load (menu_t *menu) { return; } - if (menu->load.rom_path && load_disk_with_rom) { + if (menu->load.rom_path && menu->load.combined_disk_rom) { // FIXME: if the ROM is not a DD expansion ROM, it will just load the ROM. We need to check and warn! // something involving: menu->load.rom_info.game_code[0] != 'C' or 'E' or homebrew ... err = cart_load_n64_rom_and_save(menu, draw_progress); @@ -163,7 +162,7 @@ static void load (menu_t *menu) { menu->next_mode = MENU_MODE_BOOT; - if (load_disk_with_rom) { + if (menu->load.combined_disk_rom) { menu->boot_params->device_type = BOOT_DEVICE_TYPE_ROM; menu->boot_params->detect_cic_seed = rom_info_get_cic_seed(&menu->load.rom_info, &menu->boot_params->cic_seed); switch (rom_info_get_tv_type(&menu->load.rom_info)) { diff --git a/src/menu/views/startup.c b/src/menu/views/startup.c index ed196ae1e..83280a531 100644 --- a/src/menu/views/startup.c +++ b/src/menu/views/startup.c @@ -28,6 +28,11 @@ void view_startup_init (menu_t *menu) { menu->browser.directory = path_init(menu->storage_prefix, menu->settings.disk_autoload_path); menu->load.disk_path = path_clone_push(menu->browser.directory, menu->settings.disk_autoload_filename); menu->boot_pending.disk_file = true; + if (menu->settings.rom_autoload_enabled) { + menu->browser.directory = path_init(menu->storage_prefix, menu->settings.rom_autoload_path); + menu->load.rom_path = path_clone_push(menu->browser.directory, menu->settings.rom_autoload_filename); + menu->load.combined_disk_rom = true; + } menu->next_mode = MENU_MODE_LOAD_DISK; return;