// $Id: MSXMemoryMapper.hh 5842 2006-11-04 18:47:26Z m9710797 $ #ifndef MSXMEMORYMAPPER_HH #define MSXMEMORYMAPPER_HH #include "MSXDevice.hh" #include namespace openmsx { class XMLElement; class MSXMapperIO; class CheckedRam; class MSXMemoryMapper : public MSXDevice { public: MSXMemoryMapper(MSXMotherBoard& motherBoard, const XMLElement& config, const EmuTime& time); virtual ~MSXMemoryMapper(); virtual void powerUp(const EmuTime& time); virtual byte readMem(word address, const EmuTime& time); virtual void writeMem(word address, byte value, const EmuTime& time); virtual const byte* getReadCacheLine(word start) const; virtual byte* getWriteCacheLine(word start) const; virtual byte peekMem(word address, const EmuTime& time) const; virtual void reset(const EmuTime& time); protected: /** Converts a Z80 address to a RAM address. * @param address Index in Z80 address space. * @return Index in RAM address space. */ unsigned calcAddress(word address) const; std::auto_ptr checkedRam; private: void createMapperIO(); void destroyMapperIO(); unsigned nbBlocks; MSXMapperIO* mapperIO; }; } // namespace openmsx #endif