URL
https://opencores.org/ocsvn/w11/w11/trunk
Subversion Repositories w11
[/] [w11/] [tags/] [w11a_V0.6/] [tools/] [src/] [librw11/] [Rw11UnitDisk.ipp] - Rev 24
Compare with Previous | Blame | View Log
// $Id: Rw11UnitDisk.ipp 509 2013-04-21 20:46:20Z mueller $
//
// Copyright 2013- by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
//
// 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
// 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
// WITHOUT ANY WARRANTY, without even the implied warranty of MERCHANTABILITY
// or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
// for complete details.
//
// Revision History:
// Date Rev Version Comment
// 2013-04-19 507 1.0 Initial version
// 2013-02-19 490 0.1 First draft
// ---------------------------------------------------------------------------
/*!
\file
\version $Id: Rw11UnitDisk.ipp 509 2013-04-21 20:46:20Z mueller $
\brief Implemenation (inline) of Rw11UnitDisk.
*/
// all method definitions in namespace Retro
namespace Retro {
//------------------------------------------+-----------------------------------
//! FIXME_docs
inline const std::string& Rw11UnitDisk::Type() const
{
return fType;
}
//------------------------------------------+-----------------------------------
//! FIXME_docs
inline size_t Rw11UnitDisk::NCylinder() const
{
return fNCyl;
}
//------------------------------------------+-----------------------------------
//! FIXME_docs
inline size_t Rw11UnitDisk::NHead() const
{
return fNHead;
}
//------------------------------------------+-----------------------------------
//! FIXME_docs
inline size_t Rw11UnitDisk::NSector() const
{
return fNSect;
}
//------------------------------------------+-----------------------------------
//! FIXME_docs
inline size_t Rw11UnitDisk::BlockSize() const
{
return fBlksize;
}
//------------------------------------------+-----------------------------------
//! FIXME_docs
inline size_t Rw11UnitDisk::NBlock() const
{
return fNBlock;
}
//------------------------------------------+-----------------------------------
//! FIXME_docs
inline uint32_t Rw11UnitDisk::Chs2Lba(uint16_t cy, uint16_t hd, uint16_t se)
{
return se + fNSect * (hd + fNHead*cy);
}
//------------------------------------------+-----------------------------------
//! FIXME_docs
inline void Rw11UnitDisk::Lba2Chs(uint32_t lba, uint16_t& cy, uint16_t& hd,
uint16_t& se)
{
se = lba % fNSect;
hd = (lba/fNSect) % fNHead;
cy = lba / (fNSect*fNHead);
return;
}
//------------------------------------------+-----------------------------------
//! FIXME_docs
inline void Rw11UnitDisk::SetWProt(bool wprot)
{
fWProt = wprot;
return;
}
//------------------------------------------+-----------------------------------
//! FIXME_docs
inline bool Rw11UnitDisk::WProt() const
{
return fWProt;
}
} // end namespace Retro