From a695cfbd89878cee4e5f37df54c94ec3a97da688 Mon Sep 17 00:00:00 2001 From: penfold42 Date: Sun, 12 Aug 2018 21:15:17 +1000 Subject: [PATCH 1/3] 128BootSectorName = bootsect.128 --- src/iec_commands.cpp | 11 +++++++++++ src/iec_commands.h | 8 ++++++++ src/main.cpp | 1 + src/options.cpp | 6 +++++- src/options.h | 3 ++- 5 files changed, 27 insertions(+), 2 deletions(-) diff --git a/src/iec_commands.cpp b/src/iec_commands.cpp index 009acdd..4f3ecf1 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,16 @@ void IEC_Commands::OpenFile() channel.buffer[index++] = '8'; 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)) 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]; From 71e1267b4be490ea11c7acef3b7182d694b12855 Mon Sep 17 00:00:00 2001 From: penfold42 Date: Sun, 12 Aug 2018 21:50:29 +1000 Subject: [PATCH 2/3] Updated options.txt --- options.txt | 4 ++++ src/iec_commands.cpp | 1 - 2 files changed, 4 insertions(+), 1 deletion(-) 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/src/iec_commands.cpp b/src/iec_commands.cpp index 4f3ecf1..d737dcc 100644 --- a/src/iec_commands.cpp +++ b/src/iec_commands.cpp @@ -1778,7 +1778,6 @@ void IEC_Commands::OpenFile() } if (C128BootSectorName) { -//blah FIL fpBS; u32 bytes; if (FR_OK == f_open(&fpBS, C128BootSectorName, FA_READ)) From 2e06b4b1b7b146df235ffacd236151c1674d3b75 Mon Sep 17 00:00:00 2001 From: penfold42 Date: Sun, 12 Aug 2018 22:07:09 +1000 Subject: [PATCH 3/3] include modified bootcpm.128 to include a 2 second delay --- resources/3rdPartyFiles.txt | 5 +++++ resources/bootcpm.128 | Bin 0 -> 256 bytes 2 files changed, 5 insertions(+) create mode 100644 resources/3rdPartyFiles.txt create mode 100644 resources/bootcpm.128 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 0000000000000000000000000000000000000000..50aae0185ff48ca9dd88a34b98ed43ef1e305720 GIT binary patch literal 256 zcmZ>E@?`*nMf?l6eU`5G4{-G})UnVpG}TdZcCm5}@YQoMGf}c~_VEvPHM9!$adiza OwsP|K4}oYK>LdW34-QHI literal 0 HcmV?d00001