ROLAND  0.70
Amstrad Emulator based on Caprice Source rewritten in C++.
drive.h
Go to the documentation of this file.
1 /***************************************************************************
2  * Copyright (C) 2005 by Fred Klaus *
3  * frednet@web.de *
4  * *
5  * This program is free software; you can redistribute it and/or modify *
6  * it under the terms of the GNU General Public License as published by *
7  * the Free Software Foundation; either version 2 of the License, or *
8  * (at your option) any later version. *
9  * *
10  * This program is distributed in the hope that it will be useful, *
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
13  * GNU General Public License for more details. *
14  * *
15  * You should have received a copy of the GNU General Public License *
16  * along with this program; if not, write to the *
17  * Free Software Foundation, Inc., *
18  * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
19  ***************************************************************************/
20 #ifndef CPC_DISKDRIVE_H
21 #define CPC_DISKDRIVE_H
22 
23 #include "track.h"
24 #include "fdcconst.h"
25 
26 namespace cpcx
27 {
29  class Drive final
30  {
31  public:
32  Drive();
34 
35  void init();
36 
38  uint tracks() {return mTracks;}
42  uint sides() {return mSides;}
43  uint flipped() {return mFlipped;}
45  Track & track(int trck, int sde) {return mTrack[trck][sde];}
46 
47  void setAltered(uint num) {mAltered=num;}
50  void setCurrentSide(uint num) {mCurrentSide=num;}
51  void setSides(uint num) {mSides=num;}
52  void setRandomDEs(uint num) {mRandomDEs=num;}
53  void setTracks(uint num) {mTracks=num;}
54 
55  private:
56  uint mTracks; // total number of tracks
57  uint mCurrentTrack; // location of drive head
58  uint mSides; // total number of sides
59  uint mCurrentSide; // side being accessed
60  uint mCurrentSector; // sector being accessed
61  uint mAltered; // has the image been modified?
62  uint mWriteProtected; // is the image write protected?
63  uint mRandomDEs; // sectors with Data Errors return random data?
64  uint mFlipped; // reverse the side to access?
65  Track mTrack[DSK_TRACKMAX][DSK_SIDEMAX]; // array of track information structures
66 
67  };
68 } // namespace cpcx
69 #endif
uint mTracks
Definition: drive.h:56
uint mSides
Definition: drive.h:58
void init()
Definition: roland.cpp:97
void setCurrentSide(uint num)
Definition: drive.h:50
#define DSK_TRACKMAX
Definition: fdcconst.h:25
A floppy drive.
Definition: drive.h:29
Namespace for all CPC components.
Definition: colours.cpp:22
uint randomDEs()
Definition: drive.h:44
uint sides()
Definition: drive.h:42
void setCurrentSector(uint num)
Definition: drive.h:48
uint mCurrentSide
Definition: drive.h:59
uint currentSector()
Definition: drive.h:37
void setCurrentTrack(uint num)
Definition: drive.h:49
uint mRandomDEs
Definition: drive.h:63
uint mCurrentSector
Definition: drive.h:60
void setSides(uint num)
Definition: drive.h:51
void setAltered(uint num)
Definition: drive.h:47
void setRandomDEs(uint num)
Definition: drive.h:52
uint mAltered
Definition: drive.h:61
uint mWriteProtected
Definition: drive.h:62
Drive()
Definition: drive.cpp:24
void setTracks(uint num)
Definition: drive.h:53
A track of a disk.
Definition: track.h:32
Track & track(int trck, int sde)
Definition: drive.h:45
uint currentSide()
Definition: drive.h:41
uint tracks()
Definition: drive.h:38
uint writeProtected()
Definition: drive.h:39
Track mTrack[102][2]
Definition: drive.h:65
uint flipped()
Definition: drive.h:43
#define ROLAND_DEFAULT
Definition: compspec.h:46
unsigned int uint
Definition: types.h:121
~Drive() ROLAND_DEFAULT void init()
uint mFlipped
Definition: drive.h:64
uint currentTrack()
Definition: drive.h:40
#define DSK_SIDEMAX
Definition: fdcconst.h:26
uint mCurrentTrack
Definition: drive.h:57