summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices/machine/68340.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/devices/machine/68340.cpp')
-rw-r--r--src/devices/machine/68340.cpp50
1 files changed, 40 insertions, 10 deletions
diff --git a/src/devices/machine/68340.cpp b/src/devices/machine/68340.cpp
index 0de1bf4dcf8..1aaa6ee78dd 100644
--- a/src/devices/machine/68340.cpp
+++ b/src/devices/machine/68340.cpp
@@ -77,12 +77,24 @@ WRITE32_MEMBER( m68340_cpu_device::m68340_internal_base_w )
{
int base = m68340_base & 0xfffff000;
- internal->install_readwrite_handler(base + 0x000, base + 0x03f, read16_delegate(FUNC(m68340_cpu_device::m68340_internal_sim_r),this), write16_delegate(FUNC(m68340_cpu_device::m68340_internal_sim_w),this),0xffffffff);
- internal->install_readwrite_handler(base + 0x010, base + 0x01f, read8_delegate(FUNC(m68340_cpu_device::m68340_internal_sim_ports_r),this),write8_delegate(FUNC(m68340_cpu_device::m68340_internal_sim_ports_w),this),0xffffffff);
- internal->install_readwrite_handler(base + 0x040, base + 0x05f, read32_delegate(FUNC(m68340_cpu_device::m68340_internal_sim_cs_r),this), write32_delegate(FUNC(m68340_cpu_device::m68340_internal_sim_cs_w),this));
- internal->install_readwrite_handler(base + 0x600, base + 0x67f, read32_delegate(FUNC(m68340_cpu_device::m68340_internal_timer_r),this), write32_delegate(FUNC(m68340_cpu_device::m68340_internal_timer_w),this));
- internal->install_readwrite_handler(base + 0x700, base + 0x723, read32_delegate(FUNC(m68340_cpu_device::m68340_internal_serial_r),this), write32_delegate(FUNC(m68340_cpu_device::m68340_internal_serial_w),this));
- internal->install_readwrite_handler(base + 0x780, base + 0x7bf, read32_delegate(FUNC(m68340_cpu_device::m68340_internal_dma_r),this), write32_delegate(FUNC(m68340_cpu_device::m68340_internal_dma_w),this));
+ internal->install_readwrite_handler(base + 0x000, base + 0x03f,
+ read16_delegate(FUNC(m68340_cpu_device::m68340_internal_sim_r),this),
+ write16_delegate(FUNC(m68340_cpu_device::m68340_internal_sim_w),this),0xffffffff);
+ internal->install_readwrite_handler(base + 0x010, base + 0x01f, // Intentionally punches a hole in previous address mapping
+ read8_delegate(FUNC(m68340_cpu_device::m68340_internal_sim_ports_r),this),
+ write8_delegate(FUNC(m68340_cpu_device::m68340_internal_sim_ports_w),this),0xffffffff);
+ internal->install_readwrite_handler(base + 0x040, base + 0x05f,
+ read32_delegate(FUNC(m68340_cpu_device::m68340_internal_sim_cs_r),this),
+ write32_delegate(FUNC(m68340_cpu_device::m68340_internal_sim_cs_w),this));
+ internal->install_readwrite_handler(base + 0x600, base + 0x67f,
+ read16_delegate(FUNC(m68340_cpu_device::m68340_internal_timer_r),this),
+ write16_delegate(FUNC(m68340_cpu_device::m68340_internal_timer_w),this),0xffffffff);
+ internal->install_readwrite_handler(base + 0x700, base + 0x723,
+ read32_delegate(FUNC(m68340_cpu_device::m68340_internal_serial_r),this),
+ write32_delegate(FUNC(m68340_cpu_device::m68340_internal_serial_w),this));
+ internal->install_readwrite_handler(base + 0x780, base + 0x7bf,
+ read32_delegate(FUNC(m68340_cpu_device::m68340_internal_dma_r),this),
+ write32_delegate(FUNC(m68340_cpu_device::m68340_internal_dma_w),this));
}
@@ -107,10 +119,19 @@ ADDRESS_MAP_END
m68340_cpu_device::m68340_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
: fscpu32_device(mconfig, tag, owner, clock, M68340, 32,32, ADDRESS_MAP_NAME(m68340_internal_map))
- ,m_pa_out_cb(*this)
- ,m_pa_in_cb(*this)
- ,m_pb_out_cb(*this)
- ,m_pb_in_cb(*this)
+ , m_clock_mode(0)
+ , m_crystal(0)
+ , m_extal(0)
+ , m_pa_out_cb(*this)
+ , m_pa_in_cb(*this)
+ , m_pb_out_cb(*this)
+ , m_pb_in_cb(*this)
+ , m_tout1_out_cb(*this)
+ , m_tin1_in_cb(*this)
+ , m_tgate1_in_cb(*this)
+ , m_tout2_out_cb(*this)
+ , m_tin2_in_cb(*this)
+ , m_tgate2_in_cb(*this)
{
m68340SIM = nullptr;
m68340DMA = nullptr;
@@ -129,6 +150,14 @@ void m68340_cpu_device::device_reset()
fscpu32_device::device_reset();
}
+// Some hardwares pulls this low when resetting peripherals, most just ties this line to GND or VCC
+// TODO: Support Limp mode and external clock with no PLL
+WRITE_LINE_MEMBER( m68340_cpu_device::set_modck )
+{
+ m_modck = state;
+ m_clock_mode &= ~(m68340_sim::CLOCK_MODCK | m68340_sim::CLOCK_PLL);
+ m_clock_mode |= ((m_modck == ASSERT_LINE) ? (m68340_sim::CLOCK_MODCK | m68340_sim::CLOCK_PLL) : 0);
+}
void m68340_cpu_device::device_start()
{
@@ -145,6 +174,7 @@ void m68340_cpu_device::device_start()
m68340TIMER->reset();
start_68340_sim();
+ start_68340_timer();
m68340_base = 0x00000000;