openMSX
|
#include <HD.hh>
Public Member Functions | |
HD (const DeviceConfig &config) | |
~HD () override | |
const std::string & | getName () const |
const Filename & | getImageName () const |
void | switchImage (const Filename &filename) |
std::string | getTigerTreeHash () |
void | getMediaInfo (TclObject &result) override |
This method gets called when information is required on the media inserted in the media slot of the provider. More... | |
template<typename Archive > | |
void | serialize (Archive &ar, unsigned version) |
MSXMotherBoard & | getMotherBoard () const |
![]() | |
void | readSector (size_t sector, SectorBuffer &buf) |
void | writeSector (size_t sector, const SectorBuffer &buf) |
void | readSectors (std::span< SectorBuffer > buffers, size_t startSector) |
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. More... | |
virtual void | readSectorsImpl (std::span< SectorBuffer > buffers, size_t startSector) |
virtual void | readSectorImpl (size_t sector, SectorBuffer &buf) |
![]() | |
DiskContainer (const DiskContainer &)=delete | |
DiskContainer & | operator= (const DiskContainer &)=delete |
DiskContainer ()=default | |
virtual | ~DiskContainer ()=default |
virtual SectorAccessibleDisk * | getSectorAccessibleDisk ()=0 |
virtual std::string_view | getContainerName () const =0 |
virtual bool | diskChanged ()=0 |
virtual int | insertDisk (const std::string &filename)=0 |
bool | isRomDisk () const |
template<typename Archive > | |
void | serialize (Archive &, unsigned) |
virtual uint8_t * | getData (size_t offset, size_t size)=0 |
Return the requested portion of the to-be-hashed data block. More... | |
virtual bool | isCacheStillValid (time_t &time)=0 |
Because TTH calculation of a large file takes some time (a few 1/10s for a hard disk image) we try to cache previous calculations. More... | |
![]() | |
MediaInfoProvider (const MediaInfoProvider &)=delete | |
MediaInfoProvider & | operator= (const MediaInfoProvider &)=delete |
virtual void | getMediaInfo (TclObject &result)=0 |
This method gets called when information is required on the media inserted in the media slot of the provider. More... | |
Additional Inherited Members | |
![]() | |
static constexpr size_t | SECTOR_SIZE = sizeof(SectorBuffer) |
![]() | |
SectorAccessibleDisk () | |
~SectorAccessibleDisk () | |
void | setPeekMode (bool peek) |
bool | isPeekMode () const |
virtual void | checkCaches () |
virtual void | flushCaches () |
virtual Sha1Sum | getSha1SumImpl (FilePool &filePool) |
![]() | |
~TTData ()=default | |
![]() | |
MediaInfoProvider ()=default | |
~MediaInfoProvider ()=default | |
|
explicit |
Definition at line 24 of file HD.cc.
References openmsx::File::CREATE, openmsx::Filename, openmsx::DeviceConfig::getChildData(), openmsx::DeviceConfig::getChildDataAsInt(), openmsx::MSXMotherBoard::getCommandController(), openmsx::DeviceConfig::getFileContext(), openmsx::Reactor::getGlobalSettings(), openmsx::HDImageCLI::getImageForId(), openmsx::MSXMotherBoard::getMSXCliComm(), openmsx::GlobalSettings::getPowerSetting(), openmsx::MSXMotherBoard::getReactor(), openmsx::Filename::getResolved(), openmsx::MSXMotherBoard::getScheduler(), openmsx::MSXMotherBoard::getSharedStuff(), openmsx::File::getSize(), openmsx::MSXMotherBoard::getStateChangeDistributor(), openmsx::CliComm::HARDWARE, id, openmsx::File::NORMAL, openmsx::MSXMotherBoard::registerMediaInfo(), openmsx::FileContext::resolveCreate(), openmsx::File::truncate(), openmsx::CliComm::update(), and openmsx::userFileContext().
|
override |
Definition at line 75 of file HD.cc.
References openmsx::MSXMotherBoard::getMSXCliComm(), openmsx::CliComm::HARDWARE, id, openmsx::MSXMotherBoard::unregisterMediaInfo(), and openmsx::CliComm::update().
|
inline |
Definition at line 28 of file HD.hh.
Referenced by openmsx::HDCommand::execute(), and getMediaInfo().
|
overridevirtual |
This method gets called when information is required on the media inserted in the media slot of the provider.
The provider must attach the info as a dictionary to the given TclObject.
Implements openmsx::MediaInfoProvider.
Definition at line 85 of file HD.cc.
References openmsx::TclObject::addDictKeyValues(), getImageName(), and openmsx::SectorAccessibleDisk::isWriteProtected().
|
inline |
|
inline |
Definition at line 27 of file HD.hh.
Referenced by openmsx::HDCommand::execute(), openmsx::HDCommand::help(), and switchImage().
std::string openmsx::HD::getTigerTreeHash | ( | ) |
Definition at line 153 of file HD.cc.
References openmsx::Timer::getTime(), and t.
Referenced by serialize().
void openmsx::HD::serialize | ( | Archive & | ar, |
unsigned | version | ||
) |
Definition at line 216 of file HD.cc.
References openmsx::File::close(), openmsx::Filename::empty(), openmsx::Sha1Sum::empty(), openmsx::Filename, openmsx::SectorAccessibleDisk::forceWriteProtect(), openmsx::Reactor::getFilePool(), openmsx::MSXMotherBoard::getMSXCliComm(), openmsx::MSXMotherBoard::getReactor(), openmsx::Filename::getResolved(), openmsx::SectorAccessibleDisk::getSha1Sum(), getTigerTreeHash(), openmsx::File::is_open(), openmsx::CliComm::printWarning(), switchImage(), openmsx::Sha1Sum::toString(), and openmsx::Filename::updateAfterLoadState().
void openmsx::HD::switchImage | ( | const Filename & | filename | ) |
Definition at line 91 of file HD.cc.
References openmsx::MSXMotherBoard::getMSXCliComm(), getName(), openmsx::Filename::getResolved(), openmsx::File::getSize(), openmsx::CliComm::MEDIA, and openmsx::CliComm::update().
Referenced by openmsx::HDCommand::execute(), and serialize().