From d04de1803645d147f09d6c27081482c122c12326 Mon Sep 17 00:00:00 2001 From: sorgelig Date: Thu, 15 Jun 2017 06:35:40 +0800 Subject: [PATCH] Minimig: Search for HDF and ROM files in Amiga dir first. --- config.c | 3 ++- menu.c | 28 ++++++++++------------------ user_io.c | 3 ++- 3 files changed, 14 insertions(+), 20 deletions(-) diff --git a/config.c b/config.c index 0dade62..0e8eb84 100644 --- a/config.c +++ b/config.c @@ -152,7 +152,8 @@ char UploadKickstart(char *name) char UploadActionReplay() { fileTYPE file; - if (FileOpen(&file, "HRTMON.ROM")) { + if(FileOpen(&file, "Amiga/HRTMON.ROM") || FileOpen(&file, "HRTMON.ROM")) + { int adr, data; puts("Uploading HRTmon ROM... "); SendFileV2(&file, NULL, 0, 0xa10000, (file.size + 511) >> 9); diff --git a/menu.c b/menu.c index d860dbc..1ea6a71 100644 --- a/menu.c +++ b/menu.c @@ -259,9 +259,9 @@ static void SelectFile(char* pFileExt, unsigned char Options, unsigned char Menu { // if different from the current one go to the root directory and init entry buffer SelectedPath[0] = 0; - // for 8 bit cores try to - if ((user_io_core_type() == CORE_TYPE_8BIT) && chdir) { - strcpy(SelectedPath, user_io_get_core_name()); + if(((user_io_core_type() == CORE_TYPE_8BIT) || (user_io_core_type() == CORE_TYPE_MINIMIG2)) && chdir) + { + strcpy(SelectedPath, (user_io_core_type() == CORE_TYPE_MINIMIG2) ? "Amiga" : user_io_get_core_name()); ScanDirectory(SelectedPath, SCAN_INIT, pFileExt, Options); if (!nDirEntries) { @@ -2129,7 +2129,7 @@ void HandleUI(void) else { df[menusub].status = 0; - SelectFile("ADF", SCAN_DIR, MENU_FILE_SELECTED, MENU_MAIN1, 0); + SelectFile("ADF", SCAN_DIR, MENU_FILE_SELECTED, MENU_MAIN1, 1); } } else if (menusub == 4) // Toggle floppy turbo @@ -2630,25 +2630,17 @@ void HandleUI(void) else if (menusub == 2) { config.memory = ((config.memory + 0x10) & 0x30) | (config.memory & ~0x30); - // if ((config.memory & 0x30) == 0x30) - // config.memory -= 0x30; - // if (!(config.disable_ar3 & 0x01)&&(config.memory & 0x20)) - // config.memory &= ~0x30; menustate = MENU_SETTINGS_MEMORY1; ConfigMemory(config.memory); } else if (menusub == 3) { - SelectFile("ROM", 0, MENU_ROMFILE_SELECTED, MENU_SETTINGS_MEMORY1, 0); + SelectFile("ROM", 0, MENU_ROMFILE_SELECTED, MENU_SETTINGS_MEMORY1, 1); } else if (menusub == 4) { config.memory ^= 0x40; ConfigMemory(config.memory); - //if (!(config.disable_ar3 & 0x01)||(config.memory & 0x20)) - // config.disable_ar3 |= 0x01; - //else - // config.disable_ar3 &= 0xFE; menustate = MENU_SETTINGS_MEMORY1; } else if (menusub == 5) @@ -2691,6 +2683,7 @@ void HandleUI(void) menumask = 0x21; // b00100001 - On/off & exit enabled by default... if (config.enable_ide) menumask |= 0x0a; // b00001010 - HD0 and HD1 type + OsdWrite(0, "", 0, 0); strcpy(s, " A600/A1200 IDE : "); strcat(s, config.enable_ide ? "on " : "off"); OsdWrite(1, s, menusub == 0, 0); @@ -2705,7 +2698,7 @@ void HandleUI(void) if (config.hardfile[0].present) { strcpy(s, " "); - strncpy(&s[14], config.hardfile[0].long_name, 15); + strncpy(&s[7], config.hardfile[0].long_name, 21); } else strcpy(s, " ** file not found **"); @@ -2724,7 +2717,7 @@ void HandleUI(void) OsdWrite(6, s, config.enable_ide ? (menusub == 3) : 0, config.enable_ide == 0); if (config.hardfile[1].present) { strcpy(s, " "); - strncpy(&s[14], config.hardfile[1].long_name, 15); + strncpy(&s[7], config.hardfile[1].long_name, 21); } else strcpy(s, " ** file not found **"); @@ -2737,7 +2730,6 @@ void HandleUI(void) OsdWrite(OsdGetSize() - 1, STD_EXIT, menusub == 5, 0); menustate = MENU_SETTINGS_HARDFILE2; - break; case MENU_SETTINGS_HARDFILE2: @@ -2766,7 +2758,7 @@ void HandleUI(void) } else if (menusub == 2) { - SelectFile("HDF", 0, MENU_HARDFILE_SELECTED, MENU_SETTINGS_HARDFILE1, 0); + SelectFile("HDF", 0, MENU_HARDFILE_SELECTED, MENU_SETTINGS_HARDFILE1, 1); } else if (menusub == 3) { @@ -2786,7 +2778,7 @@ void HandleUI(void) } else if (menusub == 4) { - SelectFile("HDF", 0, MENU_HARDFILE_SELECTED, MENU_SETTINGS_HARDFILE1, 0); + SelectFile("HDF", 0, MENU_HARDFILE_SELECTED, MENU_SETTINGS_HARDFILE1, 1); } else if (menusub == 5) // return to previous menu { diff --git a/user_io.c b/user_io.c index 73666cd..a3ae77d 100644 --- a/user_io.c +++ b/user_io.c @@ -564,7 +564,6 @@ void user_io_set_index(unsigned char index) void user_io_file_mount(char *name) { int writable = FileCanWrite(name); - printf("Mount %s as %s\n", name, writable ? "read-write" : "read-only"); int ret = FileOpenEx(&sd_image, name, writable ? (O_RDWR | O_SYNC) : O_RDONLY); if (!ret) @@ -574,6 +573,8 @@ void user_io_file_mount(char *name) return; } + printf("Mount %s as %s\n", name, writable ? "read-write" : "read-only"); + // send mounted image size first then notify about mounting EnableIO(); spi8(UIO_SET_SDINFO);