diff --git a/options.txt b/options.txt index 704af64..4534551 100644 --- a/options.txt +++ b/options.txt @@ -39,6 +39,10 @@ OnResetChangeToStartingFolder = 1 // If you are using a FB128 in 128 mode you can get FB128 to auto boot using this option //AutoBootFB128 = 1 +// If you are using a 128 you can auto boot anything using this option +// This over-rides AutoBootFB128 +//128BootSectorName = bootsect.128 + // If you would ever like to disable browse mode completely ypu can do so here //DisableSD2IECCommands = 1 diff --git a/resources/3rdPartyFiles.txt b/resources/3rdPartyFiles.txt new file mode 100644 index 0000000..05a5a0d --- /dev/null +++ b/resources/3rdPartyFiles.txt @@ -0,0 +1,5 @@ +buzbard's c128 bootsect.7z +http://www.lemon64.com/forum/viewtopic.php?t=54219 +modified by penfold42 to include a sleep for 2 secs while cpm.d64 loads +bootcpm.128 + diff --git a/resources/bootcpm.128 b/resources/bootcpm.128 new file mode 100644 index 0000000..50aae01 Binary files /dev/null and b/resources/bootcpm.128 differ diff --git a/src/iec_commands.cpp b/src/iec_commands.cpp index 009acdd..d737dcc 100644 --- a/src/iec_commands.cpp +++ b/src/iec_commands.cpp @@ -238,6 +238,7 @@ IEC_Commands::IEC_Commands() autoBootFB128 = false; Reset(); starFileName = 0; + C128BootSectorName = 0; } void IEC_Commands::Reset(void) @@ -1775,6 +1776,15 @@ void IEC_Commands::OpenFile() channel.buffer[index++] = '8'; channel.buffer[index++] = '\"'; } + if (C128BootSectorName) + { + 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)) return; diff --git a/src/iec_commands.h b/src/iec_commands.h index 7466f26..786fc24 100644 --- a/src/iec_commands.h +++ b/src/iec_commands.h @@ -72,6 +72,13 @@ public: u8 GetDeviceId() { return deviceID; } 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 SimulateIECBegin(void); @@ -174,6 +181,7 @@ protected: FILINFO filInfoSelectedImage; const char* starFileName; + const char* C128BootSectorName; }; #endif diff --git a/src/main.cpp b/src/main.cpp index 0fe07de..adc0eae 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -686,6 +686,7 @@ void emulator() pi1541.Initialise(); m_IEC_Commands.SetAutoBootFB128(options.AutoBootFB128()); + m_IEC_Commands.Set128BootSectorName(options.Get128BootSectorName()); emulating = false; diff --git a/src/options.cpp b/src/options.cpp index d3d70ce..6f30db7 100644 --- a/src/options.cpp +++ b/src/options.cpp @@ -154,6 +154,7 @@ Options::Options(void) strcpy(ROMFontName, "chargen"); strcpy(LcdLogoName, "1541ii"); strcpy(autoBaseName, "autoname"); + C128BootSectorName[0] = 0; starFileName[0] = 0; ROMName[0] = 0; ROMNameSlot2[0] = 0; @@ -231,6 +232,10 @@ void Options::Process(char* buffer) { strncpy(autoBaseName, pValue, 255); } + else if ((strcasecmp(pOption, "128BootSectorName") == 0)) + { + strncpy(C128BootSectorName, pValue, 255); + } else if ((strcasecmp(pOption, "StarFileName") == 0)) { strncpy(starFileName, pValue, 255); @@ -248,7 +253,6 @@ void Options::Process(char* buffer) i2cLcdModel = LCD_1306_128x32; else if (strcasecmp(pValue, "sh1106_128x64") == 0) i2cLcdModel = LCD_1106_128x64; - } else if ((strcasecmp(pOption, "ROM") == 0) || (strcasecmp(pOption, "ROM1") == 0)) { diff --git a/src/options.h b/src/options.h index 82be4b9..c860161 100644 --- a/src/options.h +++ b/src/options.h @@ -70,6 +70,7 @@ public: inline unsigned int IgnoreReset() const { return ignoreReset; } inline unsigned int AutoBootFB128() const { return autoBootFB128; } + inline const char* Get128BootSectorName() const { return C128BootSectorName; } inline unsigned int ScreenWidth() const { return screenWidth; } inline unsigned int ScreenHeight() const { return screenHeight; } @@ -128,7 +129,6 @@ private: unsigned int i2cLcdOnContrast; unsigned int i2cLcdDimContrast; unsigned int i2cLcdDimTime; -// unsigned int i2cLcdModel; LCD_MODEL i2cLcdModel = LCD_UNKNOWN; float scrollHighlightRate; @@ -136,6 +136,7 @@ private: unsigned int keyboardBrowseLCDScreen; char starFileName[256]; + char C128BootSectorName[256]; char autoBaseName[256]; char LCDName[256]; char LcdLogoName[256];