1
0
mirror of https://github.com/jscrane/r65emu.git synced 2024-12-20 21:29:48 +00:00

minor fixes

This commit is contained in:
Stephen Crane 2018-11-16 12:35:07 +00:00
parent 5cceb03cc7
commit a43a529fe7

View File

@ -22,10 +22,15 @@ static Dir dir;
#define STORAGE defined(USE_SD) || defined(USE_SPIFFS) || defined(USE_FS)
#if defined(USE_FS)
static const char *programs;
#endif
bool sdtape::start(const char *programs)
{
#if defined(USE_FS)
dir = SPIFFS.openDir("/");
::programs = programs;
dir = SPIFFS.openDir(programs);
#elif defined(DISK)
dir = DISK.open(programs);
if (!dir)
@ -45,15 +50,14 @@ void sdtape::stop()
bool sdtape::more()
{
#if defined(STORAGE)
if (_pos >= _len) {
_pos = 0;
#if defined(STORAGE)
_len = file.read(_buf, sizeof(_buf));
#endif
if (_len == 0) // eof
return false;
}
#endif
return true;
}
@ -68,7 +72,7 @@ const char *sdtape::advance() {
file = dir.openFile("r");
break;
}
dir = SPIFFS.openDir("/");
dir = SPIFFS.openDir(programs);
}
strncpy(buf, dir.fileName().c_str(), sizeof(buf));
return buf;