openMSX
|
#include <IDECDROM.hh>
Public Member Functions | |
IDECDROM (const IDECDROM &)=delete | |
IDECDROM & | operator= (const IDECDROM &)=delete |
IDECDROM (const DeviceConfig &config) | |
~IDECDROM () override | |
void | eject () |
void | insert (const std::string &filename) |
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) |
![]() | |
void | reset (EmuTime::param time) override |
word | readData (EmuTime::param time) override |
byte | readReg (nibble reg, EmuTime::param time) override |
void | writeData (word value, EmuTime::param time) override |
void | writeReg (nibble reg, byte value, EmuTime::param time) override |
template<typename Archive > | |
void | serialize (Archive &ar, unsigned version) |
![]() | |
virtual | ~IDEDevice ()=default |
virtual void | reset (EmuTime::param time)=0 |
virtual word | readData (EmuTime::param time)=0 |
virtual byte | readReg (nibble reg, EmuTime::param time)=0 |
virtual void | writeData (word value, EmuTime::param time)=0 |
virtual void | writeReg (nibble reg, byte value, EmuTime::param time)=0 |
![]() | |
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... | |
Protected Member Functions | |
bool | isPacketDevice () override |
Is this device a packet (ATAPI) device? More... | |
std::string_view | getDeviceName () override |
Gets the device name to insert as "model number" into the identify block. More... | |
void | fillIdentifyBlock (AlignedBuffer &buffer) override |
Tells a subclass to fill the device specific parts of the identify block located in the buffer. More... | |
unsigned | readBlockStart (AlignedBuffer &buffer, unsigned count) override |
Called when a block of read data should be buffered by the controller: when the buffer is empty or at the start of the transfer. More... | |
void | readEnd () override |
Called when a read transfer completes. More... | |
void | writeBlockComplete (AlignedBuffer &buffer, unsigned count) override |
Called when a block of written data has been buffered by the controller: when the buffer is full or at the end of the transfer. More... | |
void | executeCommand (byte cmd) override |
Starts execution of an IDE command. More... | |
![]() | |
AbstractIDEDevice (MSXMotherBoard &motherBoard) | |
~AbstractIDEDevice () override=default | |
virtual bool | isPacketDevice ()=0 |
Is this device a packet (ATAPI) device? More... | |
virtual std::string_view | getDeviceName ()=0 |
Gets the device name to insert as "model number" into the identify block. More... | |
virtual void | fillIdentifyBlock (AlignedBuffer &buffer)=0 |
Tells a subclass to fill the device specific parts of the identify block located in the buffer. More... | |
virtual unsigned | readBlockStart (AlignedBuffer &buffer, unsigned count)=0 |
Called when a block of read data should be buffered by the controller: when the buffer is empty or at the start of the transfer. More... | |
virtual void | readEnd () |
Called when a read transfer completes. More... | |
virtual void | writeBlockComplete (AlignedBuffer &buffer, unsigned count)=0 |
Called when a block of written data has been buffered by the controller: when the buffer is full or at the end of the transfer. More... | |
virtual void | executeCommand (byte cmd) |
Starts execution of an IDE command. More... | |
void | setError (byte error) |
Indicates an error: sets error register, error flag, aborts transfers. More... | |
unsigned | getSectorNumber () const |
Creates an LBA sector address from the contents of the sectorNumReg, cylinderLowReg, cylinderHighReg and devHeadReg registers. More... | |
unsigned | getNumSectors () const |
Gets the number of sectors indicated by the sector count register. More... | |
void | setInterruptReason (byte value) |
Writes the interrupt reason register. More... | |
unsigned | getByteCount () const |
Reads the byte count limit of a packet transfer in the registers. More... | |
void | setByteCount (unsigned count) |
Writes the byte count of a packet transfer in the registers. More... | |
void | setSectorNumber (unsigned lba) |
Writes a 28-bit LBA sector number in the registers. More... | |
void | startLongReadTransfer (unsigned count) |
Indicates the start of a read data transfer which uses blocks. More... | |
AlignedBuffer & | startShortReadTransfer (unsigned count) |
Indicates the start of a read data transfer where all data fits into the buffer at once. More... | |
void | abortReadTransfer (byte error) |
Aborts the read transfer in progress. More... | |
void | startWriteTransfer (unsigned count) |
Indicates the start of a write data transfer. More... | |
void | abortWriteTransfer (byte error) |
Aborts the write transfer in progress. More... | |
byte | getFeatureReg () const |
void | setLBALow (byte value) |
void | setLBAMid (byte value) |
void | setLBAHigh (byte value) |
MSXMotherBoard & | getMotherBoard () const |
![]() | |
MediaInfoProvider ()=default | |
~MediaInfoProvider ()=default | |
Friends | |
class | CDXCommand |
Additional Inherited Members | |
![]() | |
static constexpr byte | DRDY = 0x40 |
static constexpr byte | DSC = 0x10 |
static constexpr byte | DRQ = 0x08 |
static constexpr byte | ERR = 0x01 |
static constexpr byte | UNC = 0x40 |
static constexpr byte | IDNF = 0x10 |
static constexpr byte | ABORT = 0x04 |
Definition at line 31 of file IDECDROM.hh.
|
delete |
|
explicit |
|
override |
Definition at line 56 of file IDECDROM.cc.
References openmsx::AbstractIDEDevice::getMotherBoard(), openmsx::MSXMotherBoard::getMSXCliComm(), openmsx::CliComm::HARDWARE, id, openmsx::MSXMotherBoard::unregisterMediaInfo(), and openmsx::CliComm::update().
void openmsx::IDECDROM::eject | ( | ) |
Definition at line 302 of file IDECDROM.cc.
References openmsx::File::close(), openmsx::AbstractIDEDevice::getMotherBoard(), openmsx::MSXMotherBoard::getMSXCliComm(), openmsx::CliComm::MEDIA, and openmsx::CliComm::update().
Referenced by openmsx::CDXCommand::execute(), and serialize().
|
overrideprotectedvirtual |
Starts execution of an IDE command.
Override this to implement additional commands and make sure you call the superclass implementation for all commands that you don't handle.
Reimplemented from openmsx::AbstractIDEDevice.
Definition at line 131 of file IDECDROM.cc.
References openmsx::AbstractIDEDevice::executeCommand(), openmsx::AbstractIDEDevice::getByteCount(), openmsx::AbstractIDEDevice::getFeatureReg(), openmsx::File::is_open(), openmsx::AbstractIDEDevice::setError(), openmsx::AbstractIDEDevice::setInterruptReason(), openmsx::AbstractIDEDevice::setLBAHigh(), openmsx::AbstractIDEDevice::setLBAMid(), and openmsx::AbstractIDEDevice::startWriteTransfer().
|
overrideprotectedvirtual |
Tells a subclass to fill the device specific parts of the identify block located in the buffer.
The generic part is already written there.
buffer | Array of 512 bytes. |
Implements openmsx::AbstractIDEDevice.
Definition at line 81 of file IDECDROM.cc.
|
overrideprotectedvirtual |
Gets the device name to insert as "model number" into the identify block.
Implements openmsx::AbstractIDEDevice.
Definition at line 76 of file IDECDROM.cc.
|
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 66 of file IDECDROM.cc.
References openmsx::TclObject::addDictKeyValue(), openmsx::File::getURL(), and openmsx::File::is_open().
void openmsx::IDECDROM::insert | ( | const std::string & | filename | ) |
Definition at line 310 of file IDECDROM.cc.
References openmsx::AbstractIDEDevice::getMotherBoard(), openmsx::MSXMotherBoard::getMSXCliComm(), openmsx::CliComm::MEDIA, and openmsx::CliComm::update().
Referenced by openmsx::CDXCommand::execute(), and serialize().
|
overrideprotectedvirtual |
Is this device a packet (ATAPI) device?
Implements openmsx::AbstractIDEDevice.
Definition at line 71 of file IDECDROM.cc.
|
overrideprotectedvirtual |
Called when a block of read data should be buffered by the controller: when the buffer is empty or at the start of the transfer.
buffer | Pointer to the start of a byte array. |
count | Number of bytes to be filled by this method. This number will not exceed the array size nor the transfer length. |
Implements openmsx::AbstractIDEDevice.
Definition at line 101 of file IDECDROM.cc.
References openmsx::AbstractIDEDevice::abortReadTransfer(), LZ4::count(), openmsx::AlignedBuffer::data(), openmsx::File::is_open(), openmsx::File::read(), and openmsx::File::seek().
|
overrideprotectedvirtual |
Called when a read transfer completes.
The default implementation does nothing.
Reimplemented from openmsx::AbstractIDEDevice.
Definition at line 118 of file IDECDROM.cc.
References openmsx::AbstractIDEDevice::setInterruptReason().
void openmsx::IDECDROM::serialize | ( | Archive & | ar, |
unsigned | version | ||
) |
Definition at line 388 of file IDECDROM.cc.
References eject(), openmsx::File::getURL(), insert(), and openmsx::File::is_open().
|
overrideprotectedvirtual |
Called when a block of written data has been buffered by the controller: when the buffer is full or at the end of the transfer.
buffer | Pointer to the start of a byte array. |
count | Number of data bytes in the array. |
Implements openmsx::AbstractIDEDevice.
Definition at line 123 of file IDECDROM.cc.
References LZ4::count().
|
friend |
Definition at line 93 of file IDECDROM.hh.