diff --git a/file_io.cpp b/file_io.cpp index 82aa240..6c0105b 100644 --- a/file_io.cpp +++ b/file_io.cpp @@ -655,11 +655,17 @@ int ScanDirectory(char* path, int mode, const char *extension, int options, cons e[0] = '.'; e[4] = 0; int l = strlen(e); - if((len>l) && !strncasecmp(de->d_name + len - l, e, l)) + if (len > l) { + char *p = de->d_name + len - l; found = 1; - break; + for (int i = 0; i < l; i++) + { + if (e[i] == '?') continue; + if (tolower(e[i]) != tolower(p[i])) found = 0; + } } + if (found) break; if (strlen(ext) < 3) break; ext += 3; diff --git a/user_io.cpp b/user_io.cpp index 0bfdb48..52cee8a 100644 --- a/user_io.cpp +++ b/user_io.cpp @@ -6,6 +6,7 @@ #include #include #include +#include #include "hardware.h" #include "osd.h" @@ -880,13 +881,13 @@ int user_io_file_tx(char* name, unsigned char index, char opensave) // set index byte (0=bios rom, 1-n=OSD entry index) user_io_set_index(index); - // send directory entry (for alpha amstrad core) - //EnableFpga(); - //spi8(UIO_FILE_INFO); - //spi_write((void*)(DirEntry + sort_table[iSelectedEntry]), sizeof(DIRENTRY)); - //DisableFpga(); - - // hexdump(DirEntry+sort_table[iSelectedEntry], sizeof(DIRENTRY), 0); + int len = strlen(f.name); + char *p = f.name + len - 4; + EnableFpga(); + spi8(UIO_FILE_INFO); + spi_w(toupper(p[0]) << 8 | toupper(p[1])); + spi_w(toupper(p[2]) << 8 | toupper(p[3])); + DisableFpga(); // prepare transmission of new file EnableFpga();