mirror of
https://github.com/holub/mame
synced 2025-04-23 17:00:53 +03:00
taitosj: add the other mode for MCU interrupts (not used by anything yet)
This commit is contained in:
parent
a716e67787
commit
0422077dbd
@ -1814,6 +1814,7 @@ static MACHINE_CONFIG_DERIVED( mcu, nomcu )
|
||||
MCFG_CPU_PROGRAM_MAP(taitosj_main_mcu_map)
|
||||
|
||||
MCFG_CPU_ADD("bmcu", TAITO_SJ_SECURITY_MCU, XTAL_3MHz) /* xtal is 3MHz, divided by 4 internally */
|
||||
MCFG_TAITO_SJ_SECURITY_MCU_INT_MODE(LATCH)
|
||||
MCFG_TAITO_SJ_SECURITY_MCU_68READ_CB(READ8(taitosj_state, mcu_mem_r))
|
||||
MCFG_TAITO_SJ_SECURITY_MCU_68WRITE_CB(WRITE8(taitosj_state, mcu_mem_w))
|
||||
MCFG_TAITO_SJ_SECURITY_MCU_68INTRQ_CB(WRITELINE(taitosj_state, mcu_intrq_w))
|
||||
|
@ -17,8 +17,8 @@ DECLARE_DEVICE_TYPE(ARKANOID_68705P5, arkanoid_68705p5_device)
|
||||
class taito68705_mcu_device_base : public device_t
|
||||
{
|
||||
public:
|
||||
template <typename Obj> static devcb_base &set_semaphore_cb(device_t &device, Obj &&object)
|
||||
{ return downcast<taito68705_mcu_device_base &>(device).m_semaphore_cb.set_callback(std::forward<Obj>(object)); }
|
||||
template <typename Obj> static devcb_base &set_semaphore_cb(device_t &device, Obj &&cb)
|
||||
{ return downcast<taito68705_mcu_device_base &>(device).m_semaphore_cb.set_callback(std::forward<Obj>(cb)); }
|
||||
|
||||
// host interface
|
||||
DECLARE_READ8_MEMBER(data_r);
|
||||
@ -64,13 +64,13 @@ private:
|
||||
|
||||
|
||||
#define MCFG_TAITO_M68705_AUX_STROBE_CB(cb) \
|
||||
taito68705_mcu_device::set_aux_strobe_cb(*device, DEVCB_##cb);
|
||||
devcb = &taito68705_mcu_device::set_aux_strobe_cb(*device, DEVCB_##cb);
|
||||
|
||||
class taito68705_mcu_device : public taito68705_mcu_device_base
|
||||
{
|
||||
public:
|
||||
template <typename Obj> static devcb_base &set_aux_strobe_cb(device_t &device, Obj &&object)
|
||||
{ return downcast<taito68705_mcu_device &>(device).m_aux_strobe_cb.set_callback(std::forward<Obj>(object)); }
|
||||
template <typename Obj> static devcb_base &set_aux_strobe_cb(device_t &device, Obj &&cb)
|
||||
{ return downcast<taito68705_mcu_device &>(device).m_aux_strobe_cb.set_callback(std::forward<Obj>(cb)); }
|
||||
|
||||
taito68705_mcu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
|
||||
|
||||
@ -100,16 +100,16 @@ protected:
|
||||
|
||||
|
||||
#define MCFG_ARKANOID_MCU_SEMAPHORE_CB(cb) \
|
||||
arkanoid_mcu_device_base::set_semaphore_cb(*device, DEVCB_##cb);
|
||||
devcb = &arkanoid_mcu_device_base::set_semaphore_cb(*device, DEVCB_##cb);
|
||||
|
||||
#define MCFG_ARKANOID_MCU_PORTB_R_CB(cb) \
|
||||
arkanoid_mcu_device_base::set_portb_r_cb(*device, DEVCB_##cb);
|
||||
devcb = &arkanoid_mcu_device_base::set_portb_r_cb(*device, DEVCB_##cb);
|
||||
|
||||
class arkanoid_mcu_device_base : public taito68705_mcu_device_base
|
||||
{
|
||||
public:
|
||||
template <typename Obj> static devcb_base &set_portb_r_cb(device_t &device, Obj &&object)
|
||||
{ return downcast<arkanoid_mcu_device_base &>(device).m_portb_r_cb.set_callback(std::forward<Obj>(object)); }
|
||||
template <typename Obj> static devcb_base &set_portb_r_cb(device_t &device, Obj &&cb)
|
||||
{ return downcast<arkanoid_mcu_device_base &>(device).m_portb_r_cb.set_callback(std::forward<Obj>(cb)); }
|
||||
|
||||
protected:
|
||||
arkanoid_mcu_device_base(
|
||||
|
@ -13,6 +13,7 @@ taito_sj_security_mcu_device::taito_sj_security_mcu_device(
|
||||
u32 clock)
|
||||
: device_t(mconfig,TAITO_SJ_SECURITY_MCU, tag, owner, clock)
|
||||
, m_mcu(*this, "mcu")
|
||||
, m_int_mode(int_mode::NONE)
|
||||
, m_68read_cb(*this)
|
||||
, m_68write_cb(*this)
|
||||
, m_68intrq_cb(*this)
|
||||
@ -54,7 +55,10 @@ WRITE8_MEMBER(taito_sj_security_mcu_device::data_w)
|
||||
if (BIT(offset, 0))
|
||||
{
|
||||
// ZINTRQ
|
||||
// FIXME: this can be jumpered to /INT on the MCU
|
||||
// if jumpered this way, the Z80 write strobe pulses the MCU interrupt line
|
||||
// should be PULSE_LINE because it's edge sensitive, but diexec only allows PULSE_LINE on reset and NMI
|
||||
if (int_mode::WRITE == m_int_mode)
|
||||
m_mcu->set_input_line(M68705_IRQ_LINE, HOLD_LINE);
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -77,7 +81,8 @@ WRITE_LINE_MEMBER(taito_sj_security_mcu_device::reset_w)
|
||||
{
|
||||
m_zaccept = true;
|
||||
m_zready = false;
|
||||
m_mcu->set_input_line(M68705_IRQ_LINE, CLEAR_LINE);
|
||||
if (int_mode::LATCH == m_int_mode)
|
||||
m_mcu->set_input_line(M68705_IRQ_LINE, CLEAR_LINE);
|
||||
}
|
||||
m_mcu->set_input_line(INPUT_LINE_RESET, state);
|
||||
}
|
||||
@ -112,7 +117,8 @@ void taito_sj_security_mcu_device::device_reset()
|
||||
{
|
||||
m_zaccept = true;
|
||||
m_zready = false;
|
||||
m_mcu->set_input_line(M68705_IRQ_LINE, CLEAR_LINE);
|
||||
if (int_mode::LATCH == m_int_mode)
|
||||
m_mcu->set_input_line(M68705_IRQ_LINE, CLEAR_LINE);
|
||||
}
|
||||
|
||||
MACHINE_CONFIG_MEMBER(taito_sj_security_mcu_device::device_add_mconfig)
|
||||
@ -158,7 +164,8 @@ WRITE8_MEMBER(taito_sj_security_mcu_device::mcu_pb_w)
|
||||
if (BIT(diff & data, 1))
|
||||
{
|
||||
machine().scheduler().synchronize(timer_expired_delegate(FUNC(taito_sj_security_mcu_device::do_mcu_read), this));
|
||||
m_mcu->set_input_line(M68705_IRQ_LINE, CLEAR_LINE);
|
||||
if (int_mode::LATCH == m_int_mode)
|
||||
m_mcu->set_input_line(M68705_IRQ_LINE, CLEAR_LINE);
|
||||
}
|
||||
|
||||
// 68LWR
|
||||
@ -218,7 +225,7 @@ TIMER_CALLBACK_MEMBER(taito_sj_security_mcu_device::do_host_write)
|
||||
if (!m_reset)
|
||||
{
|
||||
m_zready = true;
|
||||
// FIXME: this can be jumpered off if ZINTRQ is being used
|
||||
m_mcu->set_input_line(M68705_IRQ_LINE, ASSERT_LINE);
|
||||
if (int_mode::LATCH == m_int_mode)
|
||||
m_mcu->set_input_line(M68705_IRQ_LINE, ASSERT_LINE);
|
||||
}
|
||||
}
|
||||
|
@ -7,12 +7,11 @@
|
||||
|
||||
#include "cpu/m6805/m68705.h"
|
||||
|
||||
// TODO: there should be a device representing the whole security board with both the Z80 and 68705
|
||||
|
||||
|
||||
DECLARE_DEVICE_TYPE(TAITO_SJ_SECURITY_MCU, taito_sj_security_mcu_device)
|
||||
|
||||
|
||||
#define MCFG_TAITO_SJ_SECURITY_MCU_INT_MODE(mode) \
|
||||
taito_sj_security_mcu_device::set_int_mode(*device, taito_sj_security_mcu_device::int_mode::mode);
|
||||
#define MCFG_TAITO_SJ_SECURITY_MCU_68READ_CB(cb) \
|
||||
devcb = &taito_sj_security_mcu_device::set_68read_cb(*device, DEVCB_##cb);
|
||||
#define MCFG_TAITO_SJ_SECURITY_MCU_68WRITE_CB(cb) \
|
||||
@ -25,6 +24,15 @@ DECLARE_DEVICE_TYPE(TAITO_SJ_SECURITY_MCU, taito_sj_security_mcu_device)
|
||||
class taito_sj_security_mcu_device : public device_t
|
||||
{
|
||||
public:
|
||||
enum class int_mode
|
||||
{
|
||||
NONE,
|
||||
LATCH,
|
||||
WRITE
|
||||
};
|
||||
|
||||
static void set_int_mode(device_t &device, int_mode mode)
|
||||
{ downcast<taito_sj_security_mcu_device &>(device).m_int_mode = mode; }
|
||||
template <typename Obj> static devcb_base &set_68read_cb(device_t &device, Obj &&cb)
|
||||
{ return downcast<taito_sj_security_mcu_device &>(device).m_68read_cb.set_callback(std::forward<Obj>(cb)); }
|
||||
template <typename Obj> static devcb_base &set_68write_cb(device_t &device, Obj &&cb)
|
||||
@ -67,6 +75,7 @@ private:
|
||||
|
||||
required_device<m68705p_device> m_mcu;
|
||||
|
||||
int_mode m_int_mode;
|
||||
devcb_read8 m_68read_cb;
|
||||
devcb_write8 m_68write_cb;
|
||||
devcb_write_line m_68intrq_cb;
|
||||
|
Loading…
Reference in New Issue
Block a user