From b45fe947fbf431d475f7bc16488f4bb8fc0776e4 Mon Sep 17 00:00:00 2001 From: angelosa Date: Mon, 13 Nov 2023 23:45:19 +0100 Subject: m68000/tmp68301.cpp: add stub for TMP68303, recify previous commit to apply for '303 only --- src/devices/cpu/m68000/tmp68301.cpp | 26 ++++++++++++++++++++++---- src/devices/cpu/m68000/tmp68301.h | 15 +++++++++++++++ src/mame/misc/joystand.cpp | 2 +- src/mame/taito/bingowav.cpp | 2 +- src/mame/taito/pkspirit.cpp | 2 +- 5 files changed, 40 insertions(+), 7 deletions(-) diff --git a/src/devices/cpu/m68000/tmp68301.cpp b/src/devices/cpu/m68000/tmp68301.cpp index 112a7a6f247..03d9d417cdf 100644 --- a/src/devices/cpu/m68000/tmp68301.cpp +++ b/src/devices/cpu/m68000/tmp68301.cpp @@ -10,9 +10,10 @@ // - serial parity DEFINE_DEVICE_TYPE(TMP68301, tmp68301_device, "tmp68301", "Toshiba TMP68301") +DEFINE_DEVICE_TYPE(TMP68303, tmp68303_device, "tmp68303", "Toshiba TMP68303") -tmp68301_device::tmp68301_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) : - m68000_mcu_device(mconfig, TMP68301, tag, owner, clock), +tmp68301_device::tmp68301_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock) : + m68000_mcu_device(mconfig, type, tag, owner, clock), m_parallel_r_cb(*this, 0xffff), m_parallel_w_cb(*this), m_tx_cb(*this) @@ -27,6 +28,12 @@ tmp68301_device::tmp68301_device(const machine_config &mconfig, const char *tag, m_serial_external_clock = 0; } +tmp68301_device::tmp68301_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) + : tmp68301_device(mconfig, TMP68301, tag, owner, clock) +{ +} + + void tmp68301_device::internal_update(uint64_t current_time) { // If current_time == 0, only compute the next event time @@ -1261,9 +1268,9 @@ void tmp68301_device::timer_sync(int ch) if(ntctr >= max) { if(m_tcr[ch] & TCR_INT) { - // T0 can't irq, so we compensate by -1 + // On '303 T0 can't irq, so we compensate by -1 there // (pkspirit cares for '7750 inputs) - interrupt_internal_trigger(3 + ch); + interrupt_internal_trigger(base_timer_irq() + ch); } ntctr = ntctr % max; } @@ -1313,3 +1320,14 @@ void tmp68301_device::timer_predict(int ch) m_timer_next_event[ch] = (((ctime >> div) + delta) << div); recompute_bcount(ctime); } + +// 68303 overrides + +// TODO: +// - Stub, needs internal map overrides (DMA, new timers, irq changes, stepping motor controller, other) +// - DMAC for pkspirit + +tmp68303_device::tmp68303_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) + : tmp68301_device(mconfig, TMP68303, tag, owner, clock) +{ +} diff --git a/src/devices/cpu/m68000/tmp68301.h b/src/devices/cpu/m68000/tmp68301.h index 0d3406a827a..aa49f1674ae 100644 --- a/src/devices/cpu/m68000/tmp68301.h +++ b/src/devices/cpu/m68000/tmp68301.h @@ -27,6 +27,8 @@ public: void timer_in_w(int state); protected: + tmp68301_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock); + devcb_read16 m_parallel_r_cb; devcb_write16 m_parallel_w_cb; devcb_write_line::array<3> m_tx_cb; @@ -38,6 +40,8 @@ protected: void internal_update(uint64_t current_time = 0) override; + virtual u8 base_timer_irq() const noexcept { return 4; } + void internal_map(address_map &map); void cpu_space_map(address_map &map); @@ -301,6 +305,17 @@ protected: }; +class tmp68303_device : public tmp68301_device +{ +public: + tmp68303_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); + +private: + virtual u8 base_timer_irq() const noexcept override { return 3; } +}; + DECLARE_DEVICE_TYPE(TMP68301, tmp68301_device) +DECLARE_DEVICE_TYPE(TMP68303, tmp68303_device) + #endif diff --git a/src/mame/misc/joystand.cpp b/src/mame/misc/joystand.cpp index 487c5375c6f..5eedfda19f0 100644 --- a/src/mame/misc/joystand.cpp +++ b/src/mame/misc/joystand.cpp @@ -689,7 +689,7 @@ void joystand_state::joystand(machine_config &config) void joystand_state::x180ii(machine_config &config) { // basic machine hardware - TMP68301(config, m_maincpu, XTAL(16'000'000)); // actually TMP68303F + TMP68303(config, m_maincpu, XTAL(16'000'000)); // TMP68303F m_maincpu->set_addrmap(AS_PROGRAM, &joystand_state::x180ii_map); m_maincpu->parallel_r_cb().set(FUNC(joystand_state::eeprom_r)); m_maincpu->parallel_w_cb().set(FUNC(joystand_state::eeprom_w)); diff --git a/src/mame/taito/bingowav.cpp b/src/mame/taito/bingowav.cpp index f17ac43cdff..a1e1ecc1bc6 100644 --- a/src/mame/taito/bingowav.cpp +++ b/src/mame/taito/bingowav.cpp @@ -115,7 +115,7 @@ INPUT_PORTS_END void bingowav_state::bingowav(machine_config &config) { - TMP68301(config, m_maincpu, 12000000); // actually TMP63803F-16 + TMP68303(config, m_maincpu, 12000000); // TMP63803F-16 m_maincpu->set_addrmap(AS_PROGRAM, &bingowav_state::bingowav_main_map); te7750_device &mainioh(TE7750(config, "mainioh")); diff --git a/src/mame/taito/pkspirit.cpp b/src/mame/taito/pkspirit.cpp index 899fb983a41..324a689fcc3 100644 --- a/src/mame/taito/pkspirit.cpp +++ b/src/mame/taito/pkspirit.cpp @@ -247,7 +247,7 @@ GFXDECODE_END void pkspirit_state::pkspirit(machine_config &config) { // basic machine hardware - TMP68301(config, m_maincpu, 32_MHz_XTAL / 2); // divider not verified, actually TMP68303F-16 + TMP68303(config, m_maincpu, 32_MHz_XTAL / 2); // divider not verified, TMP68303F-16 m_maincpu->set_addrmap(AS_PROGRAM, &pkspirit_state::main_map); m_maincpu->parallel_r_cb().set([this]() { logerror("%s par_r\n", machine().describe_context()); return 0xffff; }); -- cgit v1.2.3