diff options
author | 2018-10-17 20:02:52 +0200 | |
---|---|---|
committer | 2018-10-17 20:02:52 +0200 | |
commit | 1cd55d138b487e262667b01a8bc119da76e99757 (patch) | |
tree | 03420d99483e6b1c4f7e924ca15a8e02abce38c1 | |
parent | f260c76f20cc9abc770c1e9ba7e192600d604d59 (diff) |
taitosjsec.cpp: added missing save state, fixes save state regressions in various taito sj games. Also removed MCFG macros (nw)
-rw-r--r-- | src/mame/drivers/taitosj.cpp | 12 | ||||
-rw-r--r-- | src/mame/machine/taitosjsec.cpp | 16 | ||||
-rw-r--r-- | src/mame/machine/taitosjsec.h | 18 |
3 files changed, 19 insertions, 27 deletions
diff --git a/src/mame/drivers/taitosj.cpp b/src/mame/drivers/taitosj.cpp index 69370b98ab5..16296444801 100644 --- a/src/mame/drivers/taitosj.cpp +++ b/src/mame/drivers/taitosj.cpp @@ -1851,12 +1851,12 @@ MACHINE_CONFIG_START(taitosj_state::mcu) MCFG_DEVICE_MODIFY("maincpu") MCFG_DEVICE_PROGRAM_MAP(taitosj_main_mcu_map) - MCFG_DEVICE_ADD("bmcu", TAITO_SJ_SECURITY_MCU, XTAL(3'000'000)) /* xtal is 3MHz, divided by 4 internally */ - MCFG_TAITO_SJ_SECURITY_MCU_INT_MODE(LATCH) - MCFG_TAITO_SJ_SECURITY_MCU_68READ_CB(READ8(*this, taitosj_state, mcu_mem_r)) - MCFG_TAITO_SJ_SECURITY_MCU_68WRITE_CB(WRITE8(*this, taitosj_state, mcu_mem_w)) - MCFG_TAITO_SJ_SECURITY_MCU_68INTRQ_CB(WRITELINE(*this, taitosj_state, mcu_intrq_w)) - MCFG_TAITO_SJ_SECURITY_MCU_BUSRQ_CB(WRITELINE(*this, taitosj_state, mcu_busrq_w)) + TAITO_SJ_SECURITY_MCU(config, m_mcu, XTAL(3'000'000)); /* xtal is 3MHz, divided by 4 internally */ + m_mcu->set_int_mode(taito_sj_security_mcu_device::int_mode::LATCH); + m_mcu->m68read_cb().set(FUNC(taitosj_state::mcu_mem_r)); + m_mcu->m68write_cb().set(FUNC(taitosj_state::mcu_mem_w)); + m_mcu->m68intrq_cb().set(FUNC(taitosj_state::mcu_intrq_w)); + m_mcu->busrq_cb().set(FUNC(taitosj_state::mcu_busrq_w)); MCFG_QUANTUM_TIME(attotime::from_hz(6000)) MACHINE_CONFIG_END diff --git a/src/mame/machine/taitosjsec.cpp b/src/mame/machine/taitosjsec.cpp index cbb2502078c..e5eb6877c43 100644 --- a/src/mame/machine/taitosjsec.cpp +++ b/src/mame/machine/taitosjsec.cpp @@ -100,6 +100,7 @@ void taito_sj_security_mcu_device::device_start() save_item(NAME(m_read_data)); save_item(NAME(m_zaccept)); save_item(NAME(m_zready)); + save_item(NAME(m_pa_val)); save_item(NAME(m_pb_val)); save_item(NAME(m_busak)); save_item(NAME(m_reset)); @@ -121,13 +122,14 @@ void taito_sj_security_mcu_device::device_reset() m_mcu->set_input_line(M68705_IRQ_LINE, CLEAR_LINE); } -MACHINE_CONFIG_START(taito_sj_security_mcu_device::device_add_mconfig) - MCFG_DEVICE_ADD("mcu", M68705P5, DERIVED_CLOCK(1, 1)) - MCFG_M68705_PORTA_R_CB(READ8(*this, taito_sj_security_mcu_device, mcu_pa_r)) - MCFG_M68705_PORTC_R_CB(READ8(*this, taito_sj_security_mcu_device, mcu_pc_r)) - MCFG_M68705_PORTA_W_CB(WRITE8(*this, taito_sj_security_mcu_device, mcu_pa_w)) - MCFG_M68705_PORTB_W_CB(WRITE8(*this, taito_sj_security_mcu_device, mcu_pb_w)) -MACHINE_CONFIG_END +void taito_sj_security_mcu_device::device_add_mconfig(machine_config &config) +{ + M68705P5(config, m_mcu, DERIVED_CLOCK(1, 1)); + m_mcu->porta_r_cb().set(FUNC(taito_sj_security_mcu_device::mcu_pa_r)); + m_mcu->portc_r_cb().set(FUNC(taito_sj_security_mcu_device::mcu_pc_r)); + m_mcu->porta_w_cb().set(FUNC(taito_sj_security_mcu_device::mcu_pa_w)); + m_mcu->portb_w_cb().set(FUNC(taito_sj_security_mcu_device::mcu_pb_w)); +} READ8_MEMBER(taito_sj_security_mcu_device::mcu_pa_r) { diff --git a/src/mame/machine/taitosjsec.h b/src/mame/machine/taitosjsec.h index d46e5ec705f..c952a532e57 100644 --- a/src/mame/machine/taitosjsec.h +++ b/src/mame/machine/taitosjsec.h @@ -10,16 +10,6 @@ DECLARE_DEVICE_TYPE(TAITO_SJ_SECURITY_MCU, taito_sj_security_mcu_device) -#define MCFG_TAITO_SJ_SECURITY_MCU_INT_MODE(mode) \ - downcast<taito_sj_security_mcu_device &>(*device).set_int_mode(taito_sj_security_mcu_device::int_mode::mode); -#define MCFG_TAITO_SJ_SECURITY_MCU_68READ_CB(cb) \ - downcast<taito_sj_security_mcu_device &>(*device).set_68read_cb(DEVCB_##cb); -#define MCFG_TAITO_SJ_SECURITY_MCU_68WRITE_CB(cb) \ - downcast<taito_sj_security_mcu_device &>(*device).set_68write_cb(DEVCB_##cb); -#define MCFG_TAITO_SJ_SECURITY_MCU_68INTRQ_CB(cb) \ - downcast<taito_sj_security_mcu_device &>(*device).set_68intrq_cb(DEVCB_##cb); -#define MCFG_TAITO_SJ_SECURITY_MCU_BUSRQ_CB(cb) \ - downcast<taito_sj_security_mcu_device &>(*device).set_busrq_cb(DEVCB_##cb); class taito_sj_security_mcu_device : public device_t { @@ -32,10 +22,10 @@ public: }; void set_int_mode(int_mode mode) { m_int_mode = mode; } - template <typename Obj> devcb_base &set_68read_cb(Obj &&cb) { return m_68read_cb.set_callback(std::forward<Obj>(cb)); } - template <typename Obj> devcb_base &set_68write_cb(Obj &&cb) { return m_68write_cb.set_callback(std::forward<Obj>(cb)); } - template <typename Obj> devcb_base &set_68intrq_cb(Obj &&cb) { return m_68intrq_cb.set_callback(std::forward<Obj>(cb)); } - template <typename Obj> devcb_base &set_busrq_cb(Obj &&cb) { return m_busrq_cb.set_callback(std::forward<Obj>(cb)); } + auto m68read_cb() { return m_68read_cb.bind(); } + auto m68write_cb() { return m_68write_cb.bind(); } + auto m68intrq_cb() { return m_68intrq_cb.bind(); } + auto busrq_cb() { return m_busrq_cb.bind(); } taito_sj_security_mcu_device( machine_config const &mconfig, |