128BootSectorName = bootsect.128

This commit is contained in:
penfold42 2018-08-12 21:15:17 +10:00
parent be5b1a0312
commit a695cfbd89
5 changed files with 27 additions and 2 deletions

View File

@ -238,6 +238,7 @@ IEC_Commands::IEC_Commands()
autoBootFB128 = false; autoBootFB128 = false;
Reset(); Reset();
starFileName = 0; starFileName = 0;
C128BootSectorName = 0;
} }
void IEC_Commands::Reset(void) void IEC_Commands::Reset(void)
@ -1775,6 +1776,16 @@ void IEC_Commands::OpenFile()
channel.buffer[index++] = '8'; channel.buffer[index++] = '8';
channel.buffer[index++] = '\"'; channel.buffer[index++] = '\"';
} }
if (C128BootSectorName)
{
//blah
FIL fpBS;
u32 bytes;
if (FR_OK == f_open(&fpBS, C128BootSectorName, FA_READ))
f_read(&fpBS, channel.buffer, 256, &bytes);
else
memset(channel.buffer, 0, 256);
}
if (SendBuffer(channel, true)) if (SendBuffer(channel, true))
return; return;

View File

@ -72,6 +72,13 @@ public:
u8 GetDeviceId() { return deviceID; } u8 GetDeviceId() { return deviceID; }
void SetAutoBootFB128(bool autoBootFB128) { this->autoBootFB128 = autoBootFB128; } void SetAutoBootFB128(bool autoBootFB128) { this->autoBootFB128 = autoBootFB128; }
void Set128BootSectorName(const char* SectorName)
{
if (SectorName && SectorName[0])
this->C128BootSectorName = SectorName;
else
this->C128BootSectorName = 0;
}
void Reset(void); void Reset(void);
void SimulateIECBegin(void); void SimulateIECBegin(void);
@ -174,6 +181,7 @@ protected:
FILINFO filInfoSelectedImage; FILINFO filInfoSelectedImage;
const char* starFileName; const char* starFileName;
const char* C128BootSectorName;
}; };
#endif #endif

View File

@ -686,6 +686,7 @@ void emulator()
pi1541.Initialise(); pi1541.Initialise();
m_IEC_Commands.SetAutoBootFB128(options.AutoBootFB128()); m_IEC_Commands.SetAutoBootFB128(options.AutoBootFB128());
m_IEC_Commands.Set128BootSectorName(options.Get128BootSectorName());
emulating = false; emulating = false;

View File

@ -154,6 +154,7 @@ Options::Options(void)
strcpy(ROMFontName, "chargen"); strcpy(ROMFontName, "chargen");
strcpy(LcdLogoName, "1541ii"); strcpy(LcdLogoName, "1541ii");
strcpy(autoBaseName, "autoname"); strcpy(autoBaseName, "autoname");
C128BootSectorName[0] = 0;
starFileName[0] = 0; starFileName[0] = 0;
ROMName[0] = 0; ROMName[0] = 0;
ROMNameSlot2[0] = 0; ROMNameSlot2[0] = 0;
@ -231,6 +232,10 @@ void Options::Process(char* buffer)
{ {
strncpy(autoBaseName, pValue, 255); strncpy(autoBaseName, pValue, 255);
} }
else if ((strcasecmp(pOption, "128BootSectorName") == 0))
{
strncpy(C128BootSectorName, pValue, 255);
}
else if ((strcasecmp(pOption, "StarFileName") == 0)) else if ((strcasecmp(pOption, "StarFileName") == 0))
{ {
strncpy(starFileName, pValue, 255); strncpy(starFileName, pValue, 255);
@ -248,7 +253,6 @@ void Options::Process(char* buffer)
i2cLcdModel = LCD_1306_128x32; i2cLcdModel = LCD_1306_128x32;
else if (strcasecmp(pValue, "sh1106_128x64") == 0) else if (strcasecmp(pValue, "sh1106_128x64") == 0)
i2cLcdModel = LCD_1106_128x64; i2cLcdModel = LCD_1106_128x64;
} }
else if ((strcasecmp(pOption, "ROM") == 0) || (strcasecmp(pOption, "ROM1") == 0)) else if ((strcasecmp(pOption, "ROM") == 0) || (strcasecmp(pOption, "ROM1") == 0))
{ {

View File

@ -70,6 +70,7 @@ public:
inline unsigned int IgnoreReset() const { return ignoreReset; } inline unsigned int IgnoreReset() const { return ignoreReset; }
inline unsigned int AutoBootFB128() const { return autoBootFB128; } inline unsigned int AutoBootFB128() const { return autoBootFB128; }
inline const char* Get128BootSectorName() const { return C128BootSectorName; }
inline unsigned int ScreenWidth() const { return screenWidth; } inline unsigned int ScreenWidth() const { return screenWidth; }
inline unsigned int ScreenHeight() const { return screenHeight; } inline unsigned int ScreenHeight() const { return screenHeight; }
@ -128,7 +129,6 @@ private:
unsigned int i2cLcdOnContrast; unsigned int i2cLcdOnContrast;
unsigned int i2cLcdDimContrast; unsigned int i2cLcdDimContrast;
unsigned int i2cLcdDimTime; unsigned int i2cLcdDimTime;
// unsigned int i2cLcdModel;
LCD_MODEL i2cLcdModel = LCD_UNKNOWN; LCD_MODEL i2cLcdModel = LCD_UNKNOWN;
float scrollHighlightRate; float scrollHighlightRate;
@ -136,6 +136,7 @@ private:
unsigned int keyboardBrowseLCDScreen; unsigned int keyboardBrowseLCDScreen;
char starFileName[256]; char starFileName[256];
char C128BootSectorName[256];
char autoBaseName[256]; char autoBaseName[256];
char LCDName[256]; char LCDName[256];
char LcdLogoName[256]; char LcdLogoName[256];