diff --git a/source/CMakeLists.txt b/source/CMakeLists.txt
index 32076372..5078ad27 100644
--- a/source/CMakeLists.txt
+++ b/source/CMakeLists.txt
@@ -35,6 +35,7 @@ add_library(appleii SHARED
linux/windows/stringcb.cpp
linux/windows/strings.cpp
linux/windows/misc.cpp
+ linux/windows/winbase.cpp
linux/data.cpp
linux/dummies.cpp
diff --git a/source/frontends/qapple/qapple.qrc b/source/frontends/qapple/qapple.qrc
index 41662278..3bee32e9 100644
--- a/source/frontends/qapple/qapple.qrc
+++ b/source/frontends/qapple/qapple.qrc
@@ -9,6 +9,7 @@
resources/CHARSET8C.bmp
resources/ApplewinLogo.bmp
resources/DISK2.rom
+ resources/DISK2-13sector.rom
resources/Hddrvr.bin
resources/Parallel.rom
resources/MouseInterface.rom
diff --git a/source/frontends/qapple/resources/DISK2-13sector.rom b/source/frontends/qapple/resources/DISK2-13sector.rom
new file mode 100644
index 00000000..3588f88e
Binary files /dev/null and b/source/frontends/qapple/resources/DISK2-13sector.rom differ
diff --git a/source/linux/duplicates/Applewin.cpp b/source/linux/duplicates/Applewin.cpp
index 5e2d564b..d5d1acbf 100644
--- a/source/linux/duplicates/Applewin.cpp
+++ b/source/linux/duplicates/Applewin.cpp
@@ -4,6 +4,9 @@
#include "Common.h"
#include "CPU.h"
+static const UINT VERSIONSTRING_SIZE = 16;
+TCHAR VERSIONSTRING[VERSIONSTRING_SIZE] = "xx.yy.zz.ww";
+
static bool bLogKeyReadDone = false;
static DWORD dwLogKeyReadTickStart;
diff --git a/source/linux/win.h b/source/linux/win.h
index 47776fd8..52c5be47 100644
--- a/source/linux/win.h
+++ b/source/linux/win.h
@@ -12,3 +12,4 @@
#include "linux/windows/stringcb.h"
#include "linux/windows/strings.h"
#include "linux/windows/gdi.h"
+#include "linux/windows/winbase.h"
diff --git a/source/linux/windows/files.cpp b/source/linux/windows/files.cpp
index 27e35a1a..edd69154 100644
--- a/source/linux/windows/files.cpp
+++ b/source/linux/windows/files.cpp
@@ -26,8 +26,15 @@ DWORD SetFilePointer(HANDLE hFile, LONG lDistanceToMove,
{
const FILE_HANDLE & file_handle = dynamic_cast(*hFile);
- fseek(file_handle.f, lDistanceToMove, dwMoveMethod);
- return ftell(file_handle.f);
+ const int res = fseek(file_handle.f, lDistanceToMove, dwMoveMethod);
+ if (res)
+ {
+ return INVALID_SET_FILE_POINTER;
+ }
+ else
+ {
+ return ftell(file_handle.f);
+ }
}
BOOL ReadFile(HANDLE hFile, LPVOID lpBuffer, DWORD nNumberOfBytesToRead,
diff --git a/source/linux/windows/files.h b/source/linux/windows/files.h
index 08fde108..58d6911c 100644
--- a/source/linux/windows/files.h
+++ b/source/linux/windows/files.h
@@ -4,6 +4,7 @@
#include "linux/windows/handles.h"
#define INVALID_FILE_ATTRIBUTES (~0u)
+#define INVALID_SET_FILE_POINTER (~0u)
typedef struct tagOFN {
DWORD lStructSize;
diff --git a/source/linux/windows/resources.cpp b/source/linux/windows/resources.cpp
index 5007c0ab..f0f7b43e 100644
--- a/source/linux/windows/resources.cpp
+++ b/source/linux/windows/resources.cpp
@@ -5,7 +5,7 @@
// forward declared
HRSRC FindResource(void *, const std::string & filename, const char *);
-std::string MAKEINTRESOURCE(int x)
+const char * MAKEINTRESOURCE(int x)
{
switch (x)
{
@@ -18,7 +18,8 @@ std::string MAKEINTRESOURCE(int x)
case IDR_PRAVETS_8M_ROM: return "PRAVETS8M.ROM";
case IDR_TK3000_2E_ROM: return "TK3000e.rom";
- case IDR_DISK2_FW: return "DISK2.rom";
+ case IDR_DISK2_16SECTOR_FW: return "DISK2.rom";
+ case IDR_DISK2_13SECTOR_FW: return "DISK2-13sector.rom";
case IDR_SSC_FW: return "SSC.rom";
case IDR_HDDRVR_FW: return "Hddrvr.bin";
case IDR_PRINTDRVR_FW: return "Parallel.rom";
@@ -29,7 +30,7 @@ std::string MAKEINTRESOURCE(int x)
}
LogFileOutput("Unknown resource %d\n", x);
- return std::string();
+ return nullptr;
}
DWORD SizeofResource(void *, const HRSRC & res)
diff --git a/source/linux/windows/resources.h b/source/linux/windows/resources.h
index b8a9113b..9d37c5fc 100644
--- a/source/linux/windows/resources.h
+++ b/source/linux/windows/resources.h
@@ -18,7 +18,7 @@ struct HRSRC : public CHANDLE
}
};
-std::string MAKEINTRESOURCE(int x);
+const char * MAKEINTRESOURCE(int x);
HRSRC FindResource(void *, const std::string & filename, const char *);
DWORD SizeofResource(void *, const HRSRC &);
HGLOBAL LoadResource(void *, HRSRC &);
diff --git a/source/linux/windows/winbase.cpp b/source/linux/windows/winbase.cpp
new file mode 100644
index 00000000..eac0863b
--- /dev/null
+++ b/source/linux/windows/winbase.cpp
@@ -0,0 +1,8 @@
+#include "linux/windows/winbase.h"
+
+#include
+
+DWORD WINAPI GetLastError(void)
+{
+ return errno;
+}
diff --git a/source/linux/windows/winbase.h b/source/linux/windows/winbase.h
new file mode 100644
index 00000000..9f21526d
--- /dev/null
+++ b/source/linux/windows/winbase.h
@@ -0,0 +1,5 @@
+#pragma once
+
+#include "linux/windows/wincompat.h"
+
+DWORD WINAPI GetLastError(void);