From 78ca6157e403679a5a40037cdbb3d2fd7283477f Mon Sep 17 00:00:00 2001 From: arbee Date: Sat, 3 Aug 2019 16:00:30 -0400 Subject: f2mc16: checkpoint (nw) princ now runs for a few seconds then enables Timer 0 (not yet implemented) and waits for it. --- src/devices/cpu/f2mc16/f2mc16.cpp | 68 ++++++++++++++++++++++++++++++++++++++ src/devices/cpu/f2mc16/f2mc16.h | 2 +- src/devices/cpu/f2mc16/mb9061x.cpp | 2 +- 3 files changed, 70 insertions(+), 2 deletions(-) diff --git a/src/devices/cpu/f2mc16/f2mc16.cpp b/src/devices/cpu/f2mc16/f2mc16.cpp index 4707c38aaf2..a71c1532fac 100644 --- a/src/devices/cpu/f2mc16/f2mc16.cpp +++ b/src/devices/cpu/f2mc16/f2mc16.cpp @@ -1892,6 +1892,13 @@ void f2mc16_device::opcodes_ea70(u8 operand) m_icount -= 7; break; + // SUBL A, RLx + case 0x20: case 0x21: case 0x22: case 0x23: case 0x24: case 0x25: case 0x26: case 0x27: + m_acc = doSUB_32(m_acc, read_rlX((operand>>1) & 3)); + m_pc += 2; + m_icount -= 7; + break; + // SUBL A, @RWx + disp8 case 0x30: case 0x31: case 0x32: case 0x33: case 0x34: case 0x35: case 0x36: case 0x37: m_tmp8 = read_32((m_pcb<<16) | (m_pc+2)); @@ -1902,6 +1909,13 @@ void f2mc16_device::opcodes_ea70(u8 operand) m_icount -= 7; break; + // CMPL A, RLx + case 0x60: case 0x61: case 0x62: case 0x63: case 0x64: case 0x65: case 0x66: case 0x67: + doCMP_32(m_acc, read_rlX((operand>>1) & 3)); + m_pc += 2; + m_icount -= 7; + break; + // CMPL A, @RWx + disp8 case 0x70: case 0x71: case 0x72: case 0x73: case 0x74: case 0x75: case 0x76: case 0x77: m_tmp8 = read_32((m_pcb<<16) | (m_pc+2)); @@ -1912,6 +1926,16 @@ void f2mc16_device::opcodes_ea70(u8 operand) m_icount -= 7; break; + // ANDL A, RLx + case 0x80: case 0x81: case 0x82: case 0x83: case 0x84: case 0x85: case 0x86: case 0x87: + m_tmp32 = read_rlX((operand>>1) & 3); + m_acc &= m_tmp32; + setNZ_32(m_acc); + m_ps &= ~F_V; + m_pc += 3; + m_icount -= 7; + break; + // ANDL A, @RWx + disp8 case 0x90: case 0x91: case 0x92: case 0x93: case 0x94: case 0x95: case 0x96: case 0x97: m_tmp8 = read_32((m_pcb<<16) | (m_pc+2)); @@ -1983,6 +2007,24 @@ void f2mc16_device::opcodes_ea71(u8 operand) m_icount -= 4; break; + // MOVL A, adr16 + case 0x9f: + m_tmp32 = read_16((m_pcb<<16) | (m_pc+2)); + if (m_prefix_valid) + { + m_prefix_valid = false; + m_tmp32 |= (m_prefix << 16); + } + else + { + m_tmp32 |= (m_dtb << 16); + } + m_acc = read_32(m_tmp32); + setNZ_32(m_acc); + m_pc += 4; + m_icount -= 4; + break; + // MOVL RLx, A case 0xa0: case 0xa1: case 0xa2: case 0xa3: case 0xa4: case 0xa5: case 0xa6: case 0xa7: write_rlX((operand & 7) >> 1, m_acc); @@ -2103,6 +2145,32 @@ void f2mc16_device::opcodes_ea73(u8 operand) m_icount -= 5; break; + // DECW addr16 + case 0x7f: + m_tmp32 = read_16((m_pcb<<16) | (m_pc+2)); + if (m_prefix_valid) + { + m_prefix_valid = false; + m_tmp32 |= (m_prefix << 16); + } + else + { + m_tmp32 |= (m_dtb << 16); + } + m_tmp16 = read_16(m_tmp32); + m_tmp16aux = m_tmp16; + m_tmp16--; + write_16(m_tmp32, m_tmp16); + setNZ_16(m_tmp16); + m_ps &= ~F_V; + if ((m_tmp16aux ^ 0x0001) & (m_tmp16aux ^ m_tmp16) & 0x8000) + { + m_ps |= F_V; + } + m_pc += 4; + m_icount -= 5; + break; + // MOVW @RWx + disp16, #imm16 case 0xd8: case 0xd9: case 0xda: case 0xdb: m_tmp16 = read_16((m_pcb<<16) | (m_pc+2)); diff --git a/src/devices/cpu/f2mc16/f2mc16.h b/src/devices/cpu/f2mc16/f2mc16.h index e4c57953ea4..3e5217268e1 100644 --- a/src/devices/cpu/f2mc16/f2mc16.h +++ b/src/devices/cpu/f2mc16/f2mc16.h @@ -65,7 +65,7 @@ private: address_space_config m_program_config; address_space *m_program; - u16 m_pc, m_usp, m_ssp, m_ps, m_tmp16, m_tmpea; + u16 m_pc, m_usp, m_ssp, m_ps, m_tmp16, m_tmpea, m_tmp16aux; u8 m_pcb, m_dtb, m_usb, m_ssb, m_adb, m_dpr, m_tmp8, m_prefix; u32 m_acc, m_temp, m_tmp32; s32 m_icount; diff --git a/src/devices/cpu/f2mc16/mb9061x.cpp b/src/devices/cpu/f2mc16/mb9061x.cpp index aea77406f79..47546332280 100644 --- a/src/devices/cpu/f2mc16/mb9061x.cpp +++ b/src/devices/cpu/f2mc16/mb9061x.cpp @@ -104,7 +104,7 @@ WRITE8_MEMBER(mb9061x_device::tbtc_w) static const float periods[4] = { 1.024, 4.096, 16.384, 131.072 }; //printf("%02x to TBTC\n", data); - if ((!(data & TBTC_TBR)) || ((data & (TBTC_TBC1|TBTC_TBC0)) != (m_tbtc & (TBTC_TBC1|TBTC_TBC0)))) +// if ((!(data & TBTC_TBR)) || ((data & (TBTC_TBC1|TBTC_TBC0)) != (m_tbtc & (TBTC_TBC1|TBTC_TBC0)))) { m_tbtc_timer->adjust(attotime(0, ATTOSECONDS_IN_MSEC(periods[data & (TBTC_TBC1|TBTC_TBC0)]))); -- cgit v1.2.3