Skip to content

Commit 5149150

Browse files
committed
Changes to be committed:
modified: ArduinoFloppyReader/ArduinoFloppyReader/ArduinoFloppyReader.vcxproj modified: ArduinoFloppyReader/ArduinoFloppyReader/Main.cpp modified: ArduinoFloppyReader/ArduinoFloppyReaderWin/ArduinoFloppyReaderWin.aps modified: ArduinoFloppyReader/ArduinoFloppyReaderWin/ArduinoFloppyReaderWin.rc modified: ArduinoFloppyReader/ArduinoFloppyReaderWin/ArduinoFloppyReaderWin.vcxproj modified: ArduinoFloppyReader/ArduinoFloppyReaderWin/ArduinoFloppyReaderWinDlg.cpp modified: ArduinoFloppyReader/lib/ADFWriter.cpp modified: ArduinoFloppyReader/lib/ADFWriter.h modified: ArduinoFloppyReader/lib/ArduinoInterface.cpp modified: ArduinoFloppyReader/lib/ArduinoInterface.h modified: readme.md
1 parent 8c4199f commit 5149150

File tree

11 files changed

+147
-134
lines changed

11 files changed

+147
-134
lines changed

ArduinoFloppyReader/ArduinoFloppyReader/ArduinoFloppyReader.vcxproj

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,20 +22,20 @@
2222
<ProjectGuid>{17585290-34DC-42A1-9747-37198CE4AD1A}</ProjectGuid>
2323
<Keyword>Win32Proj</Keyword>
2424
<RootNamespace>ArduinoFloppyReader</RootNamespace>
25-
<WindowsTargetPlatformVersion>10.0.19041.0</WindowsTargetPlatformVersion>
25+
<WindowsTargetPlatformVersion>10.0.18362.0</WindowsTargetPlatformVersion>
2626
<ProjectName>ArduinoFloppyReader</ProjectName>
2727
</PropertyGroup>
2828
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
2929
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
3030
<ConfigurationType>Application</ConfigurationType>
3131
<UseDebugLibraries>true</UseDebugLibraries>
32-
<PlatformToolset>v141</PlatformToolset>
32+
<PlatformToolset>v142</PlatformToolset>
3333
<CharacterSet>Unicode</CharacterSet>
3434
</PropertyGroup>
3535
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
3636
<ConfigurationType>Application</ConfigurationType>
3737
<UseDebugLibraries>false</UseDebugLibraries>
38-
<PlatformToolset>v141</PlatformToolset>
38+
<PlatformToolset>v142</PlatformToolset>
3939
<WholeProgramOptimization>true</WholeProgramOptimization>
4040
<CharacterSet>Unicode</CharacterSet>
4141
</PropertyGroup>
@@ -48,7 +48,7 @@
4848
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
4949
<ConfigurationType>Application</ConfigurationType>
5050
<UseDebugLibraries>false</UseDebugLibraries>
51-
<PlatformToolset>v141</PlatformToolset>
51+
<PlatformToolset>v142</PlatformToolset>
5252
<WholeProgramOptimization>true</WholeProgramOptimization>
5353
<CharacterSet>Unicode</CharacterSet>
5454
</PropertyGroup>
@@ -153,10 +153,14 @@
153153
<ClCompile Include="..\lib\ADFWriter.cpp">
154154
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">NotUsing</PrecompiledHeader>
155155
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">NotUsing</PrecompiledHeader>
156+
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">NotUsing</PrecompiledHeader>
157+
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'">NotUsing</PrecompiledHeader>
156158
</ClCompile>
157159
<ClCompile Include="..\lib\ArduinoInterface.cpp">
158160
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">NotUsing</PrecompiledHeader>
159161
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">NotUsing</PrecompiledHeader>
162+
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">NotUsing</PrecompiledHeader>
163+
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'">NotUsing</PrecompiledHeader>
160164
</ClCompile>
161165
<ClCompile Include="Main.cpp" />
162166
<ClCompile Include="stdafx.cpp">

ArduinoFloppyReader/ArduinoFloppyReader/Main.cpp

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/* ArduinoFloppyReader (and writer)
22
*
3-
* Copyright (C) 2017-2018 Robert Smith (@RobSmithDev)
3+
* Copyright (C) 2017-2020 Robert Smith (@RobSmithDev)
44
* http://amiga.robsmithdev.co.uk
55
*
66
* This program is free software; you can redistribute it and/or
@@ -55,13 +55,13 @@ void adf2Disk(wchar_t* argv[], bool verify) {
5555
});
5656

5757
switch (result) {
58-
case adfrComplete: printf("\rADF file written to disk "); break;
59-
case adfrCompletedWithErrors: printf("\rADF file written to disk but there were errors during verification "); break;
60-
case adfrAborted: printf("\rWriting ADF file to disk "); break;
61-
case adfrFileError: printf("\rError opening ADF file. "); break;
62-
case adfrDriveError: printf("\rError communicating with the Arduino interface. ");
63-
printf("\n%s ", writer.getLastError().c_str()); break;
64-
case adfrDiskWriteProtected: printf("\rError, disk is write protected! "); break;
58+
case ADFResult::adfrComplete: printf("\rADF file written to disk "); break;
59+
case ADFResult::adfrCompletedWithErrors: printf("\rADF file written to disk but there were errors during verification "); break;
60+
case ADFResult::adfrAborted: printf("\rWriting ADF file to disk "); break;
61+
case ADFResult::adfrFileError: printf("\rError opening ADF file. "); break;
62+
case ADFResult::adfrDriveError: printf("\rError communicating with the Arduino interface. ");
63+
printf("\n%s ", writer.getLastError().c_str()); break;
64+
case ADFResult::adfrDiskWriteProtected: printf("\rError, disk is write protected! "); break;
6565
}
6666
}
6767

@@ -87,13 +87,13 @@ void disk2ADF(wchar_t* argv[]) {
8787
});
8888

8989
switch (result) {
90-
case adfrComplete: printf("\rADF file created with valid checksums. "); break;
91-
case adfrAborted: printf("\rADF file aborted. "); break;
92-
case adfrFileError: printf("\rError creating ADF file. "); break;
93-
case adfrFileIOError: printf("\rError writing to ADF file. "); break;
94-
case adfrCompletedWithErrors: printf("\rADF file created with partial success. "); break;
95-
case adfrDriveError: printf("\rError communicating with the Arduino interface. ");
96-
printf("\n%s ", writer.getLastError().c_str()); break;
90+
case ADFResult::adfrComplete: printf("\rADF file created with valid checksums. "); break;
91+
case ADFResult::adfrAborted: printf("\rADF file aborted. "); break;
92+
case ADFResult::adfrFileError: printf("\rError creating ADF file. "); break;
93+
case ADFResult::adfrFileIOError: printf("\rError writing to ADF file. "); break;
94+
case ADFResult::adfrCompletedWithErrors: printf("\rADF file created with partial success. "); break;
95+
case ADFResult::adfrDriveError: printf("\rError communicating with the Arduino interface. ");
96+
printf("\n%s ", writer.getLastError().c_str()); break;
9797
}
9898
}
9999

Binary file not shown.
Binary file not shown.

ArduinoFloppyReader/ArduinoFloppyReaderWin/ArduinoFloppyReaderWin.vcxproj

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -21,39 +21,43 @@
2121
<PropertyGroup Label="Globals">
2222
<ProjectGuid>{37EEB775-8CC2-40F8-A3CD-40C955E11F0F}</ProjectGuid>
2323
<RootNamespace>ArduinoFloppyReaderWin</RootNamespace>
24-
<WindowsTargetPlatformVersion>10.0.19041.0</WindowsTargetPlatformVersion>
24+
<WindowsTargetPlatformVersion>10.0.18362.0</WindowsTargetPlatformVersion>
2525
<Keyword>MFCProj</Keyword>
2626
</PropertyGroup>
2727
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
2828
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
2929
<ConfigurationType>Application</ConfigurationType>
3030
<UseDebugLibraries>true</UseDebugLibraries>
31-
<PlatformToolset>v141</PlatformToolset>
31+
<PlatformToolset>v142</PlatformToolset>
3232
<CharacterSet>Unicode</CharacterSet>
3333
<UseOfMfc>Dynamic</UseOfMfc>
34+
<SpectreMitigation>false</SpectreMitigation>
3435
</PropertyGroup>
3536
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
3637
<ConfigurationType>Application</ConfigurationType>
3738
<UseDebugLibraries>false</UseDebugLibraries>
38-
<PlatformToolset>v141</PlatformToolset>
39+
<PlatformToolset>v142</PlatformToolset>
3940
<WholeProgramOptimization>true</WholeProgramOptimization>
4041
<CharacterSet>Unicode</CharacterSet>
4142
<UseOfMfc>Static</UseOfMfc>
43+
<SpectreMitigation>false</SpectreMitigation>
4244
</PropertyGroup>
4345
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
4446
<ConfigurationType>Application</ConfigurationType>
4547
<UseDebugLibraries>true</UseDebugLibraries>
4648
<PlatformToolset>v142</PlatformToolset>
4749
<CharacterSet>Unicode</CharacterSet>
48-
<UseOfMfc>Static</UseOfMfc>
50+
<UseOfMfc>Dynamic</UseOfMfc>
51+
<SpectreMitigation>false</SpectreMitigation>
4952
</PropertyGroup>
5053
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
5154
<ConfigurationType>Application</ConfigurationType>
5255
<UseDebugLibraries>false</UseDebugLibraries>
53-
<PlatformToolset>v141</PlatformToolset>
56+
<PlatformToolset>v142</PlatformToolset>
5457
<WholeProgramOptimization>true</WholeProgramOptimization>
5558
<CharacterSet>Unicode</CharacterSet>
5659
<UseOfMfc>Static</UseOfMfc>
60+
<SpectreMitigation>false</SpectreMitigation>
5761
</PropertyGroup>
5862
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
5963
<ImportGroup Label="ExtensionSettings">
@@ -90,7 +94,7 @@
9094
<PrecompiledHeader>Use</PrecompiledHeader>
9195
<WarningLevel>Level3</WarningLevel>
9296
<Optimization>Disabled</Optimization>
93-
<PreprocessorDefinitions>USING_MFC;WIN32;_WINDOWS;_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
97+
<PreprocessorDefinitions>USING_MFC;WIN32;_WINDOWS;_DEBUG;%(PreprocessorDefinitions);_WIN32_WINNT=0x0601</PreprocessorDefinitions>
9498
<SDLCheck>true</SDLCheck>
9599
</ClCompile>
96100
<Link>
@@ -113,7 +117,7 @@
113117
<PrecompiledHeader>Use</PrecompiledHeader>
114118
<WarningLevel>Level3</WarningLevel>
115119
<Optimization>Disabled</Optimization>
116-
<PreprocessorDefinitions>_WINDOWS;_DEBUG;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
120+
<PreprocessorDefinitions>_WINDOWS;_DEBUG;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions);_WIN32_WINNT=0x0601</PreprocessorDefinitions>
117121
<SDLCheck>true</SDLCheck>
118122
</ClCompile>
119123
<Link>
@@ -137,7 +141,7 @@
137141
<Optimization>MaxSpeed</Optimization>
138142
<FunctionLevelLinking>true</FunctionLevelLinking>
139143
<IntrinsicFunctions>true</IntrinsicFunctions>
140-
<PreprocessorDefinitions>USING_MFC;WIN32;_WINDOWS;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
144+
<PreprocessorDefinitions>USING_MFC;WIN32;_WINDOWS;NDEBUG;%(PreprocessorDefinitions);_WIN32_WINNT=0x0601</PreprocessorDefinitions>
141145
<SDLCheck>true</SDLCheck>
142146
</ClCompile>
143147
<Link>
@@ -164,7 +168,7 @@
164168
<Optimization>MaxSpeed</Optimization>
165169
<FunctionLevelLinking>true</FunctionLevelLinking>
166170
<IntrinsicFunctions>true</IntrinsicFunctions>
167-
<PreprocessorDefinitions>_WINDOWS;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
171+
<PreprocessorDefinitions>_WINDOWS;NDEBUG;%(PreprocessorDefinitions);_WIN32_WINNT=0x0601</PreprocessorDefinitions>
168172
<SDLCheck>true</SDLCheck>
169173
</ClCompile>
170174
<Link>
@@ -199,10 +203,14 @@
199203
<ClCompile Include="..\lib\ADFWriter.cpp">
200204
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">NotUsing</PrecompiledHeader>
201205
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">NotUsing</PrecompiledHeader>
206+
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">NotUsing</PrecompiledHeader>
207+
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'">NotUsing</PrecompiledHeader>
202208
</ClCompile>
203209
<ClCompile Include="..\lib\ArduinoInterface.cpp">
204210
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">NotUsing</PrecompiledHeader>
205211
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">NotUsing</PrecompiledHeader>
212+
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">NotUsing</PrecompiledHeader>
213+
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'">NotUsing</PrecompiledHeader>
206214
</ClCompile>
207215
<ClCompile Include="ArduinoFloppyReaderWin.cpp" />
208216
<ClCompile Include="ArduinoFloppyReaderWinDlg.cpp" />

ArduinoFloppyReader/ArduinoFloppyReaderWin/ArduinoFloppyReaderWinDlg.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/* ArduinoFloppyReaderWin
22
*
3-
* Copyright (C) 2017-2018 Robert Smith (@RobSmithDev)
3+
* Copyright (C) 2017-2020 Robert Smith (@RobSmithDev)
44
* http://amiga.robsmithdev.co.uk
55
*
66
* This program is free software; you can redistribute it and/or

ArduinoFloppyReader/lib/ADFWriter.cpp

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/* ArduinoFloppyReader (and writer)
22
*
3-
* Copyright (C) 2017-2018 Robert Smith (@RobSmithDev)
3+
* Copyright (C) 2017-2020 Robert Smith (@RobSmithDev)
44
* http://amiga.robsmithdev.co.uk
55
*
66
* This library is free software; you can redistribute it and/or
@@ -31,7 +31,6 @@
3131
// were taken from the excellent documentation by Laurent Clévy at http://lclevy.free.fr/adflib/adf_info.html
3232
// Also credits to Keith Monahan https://www.techtravels.org/tag/mfm/ regarding a bug in the MFM sector start data
3333

34-
#include "stdafx.h"
3534
#ifdef USING_MFC
3635
#include <afxwin.h>
3736
#else
@@ -920,7 +919,7 @@ ADFResult ADFWriter::ADFToDisk(const std::wstring inputFile, bool eraseFirst, bo
920919

921920
// Handle callback
922921
if (callback)
923-
if (callback(currentTrack, surface, false) == wrAbort) {
922+
if (callback(currentTrack, surface, false) == WriteResponse::wrAbort) {
924923
CloseHandle(hADFFile);
925924
return ADFResult::adfrAborted;
926925
}
@@ -939,7 +938,7 @@ ADFResult ADFWriter::ADFToDisk(const std::wstring inputFile, bool eraseFirst, bo
939938

940939
if (eraseFirst) {
941940
if (m_device.eraseCurrentTrack() != DiagnosticResponse::drOK)
942-
return adfrDriveError;
941+
return ADFResult::adfrDriveError;
943942
}
944943

945944
switch (m_device.writeCurrentTrack((const unsigned char*)(&disktrack), sizeof(disktrack), false)) {
@@ -992,10 +991,10 @@ ADFResult ADFWriter::ADFToDisk(const std::wstring inputFile, bool eraseFirst, bo
992991
bool breakOut = false;
993992

994993
switch (callback(currentTrack, surface, true)) {
995-
case wrAbort: CloseHandle(hADFFile);
994+
case WriteResponse::wrAbort: CloseHandle(hADFFile);
996995
return ADFResult::adfrAborted;
997-
case wrSkipBadChecksums: breakOut = true; errors = true; break;
998-
case wrContinue: break;
996+
case WriteResponse::wrSkipBadChecksums: breakOut = true; errors = true; break;
997+
case WriteResponse::wrContinue: break;
999998
}
1000999
if (breakOut) break;
10011000
failCount = 0;

ArduinoFloppyReader/lib/ADFWriter.h

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/* ArduinoFloppyReader (and writer)
22
*
3-
* Copyright (C) 2017-2018 Robert Smith (@RobSmithDev)
3+
* Copyright (C) 2017-2020 Robert Smith (@RobSmithDev)
44
* http://amiga.robsmithdev.co.uk
55
*
66
* This library is free software; you can redistribute it and/or
@@ -36,18 +36,17 @@
3636
#include "ArduinoInterface.h"
3737

3838

39-
4039
namespace ArduinoFloppyReader {
4140

4241
// Optional how to respond to the callback from the writeADF command.
43-
enum WriteResponse {
42+
enum class WriteResponse {
4443
wrContinue, // Continue working as normal
4544
wrAbort, // Abort thr process and stop
4645
wrSkipBadChecksums, // Request that the process ignores bad checksums (not recommended unless the retryCounter gets beyond RETRYS_PER_PHASE*16)
4746
wrRetry // Retry!
4847
};
4948

50-
enum ADFResult {
49+
enum class ADFResult {
5150
adfrComplete, // Process completed successfully
5251
adfrAborted, // Process was aborted
5352
adfrFileError, // Error opening the file to write to
@@ -57,7 +56,7 @@ namespace ArduinoFloppyReader {
5756
adfrDriveError // Something wrong with reading the disk
5857
};
5958

60-
enum AnalysisResult {
59+
enum class AnalysisResult {
6160
arComplete, // Anaysis is complete and ready for use
6261
arFailed, // Anaysis failed to read a disk
6362
arAborted, // Analysis was aborted

0 commit comments

Comments
 (0)