// license:BSD-3-Clause // copyright-holders:smf #ifndef MAME_CPU_F2MC16_MB90640A_H #define MAME_CPU_F2MC16_MB90640A_H #pragma once #include "f2mc16.h" #include "f2mc16_clock.h" #include "f2mc16_intc.h" #include "f2mc16_port.h" #include "f2mc16_ppg.h" #include "f2mc16_reload.h" #include "f2mc16_uart.h" class mb90640a_device : public f2mc16_device { public: template typename std::enable_if::type &port() const { if (m_port[N]) return *m_port[N]; return *subdevice(m_port[N].finder_tag()); } auto &ppg() const { if (m_ppg) return *m_ppg; return *subdevice(m_ppg.finder_tag()); } template typename std::enable_if::type &reload_timer() const { if (m_reload_timer[N]) return *m_reload_timer[N]; return *subdevice(m_reload_timer[N].finder_tag()); } template typename std::enable_if::type &uart() const { if (m_uart[N]) return *m_uart[N]; return *subdevice(m_uart[N].finder_tag()); } protected: mb90640a_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock); // device_t virtual void device_add_mconfig(machine_config &config) override ATTR_COLD; virtual space_config_vector memory_space_config() const override ATTR_COLD; void internal_map(address_map &map) ATTR_COLD; const address_space_config m_program_config; required_device m_clock_generator; required_device m_intc; required_device_array m_port; required_device m_ppg; required_device_array m_reload_timer; required_device_array m_uart; }; class mb90641a_device : public mb90640a_device { public: mb90641a_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; DECLARE_DEVICE_TYPE(MB90641A, mb90641a_device) #endif // MAME_CPU_F2MC16_MB90640A_H