openMSX
|
#include <SectorAccessibleDisk.hh>
Public Member Functions | |
void | readSector (size_t sector, SectorBuffer &buf) |
void | writeSector (size_t sector, const SectorBuffer &buf) |
void | readSectors (SectorBuffer *buffers, size_t startSector, size_t nbSectors) |
void | writeSectors (const SectorBuffer *buffers, size_t startSector, size_t nbSectors) |
size_t | getNbSectors () const |
bool | isWriteProtected () const |
void | forceWriteProtect () |
virtual bool | isDummyDisk () const |
void | applyPatch (Filename patchFile) |
std::vector< Filename > | getPatches () const |
bool | hasPatches () const |
Sha1Sum | getSha1Sum (FilePool &filepool) |
Calculate SHA1 of the content of this disk. More... | |
virtual void | readSectorsImpl (SectorBuffer *buffers, size_t startSector, size_t nbSectors) |
virtual void | readSectorImpl (size_t sector, SectorBuffer &buf) |
Static Public Attributes | |
static constexpr size_t | SECTOR_SIZE = sizeof(SectorBuffer) |
Protected Member Functions | |
SectorAccessibleDisk () | |
~SectorAccessibleDisk () | |
void | setPeekMode (bool peek) |
bool | isPeekMode () const |
virtual void | checkCaches () |
virtual void | flushCaches () |
virtual Sha1Sum | getSha1SumImpl (FilePool &filepool) |
Definition at line 15 of file SectorAccessibleDisk.hh.
|
protected |
Definition at line 12 of file SectorAccessibleDisk.cc.
|
protecteddefault |
void openmsx::SectorAccessibleDisk::applyPatch | ( | Filename | patchFile | ) |
Definition at line 95 of file SectorAccessibleDisk.cc.
|
protectedvirtual |
Reimplemented in openmsx::DirAsDSK.
Definition at line 160 of file SectorAccessibleDisk.cc.
Referenced by getSha1Sum().
|
protectedvirtual |
Reimplemented in openmsx::SectorBasedDisk.
Definition at line 165 of file SectorAccessibleDisk.cc.
References openmsx::Sha1Sum::clear().
Referenced by openmsx::SectorBasedDisk::flushCaches(), writeSector(), and openmsx::Disk::writeTrack().
void openmsx::SectorAccessibleDisk::forceWriteProtect | ( | ) |
Definition at line 149 of file SectorAccessibleDisk.cc.
Referenced by openmsx::DiskChanger::serialize(), and openmsx::HD::serialize().
size_t openmsx::SectorAccessibleDisk::getNbSectors | ( | ) | const |
Definition at line 90 of file SectorAccessibleDisk.cc.
Referenced by openmsx::SectorBasedDisk::detectGeometry(), openmsx::Disk::detectGeometryFallback(), openmsx::DiskPartition::DiskPartition(), openmsx::DiskImageUtils::format(), getSha1SumImpl(), openmsx::EmptyDiskPatch::getSize(), openmsx::MSXtar::MSXtar(), readSectors(), and writeSector().
std::vector< Filename > openmsx::SectorAccessibleDisk::getPatches | ( | ) | const |
Definition at line 100 of file SectorAccessibleDisk.cc.
Referenced by openmsx::DiskChanger::serialize().
Calculate SHA1 of the content of this disk.
This value is cached (and flushed on writes).
Definition at line 110 of file SectorAccessibleDisk.cc.
References checkCaches(), openmsx::Sha1Sum::empty(), and getSha1SumImpl().
Referenced by openmsx::HD::serialize().
Reimplemented in openmsx::DMKDiskImage.
Definition at line 119 of file SectorAccessibleDisk.cc.
References openmsx::SHA1::digest(), getNbSectors(), gl::min(), openmsx::SectorBuffer::raw, readSectors(), setPeekMode(), and openmsx::SHA1::update().
Referenced by getSha1Sum().
bool openmsx::SectorAccessibleDisk::hasPatches | ( | ) | const |
Definition at line 105 of file SectorAccessibleDisk.cc.
|
virtual |
Reimplemented in openmsx::DummyDisk.
Definition at line 155 of file SectorAccessibleDisk.cc.
Referenced by readSectors(), and writeSector().
|
inlineprotected |
Definition at line 60 of file SectorAccessibleDisk.hh.
Referenced by openmsx::DirAsDSK::readSectorImpl().
bool openmsx::SectorAccessibleDisk::isWriteProtected | ( | ) | const |
Definition at line 144 of file SectorAccessibleDisk.cc.
Referenced by openmsx::HDCommand::execute(), writeSector(), and openmsx::Disk::writeTrack().
void openmsx::SectorAccessibleDisk::readSector | ( | size_t | sector, |
SectorBuffer & | buf | ||
) |
Definition at line 19 of file SectorAccessibleDisk.cc.
References readSectors().
Referenced by openmsx::Disk::detectGeometry(), openmsx::DiskPartition::DiskPartition(), openmsx::DiskImageUtils::hasPartitionTable(), and openmsx::MSXtar::MSXtar().
|
virtual |
Reimplemented in openmsx::DMKDiskImage, and openmsx::DirAsDSK.
Definition at line 56 of file SectorAccessibleDisk.cc.
Referenced by readSectorsImpl().
void openmsx::SectorAccessibleDisk::readSectors | ( | SectorBuffer * | buffers, |
size_t | startSector, | ||
size_t | nbSectors | ||
) |
Definition at line 24 of file SectorAccessibleDisk.cc.
References Math::e, getNbSectors(), and isDummyDisk().
Referenced by getSha1SumImpl(), openmsx::MSXtar::MSXtar(), and readSector().
|
virtual |
Definition at line 46 of file SectorAccessibleDisk.cc.
References readSectorImpl(), and xrange().
Referenced by openmsx::EmptyDiskPatch::copyBlock().
|
inlineprotected |
Definition at line 59 of file SectorAccessibleDisk.hh.
Referenced by getSha1SumImpl().
void openmsx::SectorAccessibleDisk::writeSector | ( | size_t | sector, |
const SectorBuffer & | buf | ||
) |
Definition at line 63 of file SectorAccessibleDisk.cc.
References Math::e, flushCaches(), getNbSectors(), isDummyDisk(), and isWriteProtected().
Referenced by openmsx::DiskImageUtils::format(), openmsx::DiskImageUtils::partition(), writeSectors(), and openmsx::MSXtar::~MSXtar().
void openmsx::SectorAccessibleDisk::writeSectors | ( | const SectorBuffer * | buffers, |
size_t | startSector, | ||
size_t | nbSectors | ||
) |
Definition at line 79 of file SectorAccessibleDisk.cc.
References writeSector(), and xrange().
|
staticconstexpr |
Definition at line 18 of file SectorAccessibleDisk.hh.
Referenced by openmsx::EmptyDiskPatch::copyBlock(), openmsx::DirAsDSK::DirAsDSK(), and openmsx::EmptyDiskPatch::getSize().