OpenCores
URL https://opencores.org/ocsvn/w11/w11/trunk

Subversion Repositories w11

[/] [w11/] [tags/] [w11a_V0.7/] [tools/] [src/] [librw11/] [Rw11UnitDisk.hpp] - Blame information for rev 33

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 30 wfjm
// $Id: Rw11UnitDisk.hpp 680 2015-05-14 13:29:46Z mueller $
2 20 wfjm
//
3 29 wfjm
// Copyright 2013-2015 by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
4 20 wfjm
//
5
// This program is free software; you may redistribute and/or modify it under
6
// the terms of the GNU General Public License as published by the Free
7
// Software Foundation, either version 2, or at your option any later version.
8
//
9
// This program is distributed in the hope that it will be useful, but
10
// WITHOUT ANY WARRANTY, without even the implied warranty of MERCHANTABILITY
11
// or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
12
// for complete details.
13
// 
14
// Revision History: 
15
// Date         Rev Version  Comment
16 30 wfjm
// 2015-03-21   659   1.0.2  add fEnabled, Enabled()
17 29 wfjm
// 2015-02-18   647   1.0.1  add Nwrd2Nblk()
18 20 wfjm
// 2013-04-19   507   1.0    Initial version
19
// 2013-02-19   490   0.1    First draft
20
// ---------------------------------------------------------------------------
21
 
22
 
23
/*!
24
  \file
25 30 wfjm
  \version $Id: Rw11UnitDisk.hpp 680 2015-05-14 13:29:46Z mueller $
26 20 wfjm
  \brief   Declaration of class Rw11UnitDisk.
27
*/
28
 
29
#ifndef included_Retro_Rw11UnitDisk
30
#define included_Retro_Rw11UnitDisk 1
31
 
32
#include "Rw11VirtDisk.hpp"
33
 
34
#include "Rw11UnitVirt.hpp"
35
 
36
namespace Retro {
37
 
38
  class Rw11UnitDisk : public Rw11UnitVirt<Rw11VirtDisk> {
39
    public:
40
                    Rw11UnitDisk(Rw11Cntl* pcntl, size_t index);
41
                   ~Rw11UnitDisk();
42
 
43
      virtual void  SetType(const std::string& type);
44
 
45
      const std::string& Type() const;
46 30 wfjm
      virtual bool  Enabled() const;
47 20 wfjm
      size_t        NCylinder() const;
48
      size_t        NHead() const;
49
      size_t        NSector() const;
50
      size_t        BlockSize() const;
51
      size_t        NBlock() const;
52
 
53
      uint32_t      Chs2Lba(uint16_t cy, uint16_t hd, uint16_t se);
54
      void          Lba2Chs(uint32_t lba, uint16_t& cy, uint16_t& hd,
55
                            uint16_t& se);
56 29 wfjm
      uint32_t      Nwrd2Nblk(uint32_t nwrd);
57 20 wfjm
 
58
      void          SetWProt(bool wprot);
59
      bool          WProt() const;
60
 
61
      bool          VirtRead(size_t lba, size_t nblk, uint8_t* data,
62
                             RerrMsg& emsg);
63
      bool          VirtWrite(size_t lba, size_t nblk, const uint8_t* data,
64
                              RerrMsg& emsg);
65
 
66
      virtual void  Dump(std::ostream& os, int ind=0, const char* text=0) const;
67
 
68
    protected:
69 30 wfjm
      std::string   fType;                  //!< drive type
70
      bool          fEnabled;               //!< unit enabled
71
      size_t        fNCyl;                  //!< # cylinder
72
      size_t        fNHead;                 //!< # heads (aka surfaces)
73
      size_t        fNSect;                 //!< # sectors
74
      size_t        fBlksize;               //!< block size (in bytes)
75
      size_t        fNBlock;                //!< # blocks
76
      bool          fWProt;                 //!< unit write protected
77 20 wfjm
  };
78
 
79
} // end namespace Retro
80
 
81
#include "Rw11UnitDisk.ipp"
82
 
83
#endif

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.