diff options
author | 2019-01-17 19:49:27 -0500 | |
---|---|---|
committer | 2019-01-17 19:49:27 -0500 | |
commit | 326a93f937ff37b0b5ad66a9c358a161163cda5b (patch) | |
tree | 726928fdd0067f693ea11b507e1f9ae8f86b712e | |
parent | a527525e52d086c7550f87c82cba5f8204e4d61a (diff) |
z8: Add Z8682 type with (fake) internal ROM; prevent timer from endlessly thrashing with a count of 1
-rw-r--r-- | src/devices/cpu/z8/z8.cpp | 26 | ||||
-rw-r--r-- | src/devices/cpu/z8/z8.h | 13 |
2 files changed, 36 insertions, 3 deletions
diff --git a/src/devices/cpu/z8/z8.cpp b/src/devices/cpu/z8/z8.cpp index d5e19fe831f..07e38b3c112 100644 --- a/src/devices/cpu/z8/z8.cpp +++ b/src/devices/cpu/z8/z8.cpp @@ -119,6 +119,7 @@ DEFINE_DEVICE_TYPE(UB8830D, ub8830d_device, "ub8830d", "UB8830D") DEFINE_DEVICE_TYPE(Z8611, z8611_device, "z8611", "Zilog Z8611") DEFINE_DEVICE_TYPE(Z8671, z8671_device, "z8671", "Zilog Z8671") DEFINE_DEVICE_TYPE(Z8681, z8681_device, "z8681", "Zilog Z8681") +DEFINE_DEVICE_TYPE(Z8682, z8682_device, "z8682", "Zilog Z8682") /*************************************************************************** @@ -215,6 +216,23 @@ z8681_device::z8681_device(const machine_config &mconfig, const char *tag, devic } +z8682_device::z8682_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) + : z8_device(mconfig, Z8682, tag, owner, clock, 0x800, true) +{ +} + +ROM_START(z8682) + // Zilog admits that this nominally ROMless type uses a "small internal ROM" + ROM_REGION(0x0800, "internal", 0) + ROM_LOAD("z8682.bin", 0x0000, 0x0800, CRC(37525bc8) SHA1(3ce6251d647c4af4a7cbd854f6de1b4027c9f27a) BAD_DUMP) // hand-crafted bootstrap +ROM_END + +const tiny_rom_entry *z8682_device::device_rom_region() const +{ + return ROM_NAME(z8682); +} + + std::unique_ptr<util::disasm_interface> z8_device::create_disassembler() { return std::make_unique<z8_disassembler>(); @@ -845,7 +863,8 @@ TIMER_CALLBACK_MEMBER( z8_device::t0_tick ) if (m_count[0] == 0) { m_count[0] = m_t[0]; - m_t0_timer->adjust(attotime::zero, 0, cycles_to_attotime(4 * ((m_pre[0] >> 2) + 1))); + attotime period = cycles_to_attotime(4 * ((m_pre[0] >> 2) + 1)); + m_t0_timer->adjust(period, 0, period); m_t0_timer->enable(m_pre[0] & Z8_PRE0_COUNT_MODULO_N); request_interrupt(4); } @@ -858,8 +877,9 @@ TIMER_CALLBACK_MEMBER( z8_device::t1_tick ) if (m_count[1] == 0) { m_count[1] = m_t[1]; - m_t1_timer->adjust(attotime::zero, 0, cycles_to_attotime(4 * ((m_pre[1] >> 2) + 1))); - m_t1_timer->enable(m_pre[1] & Z8_PRE0_COUNT_MODULO_N); + attotime period = cycles_to_attotime(4 * ((m_pre[1] >> 2) + 1)); + m_t1_timer->adjust(period, 0, period); + m_t1_timer->enable(m_pre[1] & Z8_PRE1_COUNT_MODULO_N); request_interrupt(5); } } diff --git a/src/devices/cpu/z8/z8.h b/src/devices/cpu/z8/z8.h index 0bdd235d7c2..e031c97264c 100644 --- a/src/devices/cpu/z8/z8.h +++ b/src/devices/cpu/z8/z8.h @@ -396,6 +396,16 @@ public: }; +class z8682_device : public z8_device +{ +public: + z8682_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + +protected: + const tiny_rom_entry *device_rom_region() const override; +}; + + // Zilog Z8601 DECLARE_DEVICE_TYPE(Z8601, z8601_device) @@ -411,4 +421,7 @@ DECLARE_DEVICE_TYPE(Z8671, z8671_device) // Zilog Z8681 ROMless DECLARE_DEVICE_TYPE(Z8681, z8681_device) +// Zilog Z8682 ROMless (boot to 0812H) +DECLARE_DEVICE_TYPE(Z8682, z8682_device) + #endif // MAME_CPU_Z8_Z8_H |