diff options
Diffstat (limited to 'src/devices/bus/msx_slot/slot.h')
-rw-r--r-- | src/devices/bus/msx_slot/slot.h | 25 |
1 files changed, 18 insertions, 7 deletions
diff --git a/src/devices/bus/msx_slot/slot.h b/src/devices/bus/msx_slot/slot.h index 3a95c7b6b75..295f6e45e6d 100644 --- a/src/devices/bus/msx_slot/slot.h +++ b/src/devices/bus/msx_slot/slot.h @@ -25,22 +25,33 @@ public: // configuration helpers template <typename T> void set_memory_space(T &&tag, int spacenum) { m_mem_space.set_tag(std::forward<T>(tag), spacenum); } template <typename T> void set_io_space(T &&tag, int spacenum) { m_io_space.set_tag(std::forward<T>(tag), spacenum); } - void set_start_address(uint32_t start_address) { m_start_address = start_address; m_end_address = m_start_address + m_size; } - void set_size(uint32_t size) { m_size = size; m_end_address = m_start_address + m_size; } + template <typename T> void set_maincpu(T &&tag) { m_maincpu.set_tag(std::forward<T>(tag)); } + void set_start_address(u32 start_address) { m_start_address = start_address; m_end_address = m_start_address + m_size; } + void set_size(u32 size) { m_size = size; m_end_address = m_start_address + m_size; } - virtual uint8_t read(offs_t offset) { return 0xFF; } - virtual void write(offs_t offset, uint8_t data) { } + void install(memory_view::memory_view_entry *page0, memory_view::memory_view_entry *page1, memory_view::memory_view_entry *page2, memory_view::memory_view_entry *page3); address_space &memory_space() const { return *m_mem_space; } address_space &io_space() const { return *m_io_space; } + cpu_device &maincpu() const { return *m_maincpu; } + bool page_configured(int i) { return bool(m_page[i]); } + memory_view::memory_view_entry *page(int i) + { + if (!m_page[i]) + fatalerror("page %i view not configured\n", i); + return m_page[i]; + } protected: required_address_space m_mem_space; required_address_space m_io_space; + required_device<cpu_device> m_maincpu; - uint32_t m_start_address; - uint32_t m_size; - uint32_t m_end_address; + u32 m_start_address; + u32 m_size; + u32 m_end_address; + + memory_view::memory_view_entry *m_page[4]; }; #endif // MAME_BUS_MSX_SLOT_SLOT_H |