// $Id: Rw11UnitDisk.ipp 509 2013-04-21 20:46:20Z mueller $
|
// $Id: Rw11UnitDisk.ipp 509 2013-04-21 20:46:20Z mueller $
|
//
|
//
|
// Copyright 2013- by Walter F.J. Mueller
|
// Copyright 2013- by Walter F.J. Mueller
|
//
|
//
|
// This program is free software; you may redistribute and/or modify it under
|
// This program is free software; you may redistribute and/or modify it under
|
// the terms of the GNU General Public License as published by the Free
|
// the terms of the GNU General Public License as published by the Free
|
// Software Foundation, either version 2, or at your option any later version.
|
// Software Foundation, either version 2, or at your option any later version.
|
//
|
//
|
// This program is distributed in the hope that it will be useful, but
|
// This program is distributed in the hope that it will be useful, but
|
// WITHOUT ANY WARRANTY, without even the implied warranty of MERCHANTABILITY
|
// WITHOUT ANY WARRANTY, without even the implied warranty of MERCHANTABILITY
|
// or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
// or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
// for complete details.
|
// for complete details.
|
//
|
//
|
// Revision History:
|
// Revision History:
|
// Date Rev Version Comment
|
// Date Rev Version Comment
|
// 2013-04-19 507 1.0 Initial version
|
// 2013-04-19 507 1.0 Initial version
|
// 2013-02-19 490 0.1 First draft
|
// 2013-02-19 490 0.1 First draft
|
// ---------------------------------------------------------------------------
|
// ---------------------------------------------------------------------------
|
|
|
/*!
|
/*!
|
\file
|
\file
|
\version $Id: Rw11UnitDisk.ipp 509 2013-04-21 20:46:20Z mueller $
|
\version $Id: Rw11UnitDisk.ipp 509 2013-04-21 20:46:20Z mueller $
|
\brief Implemenation (inline) of Rw11UnitDisk.
|
\brief Implemenation (inline) of Rw11UnitDisk.
|
*/
|
*/
|
|
|
// all method definitions in namespace Retro
|
// all method definitions in namespace Retro
|
namespace Retro {
|
namespace Retro {
|
|
|
//------------------------------------------+-----------------------------------
|
//------------------------------------------+-----------------------------------
|
//! FIXME_docs
|
//! FIXME_docs
|
|
|
inline const std::string& Rw11UnitDisk::Type() const
|
inline const std::string& Rw11UnitDisk::Type() const
|
{
|
{
|
return fType;
|
return fType;
|
}
|
}
|
|
|
//------------------------------------------+-----------------------------------
|
//------------------------------------------+-----------------------------------
|
//! FIXME_docs
|
//! FIXME_docs
|
|
|
inline size_t Rw11UnitDisk::NCylinder() const
|
inline size_t Rw11UnitDisk::NCylinder() const
|
{
|
{
|
return fNCyl;
|
return fNCyl;
|
}
|
}
|
|
|
//------------------------------------------+-----------------------------------
|
//------------------------------------------+-----------------------------------
|
//! FIXME_docs
|
//! FIXME_docs
|
|
|
inline size_t Rw11UnitDisk::NHead() const
|
inline size_t Rw11UnitDisk::NHead() const
|
{
|
{
|
return fNHead;
|
return fNHead;
|
}
|
}
|
|
|
//------------------------------------------+-----------------------------------
|
//------------------------------------------+-----------------------------------
|
//! FIXME_docs
|
//! FIXME_docs
|
|
|
inline size_t Rw11UnitDisk::NSector() const
|
inline size_t Rw11UnitDisk::NSector() const
|
{
|
{
|
return fNSect;
|
return fNSect;
|
}
|
}
|
|
|
//------------------------------------------+-----------------------------------
|
//------------------------------------------+-----------------------------------
|
//! FIXME_docs
|
//! FIXME_docs
|
|
|
inline size_t Rw11UnitDisk::BlockSize() const
|
inline size_t Rw11UnitDisk::BlockSize() const
|
{
|
{
|
return fBlksize;
|
return fBlksize;
|
}
|
}
|
|
|
//------------------------------------------+-----------------------------------
|
//------------------------------------------+-----------------------------------
|
//! FIXME_docs
|
//! FIXME_docs
|
|
|
inline size_t Rw11UnitDisk::NBlock() const
|
inline size_t Rw11UnitDisk::NBlock() const
|
{
|
{
|
return fNBlock;
|
return fNBlock;
|
}
|
}
|
|
|
//------------------------------------------+-----------------------------------
|
//------------------------------------------+-----------------------------------
|
//! FIXME_docs
|
//! FIXME_docs
|
|
|
inline uint32_t Rw11UnitDisk::Chs2Lba(uint16_t cy, uint16_t hd, uint16_t se)
|
inline uint32_t Rw11UnitDisk::Chs2Lba(uint16_t cy, uint16_t hd, uint16_t se)
|
{
|
{
|
return se + fNSect * (hd + fNHead*cy);
|
return se + fNSect * (hd + fNHead*cy);
|
}
|
}
|
|
|
//------------------------------------------+-----------------------------------
|
//------------------------------------------+-----------------------------------
|
//! FIXME_docs
|
//! FIXME_docs
|
|
|
inline void Rw11UnitDisk::Lba2Chs(uint32_t lba, uint16_t& cy, uint16_t& hd,
|
inline void Rw11UnitDisk::Lba2Chs(uint32_t lba, uint16_t& cy, uint16_t& hd,
|
uint16_t& se)
|
uint16_t& se)
|
{
|
{
|
se = lba % fNSect;
|
se = lba % fNSect;
|
hd = (lba/fNSect) % fNHead;
|
hd = (lba/fNSect) % fNHead;
|
cy = lba / (fNSect*fNHead);
|
cy = lba / (fNSect*fNHead);
|
return;
|
return;
|
}
|
}
|
|
|
|
|
//------------------------------------------+-----------------------------------
|
//------------------------------------------+-----------------------------------
|
//! FIXME_docs
|
//! FIXME_docs
|
|
|
inline void Rw11UnitDisk::SetWProt(bool wprot)
|
inline void Rw11UnitDisk::SetWProt(bool wprot)
|
{
|
{
|
fWProt = wprot;
|
fWProt = wprot;
|
return;
|
return;
|
}
|
}
|
|
|
//------------------------------------------+-----------------------------------
|
//------------------------------------------+-----------------------------------
|
//! FIXME_docs
|
//! FIXME_docs
|
|
|
inline bool Rw11UnitDisk::WProt() const
|
inline bool Rw11UnitDisk::WProt() const
|
{
|
{
|
return fWProt;
|
return fWProt;
|
}
|
}
|
|
|
|
|
} // end namespace Retro
|
} // end namespace Retro
|
|
|