summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
author hap <happppp@users.noreply.github.com>2023-05-17 11:34:18 +0200
committer hap <happppp@users.noreply.github.com>2023-05-17 11:34:18 +0200
commita0eb81633db32045d68e71561e6fb7bdb83776b4 (patch)
tree00cf2780a2530409a408fe288d9d8ebaffd17db4
parent9f5d36fefaad002c5d719c35ceb0a97688ae838e (diff)
mn1400: add 28-pin mn1400 device
-rw-r--r--src/devices/cpu/mn1400/mn1400.cpp13
-rw-r--r--src/devices/cpu/mn1400/mn1400.h11
-rw-r--r--src/mame/handheld/hh_mn1400.cpp7
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");