f2mc16: checkpoint (nw)

princ now runs for a few seconds then enables Timer 0 (not yet implemented) and waits for it.
This commit is contained in:
arbee 2019-08-03 16:00:30 -04:00
parent 33e71d9ae6
commit 78ca6157e4
3 changed files with 70 additions and 2 deletions

View File

@ -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));

View File

@ -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;

View File

@ -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)])));