-unsp: Fix compile, nw

This commit is contained in:
Ryan Holtz 2020-05-21 23:29:55 +02:00
parent 4cabfa3135
commit 11277a993f
3 changed files with 6 additions and 8 deletions

View File

@ -240,7 +240,7 @@ void unsp_20_device::execute_extended_group(uint16_t op)
if (aluop != 0x0d) if (aluop != 0x0d)
r1 = read16(r2); r1 = read16(r2);
m_core->m_r[ry] = (uint16_t)(m_core->m_r[ry] - 1); m_core->m_r[ry] = (uint16_t)(m_core->m_r[ry] - 1);
if (m_core->m_r[ry] == 0xffff) if (m_core->m_r[ry] == 0xffff && use_ds)
m_core->m_r[REG_SR] -= 0x0400; m_core->m_r[REG_SR] -= 0x0400;
break; break;
case 0x2: // Rx, [<ds:>Ry++] case 0x2: // Rx, [<ds:>Ry++]
@ -248,7 +248,7 @@ void unsp_20_device::execute_extended_group(uint16_t op)
if (aluop != 0x0d) if (aluop != 0x0d)
r1 = read16(r2); r1 = read16(r2);
m_core->m_r[ry] = (uint16_t)(m_core->m_r[ry] + 1); m_core->m_r[ry] = (uint16_t)(m_core->m_r[ry] + 1);
if (m_core->m_r[ry] == 0x0000) if (m_core->m_r[ry] == 0x0000 && use_ds)
m_core->m_r[REG_SR] += 0x0400; m_core->m_r[REG_SR] += 0x0400;
break; break;
case 0x3: // Rx, [<ds:>++Ry] case 0x3: // Rx, [<ds:>++Ry]

View File

@ -83,7 +83,7 @@ void unsp_12_device::execute_exxx_group(uint16_t op)
const uint16_t addr = m_core->m_r[rd]; const uint16_t addr = m_core->m_r[rd];
const uint16_t orig = read16(addr); const uint16_t orig = read16(addr);
m_core->m_r[REG_SR] &= ~UNSP_Z; m_core->m_r[REG_SR] &= ~UNSP_Z;
m_core->m_r[REG_SR] |= BIT(m_core->m_r[rd], offset) ? 0 : UNSP_Z; m_core->m_r[REG_SR] |= BIT(orig, offset) ? 0 : UNSP_Z;
switch (bitop) switch (bitop)
{ {
@ -113,7 +113,7 @@ void unsp_12_device::execute_exxx_group(uint16_t op)
const uint32_t addr = m_core->m_r[rd] | (get_ds() << 16); const uint32_t addr = m_core->m_r[rd] | (get_ds() << 16);
const uint16_t orig = read16(addr); const uint16_t orig = read16(addr);
m_core->m_r[REG_SR] &= ~UNSP_Z; m_core->m_r[REG_SR] &= ~UNSP_Z;
m_core->m_r[REG_SR] |= BIT(m_core->m_r[rd], offset) ? 0 : UNSP_Z; m_core->m_r[REG_SR] |= BIT(orig, offset) ? 0 : UNSP_Z;
switch (bitop) switch (bitop)
{ {
@ -140,11 +140,11 @@ void unsp_12_device::execute_exxx_group(uint16_t op)
const uint8_t bitop = (op & 0x0030) >> 4; const uint8_t bitop = (op & 0x0030) >> 4;
const uint8_t rd = (op & 0x0e00) >> 9; const uint8_t rd = (op & 0x0e00) >> 9;
const uint8_t rs = (op & 0x0007) >> 0; const uint8_t rs = (op & 0x0007) >> 0;
const uint8_t offset = (1 << m_core->m_r[rs]); const uint8_t offset = (1 << (m_core->m_r[rs] & 0xf));
const uint16_t addr = m_core->m_r[rd]; const uint16_t addr = m_core->m_r[rd];
const uint16_t orig = read16(addr); const uint16_t orig = read16(addr);
m_core->m_r[REG_SR] &= ~UNSP_Z; m_core->m_r[REG_SR] &= ~UNSP_Z;
m_core->m_r[REG_SR] |= BIT(m_core->m_r[rd], offset) ? 0 : UNSP_Z; m_core->m_r[REG_SR] |= BIT(orig, offset) ? 0 : UNSP_Z;
switch (bitop) switch (bitop)
{ {

View File

@ -250,7 +250,6 @@ inline void unsp_device::execute_fxxx_100_group(uint16_t op)
void unsp_12_device::execute_divq(uint16_t op) void unsp_12_device::execute_divq(uint16_t op)
{ {
uint32_t orig_dividend = 0;
if (m_core->m_divq_bit == UINT_MAX) if (m_core->m_divq_bit == UINT_MAX)
{ {
m_core->m_divq_bit = 15; m_core->m_divq_bit = 15;
@ -258,7 +257,6 @@ void unsp_12_device::execute_divq(uint16_t op)
m_core->m_divq_divisor = m_core->m_r[REG_R2]; m_core->m_divq_divisor = m_core->m_r[REG_R2];
m_core->m_divq_a = 0; m_core->m_divq_a = 0;
} }
orig_dividend = m_core->m_divq_dividend;
m_core->m_aq = BIT(m_core->m_divq_a, 31); m_core->m_aq = BIT(m_core->m_divq_a, 31);
if (m_core->m_aq) if (m_core->m_aq)
{ {