From 93990b0055a97ba3210c1764e6b98cfe0754a9c9 Mon Sep 17 00:00:00 2001 From: Andrea Odetti Date: Sat, 22 Feb 2020 19:00:42 +0000 Subject: [PATCH] Small changes to compile with latest version. Signed-off-by: Andrea Odetti --- source/CMakeLists.txt | 1 + source/frontends/qapple/qapple.qrc | 1 + .../frontends/qapple/resources/DISK2-13sector.rom | Bin 0 -> 256 bytes source/linux/duplicates/Applewin.cpp | 3 +++ source/linux/win.h | 1 + source/linux/windows/files.cpp | 11 +++++++++-- source/linux/windows/files.h | 1 + source/linux/windows/resources.cpp | 7 ++++--- source/linux/windows/resources.h | 2 +- source/linux/windows/winbase.cpp | 8 ++++++++ source/linux/windows/winbase.h | 5 +++++ 11 files changed, 34 insertions(+), 6 deletions(-) create mode 100644 source/frontends/qapple/resources/DISK2-13sector.rom create mode 100644 source/linux/windows/winbase.cpp create mode 100644 source/linux/windows/winbase.h 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 0000000000000000000000000000000000000000..3588f88e32831b4bf748d58748527a1fa473a930 GIT binary patch literal 256 zcmZ3auz+DDbE}O+#|#yl4`0=6Cj2;X^~2j!T{9UtE<96+_`ho}1EU8Q5VUHqT6w`^ zZ{LBvJqPx79oXA>U_rp%h66J+nYmcCSM6;)urf?x#h(s=*FfXcS2DD!wc1K>0M!co z_Pl!GJD72D)rHTmAgrw)I5j5R_gwoy{=&@#%q?1AQLR=RFs*9Sap9fDQQHgqHtbz6 ztHovy$dpJ1jwLo7AZNWp7MZAa;=+5Ff(yL~D;6>AWZ>|!JHzZ{HxuZwjcP!*v)TZa by?9`J;mI+r3-``2FkfKyVPy8v{r?{TM}2(l literal 0 HcmV?d00001 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);