openMSX
ADVram.hh
Go to the documentation of this file.
1 #ifndef ADVRAM_HH
2 #define ADVRAM_HH
3 
4 #include "MSXDevice.hh"
5 
6 namespace openmsx {
7 
8 class VDP;
9 class VDPVRAM;
10 
15 class ADVram final : public MSXDevice
16 {
17 public:
18  explicit ADVram(const DeviceConfig& config);
19 
24  void reset(EmuTime::param time) override;
25 
30  [[nodiscard]] byte readIO(word port, EmuTime::param time) override;
31  // default peekIO() implementation is ok.
32 
34  void writeIO(word port, byte value, EmuTime::param time) override;
35 
40  [[nodiscard]] byte readMem(word address, EmuTime::param time) override;
41 
46  void writeMem(word address, byte value, EmuTime::param time) override;
47 
48  template<typename Archive>
49  void serialize(Archive& ar, unsigned version);
50 
51 private:
52  void init() override;
53  [[nodiscard]] inline unsigned calcAddress(word address) const;
54 
55 private:
56  VDP* vdp;
57  VDPVRAM* vram;
59  /*const*/ unsigned mask;
61  unsigned baseAddr;
63  bool enabled;
66  const bool hasEnable;
69  bool planar;
70 };
71 
72 } // namespace openmsx
73 
74 #endif // ADVRAM_HH
Implementation of direct cpu access to VRAM.
Definition: ADVram.hh:16
void writeMem(word address, byte value, EmuTime::param time) override
Write a given byte at a certain time to a given location in the video ram.
Definition: ADVram.cc:77
void writeIO(word port, byte value, EmuTime::param time) override
Write a byte to a given IO port, set mapper register.
Definition: ADVram.cc:57
byte readMem(word address, EmuTime::param time) override
Read a byte from a location in the video ram at a certain time.
Definition: ADVram.cc:72
byte readIO(word port, EmuTime::param time) override
Read a byte from an IO port, change mode bits.
Definition: ADVram.cc:45
void reset(EmuTime::param time) override
This method is called on reset.
Definition: ADVram.cc:37
void serialize(Archive &ar, unsigned version)
Definition: ADVram.cc:85
ADVram(const DeviceConfig &config)
Definition: ADVram.cc:10
An MSXDevice is an emulated hardware component connected to the bus of the emulated MSX.
Definition: MSXDevice.hh:32
Manages VRAM contents and synchronizes the various users of the VRAM.
Definition: VDPVRAM.hh:387
Unified implementation of MSX Video Display Processors (VDPs).
Definition: VDP.hh:63
This file implemented 3 utility functions:
Definition: Autofire.cc:5
uint16_t word
16 bit unsigned integer
Definition: openmsx.hh:29