diff --git a/src/devices/machine/m3002.cpp b/src/devices/machine/m3002.cpp index 2416dc4afd6..8bb9edda2b9 100644 --- a/src/devices/machine/m3002.cpp +++ b/src/devices/machine/m3002.cpp @@ -7,13 +7,14 @@ TODO: - Pulse output (256 Hz, second, minute, hour) - Test mode + - Emulate M 3000 differences (if any meaningful ones exist) **********************************************************************/ #include "emu.h" #include "m3002.h" -#define VERBOSE 1 +#define VERBOSE 0 #include "logmacro.h" //************************************************************************** @@ -21,6 +22,7 @@ //************************************************************************** DEFINE_DEVICE_TYPE(M3002, m3002_device, "m3002", "EM M 3002 Real Time Clock") +DEFINE_DEVICE_TYPE(M3000, m3000_device, "m3000", "EM M 3000 Real Time Clock") //************************************************************************** // DEVICE CONSTRUCTION AND INITIALIZATION @@ -32,8 +34,8 @@ ALLOW_SAVE_TYPE(m3002_device::mux_state); // m3002_device - constructor //------------------------------------------------- -m3002_device::m3002_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) - : device_t(mconfig, M3002, tag, owner, clock) +m3002_device::m3002_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock) + : device_t(mconfig, type, tag, owner, clock) , device_nvram_interface(mconfig, *this) , device_rtc_interface(mconfig, *this) , m_irq_callback(*this) @@ -46,6 +48,21 @@ m3002_device::m3002_device(const machine_config &mconfig, const char *tag, devic std::fill_n(&m_ram[0], 0x10, 0); } +m3002_device::m3002_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) + : m3002_device(mconfig, M3002, tag, owner, clock) +{ +} + + +//------------------------------------------------- +// m3000_device - constructor +//------------------------------------------------- + +m3000_device::m3000_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) + : m3002_device(mconfig, M3000, tag, owner, clock) +{ +} + //------------------------------------------------- // device_resolve_objects - resolve objects that diff --git a/src/devices/machine/m3002.h b/src/devices/machine/m3002.h index d75d5e99c70..d39f904fe60 100644 --- a/src/devices/machine/m3002.h +++ b/src/devices/machine/m3002.h @@ -46,6 +46,8 @@ public: DECLARE_READ_LINE_MEMBER(irq_r) { return m_irq_active ? 0 : 1; } protected: + m3002_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock); + // device-level overrides virtual void device_resolve_objects() override; virtual void device_start() override; @@ -95,7 +97,17 @@ private: emu_timer *m_second_timer; }; -// device type declaration +// ======================> m3000_device + +class m3000_device : public m3002_device +{ +public: + // device type constructor + m3000_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); +}; + +// device type declarations DECLARE_DEVICE_TYPE(M3002, m3002_device) +DECLARE_DEVICE_TYPE(M3000, m3000_device) #endif // MAME_MACHINE_M3002_H diff --git a/src/mame/drivers/clxvme186.cpp b/src/mame/drivers/clxvme186.cpp index 1594c6bdd80..ec3fdc68bb6 100644 --- a/src/mame/drivers/clxvme186.cpp +++ b/src/mame/drivers/clxvme186.cpp @@ -10,7 +10,7 @@ #include "cpu/i86/i186.h" //#include "bus/vme/vme.h" #include "machine/74259.h" -//#include "machine/m3000.h" +#include "machine/m3002.h" #include "machine/z80scc.h" class clxvme186_state : public driver_device @@ -65,7 +65,7 @@ void clxvme186_state::io_map(address_map &map) { map(0xe000, 0xe001).unmaprw(); // SASI data port (PCS0) map(0xe080, 0xe087).rw("scc", FUNC(scc8530_device::ab_dc_r), FUNC(scc8530_device::ab_dc_w)).umask16(0x00ff); // Serial I/O ports A & B (PCS1) - //map(0xe100, 0xe100).rw("rtc", FUNC(m3000_device::read), FUNC(m3000_device::write)); // Real time clock (PCS2) + map(0xe100, 0xe100).rw("rtc", FUNC(m3000_device::read), FUNC(m3000_device::write)); // Real time clock (PCS2) map(0xe180, 0xe181).portr("TTL"); // TTL input port (PCS3) map(0xe180, 0xe181).w(FUNC(clxvme186_state::unknown_w)); map(0xe190, 0xe190).r(FUNC(clxvme186_state::sasi_status_r)); // SASI status port (PCS3) @@ -85,7 +85,7 @@ static INPUT_PORTS_START(clxvme186) PORT_BIT(0x0020, IP_ACTIVE_LOW, IPT_UNKNOWN) // Printer busy PORT_BIT(0x0040, IP_ACTIVE_LOW, IPT_UNKNOWN) // Printer paper empty PORT_BIT(0x0080, IP_ACTIVE_LOW, IPT_UNKNOWN) // /SYSFAIL - PORT_BIT(0x0100, IP_ACTIVE_LOW, IPT_UNKNOWN) // Real time clock busy + PORT_BIT(0x0100, IP_ACTIVE_HIGH, IPT_CUSTOM) PORT_READ_LINE_DEVICE_MEMBER("rtc", m3000_device, busy_r) PORT_BIT(0x0200, IP_ACTIVE_LOW, IPT_UNKNOWN) // Colex use only PORT_BIT(0x0400, IP_ACTIVE_LOW, IPT_UNKNOWN) // Colex use only PORT_BIT(0x0800, IP_ACTIVE_LOW, IPT_UNKNOWN) // /ACFAIL @@ -102,7 +102,7 @@ void clxvme186_state::clxvme186(machine_config &config) SCC8530N(config, "scc", 3.6864_MHz_XTAL); - //M3000(config, "rtc", 32.768_kHz_XTAL); + M3000(config, "rtc", 32.768_kHz_XTAL); LS259(config, "ctrllatch"); } diff --git a/src/mame/drivers/cms.cpp b/src/mame/drivers/cms.cpp index 0314d7cf58a..1c093c1bb64 100644 --- a/src/mame/drivers/cms.cpp +++ b/src/mame/drivers/cms.cpp @@ -167,7 +167,7 @@ void cms_state::cms6502(machine_config &config) VIA6522(config, m_via, 1_MHz_XTAL); m_via->irq_handler().set("irqs", FUNC(input_merger_device::in_w<0>)); - M3002(config, "rtc", 32768); + M3002(config, "rtc", 32.768_kHz_XTAL); /* 7 Slot Backplane */ ACORN_BUS(config, m_bus, 0);