From a6d88e4a69374ce04628712b3f0285c8a8b4ebb5 Mon Sep 17 00:00:00 2001 From: sorgelig Date: Mon, 27 May 2019 15:57:13 +0800 Subject: [PATCH] Don't try to load boot.rom for Menu core. --- user_io.cpp | 100 +++++++++++++++++++++++++++------------------------- 1 file changed, 51 insertions(+), 49 deletions(-) diff --git a/user_io.cpp b/user_io.cpp index 88e5369..0bda9d2 100644 --- a/user_io.cpp +++ b/user_io.cpp @@ -599,75 +599,77 @@ void user_io_init(const char *path) user_io_8bit_set_status((cfg.menu_pal) ? 0x10 : 0, 0x10); video_menu_bg((status >> 1) & 7); } - - if (is_x86_core()) - { - x86_config_load(); - x86_init(); - } else { - if (!strlen(path) || !user_io_file_tx(path, 0, 0, 0, 1)) + if (is_x86_core()) { - if (!is_cpc_core()) + x86_config_load(); + x86_init(); + } + else + { + if (!strlen(path) || !user_io_file_tx(path, 0, 0, 0, 1)) { - // check for multipart rom - for (char i = 0; i < 4; i++) + if (!is_cpc_core()) { - sprintf(mainpath, "%s/boot%i.rom", user_io_get_core_name(), i); - user_io_file_tx(mainpath, i<<6); + // check for multipart rom + for (char i = 0; i < 4; i++) + { + sprintf(mainpath, "%s/boot%i.rom", user_io_get_core_name(), i); + user_io_file_tx(mainpath, i << 6); + } } + + // legacy style of rom + sprintf(mainpath, "%s/boot.rom", user_io_get_core_name()); + if (!user_io_file_tx(mainpath)) + { + strcpy(name + strlen(name) - 3, "ROM"); + sprintf(mainpath, "%s/%s", get_rbf_dir(), name); + if (!get_rbf_dir()[0] || !user_io_file_tx(mainpath)) + { + if (!user_io_file_tx(name)) + { + sprintf(mainpath, "bootrom/%s", name); + user_io_file_tx(mainpath); + } + } + } + + // cheats for boot file + if (user_io_use_cheats()) cheats_init("", user_io_get_file_crc()); } - // legacy style of rom - sprintf(mainpath, "%s/boot.rom", user_io_get_core_name()); - if (!user_io_file_tx(mainpath)) + if (is_cpc_core()) { - strcpy(name + strlen(name) - 3, "ROM"); - sprintf(mainpath, "%s/%s", get_rbf_dir(), name); - if (!get_rbf_dir()[0] || !user_io_file_tx(mainpath)) + for (int m = 0; m < 3; m++) { - if (!user_io_file_tx(name)) + const char *model = !m ? "" : (m == 1) ? "0" : "1"; + sprintf(mainpath, "%s/boot%s.eZZ", user_io_get_core_name(), model); + user_io_file_tx(mainpath, 0x40 * (m + 1), 0, 1); + sprintf(mainpath, "%s/boot%s.eZ0", user_io_get_core_name(), model); + user_io_file_tx(mainpath, 0x40 * (m + 1), 0, 1); + for (int i = 0; i < 256; i++) { - sprintf(mainpath, "bootrom/%s", name); - user_io_file_tx(mainpath); + sprintf(mainpath, "%s/boot%s.e%02X", user_io_get_core_name(), model, i); + user_io_file_tx(mainpath, 0x40 * (m + 1), 0, 1); } } } - // cheats for boot file - if (user_io_use_cheats()) cheats_init("", user_io_get_file_crc()); - } - - if (is_cpc_core()) - { - for (int m = 0; m < 3; m++) + // check if vhd present + sprintf(mainpath, "%s/boot.vhd", user_io_get_core_name()); + user_io_set_index(0); + if (!user_io_file_mount(mainpath)) { - const char *model = !m ? "" : (m == 1) ? "0" : "1"; - sprintf(mainpath, "%s/boot%s.eZZ", user_io_get_core_name(), model); - user_io_file_tx(mainpath, 0x40 * (m + 1),0,1); - sprintf(mainpath, "%s/boot%s.eZ0", user_io_get_core_name(), model); - user_io_file_tx(mainpath, 0x40 * (m + 1),0,1); - for (int i = 0; i < 256; i++) + strcpy(name + strlen(name) - 3, "VHD"); + sprintf(mainpath, "%s/%s", get_rbf_dir(), name); + if (!get_rbf_dir()[0] || !user_io_file_mount(mainpath)) { - sprintf(mainpath, "%s/boot%s.e%02X", user_io_get_core_name(), model, i); - user_io_file_tx(mainpath, 0x40 * (m + 1),0,1); + user_io_file_mount(name); } } } - - // check if vhd present - sprintf(mainpath, "%s/boot.vhd", user_io_get_core_name()); - user_io_set_index(0); - if (!user_io_file_mount(mainpath)) - { - strcpy(name + strlen(name) - 3, "VHD"); - sprintf(mainpath, "%s/%s", get_rbf_dir(), name); - if (!get_rbf_dir()[0] || !user_io_file_mount(mainpath)) - { - user_io_file_mount(name); - } - } } }