openMSX
|
#include <SectorAccessibleDisk.hh>
Public Member Functions | |
void | readSector (size_t sector, SectorBuffer &buf) const |
void | writeSector (size_t sector, const SectorBuffer &buf) |
void | readSectors (std::span< SectorBuffer > buffers, size_t startSector) const |
void | writeSectors (std::span< const SectorBuffer > buffers, size_t startSector) |
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. | |
virtual void | readSectorsImpl (std::span< SectorBuffer > buffers, size_t startSector) |
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 18 of file SectorAccessibleDisk.hh.
|
protected |
Definition at line 16 of file SectorAccessibleDisk.cc.
|
protecteddefault |
void openmsx::SectorAccessibleDisk::applyPatch | ( | Filename | patchFile | ) |
Definition at line 99 of file SectorAccessibleDisk.cc.
|
protectedvirtual |
Reimplemented in openmsx::DirAsDSK.
Definition at line 164 of file SectorAccessibleDisk.cc.
Referenced by getSha1Sum().
|
protectedvirtual |
Reimplemented in openmsx::SectorBasedDisk.
Definition at line 169 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 153 of file SectorAccessibleDisk.cc.
Referenced by openmsx::DiskChanger::serialize(), and openmsx::HD::serialize().
size_t openmsx::SectorAccessibleDisk::getNbSectors | ( | ) | const |
Definition at line 94 of file SectorAccessibleDisk.cc.
Referenced by openmsx::SectorBasedDisk::detectGeometry(), openmsx::Disk::detectGeometryFallback(), openmsx::DiskPartition::DiskPartition(), openmsx::DiskImageUtils::format(), openmsx::DiskImageUtils::format(), getSha1SumImpl(), openmsx::EmptyDiskPatch::getSize(), openmsx::MSXtar::MSXtar(), readSectors(), and writeSector().
std::vector< Filename > openmsx::SectorAccessibleDisk::getPatches | ( | ) | const |
Definition at line 104 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 114 of file SectorAccessibleDisk.cc.
References checkCaches(), openmsx::Sha1Sum::empty(), and getSha1SumImpl().
Referenced by openmsx::HD::serialize().
Reimplemented in openmsx::DMKDiskImage.
Definition at line 123 of file SectorAccessibleDisk.cc.
References openmsx::SHA1::digest(), getNbSectors(), readSectors(), setPeekMode(), subspan(), and openmsx::SHA1::update().
Referenced by getSha1Sum().
bool openmsx::SectorAccessibleDisk::hasPatches | ( | ) | const |
Definition at line 109 of file SectorAccessibleDisk.cc.
|
virtual |
Reimplemented in openmsx::DummyDisk.
Definition at line 159 of file SectorAccessibleDisk.cc.
Referenced by readSectors(), and writeSector().
|
inlineprotected |
Definition at line 61 of file SectorAccessibleDisk.hh.
Referenced by openmsx::DirAsDSK::readSectorImpl().
bool openmsx::SectorAccessibleDisk::isWriteProtected | ( | ) | const |
Definition at line 148 of file SectorAccessibleDisk.cc.
Referenced by openmsx::HDCommand::execute(), openmsx::HD::getMediaInfo(), writeSector(), and openmsx::Disk::writeTrack().
void openmsx::SectorAccessibleDisk::readSector | ( | size_t | sector, |
SectorBuffer & | buf | ||
) | const |
Definition at line 23 of file SectorAccessibleDisk.cc.
References readSectors().
Referenced by openmsx::Disk::detectGeometry(), openmsx::DiskImageUtils::getPartition(), openmsx::DiskImageUtils::hasPartitionTable(), and openmsx::MSXtar::MSXtar().
|
virtual |
Reimplemented in openmsx::DirAsDSK, and openmsx::DMKDiskImage.
Definition at line 60 of file SectorAccessibleDisk.cc.
Referenced by readSectorsImpl().
void openmsx::SectorAccessibleDisk::readSectors | ( | std::span< SectorBuffer > | buffers, |
size_t | startSector | ||
) | const |
Definition at line 28 of file SectorAccessibleDisk.cc.
References getNbSectors(), and isDummyDisk().
Referenced by getSha1SumImpl(), openmsx::MSXtar::MSXtar(), and readSector().
|
virtual |
Definition at line 50 of file SectorAccessibleDisk.cc.
References enumerate(), and readSectorImpl().
Referenced by openmsx::EmptyDiskPatch::copyBlock().
|
inlineprotected |
Definition at line 60 of file SectorAccessibleDisk.hh.
Referenced by getSha1SumImpl().
void openmsx::SectorAccessibleDisk::writeSector | ( | size_t | sector, |
const SectorBuffer & | buf | ||
) |
Definition at line 67 of file SectorAccessibleDisk.cc.
References flushCaches(), getNbSectors(), isDummyDisk(), and isWriteProtected().
Referenced by openmsx::DiskImageUtils::format(), writeSectors(), and openmsx::MSXtar::~MSXtar().
void openmsx::SectorAccessibleDisk::writeSectors | ( | std::span< const SectorBuffer > | buffers, |
size_t | startSector | ||
) |
Definition at line 83 of file SectorAccessibleDisk.cc.
References enumerate(), and writeSector().
|
staticconstexpr |
Definition at line 21 of file SectorAccessibleDisk.hh.
Referenced by openmsx::EmptyDiskPatch::copyBlock(), openmsx::DiskManipulator::create(), openmsx::RealDrive::getMediaInfo(), and openmsx::EmptyDiskPatch::getSize().