summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices/cpu/tms1000/tp0320.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/devices/cpu/tms1000/tp0320.cpp')
-rw-r--r--src/devices/cpu/tms1000/tp0320.cpp61
1 files changed, 61 insertions, 0 deletions
diff --git a/src/devices/cpu/tms1000/tp0320.cpp b/src/devices/cpu/tms1000/tp0320.cpp
index 177396e36aa..72dc85ef331 100644
--- a/src/devices/cpu/tms1000/tp0320.cpp
+++ b/src/devices/cpu/tms1000/tp0320.cpp
@@ -3,6 +3,9 @@
/*
TMS1000 family - TP0320
+
+ TODO:
+ - lots
*/
@@ -38,9 +41,67 @@ tp0320_cpu_device::tp0320_cpu_device(const machine_config &mconfig, const char *
{ }
+// machine configs
+static MACHINE_CONFIG_FRAGMENT(tp0320)
+
+ // main opcodes PLA(partial), microinstructions PLA
+ MCFG_PLA_ADD("ipla", 9, 6, 8)
+ MCFG_PLA_FILEFORMAT(PLA_FMT_BERKELEY)
+ MCFG_PLA_ADD("mpla", 6, 22, 64)
+ MCFG_PLA_FILEFORMAT(PLA_FMT_BERKELEY)
+MACHINE_CONFIG_END
+
+machine_config_constructor tp0320_cpu_device::device_mconfig_additions() const
+{
+ return MACHINE_CONFIG_NAME(tp0320);
+}
+
+
// disasm
offs_t tp0320_cpu_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options)
{
extern CPU_DISASSEMBLE(tp0320);
return CPU_DISASSEMBLE_NAME(tp0320)(this, buffer, pc, oprom, opram, options);
}
+
+
+// device_reset
+UINT32 tp0320_cpu_device::decode_micro(UINT8 sel)
+{
+ UINT32 decode = 0;
+
+ sel = BITSWAP8(sel,7,6,0,1,2,3,4,5); // lines are reversed
+ UINT32 mask = m_mpla->read(sel);
+ mask ^= 0x0bff0; // invert active-negative
+
+ // _____ _______ ______ _____ _____ ______ _____ _____ ______ _____ _____
+ const UINT32 md[22] = { M_AUTA, M_AUTY, M_SSS, M_STO, M_YTP, M_NDMTP, M_DMTP, M_MTP, M_CKP, M_15TN, M_CKN, M_MTN, M_NATN, M_ATN, M_CME, M_CIN, M_SSE, M_CKM, M_NE, M_C8, M_SETR, M_RSTR };
+
+ for (int bit = 0; bit < 22 && bit < m_mpla->outputs(); bit++)
+ if (mask & (1 << bit))
+ decode |= md[bit];
+
+ return decode;
+}
+
+void tp0320_cpu_device::device_reset()
+{
+ // common reset
+ tms0980_cpu_device::device_reset();
+
+ // fixed instructionset isn't fully understood yet
+ m_fixed_decode[0x19] = F_XDA;
+ m_fixed_decode[0xb0] = F_TDO;
+ m_fixed_decode[0xb1] = F_SAL;
+ m_fixed_decode[0xb2] = F_COMX8;
+ m_fixed_decode[0xb3] = F_SBL;
+ m_fixed_decode[0xb4] = F_REAC;
+ m_fixed_decode[0xb5] = F_SEAC;
+ m_fixed_decode[0xb6] = F_OFF;
+ m_fixed_decode[0xbf] = F_RETN;
+
+ for (int i = 0x80; i < 0x90; i++) m_fixed_decode[i] = F_LDP;
+ for (int i = 0x90; i < 0xa0; i++) m_fixed_decode[i] = F_LDX;
+ for (int i = 0xa0; i < 0xa4; i++) m_fixed_decode[i] = F_SBIT;
+ for (int i = 0xa4; i < 0xa8; i++) m_fixed_decode[i] = F_RBIT;
+}