Skip to content

Commit 739f5d2

Browse files
committed
Updated dialog to switch file extension between adf and scp automatically
Updated no-click support Added extra diagnostic information Added FUNDING.yml
1 parent b334453 commit 739f5d2

File tree

7 files changed

+30
-0
lines changed

7 files changed

+30
-0
lines changed

.github/FUNDING.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
custom: ["https://paypal.me/RobSmithDev"]
Binary file not shown.
Binary file not shown.

ArduinoFloppyReader/ArduinoFloppyReaderWin/ArduinoFloppyReaderWinDlg.cpp

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -295,6 +295,7 @@ BEGIN_MESSAGE_MAP(CArduinoFloppyReaderWinDlg, CDialogEx)
295295
ON_BN_CLICKED(IDC_STARTSTOP2, &CArduinoFloppyReaderWinDlg::OnBnClickedStartstop2)
296296
ON_BN_CLICKED(IDC_STARTSTOP3, &CArduinoFloppyReaderWinDlg::OnBnClickedStartstop3)
297297
ON_MESSAGE(WM_DEVICECHANGE, &CArduinoFloppyReaderWinDlg::OnDevicechange)
298+
ON_CBN_SELCHANGE(IDC_DISKFORMAT, &CArduinoFloppyReaderWinDlg::OnCbnSelchangeDiskformat)
298299
END_MESSAGE_MAP()
299300

300301

@@ -827,3 +828,23 @@ afx_msg LRESULT CArduinoFloppyReaderWinDlg::OnDevicechange(WPARAM wParam, LPARAM
827828
setComPort(port);
828829
return 0;
829830
}
831+
832+
833+
void CArduinoFloppyReaderWinDlg::OnCbnSelchangeDiskformat()
834+
{
835+
// Correct the file extension
836+
bool isSCP = m_fileFormat.GetCurSel() == 1;
837+
CString filename;
838+
839+
m_outputADF.GetWindowText(filename);
840+
841+
int pos = filename.ReverseFind(_T('.'));
842+
if (pos > 0) {
843+
filename = filename.Left(pos);
844+
845+
if (isSCP) filename += _T(".scp"); else filename += _T(".adf");
846+
847+
m_outputADF.SetWindowText(filename);
848+
849+
}
850+
}

ArduinoFloppyReader/ArduinoFloppyReaderWin/ArduinoFloppyReaderWinDlg.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,4 +103,5 @@ class CArduinoFloppyReaderWinDlg : public CDialogEx
103103
afx_msg LRESULT OnDevicechange(WPARAM wParam, LPARAM lParam);
104104
public:
105105

106+
afx_msg void OnCbnSelchangeDiskformat();
106107
};

ArduinoFloppyReader/lib/ADFWriter.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -607,6 +607,7 @@ bool ADFWriter::runDiagnostics(const std::wstring& portName, std::function<void(
607607
// Ask the user for verification of the result
608608
if (!askQuestion(true,"Did the floppy disk start spinning, and did the drive LED switch on?")) {
609609
messageOutput(true, "Please check the drive has power and the following PINS on the Arduino: 5 and 11");
610+
messageOutput(true, "It's possible you may also need need to provide a seperate 5V power supply for this drive.");
610611
return false;
611612
}
612613

@@ -620,6 +621,7 @@ bool ADFWriter::runDiagnostics(const std::wstring& portName, std::function<void(
620621
}
621622
else {
622623
messageOutput(true, "Please check the following PINS on the Arduino: 7");
624+
messageOutput(true, "It's possible you may also need need to provide a seperate 5V power supply for this drive.");
623625
}
624626
return false;
625627
}
@@ -634,11 +636,13 @@ bool ADFWriter::runDiagnostics(const std::wstring& portName, std::function<void(
634636
r = m_device.selectTrack(70);
635637
if (r != DiagnosticResponse::drOK) {
636638
messageOutput(true, m_device.getLastErrorStr());
639+
messageOutput(true, "There is also a strong possability that you may also need need to provide a seperate 5V power supply for this drive.");
637640
return false;
638641
}
639642

640643
if (!askQuestion(true,"Could you hear the head moving quite a distance?")) {
641644
messageOutput(true, "As we successfully found track 0, please check the following PINS on the Arduino: 6, 7");
645+
messageOutput(true, "It's possible you may also need need to provide a seperate 5V power supply for this drive.");
642646
return false;
643647
}
644648

ArduinoFloppyReader/lib/ArduinoInterface.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -942,6 +942,8 @@ DiagnosticResponse ArduinoInterface::readRotation(RotationExtractor& extractor,
942942
unsigned int bits = 0;
943943
// Go!
944944
if (extractor.extractRotation(firstOutputBuffer, bits, maxOutputSize)) {
945+
m_diskInDrive = true;
946+
945947
if (!onRotation(&firstOutputBuffer, bits)) {
946948
// And if the callback says so we stop.
947949
abortReadStreaming();
@@ -955,6 +957,7 @@ DiagnosticResponse ArduinoInterface::readRotation(RotationExtractor& extractor,
955957
abortReadStreaming();
956958
noDataCounter = 0;
957959
timeout = true;
960+
m_diskInDrive = false; // probably no disk
958961
}
959962
}
960963
}

0 commit comments

Comments
 (0)