w11 - cpp 0.794
Backend server for Rlink and w11
Loading...
Searching...
No Matches
Rw11UnitDisk.ipp
Go to the documentation of this file.
1// $Id: Rw11UnitDisk.ipp 1186 2019-07-12 17:49:59Z mueller $
2// SPDX-License-Identifier: GPL-3.0-or-later
3// Copyright 2013-2015 by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
4//
5// Revision History:
6// Date Rev Version Comment
7// 2015-03-21 659 1.0.2 add fEnabled, Enabled()
8// 2015-02-18 647 1.0.1 add Nwrd2Nblk()
9// 2013-04-19 507 1.0 Initial version
10// 2013-02-19 490 0.1 First draft
11// ---------------------------------------------------------------------------
12
17// all method definitions in namespace Retro
18namespace Retro {
19
20//------------------------------------------+-----------------------------------
22
23inline const std::string& Rw11UnitDisk::Type() const
24{
25 return fType;
26}
27
28//------------------------------------------+-----------------------------------
30
31inline bool Rw11UnitDisk::Enabled() const
32{
33 return fEnabled;
34}
35
36//------------------------------------------+-----------------------------------
38
39inline size_t Rw11UnitDisk::NCylinder() const
40{
41 return fNCyl;
42}
43
44//------------------------------------------+-----------------------------------
46
47inline size_t Rw11UnitDisk::NHead() const
48{
49 return fNHead;
50}
51
52//------------------------------------------+-----------------------------------
54
55inline size_t Rw11UnitDisk::NSector() const
56{
57 return fNSect;
58}
59
60//------------------------------------------+-----------------------------------
62
63inline size_t Rw11UnitDisk::BlockSize() const
64{
65 return fBlksize;
66}
67
68//------------------------------------------+-----------------------------------
70
71inline size_t Rw11UnitDisk::NBlock() const
72{
73 return fNBlock;
74}
75
76//------------------------------------------+-----------------------------------
78
79inline uint32_t Rw11UnitDisk::Chs2Lba(uint16_t cy, uint16_t hd, uint16_t se)
80{
81 return se + fNSect * (hd + fNHead*cy);
82}
83
84//------------------------------------------+-----------------------------------
86
87inline void Rw11UnitDisk::Lba2Chs(uint32_t lba, uint16_t& cy, uint16_t& hd,
88 uint16_t& se)
89{
90 se = lba % fNSect;
91 hd = (lba/fNSect) % fNHead;
92 cy = lba / (fNSect*fNHead);
93 return;
94}
95
96//------------------------------------------+-----------------------------------
98
99inline uint32_t Rw11UnitDisk::Nwrd2Nblk(uint32_t nwrd)
100{
101 return (2*nwrd+BlockSize()-1) / BlockSize();
102}
103
104//------------------------------------------+-----------------------------------
106
107inline void Rw11UnitDisk::SetWProt(bool wprot)
108{
109 fWProt = wprot;
110 return;
111}
112
113//------------------------------------------+-----------------------------------
115
116inline bool Rw11UnitDisk::WProt() const
117{
118 return fWProt;
119}
120
121
122} // end namespace Retro
size_t fBlksize
block size (in bytes)
size_t NCylinder() const
FIXME_docs.
void SetWProt(bool wprot)
FIXME_docs.
bool fEnabled
unit enabled
std::string fType
drive type
bool WProt() const
FIXME_docs.
size_t NHead() const
FIXME_docs.
const std::string & Type() const
FIXME_docs.
uint32_t Chs2Lba(uint16_t cy, uint16_t hd, uint16_t se)
FIXME_docs.
size_t NBlock() const
FIXME_docs.
size_t NSector() const
FIXME_docs.
size_t BlockSize() const
FIXME_docs.
bool fWProt
unit write protected
virtual bool Enabled() const
FIXME_docs.
void Lba2Chs(uint32_t lba, uint16_t &cy, uint16_t &hd, uint16_t &se)
FIXME_docs.
uint32_t Nwrd2Nblk(uint32_t nwrd)
FIXME_docs.
Declaration of class ReventLoop.
Definition: ReventLoop.cpp:47