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

Subversion Repositories w11

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

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 20 wfjm
// $Id: Rw11UnitDisk.hpp 509 2013-04-21 20:46:20Z mueller $
2
//
3
// Copyright 2013- by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
4
//
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
// 2013-04-19   507   1.0    Initial version
17
// 2013-02-19   490   0.1    First draft
18
// ---------------------------------------------------------------------------
19
 
20
 
21
/*!
22
  \file
23
  \version $Id: Rw11UnitDisk.hpp 509 2013-04-21 20:46:20Z mueller $
24
  \brief   Declaration of class Rw11UnitDisk.
25
*/
26
 
27
#ifndef included_Retro_Rw11UnitDisk
28
#define included_Retro_Rw11UnitDisk 1
29
 
30
#include "Rw11VirtDisk.hpp"
31
 
32
#include "Rw11UnitVirt.hpp"
33
 
34
namespace Retro {
35
 
36
  class Rw11UnitDisk : public Rw11UnitVirt<Rw11VirtDisk> {
37
    public:
38
                    Rw11UnitDisk(Rw11Cntl* pcntl, size_t index);
39
                   ~Rw11UnitDisk();
40
 
41
      virtual void  SetType(const std::string& type);
42
 
43
      const std::string& Type() const;
44
      size_t        NCylinder() const;
45
      size_t        NHead() const;
46
      size_t        NSector() const;
47
      size_t        BlockSize() const;
48
      size_t        NBlock() const;
49
 
50
      uint32_t      Chs2Lba(uint16_t cy, uint16_t hd, uint16_t se);
51
      void          Lba2Chs(uint32_t lba, uint16_t& cy, uint16_t& hd,
52
                            uint16_t& se);
53
 
54
      void          SetWProt(bool wprot);
55
      bool          WProt() const;
56
 
57
      bool          VirtRead(size_t lba, size_t nblk, uint8_t* data,
58
                             RerrMsg& emsg);
59
      bool          VirtWrite(size_t lba, size_t nblk, const uint8_t* data,
60
                              RerrMsg& emsg);
61
 
62
      virtual void  Dump(std::ostream& os, int ind=0, const char* text=0) const;
63
 
64
    protected:
65
      std::string   fType;
66
      size_t        fNCyl;
67
      size_t        fNHead;
68
      size_t        fNSect;
69
      size_t        fBlksize;
70
      size_t        fNBlock;
71
      bool          fWProt;
72
  };
73
 
74
} // end namespace Retro
75
 
76
#include "Rw11UnitDisk.ipp"
77
 
78
#endif

powered by: WebSVN 2.1.0

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