diff options
author | 2023-09-22 13:56:24 +0900 | |
---|---|---|
committer | 2023-09-22 14:56:24 +1000 | |
commit | f60fd23e3e10f140aa4a63ec1cf26cffd78f422a (patch) | |
tree | e203d59afaa7da25cf63748eac9501ed65108216 /src/devices/cpu/sh/sh7014.h | |
parent | 85ce279c637a21d9a62627392d1636ece7ec360d (diff) |
namco/namcos12.cpp: Emulated games with CDXA board. (#11558)
* machine/t10mmc.cpp: Added support for T10SBC_CMD_SEEK_10 command.
* cpu/sh: Added SH7014 SoC.
* machine/icd2061a.cpp: Emulated IC Designs 2061A programmable clock generator.
* sound/lc78836m.cpp: Emulated Sanyo LC78836M audio DAC.
* namco/namcos12_cdxa.cpp: Emulated Namco System 12 CDXA board.
Systems promoted to working
-----------------------------
Truck Kyosokyoku (Japan, TKK2/VER.A) [Windy Fairy]
New working systems
-----------------------------
Um Jammer Lammy NOW! (Japan, UL1/VER.A) [Phil Bennett, Eric Yockey, Windy Fairy]
Diffstat (limited to 'src/devices/cpu/sh/sh7014.h')
-rw-r--r-- | src/devices/cpu/sh/sh7014.h | 83 |
1 files changed, 83 insertions, 0 deletions
diff --git a/src/devices/cpu/sh/sh7014.h b/src/devices/cpu/sh/sh7014.h new file mode 100644 index 00000000000..873581404d1 --- /dev/null +++ b/src/devices/cpu/sh/sh7014.h @@ -0,0 +1,83 @@ +// license:BSD-3-Clause +// copyright-holders:windyfairy +/*************************************************************************** + + SH-2 SH7014 + +***************************************************************************/ + +#ifndef MAME_CPU_SH_SH7014_H +#define MAME_CPU_SH_SH7014_H + +#pragma once + +#include "sh2.h" +#include "sh7014_bsc.h" +#include "sh7014_dmac.h" +#include "sh7014_intc.h" +#include "sh7014_mtu.h" +#include "sh7014_port.h" +#include "sh7014_sci.h" + +class sh2_sh7014_device : public sh2_device +{ +public: + sh2_sh7014_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + + template<int Sci> auto sci_tx_w() { + return m_sci[Sci].lookup()->write_sci_tx(); + } + + template<int Sci> void sci_set_external_clock_period(const attotime &period) { + m_sci[Sci].lookup()->set_external_clock_period(period); + } + + template<int Sci> void sci_set_send_full_data_transmit_on_sync_hack(bool enabled) { + m_sci[Sci].lookup()->set_send_full_data_transmit_on_sync_hack(enabled); + } + + auto read_porta() { return m_port.lookup()->port_a_read_callback(); } + auto write_porta() { return m_port.lookup()->port_a_write_callback(); } + + auto read_portb() { return m_port.lookup()->port_b_read_callback(); } + auto write_portb() { return m_port.lookup()->port_b_write_callback(); } + + auto read_porte() { return m_port.lookup()->port_e_read_callback(); } + auto write_porte() { return m_port.lookup()->port_e_write_callback(); } + + auto read_portf() { return m_port.lookup()->port_f_read_callback(); } + +protected: + virtual void device_start() override; + virtual void device_reset() override; + virtual void device_add_mconfig(machine_config &config) override; + + virtual void execute_set_input(int inputnum, int state) override; + + virtual void sh2_exception_internal(const char *message, int irqline, int vector) override; + +private: + void sh7014_map(address_map &map); + + void set_irq(int vector, int level, bool is_internal); + + void notify_dma_source(uint32_t source); + + uint16_t ccr_r(); + void ccr_w(offs_t offset, uint16_t dat, uint16_t mem_mask = ~0); + + required_device_array<sh7014_sci_device, 2> m_sci; + required_device<sh7014_bsc_device> m_bsc; + required_device<sh7014_dmac_device> m_dmac; + required_device<sh7014_intc_device> m_intc; + required_device<sh7014_mtu_device> m_mtu; + required_device<sh7014_port_device> m_port; + + devcb_write_line::array<2> m_sci_tx_cb; + + uint16_t m_ccr; +}; + +DECLARE_DEVICE_TYPE(SH2_SH7014, sh2_sh7014_device) + +#endif // MAME_CPU_SH_SH7014_H |