From cd2aad11480c2c1ca7e708c961fbdbd96098a933 Mon Sep 17 00:00:00 2001 From: mpohoreski Date: Sat, 18 Dec 2010 20:58:29 +0000 Subject: [PATCH] Hard Drive LED ! --- AppleWin/source/Disk.h | 34 +++++++++++++---- AppleWin/source/DiskImage.h | 74 ++++++++++++++++++++++++++----------- 2 files changed, 79 insertions(+), 29 deletions(-) diff --git a/AppleWin/source/Disk.h b/AppleWin/source/Disk.h index 546cc82c..69b1b8ec 100644 --- a/AppleWin/source/Disk.h +++ b/AppleWin/source/Disk.h @@ -1,7 +1,32 @@ #pragma once +/* +AppleWin : An Apple //e emulator for Windows + +Copyright (C) 1994-1996, Michael O'Brien +Copyright (C) 1999-2001, Oliver Schmidt +Copyright (C) 2002-2005, Tom Charlesworth +Copyright (C) 2006-2010, Tom Charlesworth, Michael Pohoreski + +AppleWin is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +AppleWin is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with AppleWin; if not, write to the Free Software +Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + #include "DiskImage.h" +// Floppy Disk Drives + enum Drive_e { DRIVE_1 = 0, @@ -27,14 +52,7 @@ LPCTSTR DiskGetFullName(const int iDrive); LPCTSTR DiskGetFullDiskFilename(const int iDrive); LPCTSTR DiskGetBaseName(const int iDrive); -enum Disk_Status_e -{ - DISK_STATUS_OFF , - DISK_STATUS_READ , - DISK_STATUS_WRITE, - DISK_STATUS_PROT , - NUM_DISK_STATUS -}; +// returns Disk_Status_e void DiskGetLightStatus (int *pDisk1Status_,int *pDisk2Status_); ImageError_e DiskInsert(const int iDrive, LPCTSTR pszImageFilename, const bool bForceWriteProtected, const bool bCreateIfNecessary); diff --git a/AppleWin/source/DiskImage.h b/AppleWin/source/DiskImage.h index b08f683d..fd09f4bb 100644 --- a/AppleWin/source/DiskImage.h +++ b/AppleWin/source/DiskImage.h @@ -1,28 +1,60 @@ #pragma once -#define NIBBLES_PER_TRACK 0x1A00 -#define TRACK_DENIBBLIZED_SIZE (16 * 256) // #Sectors x Sector-size +/* +AppleWin : An Apple //e emulator for Windows -#define TRACKS_STANDARD 35 -#define TRACKS_EXTRA 5 // Allow up to a 40-track .dsk image (160KB) -#define TRACKS_MAX (TRACKS_STANDARD+TRACKS_EXTRA) +Copyright (C) 1994-1996, Michael O'Brien +Copyright (C) 1999-2001, Oliver Schmidt +Copyright (C) 2002-2005, Tom Charlesworth +Copyright (C) 2006-2010, Tom Charlesworth, Michael Pohoreski -enum ImageError_e -{ - eIMAGE_ERROR_NONE, - eIMAGE_ERROR_BAD_POINTER, - eIMAGE_ERROR_BAD_SIZE, - eIMAGE_ERROR_BAD_FILE, - eIMAGE_ERROR_UNSUPPORTED, - eIMAGE_ERROR_UNSUPPORTED_HDV, - eIMAGE_ERROR_GZ, - eIMAGE_ERROR_ZIP, - eIMAGE_ERROR_REJECTED_MULTI_ZIP, - eIMAGE_ERROR_UNSUPPORTED_MULTI_ZIP, - eIMAGE_ERROR_UNABLE_TO_OPEN, - eIMAGE_ERROR_UNABLE_TO_OPEN_GZ, - eIMAGE_ERROR_UNABLE_TO_OPEN_ZIP, -}; +AppleWin is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +AppleWin is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with AppleWin; if not, write to the Free Software +Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + + #define NIBBLES_PER_TRACK 0x1A00 + #define TRACK_DENIBBLIZED_SIZE (16 * 256) // #Sectors x Sector-size + + #define TRACKS_STANDARD 35 + #define TRACKS_EXTRA 5 // Allow up to a 40-track .dsk image (160KB) + #define TRACKS_MAX (TRACKS_STANDARD+TRACKS_EXTRA) + + enum Disk_Status_e + { + DISK_STATUS_OFF , + DISK_STATUS_READ , + DISK_STATUS_WRITE, + DISK_STATUS_PROT , + NUM_DISK_STATUS + }; + + enum ImageError_e + { + eIMAGE_ERROR_NONE, + eIMAGE_ERROR_BAD_POINTER, + eIMAGE_ERROR_BAD_SIZE, + eIMAGE_ERROR_BAD_FILE, + eIMAGE_ERROR_UNSUPPORTED, + eIMAGE_ERROR_UNSUPPORTED_HDV, + eIMAGE_ERROR_GZ, + eIMAGE_ERROR_ZIP, + eIMAGE_ERROR_REJECTED_MULTI_ZIP, + eIMAGE_ERROR_UNSUPPORTED_MULTI_ZIP, + eIMAGE_ERROR_UNABLE_TO_OPEN, + eIMAGE_ERROR_UNABLE_TO_OPEN_GZ, + eIMAGE_ERROR_UNABLE_TO_OPEN_ZIP, + }; ImageError_e ImageOpen(LPCTSTR pszImageFilename, HIMAGE* hDiskImage_, bool* pWriteProtected_, const bool bCreateIfNecessary, std::string& strFilenameInZip); void ImageClose(const HIMAGE hDiskImage, const bool bOpenError=false);