Added option to specify which file LOAD"*" will actually load.

This commit is contained in:
Stephen White 2018-05-30 20:38:14 +10:00
parent d970e0ec73
commit 746c9efb1d
5 changed files with 28 additions and 0 deletions

View file

@ -232,6 +232,7 @@ IEC_Commands::IEC_Commands()
deviceID = 8;
usingVIC20 = false;
Reset();
starFileName = 0;
}
void IEC_Commands::Reset(void)
@ -1810,6 +1811,20 @@ void IEC_Commands::OpenFile()
text = ParseNextName(text, filemode, true);
}
if (starFileName && starFileName[0] != 0 && filename[0] == '*')
{
char cwd[1024];
if (f_getcwd(cwd, 1024) == FR_OK)
{
if (strcasecmp(cwd, "/1541") == 0)
{
DEBUG_LOG("use star %s\r\n", starFileName);
strncpy(filename, starFileName, sizeof(filename) - 1);
}
}
}
if (toupper(filetype[0]) == 'L')
{
//DEBUG_LOG("Rel file\r\n");

View file

@ -77,6 +77,7 @@ public:
const char* GetNameOfImageSelected() const { return selectedImageName; }
const FILINFO* GetImageSelected() const { return &filInfoSelectedImage; }
void SetStarFileName(const char* fileName) { starFileName = fileName; }
protected:
enum ATNSequence
{
@ -164,5 +165,7 @@ protected:
char selectedImageName[256];
FILINFO filInfoSelectedImage;
const char* starFileName;
};
#endif

View file

@ -1204,6 +1204,8 @@ extern "C"
f_chdir("/1541");
m_IEC_Commands.SetDeviceId(deviceID);
m_IEC_Commands.SetStarFileName(options.GetStarFileName());
SetVIAsDeviceID(deviceID);
pi1541.drive.SetVIA(&pi1541.VIA[1]);

View file

@ -137,6 +137,7 @@ Options::Options(void)
, screenHeight(768)
{
strcpy(ROMFontName, "chargen");
starFileName[0] = 0;
ROMName[0] = 0;
ROMNameSlot2[0] = 0;
ROMNameSlot3[0] = 0;
@ -257,6 +258,10 @@ void Options::Process(char* buffer)
{
strncpy(ROMFontName, pValue, 255);
}
else if ((strcasecmp(pOption, "StarFileName") == 0))
{
strncpy(starFileName, pValue, 255);
}
else if ((strcasecmp(pOption, "ROM") == 0) || (strcasecmp(pOption, "ROM1") == 0))
{
strncpy(ROMName, pValue, 255);

View file

@ -48,6 +48,7 @@ public:
unsigned int GetOnResetChangeToStartingFolder() const { return onResetChangeToStartingFolder; }
const char* GetRomFontName() const { return ROMFontName; }
const char* GetRomName(int index) const;
const char* GetStarFileName() const { return starFileName; }
unsigned int GetExtraRAM() const { return extraRAM; }
unsigned int GetRAMBOard() const { return enableRAMBOard; }
unsigned int GetDisableSD2IECCommands() const { return disableSD2IECCommands; }
@ -86,6 +87,8 @@ private:
unsigned int screenWidth;
unsigned int screenHeight;
char starFileName[256];
char ROMFontName[256];
char ROMName[256];
char ROMNameSlot2[256];