48 AmdFlash(
const Rom& rom, std::span<const SectorInfo> sectorInfo,
51 AmdFlash(
const std::string& name, std::span<const SectorInfo> sectorInfo,
65 [[nodiscard]]
unsigned getSize()
const {
return size; }
66 [[nodiscard]]
byte read(
unsigned address)
const;
67 [[nodiscard]]
byte peek(
unsigned address)
const;
68 void write(
unsigned address,
byte value);
71 template<
typename Archive>
72 void serialize(Archive& ar,
unsigned version);
79 template<
typename Archive>
80 void serialize(Archive& ar,
unsigned version);
87 struct GetSectorInfoResult {
unsigned sector, sectorSize, offset; };
88 [[nodiscard]] GetSectorInfoResult getSectorInfo(
unsigned address)
const;
90 void setState(
State newState);
91 [[nodiscard]]
bool checkCommandReset();
92 [[nodiscard]]
bool checkCommandEraseSector();
93 [[nodiscard]]
bool checkCommandEraseChip();
94 [[nodiscard]]
bool checkCommandProgramHelper(
unsigned numBytes,
const byte* cmdSeq,
size_t cmdLen);
95 [[nodiscard]]
bool checkCommandProgram();
96 [[nodiscard]]
bool checkCommandDoubleByteProgram();
97 [[nodiscard]]
bool checkCommandQuadrupleByteProgram();
98 [[nodiscard]]
bool checkCommandManufacturer();
99 [[nodiscard]]
bool partialMatch(
size_t len,
const byte* dataSeq)
const;
101 [[nodiscard]]
bool isSectorWritable(
unsigned sector)
const;
104 MSXMotherBoard& motherBoard;
105 std::unique_ptr<SRAM> ram;
106 MemBuffer<int> writeAddress;
107 MemBuffer<const byte*> readAddress;
108 const std::span<const SectorInfo> sectorInfo;
113 static constexpr
unsigned MAX_CMD_SIZE = 8;
114 AmdCmd cmd[MAX_CMD_SIZE];
117 bool vppWpPinLow =
false;
void write(unsigned address, byte value)
void serialize(Archive &ar, unsigned version)
byte peek(unsigned address) const
void setVppWpPinLow(bool value)
Setting the Vpp/WP# pin LOW enables a certain kind of write protection of some sectors.
byte read(unsigned address) const
AmdFlash(const Rom &rom, std::span< const SectorInfo > sectorInfo, word ID, Addressing addressing, const DeviceConfig &config, Load load=Load::NORMAL)
Create AmdFlash with given configuration.
const byte * getReadCacheLine(unsigned address) const
SDLSurfacePtr load(const std::string &filename, bool want32bpp)
Load the given PNG file in a SDL_Surface.
This file implemented 3 utility functions:
uint16_t word
16 bit unsigned integer
SERIALIZE_CLASS_VERSION(CassettePlayer, 2)
void serialize(Archive &ar, unsigned version)