diff --git a/src/FileBrowser.cpp b/src/FileBrowser.cpp index 9c493e5..97efa63 100644 --- a/src/FileBrowser.cpp +++ b/src/FileBrowser.cpp @@ -902,7 +902,7 @@ void FileBrowser::UpdateInputFolders() char newFileName[64]; strncpy (newFileName, options.GetAutoBaseName(), 63); int num = folder.FindNextAutoName( newFileName ); - m_IEC_Commands.CreateD64(newFileName, "42"); + m_IEC_Commands.CreateD64(newFileName, "42", true); FolderChanged(); } else diff --git a/src/iec_commands.cpp b/src/iec_commands.cpp index a9b5ce7..0d70a2c 100644 --- a/src/iec_commands.cpp +++ b/src/iec_commands.cpp @@ -1103,23 +1103,12 @@ void IEC_Commands::New(void) if(!(strstr(filenameNew, ".d64") || strstr(filenameNew, ".D64"))) strcat(filenameNew, ".d64"); - int ret = CreateD64(filenameNew, ID); + int ret = CreateD64(filenameNew, ID, true); if (ret==0) - { updateAction = REFRESH; - - // Mount the new disk? Shoud we do this or let them do it manually? - if (f_stat(filenameNew, &filInfo) == FR_OK) - { - DIR dir; - Enter(dir, filInfo); - } - } else - { Error(ret); - } } } @@ -1884,7 +1873,7 @@ void IEC_Commands::CloseFile(u8 secondary) channel.Close(); } -int IEC_Commands::CreateD64(char* filenameNew, char* ID) +int IEC_Commands::CreateD64(char* filenameNew, char* ID, bool automount) { FILINFO filInfo; FRESULT res; @@ -1941,6 +1930,12 @@ int IEC_Commands::CreateD64(char* filenameNew, char* ID) } f_close(&fpOut); } + // Mount the new disk? Shoud we do this or let them do it manually? + if (automount && f_stat(filenameNew, &filInfo) == FR_OK) + { + DIR dir; + Enter(dir, filInfo); + } return(ERROR_00_OK); } else diff --git a/src/iec_commands.h b/src/iec_commands.h index 173d379..f9f0012 100644 --- a/src/iec_commands.h +++ b/src/iec_commands.h @@ -79,7 +79,7 @@ public: const FILINFO* GetImageSelected() const { return &filInfoSelectedImage; } void SetStarFileName(const char* fileName) { starFileName = fileName; } - int CreateD64(char* filenameNew, char* ID); + int CreateD64(char* filenameNew, char* ID, bool automount); protected: enum ATNSequence