openMSX
|
#include <AmdFlash.hh>
Classes | |
struct | AmdCmd |
struct | SectorInfo |
Public Types | |
enum class | Addressing { BITS_11 , BITS_12 } |
enum class | Load { NORMAL , DONT } |
enum | State { ST_IDLE , ST_IDENT } |
Public Member Functions | |
AmdFlash (const Rom &rom, std::span< const SectorInfo > sectorInfo, uint16_t ID, Addressing addressing, const DeviceConfig &config, Load load=Load::NORMAL) | |
Create AmdFlash with given configuration. More... | |
AmdFlash (const std::string &name, std::span< const SectorInfo > sectorInfo, uint16_t ID, Addressing addressing, const DeviceConfig &config) | |
~AmdFlash () | |
void | reset () |
void | setVppWpPinLow (bool value) |
Setting the Vpp/WP# pin LOW enables a certain kind of write protection of some sectors. More... | |
size_t | size () const |
uint8_t | read (size_t address) const |
uint8_t | peek (size_t address) const |
void | write (size_t address, uint8_t value) |
const uint8_t * | getReadCacheLine (size_t address) const |
template<typename Archive > | |
void | serialize (Archive &ar, unsigned version) |
Definition at line 19 of file AmdFlash.hh.
|
strong |
Enumerator | |
---|---|
BITS_11 | |
BITS_12 |
Definition at line 26 of file AmdFlash.hh.
|
strong |
Enumerator | |
---|---|
NORMAL | |
DONT |
Definition at line 30 of file AmdFlash.hh.
Enumerator | |
---|---|
ST_IDLE | |
ST_IDENT |
Definition at line 85 of file AmdFlash.hh.
openmsx::AmdFlash::AmdFlash | ( | const Rom & | rom, |
std::span< const SectorInfo > | sectorInfo, | ||
uint16_t | ID, | ||
Addressing | addressing, | ||
const DeviceConfig & | config, | ||
Load | load = Load::NORMAL |
||
) |
Create AmdFlash with given configuration.
rom | The initial content for this flash |
sectorInfo | A span containing the size and write protected status of each sector in the flash. This implicitly also communicates the number of sectors (a sector is a region in the flash that can be erased individually). There exist flash roms were the different sectors are not all equally large, that's why it's required to enumerate the size of each sector (instead of simply specifying the size and the number of sectors). |
ID | Contains manufacturer and device ID for this flash. |
addressing | Specify addressing mode (11-bit or 12-bit) |
config | The motherboard this flash belongs to |
load | Load initial content (hack for 'Matra INK') |
Definition at line 22 of file AmdFlash.cc.
References openmsx::Rom::getName(), and openmsx::PNG::load().
openmsx::AmdFlash::AmdFlash | ( | const std::string & | name, |
std::span< const SectorInfo > | sectorInfo, | ||
uint16_t | ID, | ||
Addressing | addressing, | ||
const DeviceConfig & | config | ||
) |
Definition at line 34 of file AmdFlash.cc.
References NORMAL.
|
default |
const uint8_t * openmsx::AmdFlash::getReadCacheLine | ( | size_t | address | ) | const |
Definition at line 254 of file AmdFlash.cc.
References ST_IDLE, and openmsx::MSXDevice::unmappedRead.
Referenced by openmsx::NowindInterface::getReadCacheLine(), openmsx::KonamiUltimateCollection::getReadCacheLine(), openmsx::MegaFlashRomSCCPlus::getReadCacheLine(), openmsx::ReproCartridgeV1::getReadCacheLine(), openmsx::ReproCartridgeV2::getReadCacheLine(), openmsx::RomManbow2::getReadCacheLine(), and openmsx::RomMatraInk::getReadCacheLine().
uint8_t openmsx::AmdFlash::peek | ( | size_t | address | ) | const |
Definition at line 212 of file AmdFlash.cc.
References BITS_12, and ST_IDLE.
Referenced by openmsx::NowindInterface::peekMem(), openmsx::KonamiUltimateCollection::peekMem(), openmsx::MegaFlashRomSCCPlus::peekMem(), openmsx::ReproCartridgeV1::peekMem(), openmsx::ReproCartridgeV2::peekMem(), openmsx::RomManbow2::peekMem(), openmsx::RomMatraInk::peekMem(), and read().
uint8_t openmsx::AmdFlash::read | ( | size_t | address | ) | const |
Definition at line 248 of file AmdFlash.cc.
References peek().
Referenced by openmsx::NowindInterface::readMem(), openmsx::KonamiUltimateCollection::readMem(), openmsx::MegaFlashRomSCCPlus::readMem(), openmsx::ReproCartridgeV1::readMem(), openmsx::ReproCartridgeV2::readMem(), openmsx::RomManbow2::readMem(), and openmsx::RomMatraInk::readMem().
void openmsx::AmdFlash::reset | ( | ) |
Definition at line 199 of file AmdFlash.cc.
References ST_IDLE.
Referenced by openmsx::MegaFlashRomSCCPlus::reset(), openmsx::MegaFlashRomSCCPlusSD::reset(), openmsx::ReproCartridgeV1::reset(), openmsx::ReproCartridgeV2::reset(), openmsx::RomManbow2::reset(), openmsx::RomMatraInk::reset(), and write().
void openmsx::AmdFlash::serialize | ( | Archive & | ar, |
unsigned | version | ||
) |
Definition at line 404 of file AmdFlash.cc.
|
inline |
Setting the Vpp/WP# pin LOW enables a certain kind of write protection of some sectors.
Currently it is implemented that it will enable protection of the first two sectors. (As for example in Numonix/Micron M29W640FB/M29W640GB.)
Definition at line 65 of file AmdFlash.hh.
|
inline |
Definition at line 67 of file AmdFlash.hh.
void openmsx::AmdFlash::write | ( | size_t | address, |
uint8_t | value | ||
) |
Definition at line 265 of file AmdFlash.cc.
References reset().
Referenced by openmsx::NowindInterface::writeMem(), openmsx::KonamiUltimateCollection::writeMem(), openmsx::MegaFlashRomSCCPlus::writeMem(), openmsx::ReproCartridgeV1::writeMem(), openmsx::ReproCartridgeV2::writeMem(), openmsx::RomManbow2::writeMem(), and openmsx::RomMatraInk::writeMem().