From a0eb81633db32045d68e71561e6fb7bdb83776b4 Mon Sep 17 00:00:00 2001 From: hap Date: Wed, 17 May 2023 11:34:18 +0200 Subject: mn1400: add 28-pin mn1400 device --- src/devices/cpu/mn1400/mn1400.cpp | 13 +++++++++++-- src/devices/cpu/mn1400/mn1400.h | 11 ++++++++++- src/mame/handheld/hh_mn1400.cpp | 7 ++----- 3 files changed, 23 insertions(+), 8 deletions(-) diff --git a/src/devices/cpu/mn1400/mn1400.cpp b/src/devices/cpu/mn1400/mn1400.cpp index 590c6ef1798..75737359030 100644 --- a/src/devices/cpu/mn1400/mn1400.cpp +++ b/src/devices/cpu/mn1400/mn1400.cpp @@ -13,7 +13,8 @@ // device definitions -DEFINE_DEVICE_TYPE(MN1400, mn1400_cpu_device, "mn1400", "Matsushita MN1400") +DEFINE_DEVICE_TYPE(MN1400_40PINS, mn1400_cpu_device, "mn1400", "Matsushita MN1400 (40 pins)") +DEFINE_DEVICE_TYPE(MN1400_28PINS, mn1400_reduced_cpu_device, "mn1400_reduced", "Matsushita MN1400 (28 pins)") DEFINE_DEVICE_TYPE(MN1405, mn1405_cpu_device, "mn1405", "Matsushita MN1405") @@ -23,9 +24,17 @@ mn1400_cpu_device::mn1400_cpu_device(const machine_config &mconfig, device_type { } mn1400_cpu_device::mn1400_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) : - mn1400_cpu_device(mconfig, MN1400, tag, owner, clock, 2 /* stack levels */, 10 /* rom bits */, address_map_constructor(FUNC(mn1400_cpu_device::program_1kx8), this), 6 /* ram bits */, address_map_constructor(FUNC(mn1400_cpu_device::data_64x4), this)) + mn1400_cpu_device(mconfig, MN1400_40PINS, tag, owner, clock, 2 /* stack levels */, 10 /* rom bits */, address_map_constructor(FUNC(mn1400_cpu_device::program_1kx8), this), 6 /* ram bits */, address_map_constructor(FUNC(mn1400_cpu_device::data_64x4), this)) { } +mn1400_reduced_cpu_device::mn1400_reduced_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) : + mn1400_cpu_device(mconfig, MN1400_28PINS, tag, owner, clock, 2, 10, address_map_constructor(FUNC(mn1400_reduced_cpu_device::program_1kx8), this), 6, address_map_constructor(FUNC(mn1400_reduced_cpu_device::data_64x4), this)) +{ + // CO5-CO9, DO0-DO3 (scrambled) + set_c_mask(0x3e0); + set_d_mask(0xf, 0x5321); +} + mn1405_cpu_device::mn1405_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) : mn1400_cpu_device(mconfig, MN1405, tag, owner, clock, 2, 11, address_map_constructor(FUNC(mn1405_cpu_device::program_2kx8), this), 7, address_map_constructor(FUNC(mn1405_cpu_device::data_128x4), this)) { } diff --git a/src/devices/cpu/mn1400/mn1400.h b/src/devices/cpu/mn1400/mn1400.h index 1f31fc39f5e..3ed1535d2cc 100644 --- a/src/devices/cpu/mn1400/mn1400.h +++ b/src/devices/cpu/mn1400/mn1400.h @@ -125,6 +125,14 @@ protected: void op_dc(); }; + +class mn1400_reduced_cpu_device : public mn1400_cpu_device +{ +public: + mn1400_reduced_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); +}; + + class mn1405_cpu_device : public mn1400_cpu_device { public: @@ -132,7 +140,8 @@ public: }; -DECLARE_DEVICE_TYPE(MN1400, mn1400_cpu_device) +DECLARE_DEVICE_TYPE(MN1400_40PINS, mn1400_cpu_device) +DECLARE_DEVICE_TYPE(MN1400_28PINS, mn1400_reduced_cpu_device) DECLARE_DEVICE_TYPE(MN1405, mn1405_cpu_device) #endif // MAME_CPU_MN1400_MN1400_H diff --git a/src/mame/handheld/hh_mn1400.cpp b/src/mame/handheld/hh_mn1400.cpp index 0f352eba077..ef20b76684e 100644 --- a/src/mame/handheld/hh_mn1400.cpp +++ b/src/mame/handheld/hh_mn1400.cpp @@ -210,11 +210,9 @@ INPUT_PORTS_END void compperf_state::compperf(machine_config &config) { // basic machine hardware - MN1400(config, m_maincpu, 300000); // approximation - RC osc. R=18K, C=100pF + MN1400_28PINS(config, m_maincpu, 300000); // approximation - RC osc. R=18K, C=100pF m_maincpu->write_c().set(FUNC(compperf_state::write_c)); - m_maincpu->set_c_mask(0x3e0); m_maincpu->write_d().set(FUNC(compperf_state::write_d)); - m_maincpu->set_d_mask(0xf, 0x5321); m_maincpu->write_e().set(FUNC(compperf_state::write_e)); m_maincpu->read_a().set_ioport("IN.0"); m_maincpu->read_b().set_ioport("IN.1"); @@ -516,11 +514,10 @@ INPUT_PORTS_END void tmbaskb_state::tmbaskb(machine_config &config) { // basic machine hardware - MN1400(config, m_maincpu, 300000); // approximation - RC osc. R=18K, C=100pF + MN1400_28PINS(config, m_maincpu, 300000); // approximation - RC osc. R=18K, C=100pF m_maincpu->write_c().set(FUNC(tmbaskb_state::write_c)); m_maincpu->set_c_mask(0x3ef); m_maincpu->write_d().set(FUNC(tmbaskb_state::write_d)); - m_maincpu->set_d_mask(0xf, 0x5321); m_maincpu->write_e().set(FUNC(tmbaskb_state::write_e)); m_maincpu->read_b().set(FUNC(tmbaskb_state::read_b)); m_maincpu->read_sns().set_ioport("IN.3"); -- cgit v1.2.3