From f60fd23e3e10f140aa4a63ec1cf26cffd78f422a Mon Sep 17 00:00:00 2001 From: 987123879113 <63495610+987123879113@users.noreply.github.com> Date: Fri, 22 Sep 2023 13:56:24 +0900 Subject: 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] --- src/devices/cpu/sh/sh7014.h | 83 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 83 insertions(+) create mode 100644 src/devices/cpu/sh/sh7014.h (limited to 'src/devices/cpu/sh/sh7014.h') 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 auto sci_tx_w() { + return m_sci[Sci].lookup()->write_sci_tx(); + } + + template void sci_set_external_clock_period(const attotime &period) { + m_sci[Sci].lookup()->set_external_clock_period(period); + } + + template 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 m_sci; + required_device m_bsc; + required_device m_dmac; + required_device m_intc; + required_device m_mtu; + required_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 -- cgit v1.2.3-70-g09d2