Implement mask for OSD file extensions. Send file extension to the core.

This commit is contained in:
sorgelig
2018-07-08 16:34:05 +08:00
parent 729b1f4b70
commit b5441b1d12
2 changed files with 16 additions and 9 deletions

View File

@@ -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;

View File

@@ -6,6 +6,7 @@
#include <fcntl.h>
#include <time.h>
#include <limits.h>
#include <ctype.h>
#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();