18 #ifndef COM_SAXBOPHONE_WONDERCARD_MEMORY_CARD_SLOT_HPP
19 #define COM_SAXBOPHONE_WONDERCARD_MEMORY_CARD_SLOT_HPP
73 bool read_card(std::span<Byte, MemoryCard::CARD_SIZE> data);
80 bool write_card(std::span<Byte, MemoryCard::CARD_SIZE> data);
121 template <std::
size_t sector_index>
124 template <std::
size_t sector_index>
127 template <std::
size_t block_index>
128 bool _read_card_block(std::span<Byte, MemoryCard::CARD_SIZE> data);
130 template <std::
size_t block_index>
131 bool _write_card_block(std::span<Byte, MemoryCard::CARD_SIZE> data);
A MemoryCardSlot is a device which a MemoryCard can be inserted into and read/written from.
Definition: MemoryCardSlot.hpp:36
bool write_sector(std::size_t index, MemoryCard::Sector data)
Writes data from the given span to the specified sector of the inserted card.
Definition: MemoryCardSlot.cpp:164
bool write_block(std::size_t index, MemoryCard::Block data)
Writes data from the given span to the specified block of the inserted card.
Definition: MemoryCardSlot.cpp:94
bool read_sector(std::size_t index, MemoryCard::Sector data)
Reads the specified sector of the inserted card.
Definition: MemoryCardSlot.cpp:106
bool read_card(std::span< Byte, MemoryCard::CARD_SIZE > data)
Reads the entire contents of the inserted card.
Definition: MemoryCardSlot.cpp:64
bool write_card(std::span< Byte, MemoryCard::CARD_SIZE > data)
Writes data from the given span to the entire card.
Definition: MemoryCardSlot.cpp:73
bool send(TriState command, TriState &data)
Sends the given command byte to the inserted MemoryCard.
Definition: MemoryCardSlot.cpp:25
bool read_block(std::size_t index, MemoryCard::Block data)
Reads the specified block of the inserted card.
Definition: MemoryCardSlot.cpp:82
bool remove_card()
Attempts to remove a MemoryCard from this MemoryCardSlot.
Definition: MemoryCardSlot.cpp:52
bool insert_card(MemoryCard &card)
Attempts to insert the given MemoryCard into this MemoryCardSlot.
Definition: MemoryCardSlot.cpp:37
Represents a virtual PS1 Memory Card.
Definition: MemoryCard.hpp:35
std::span< Byte, BLOCK_SIZE > Block
A non-owning view of an entire save Block on the MemoryCard.
Definition: MemoryCard.hpp:46
std::span< Byte, SECTOR_SIZE > Sector
A non-owning view of a Sector on the MemoryCard.
Definition: MemoryCard.hpp:51
Definition: common.hpp:26
std::optional< Byte > TriState
Definition: common.hpp:28