From 95ba7bd5199df1e470af2c115211740fc2df5aa3 Mon Sep 17 00:00:00 2001 From: tomch Date: Sun, 17 Jul 2011 20:34:42 +0000 Subject: [PATCH] 1.20.1: Fix bug 018242: . Preserve drive's physical attributes (track, phase) when changing disk. (Fix for Platoon) --- AppleWin/docs/History.txt | 6 ++++++ AppleWin/resource/Applewin.rc | 8 ++++---- AppleWin/source/Disk.cpp | 10 +++++++++- 3 files changed, 19 insertions(+), 5 deletions(-) diff --git a/AppleWin/docs/History.txt b/AppleWin/docs/History.txt index 1bc9e608..d6d976ed 100644 --- a/AppleWin/docs/History.txt +++ b/AppleWin/docs/History.txt @@ -19,6 +19,12 @@ Restrictions/bugs: - For an original Apple //e, 80-column (PR#3) and INVERSE, it still appears to be mousetext character, but it should be inverted upper-case from $40 to $5F. +1.20.1 - 17 Jul 2011 +-------------------- +Fixes: +. [Bug #018242] Preserve drive's physical attributes (track, phase) when changing disk. (Fix for Platoon) + + 1.20.0 - 23 Feb 2011 -------------------- Changes: diff --git a/AppleWin/resource/Applewin.rc b/AppleWin/resource/Applewin.rc index c04438c8..d056fe9e 100644 --- a/AppleWin/resource/Applewin.rc +++ b/AppleWin/resource/Applewin.rc @@ -253,8 +253,8 @@ DISK_ICON ICON "DISK.ICO" // VS_VERSION_INFO VERSIONINFO - FILEVERSION 1,20,0,0 - PRODUCTVERSION 1,20,0,0 + FILEVERSION 1,20,1,0 + PRODUCTVERSION 1,20,1,0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -272,12 +272,12 @@ BEGIN VALUE "Comments", "http://applewin.berlios.de" VALUE "CompanyName", "AppleWin" VALUE "FileDescription", "Apple //e Emulator for Windows" - VALUE "FileVersion", "1, 20, 0, 0" + VALUE "FileVersion", "1, 20, 1, 0" VALUE "InternalName", "APPLEWIN" VALUE "LegalCopyright", " 1994-2011 Michael O'Brien, Oliver Schmidt, Tom Charlesworth, Michael Pohoreski, Nick Westgate, Linards Ticmanis" VALUE "OriginalFilename", "APPLEWIN.EXE" VALUE "ProductName", "Apple //e Emulator" - VALUE "ProductVersion", "1, 20, 0, 0" + VALUE "ProductVersion", "1, 20, 1, 0" END END BLOCK "VarFileInfo" diff --git a/AppleWin/source/Disk.cpp b/AppleWin/source/Disk.cpp index 93e6bd4c..fa90df14 100644 --- a/AppleWin/source/Disk.cpp +++ b/AppleWin/source/Disk.cpp @@ -514,7 +514,15 @@ ImageError_e DiskInsert(const int iDrive, LPCTSTR pszImageFilename, const bool b if (fptr->imagehandle) RemoveDisk(iDrive); - ZeroMemory(fptr,sizeof(Disk_t )); + // Reset the drive's struct, but preserve the physical attributes (bug#18242: Platoon) + // . Changing the disk (in the drive) doesn't affect the drive's head etc. + { + int track = fptr->track; + int phase = fptr->phase; + ZeroMemory(fptr, sizeof(Disk_t)); + fptr->track = track; + fptr->phase = phase; + } const DWORD dwAttributes = GetFileAttributes(pszImageFilename); if(dwAttributes == INVALID_FILE_ATTRIBUTES)