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

Subversion Repositories w11

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

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

Line No. Rev Author Line
1 30 wfjm
// $Id: Rw11UnitDisk.ipp 659 2015-03-22 23:15:51Z mueller $
2 20 wfjm
//
3 29 wfjm
// Copyright 2013-2015 by Walter F.J. Mueller 
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
  \file
24 30 wfjm
  \version $Id: Rw11UnitDisk.ipp 659 2015-03-22 23:15:51Z mueller $
25 20 wfjm
  \brief   Implemenation (inline) of Rw11UnitDisk.
26
*/
27
 
28
// all method definitions in namespace Retro
29
namespace Retro {
30
 
31
//------------------------------------------+-----------------------------------
32
//! FIXME_docs
33
 
34
inline const std::string& Rw11UnitDisk::Type() const
35
{
36
  return fType;
37
}
38
 
39
//------------------------------------------+-----------------------------------
40
//! FIXME_docs
41
 
42 30 wfjm
inline bool Rw11UnitDisk::Enabled() const
43
{
44
  return fEnabled;
45
}
46
 
47
//------------------------------------------+-----------------------------------
48
//! FIXME_docs
49
 
50 20 wfjm
inline size_t Rw11UnitDisk::NCylinder() const
51
{
52
  return fNCyl;
53
}
54
 
55
//------------------------------------------+-----------------------------------
56
//! FIXME_docs
57
 
58
inline size_t Rw11UnitDisk::NHead() const
59
{
60
  return fNHead;
61
}
62
 
63
//------------------------------------------+-----------------------------------
64
//! FIXME_docs
65
 
66
inline size_t Rw11UnitDisk::NSector() const
67
{
68
  return fNSect;
69
}
70
 
71
//------------------------------------------+-----------------------------------
72
//! FIXME_docs
73
 
74
inline size_t Rw11UnitDisk::BlockSize() const
75
{
76
  return fBlksize;
77
}
78
 
79
//------------------------------------------+-----------------------------------
80
//! FIXME_docs
81
 
82
inline size_t Rw11UnitDisk::NBlock() const
83
{
84
  return fNBlock;
85
}
86
 
87
//------------------------------------------+-----------------------------------
88
//! FIXME_docs
89
 
90
inline uint32_t Rw11UnitDisk::Chs2Lba(uint16_t cy, uint16_t hd, uint16_t se)
91
{
92
  return se + fNSect * (hd + fNHead*cy);
93
}
94
 
95
//------------------------------------------+-----------------------------------
96
//! FIXME_docs
97
 
98
inline void Rw11UnitDisk::Lba2Chs(uint32_t lba, uint16_t& cy, uint16_t& hd,
99
                                  uint16_t& se)
100
{
101
  se = lba % fNSect;
102
  hd = (lba/fNSect) % fNHead;
103
  cy = lba / (fNSect*fNHead);
104
  return;
105
}
106
 
107 29 wfjm
//------------------------------------------+-----------------------------------
108
//! FIXME_docs
109 20 wfjm
 
110 29 wfjm
inline uint32_t Rw11UnitDisk::Nwrd2Nblk(uint32_t nwrd)
111
{
112
  return (2*nwrd+BlockSize()-1) / BlockSize();
113
}
114
 
115 20 wfjm
//------------------------------------------+-----------------------------------
116
//! FIXME_docs
117
 
118
inline void Rw11UnitDisk::SetWProt(bool wprot)
119
{
120
  fWProt = wprot;
121
  return;
122
}
123
 
124
//------------------------------------------+-----------------------------------
125
//! FIXME_docs
126
 
127
inline bool Rw11UnitDisk::WProt() const
128
{
129
  return fWProt;
130
}
131
 
132
 
133
} // end namespace Retro

powered by: WebSVN 2.1.0

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