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  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  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  inline unsigned calcAddress(word address) const;
54 
55  VDP* vdp;
56  VDPVRAM* vram;
58  /*const*/ unsigned mask;
60  unsigned baseAddr;
62  bool enabled;
65  const bool hasEnable;
68  bool planar;
69 };
70 
71 } // namespace openmsx
72 
73 #endif // ADVRAM_HH
openmsx::MSXDevice
An MSXDevice is an emulated hardware component connected to the bus of the emulated MSX.
Definition: MSXDevice.hh:31
openmsx::VDPVRAM
Manages VRAM contents and synchronises the various users of the VRAM.
Definition: VDPVRAM.hh:384
openmsx::VDPVRAM
VDPVRAM
Definition: VDPVRAM.cc:343
openmsx::VDP
Unified implementation of MSX Video Display Processors (VDPs).
Definition: VDP.hh:61
openmsx::DeviceConfig
Definition: DeviceConfig.hh:19
openmsx::ADVram::serialize
void serialize(Archive &ar, unsigned version)
Definition: ADVram.cc:85
openmsx::ADVram
Implementation of direct cpu access to VRAM.
Definition: ADVram.hh:15
openmsx::ADVram::readIO
byte readIO(word port, EmuTime::param time) override
Read a byte from an IO port, change mode bits.
Definition: ADVram.cc:45
openmsx::ADVram::writeIO
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
openmsx::ADVram::reset
void reset(EmuTime::param time) override
This method is called on reset.
Definition: ADVram.cc:37
openmsx::ADVram::readMem
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
MSXDevice.hh
openmsx::ADVram::ADVram
ADVram(const DeviceConfig &config)
Definition: ADVram.cc:10
openmsx::VDP
VDP
Definition: VDP.cc:1918
openmsx::word
uint16_t word
16 bit unsigned integer
Definition: openmsx.hh:29
openmsx::ADVram::writeMem
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
openmsx
Thanks to enen for testing this on a real cartridge:
Definition: Autofire.cc:5