openMSX
PanasonicMemory.hh
Go to the documentation of this file.
1#ifndef PANASONICMEMORY_HH
2#define PANASONICMEMORY_HH
3
4#include "Rom.hh"
5#include "openmsx.hh"
6#include <optional>
7
8namespace openmsx {
9
10class MSXMotherBoard;
11class MSXCPU;
12class Ram;
13
15{
16public:
17 explicit PanasonicMemory(MSXMotherBoard& motherBoard);
18
23 void registerRam(Ram& ram);
24 [[nodiscard]] const byte* getRomBlock(unsigned block);
25 [[nodiscard]] const byte* getRomRange(unsigned first, unsigned last);
30 [[nodiscard]] byte* getRamBlock(unsigned block);
31 [[nodiscard]] unsigned getRamSize() const { return ramSize; }
32 void setDRAM(bool dram);
33 [[nodiscard]] bool isWritable(unsigned address) const;
34
35private:
36 MSXCPU& msxcpu;
37
38 const std::optional<Rom> rom; // can be nullptr
39 byte* ram = nullptr;
40 unsigned ramSize = 0;
41 bool dram = false;
42};
43
44} // namespace openmsx
45
46#endif
void registerRam(Ram &ram)
Pass reference of the actual Ram block for use in DRAM mode and RAM access via the ROM mapper.
bool isWritable(unsigned address) const
const byte * getRomBlock(unsigned block)
PanasonicMemory(MSXMotherBoard &motherBoard)
const byte * getRomRange(unsigned first, unsigned last)
unsigned getRamSize() const
byte * getRamBlock(unsigned block)
Note that this is always unchecked RAM! There is no UMR detection when accessing Ram in DRAM mode or ...
This file implemented 3 utility functions:
Definition: Autofire.cc:9
Ram
Definition: Ram.cc:108