openMSX
PanasonicMemory.hh
Go to the documentation of this file.
1 #ifndef PANASONICMEMORY_HH
2 #define PANASONICMEMORY_HH
3 
4 #include "openmsx.hh"
5 #include <memory>
6 
7 namespace openmsx {
8 
9 class MSXMotherBoard;
10 class MSXCPU;
11 class Ram;
12 class Rom;
13 
15 {
16 public:
17  explicit PanasonicMemory(MSXMotherBoard& motherBoard);
19 
24  void registerRam(Ram& ram);
25  const byte* getRomBlock(unsigned block);
26  const byte* getRomRange(unsigned first, unsigned last);
31  byte* getRamBlock(unsigned block);
32  unsigned getRamSize() const { return ramSize; }
33  void setDRAM(bool dram);
34  bool isWritable(unsigned address) const;
35 
36 private:
37  MSXCPU& msxcpu;
38 
39  const std::unique_ptr<Rom> rom; // can be nullptr
40  byte* ram;
41  unsigned ramSize;
42  bool dram;
43 };
44 
45 } // namespace openmsx
46 
47 #endif
const byte * getRomRange(unsigned first, unsigned last)
uint8_t byte
8 bit unsigned integer
Definition: openmsx.hh:26
void registerRam(Ram &ram)
Pass reference of the actual Ram block for use in DRAM mode and RAM access via the ROM mapper...
Ram
Definition: Ram.cc:124
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 ...
Thanks to enen for testing this on a real cartridge:
Definition: Autofire.cc:5
PanasonicMemory(MSXMotherBoard &motherBoard)
bool isWritable(unsigned address) const
const byte * getRomBlock(unsigned block)