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 29

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

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

powered by: WebSVN 2.1.0

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