openMSX
RomAscii16X.hh
Go to the documentation of this file.
1#ifndef ROMASCII16X_HH
2#define ROMASCII16X_HH
3
4#include "MSXRom.hh"
5#include "AmdFlash.hh"
6#include "SimpleDebuggable.hh"
7#include <array>
8
9namespace openmsx {
10
11class RomAscii16X final : public MSXRom
12{
13public:
14 RomAscii16X(const DeviceConfig& config, Rom&& rom);
15
16 void reset(EmuTime::param time) override;
17 [[nodiscard]] byte peekMem(word address, EmuTime::param time) const override;
18 [[nodiscard]] byte readMem(word address, EmuTime::param time) override;
19 [[nodiscard]] const byte* getReadCacheLine(word address) const override;
20 void writeMem(word address, byte value, EmuTime::param time) override;
21 [[nodiscard]] byte* getWriteCacheLine(word address) override;
22
23 template<typename Archive>
24 void serialize(Archive& ar, unsigned version);
25
26private:
27 [[nodiscard]] unsigned getFlashAddr(word addr) const;
28
29 struct Debuggable final : SimpleDebuggable {
30 Debuggable(MSXMotherBoard& motherBoard, const std::string& name);
31 [[nodiscard]] byte read(unsigned address) override;
32 void write(unsigned address, byte value, EmuTime::param time) override;
33 } debuggable;
34
35 AmdFlash flash;
36
37 std::array<word, 2> bankRegs = {0, 0};
38};
39
40} // namespace openmsx
41
42#endif
byte * getWriteCacheLine(word address) override
Test that the memory in the interval [start, start + CacheLine::SIZE) is cacheable for writing.
byte peekMem(word address, EmuTime::param time) const override
Read a byte from a given memory location.
void writeMem(word address, byte value, EmuTime::param time) override
Write a given byte to a given location at a certain time to this device.
void reset(EmuTime::param time) override
This method is called on reset.
void serialize(Archive &ar, unsigned version)
byte readMem(word address, EmuTime::param time) override
Read a byte from a location at a certain time from this device.
const byte * getReadCacheLine(word address) const override
Test that the memory in the interval [start, start + CacheLine::SIZE) is cacheable for reading.
This file implemented 3 utility functions:
Definition Autofire.cc:11
uint16_t word
16 bit unsigned integer
Definition openmsx.hh:29