openMSX
ADVram.hh
Go to the documentation of this file.
1#ifndef ADVRAM_HH
2#define ADVRAM_HH
3
4#include "MSXDevice.hh"
5
6namespace openmsx {
7
8class VDP;
9class VDPVRAM;
10
15class ADVram final : public MSXDevice
16{
17public:
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
51private:
52 void init() override;
53 [[nodiscard]] inline unsigned calcAddress(word address) const;
54
55private:
56 VDP* vdp = nullptr;
57 VDPVRAM* vram = nullptr;
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:75
void writeIO(word port, byte value, EmuTime::param time) override
Write a byte to a given IO port, set mapper register.
Definition ADVram.cc:55
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:70
byte readIO(word port, EmuTime::param time) override
Read a byte from an IO port, change mode bits.
Definition ADVram.cc:43
void reset(EmuTime::param time) override
This method is called on reset.
Definition ADVram.cc:35
void serialize(Archive &ar, unsigned version)
Definition ADVram.cc:83
An MSXDevice is an emulated hardware component connected to the bus of the emulated MSX.
Definition MSXDevice.hh:36
Manages VRAM contents and synchronizes the various users of the VRAM.
Definition VDPVRAM.hh:399
Unified implementation of MSX Video Display Processors (VDPs).
Definition VDP.hh:67
This file implemented 3 utility functions:
Definition Autofire.cc:11
uint16_t word
16 bit unsigned integer
Definition openmsx.hh:29