summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
author hap <happppp@users.noreply.github.com>2022-08-05 20:57:29 +0200
committer hap <happppp@users.noreply.github.com>2022-08-05 20:57:38 +0200
commitf9725bbe954c5a02192c465eda20e1f1fa452af3 (patch)
treeb942f0d680ab48abd586dfdf02f94ad8042b63e1
parent3252fa2d273d035287f3be078d45ca16d9ad0238 (diff)
tms1000: added tms2xxx skeleton devices
-rw-r--r--scripts/src/cpu.lua6
-rw-r--r--src/devices/cpu/tms1000/tms1400.cpp2
-rw-r--r--src/devices/cpu/tms1000/tms1400.h2
-rw-r--r--src/devices/cpu/tms1000/tms2100.cpp73
-rw-r--r--src/devices/cpu/tms1000/tms2100.h110
-rw-r--r--src/devices/cpu/tms1000/tms2400.cpp62
-rw-r--r--src/devices/cpu/tms1000/tms2400.h58
7 files changed, 312 insertions, 1 deletions
diff --git a/scripts/src/cpu.lua b/scripts/src/cpu.lua
index fb357bb05b7..1f350423a33 100644
--- a/scripts/src/cpu.lua
+++ b/scripts/src/cpu.lua
@@ -2409,6 +2409,8 @@ end
--@src/devices/cpu/tms1000/tms1000c.h,CPUS["TMS1000"] = true
--@src/devices/cpu/tms1000/tms1100.h,CPUS["TMS1000"] = true
--@src/devices/cpu/tms1000/tms1400.h,CPUS["TMS1000"] = true
+--@src/devices/cpu/tms1000/tms2100.h,CPUS["TMS1000"] = true
+--@src/devices/cpu/tms1000/tms2400.h,CPUS["TMS1000"] = true
--@src/devices/cpu/tms1000/tms0970.h,CPUS["TMS1000"] = true
--@src/devices/cpu/tms1000/tms0980.h,CPUS["TMS1000"] = true
--@src/devices/cpu/tms1000/tms0270.h,CPUS["TMS1000"] = true
@@ -2427,6 +2429,10 @@ if CPUS["TMS1000"] then
MAME_DIR .. "src/devices/cpu/tms1000/tms1100.h",
MAME_DIR .. "src/devices/cpu/tms1000/tms1400.cpp",
MAME_DIR .. "src/devices/cpu/tms1000/tms1400.h",
+ MAME_DIR .. "src/devices/cpu/tms1000/tms2100.cpp",
+ MAME_DIR .. "src/devices/cpu/tms1000/tms2100.h",
+ MAME_DIR .. "src/devices/cpu/tms1000/tms2400.cpp",
+ MAME_DIR .. "src/devices/cpu/tms1000/tms2400.h",
MAME_DIR .. "src/devices/cpu/tms1000/tms0970.cpp",
MAME_DIR .. "src/devices/cpu/tms1000/tms0970.h",
MAME_DIR .. "src/devices/cpu/tms1000/tms0980.cpp",
diff --git a/src/devices/cpu/tms1000/tms1400.cpp b/src/devices/cpu/tms1000/tms1400.cpp
index bc16b6c9809..9a72c57de38 100644
--- a/src/devices/cpu/tms1000/tms1400.cpp
+++ b/src/devices/cpu/tms1000/tms1400.cpp
@@ -17,7 +17,7 @@
// - rotate the view and mirror the OR-mask to get the proper layout of the mpla, the default is identical to tms1100
// - the opla size is increased from 20 to 32 terms
DEFINE_DEVICE_TYPE(TMS1400, tms1400_cpu_device, "tms1400", "Texas Instruments TMS1400") // 28-pin DIP, 11 R pins (TMS1400CR is same, but with TMS1100 pinout)
-DEFINE_DEVICE_TYPE(TMS1470, tms1470_cpu_device, "tms1470", "Texas Instruments TMS1470") // high voltage version, 1 R pin removed for Vdd
+DEFINE_DEVICE_TYPE(TMS1470, tms1470_cpu_device, "tms1470", "Texas Instruments TMS1470") // high voltage version, 1 R pin removed for Vpp
DEFINE_DEVICE_TYPE(TMS1475, tms1475_cpu_device, "tms1475", "Texas Instruments TMS1475") // 40-pin DIP, 22 R pins
// TMS1600 adds more I/O to the TMS1400, input pins are doubled with added L1,2,4,8
diff --git a/src/devices/cpu/tms1000/tms1400.h b/src/devices/cpu/tms1000/tms1400.h
index 9967702596c..8677e98bd42 100644
--- a/src/devices/cpu/tms1000/tms1400.h
+++ b/src/devices/cpu/tms1000/tms1400.h
@@ -33,6 +33,8 @@
INIT 13 | | 16 K4
K1 14 |___________| 15 K2
+ note: TMS1470 changes R10 to Vpp, and should otherwise be the same as TMS1400
+
*/
diff --git a/src/devices/cpu/tms1000/tms2100.cpp b/src/devices/cpu/tms1000/tms2100.cpp
new file mode 100644
index 00000000000..7060ff6aaba
--- /dev/null
+++ b/src/devices/cpu/tms1000/tms2100.cpp
@@ -0,0 +1,73 @@
+// license:BSD-3-Clause
+// copyright-holders:hap
+/*
+
+ TMS1000 family - TMS2100, TMS2170, TMS2300, TMS2370
+
+ TODO:
+ - x
+
+*/
+
+#include "emu.h"
+#include "tms2100.h"
+#include "tms1k_dasm.h"
+
+// TMS2100 is an enhanced version of TMS1100, adding interrupt, timer, A/D converter, and a 4-level callstack
+// - the mpla has a similar layout as TMS1400, terms reduced to 26 (looks like it's optimized and not meant to be custom)
+// - the opla is the same as TMS1400
+DEFINE_DEVICE_TYPE(TMS2100, tms2100_cpu_device, "tms2100", "Texas Instruments TMS2100") // 28-pin DIP, 7 R pins
+DEFINE_DEVICE_TYPE(TMS2170, tms2170_cpu_device, "tms2170", "Texas Instruments TMS2170") // high voltage version, 1 R pin removed for Vpp
+DEFINE_DEVICE_TYPE(TMS2300, tms2300_cpu_device, "tms2300", "Texas Instruments TMS2300") // 40-pin DIP, 15 R pins, J pins
+DEFINE_DEVICE_TYPE(TMS2370, tms2370_cpu_device, "tms2370", "Texas Instruments TMS2370") // high voltage version, 1 R pin removed for Vpp
+
+
+// device definitions
+tms2100_cpu_device::tms2100_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock)
+ : tms2100_cpu_device(mconfig, TMS2100, tag, owner, clock, 8 /* o pins */, 7 /* r pins */, 6 /* pc bits */, 8 /* byte width */, 3 /* x width */, 11 /* prg width */, address_map_constructor(FUNC(tms2100_cpu_device::program_11bit_8), this), 7 /* data width */, address_map_constructor(FUNC(tms2100_cpu_device::data_128x4), this))
+{ }
+
+tms2100_cpu_device::tms2100_cpu_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock, u8 o_pins, u8 r_pins, u8 pc_bits, u8 byte_bits, u8 x_bits, int prgwidth, address_map_constructor program, int datawidth, address_map_constructor data)
+ : tms1100_cpu_device(mconfig, type, tag, owner, clock, o_pins, r_pins, pc_bits, byte_bits, x_bits, prgwidth, program, datawidth, data)
+{ }
+
+tms2170_cpu_device::tms2170_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock)
+ : tms2100_cpu_device(mconfig, TMS2170, tag, owner, clock, 8, 6, 6, 8, 3, 11, address_map_constructor(FUNC(tms2170_cpu_device::program_11bit_8), this), 7, address_map_constructor(FUNC(tms2170_cpu_device::data_128x4), this))
+{ }
+
+tms2300_cpu_device::tms2300_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock)
+ : tms2300_cpu_device(mconfig, TMS2300, tag, owner, clock, 8, 15, 6, 8, 3, 11, address_map_constructor(FUNC(tms2300_cpu_device::program_11bit_8), this), 7, address_map_constructor(FUNC(tms2300_cpu_device::data_128x4), this))
+{ }
+
+tms2300_cpu_device::tms2300_cpu_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock, u8 o_pins, u8 r_pins, u8 pc_bits, u8 byte_bits, u8 x_bits, int prgwidth, address_map_constructor program, int datawidth, address_map_constructor data)
+ : tms2100_cpu_device(mconfig, type, tag, owner, clock, o_pins, r_pins, pc_bits, byte_bits, x_bits, prgwidth, program, datawidth, data)
+{ }
+
+tms2370_cpu_device::tms2370_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock)
+ : tms2300_cpu_device(mconfig, TMS2370, tag, owner, clock, 8, 14, 6, 8, 3, 11, address_map_constructor(FUNC(tms2370_cpu_device::program_11bit_8), this), 7, address_map_constructor(FUNC(tms2370_cpu_device::data_128x4), this))
+{ }
+
+
+// machine configs
+void tms2100_cpu_device::device_add_mconfig(machine_config &config)
+{
+ // microinstructions PLA, output PLA
+ PLA(config, "mpla", 8, 16, 26).set_format(pla_device::FMT::BERKELEY);
+ PLA(config, "opla", 5, 8, 32).set_format(pla_device::FMT::BERKELEY);
+}
+
+
+// disasm
+std::unique_ptr<util::disasm_interface> tms2100_cpu_device::create_disassembler()
+{
+ return std::make_unique<tms2100_disassembler>();
+}
+
+
+// device_reset
+void tms2100_cpu_device::device_reset()
+{
+ tms1100_cpu_device::device_reset();
+
+ // changed/added fixed instructions
+}
diff --git a/src/devices/cpu/tms1000/tms2100.h b/src/devices/cpu/tms1000/tms2100.h
new file mode 100644
index 00000000000..fd326eebe76
--- /dev/null
+++ b/src/devices/cpu/tms1000/tms2100.h
@@ -0,0 +1,110 @@
+// license:BSD-3-Clause
+// copyright-holders:hap
+/*
+
+ TMS1000 family - TMS2100, TMS2170, TMS2300, TMS2370
+
+*/
+
+#ifndef MAME_CPU_TMS1000_TMS2100_H
+#define MAME_CPU_TMS1000_TMS2100_H
+
+#pragma once
+
+#include "tms1100.h"
+
+
+// pinout reference
+
+/*
+ ____ ____
+ AVss 1 |* \_/ | 28 INT
+ AVdd 2 | | 27 OSC OUT
+ R0 3 | | 26 OSC IN
+ R1 4 | | 25 Vdd
+ R2 5 | | 24 A1
+ R3 6 | | 23 K1
+ R4 7 | TMS2100 | 22 K2
+ R5 8 | | 21 K4
+ R6 9 | | 20 K8
+ Vss 10 | | 19 INIT
+ O7 11 | | 18 O0
+ O6 12 | | 17 O1
+ O5 13 | | 16 O2
+ O4 14 |___________| 15 O3
+
+ ____ ____
+ AVss 1 |* \_/ | 48 EC1
+ AVdd 2 | | 39 INT
+ R0 3 | | 38 OSC OUT
+ R1 4 | | 37 OSC IN
+ R2 5 | | 36 Vdd
+ R3 6 | | 35 J1
+ R4 7 | | 34 J2
+ R5 8 | | 33 J4/A1
+ R6 9 | | 32 J8/A2
+ R7 10 | TMS2300 | 31 K1
+ R8 11 | | 30 K2
+ R9 12 | | 29 K4
+ R10 13 | | 28 K8
+ R11 14 | | 27 INIT
+ R12 15 | | 26 O0
+ R13 16 | | 25 O1
+ R14 17 | | 24 O2
+ Vss 18 | | 23 O3
+ O7 19 | | 22 O4
+ O6 20 |___________| 21 O5
+
+ note: TMS2170/TMS2370 chips change the highest R pin to Vpp, other than that they are the same
+
+*/
+
+
+class tms2100_cpu_device : public tms1100_cpu_device
+{
+public:
+ tms2100_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock);
+
+protected:
+ tms2100_cpu_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock, u8 o_pins, u8 r_pins, u8 pc_bits, u8 byte_bits, u8 x_bits, int prgwidth, address_map_constructor program, int datawidth, address_map_constructor data);
+
+ // overrides
+ virtual void device_reset() override;
+ virtual void device_add_mconfig(machine_config &config) override;
+
+ virtual std::unique_ptr<util::disasm_interface> create_disassembler() override;
+
+ virtual u8 stack_levels() override { return 4; } // 4-level stack
+ virtual void op_br() override { op_br2(); } // "
+ virtual void op_call() override { op_call2(); } // "
+ virtual void op_retn() override { op_retn2(); } // "
+};
+
+class tms2170_cpu_device : public tms2100_cpu_device
+{
+public:
+ tms2170_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock);
+};
+
+class tms2300_cpu_device : public tms2100_cpu_device
+{
+public:
+ tms2300_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock);
+
+protected:
+ tms2300_cpu_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock, u8 o_pins, u8 r_pins, u8 pc_bits, u8 byte_bits, u8 x_bits, int prgwidth, address_map_constructor program, int datawidth, address_map_constructor data);
+};
+
+class tms2370_cpu_device : public tms2300_cpu_device
+{
+public:
+ tms2370_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock);
+};
+
+
+DECLARE_DEVICE_TYPE(TMS2100, tms2100_cpu_device)
+DECLARE_DEVICE_TYPE(TMS2170, tms2170_cpu_device)
+DECLARE_DEVICE_TYPE(TMS2300, tms2300_cpu_device)
+DECLARE_DEVICE_TYPE(TMS2370, tms2370_cpu_device)
+
+#endif // MAME_CPU_TMS1000_TMS2100_H
diff --git a/src/devices/cpu/tms1000/tms2400.cpp b/src/devices/cpu/tms1000/tms2400.cpp
new file mode 100644
index 00000000000..0db73189547
--- /dev/null
+++ b/src/devices/cpu/tms1000/tms2400.cpp
@@ -0,0 +1,62 @@
+// license:BSD-3-Clause
+// copyright-holders:hap
+/*
+
+ TMS1000 family - TMS2400, TMS2470, TMS2600, TMS2670
+
+ TODO:
+ - x
+
+*/
+
+#include "emu.h"
+#include "tms2400.h"
+#include "tms1k_dasm.h"
+
+// TMS2400 is a TMS2100 with twice more memory (kind of like TMS1400 is to TMS1100)
+DEFINE_DEVICE_TYPE(TMS2400, tms2400_cpu_device, "tms2400", "Texas Instruments TMS2400") // 28-pin DIP, 7 R pins
+DEFINE_DEVICE_TYPE(TMS2470, tms2470_cpu_device, "tms2470", "Texas Instruments TMS2470") // high voltage version, 1 R pin removed for Vpp
+DEFINE_DEVICE_TYPE(TMS2600, tms2600_cpu_device, "tms2600", "Texas Instruments TMS2600") // 40-pin DIP, 15 R pins, J pins
+DEFINE_DEVICE_TYPE(TMS2670, tms2670_cpu_device, "tms2670", "Texas Instruments TMS2670") // high voltage version, 1 R pin removed for Vpp
+
+
+// device definitions
+tms2400_cpu_device::tms2400_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock)
+ : tms2400_cpu_device(mconfig, TMS2400, tag, owner, clock, 8 /* o pins */, 7 /* r pins */, 6 /* pc bits */, 8 /* byte width */, 4 /* x width */, 12 /* prg width */, address_map_constructor(FUNC(tms2400_cpu_device::program_11bit_8), this), 8 /* data width */, address_map_constructor(FUNC(tms2400_cpu_device::data_128x4), this))
+{ }
+
+tms2400_cpu_device::tms2400_cpu_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock, u8 o_pins, u8 r_pins, u8 pc_bits, u8 byte_bits, u8 x_bits, int prgwidth, address_map_constructor program, int datawidth, address_map_constructor data)
+ : tms2100_cpu_device(mconfig, type, tag, owner, clock, o_pins, r_pins, pc_bits, byte_bits, x_bits, prgwidth, program, datawidth, data)
+{ }
+
+tms2470_cpu_device::tms2470_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock)
+ : tms2400_cpu_device(mconfig, TMS2470, tag, owner, clock, 8, 6, 6, 8, 4, 12, address_map_constructor(FUNC(tms2470_cpu_device::program_11bit_8), this), 8, address_map_constructor(FUNC(tms2470_cpu_device::data_128x4), this))
+{ }
+
+tms2600_cpu_device::tms2600_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock)
+ : tms2600_cpu_device(mconfig, TMS2600, tag, owner, clock, 8, 15, 6, 8, 4, 12, address_map_constructor(FUNC(tms2600_cpu_device::program_11bit_8), this), 8, address_map_constructor(FUNC(tms2600_cpu_device::data_128x4), this))
+{ }
+
+tms2600_cpu_device::tms2600_cpu_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock, u8 o_pins, u8 r_pins, u8 pc_bits, u8 byte_bits, u8 x_bits, int prgwidth, address_map_constructor program, int datawidth, address_map_constructor data)
+ : tms2400_cpu_device(mconfig, type, tag, owner, clock, o_pins, r_pins, pc_bits, byte_bits, x_bits, prgwidth, program, datawidth, data)
+{ }
+
+tms2670_cpu_device::tms2670_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock)
+ : tms2600_cpu_device(mconfig, TMS2670, tag, owner, clock, 8, 14, 6, 8, 4, 12, address_map_constructor(FUNC(tms2670_cpu_device::program_11bit_8), this), 8, address_map_constructor(FUNC(tms2670_cpu_device::data_128x4), this))
+{ }
+
+
+// disasm
+std::unique_ptr<util::disasm_interface> tms2400_cpu_device::create_disassembler()
+{
+ return std::make_unique<tms2400_disassembler>();
+}
+
+
+// device_reset
+void tms2400_cpu_device::device_reset()
+{
+ tms2100_cpu_device::device_reset();
+
+ // changed/added fixed instructions
+}
diff --git a/src/devices/cpu/tms1000/tms2400.h b/src/devices/cpu/tms1000/tms2400.h
new file mode 100644
index 00000000000..feeddde0f18
--- /dev/null
+++ b/src/devices/cpu/tms1000/tms2400.h
@@ -0,0 +1,58 @@
+// license:BSD-3-Clause
+// copyright-holders:hap
+/*
+
+ TMS1000 family - TMS2400, TMS2470, TMS2600, TMS2670
+
+*/
+
+#ifndef MAME_CPU_TMS1000_TMS2400_H
+#define MAME_CPU_TMS1000_TMS2400_H
+
+#pragma once
+
+#include "tms2100.h"
+
+
+class tms2400_cpu_device : public tms2100_cpu_device
+{
+public:
+ tms2400_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock);
+
+protected:
+ tms2400_cpu_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock, u8 o_pins, u8 r_pins, u8 pc_bits, u8 byte_bits, u8 x_bits, int prgwidth, address_map_constructor program, int datawidth, address_map_constructor data);
+
+ // overrides
+ virtual void device_reset() override;
+
+ virtual std::unique_ptr<util::disasm_interface> create_disassembler() override;
+};
+
+class tms2470_cpu_device : public tms2400_cpu_device
+{
+public:
+ tms2470_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock);
+};
+
+class tms2600_cpu_device : public tms2400_cpu_device
+{
+public:
+ tms2600_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock);
+
+protected:
+ tms2600_cpu_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock, u8 o_pins, u8 r_pins, u8 pc_bits, u8 byte_bits, u8 x_bits, int prgwidth, address_map_constructor program, int datawidth, address_map_constructor data);
+};
+
+class tms2670_cpu_device : public tms2600_cpu_device
+{
+public:
+ tms2670_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock);
+};
+
+
+DECLARE_DEVICE_TYPE(TMS2400, tms2400_cpu_device)
+DECLARE_DEVICE_TYPE(TMS2470, tms2470_cpu_device)
+DECLARE_DEVICE_TYPE(TMS2600, tms2600_cpu_device)
+DECLARE_DEVICE_TYPE(TMS2670, tms2670_cpu_device)
+
+#endif // MAME_CPU_TMS1000_TMS2400_H