mirror of
https://github.com/holub/mame
synced 2025-06-01 10:31:48 +03:00
(nw)
This commit is contained in:
parent
49909156d2
commit
24309c17a7
@ -146,7 +146,7 @@ protected:
|
|||||||
ARCOMPACT_RETTYPE arcompact_handle01_01_01_0f(OPS_32);
|
ARCOMPACT_RETTYPE arcompact_handle01_01_01_0f(OPS_32);
|
||||||
ARCOMPACT_RETTYPE arcompact_handle02(OPS_32);
|
ARCOMPACT_RETTYPE arcompact_handle02(OPS_32);
|
||||||
ARCOMPACT_RETTYPE arcompact_handle03(OPS_32);
|
ARCOMPACT_RETTYPE arcompact_handle03(OPS_32);
|
||||||
ARCOMPACT_RETTYPE arcompact_handle04_00(OPS_32);
|
// ARCOMPACT_RETTYPE arcompact_handle04_00(OPS_32);
|
||||||
ARCOMPACT_RETTYPE arcompact_handle04_01(OPS_32);
|
ARCOMPACT_RETTYPE arcompact_handle04_01(OPS_32);
|
||||||
ARCOMPACT_RETTYPE arcompact_handle04_02(OPS_32);
|
ARCOMPACT_RETTYPE arcompact_handle04_02(OPS_32);
|
||||||
ARCOMPACT_RETTYPE arcompact_handle04_03(OPS_32);
|
ARCOMPACT_RETTYPE arcompact_handle04_03(OPS_32);
|
||||||
@ -767,10 +767,9 @@ protected:
|
|||||||
|
|
||||||
ARCOMPACT_RETTYPE get_insruction(OPS_32);
|
ARCOMPACT_RETTYPE get_insruction(OPS_32);
|
||||||
|
|
||||||
|
ARCOMPACT_HANDLER04_TYPE_PM(04_00);
|
||||||
ARCOMPACT_HANDLER04_TYPE_PM(04_20);
|
|
||||||
ARCOMPACT_HANDLER04_TYPE_PM(04_0a);
|
ARCOMPACT_HANDLER04_TYPE_PM(04_0a);
|
||||||
|
ARCOMPACT_HANDLER04_TYPE_PM(04_20);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
address_space_config m_program_config;
|
address_space_config m_program_config;
|
||||||
|
@ -1288,7 +1288,7 @@ ARCOMPACT_RETTYPE arcompact_device::arcompact_handle01_01_01_05(OPS_32) // regis
|
|||||||
b = limm;
|
b = limm;
|
||||||
}
|
}
|
||||||
|
|
||||||
// BRHS
|
// BRHS"
|
||||||
if (b >= c) // check
|
if (b >= c) // check
|
||||||
{
|
{
|
||||||
// take jump
|
// take jump
|
||||||
@ -1510,11 +1510,86 @@ ARCOMPACT_RETTYPE arcompact_device::arcompact_handle04_helper(OPS_32, const char
|
|||||||
return m_pc + (size>>0);
|
return m_pc + (size>>0);
|
||||||
}
|
}
|
||||||
|
|
||||||
ARCOMPACT_RETTYPE arcompact_device::arcompact_handle04_00(OPS_32)
|
|
||||||
|
ARCOMPACT_RETTYPE arcompact_device::arcompact_handle04_00_p00(OPS_32)
|
||||||
{
|
{
|
||||||
return arcompact_handle04_helper(PARAMS, opcodes_04[0x00], /*"ADD"*/ 0,0);
|
int size = 4;
|
||||||
|
UINT32 limm = 0;
|
||||||
|
int got_limm = 0;
|
||||||
|
|
||||||
|
COMMON32_GET_breg;
|
||||||
|
COMMON32_GET_F;
|
||||||
|
COMMON32_GET_creg
|
||||||
|
COMMON32_GET_areg
|
||||||
|
|
||||||
|
UINT32 b, c;
|
||||||
|
|
||||||
|
if (breg == LIMM_REG)
|
||||||
|
{
|
||||||
|
GET_LIMM_32;
|
||||||
|
size = 8;
|
||||||
|
got_limm = 1;
|
||||||
|
b = limm;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
b = m_regs[breg];
|
||||||
|
}
|
||||||
|
|
||||||
|
if (creg == LIMM_REG)
|
||||||
|
{
|
||||||
|
if (!got_limm)
|
||||||
|
{
|
||||||
|
GET_LIMM_32;
|
||||||
|
size = 8;
|
||||||
|
}
|
||||||
|
c = limm;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
c = m_regs[creg];
|
||||||
|
}
|
||||||
|
|
||||||
|
// todo: if areg = LIMM then there is no result (but since that register can never be read, I guess it doesn't matter if we store it there anyway?)
|
||||||
|
m_regs[areg] = b + c;
|
||||||
|
|
||||||
|
if (F)
|
||||||
|
{
|
||||||
|
arcompact_fatal("arcompact_handle04_00_p00 (ADD) (F set)\n"); // not yet supported
|
||||||
|
}
|
||||||
|
|
||||||
|
return m_pc + (size >> 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ARCOMPACT_RETTYPE arcompact_device::arcompact_handle04_00_p01(OPS_32)
|
||||||
|
{
|
||||||
|
int size = 4;
|
||||||
|
arcompact_fatal("arcompact_handle04_00_p01 (ADD)\n");
|
||||||
|
return m_pc + (size >> 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
ARCOMPACT_RETTYPE arcompact_device::arcompact_handle04_00_p10(OPS_32)
|
||||||
|
{
|
||||||
|
int size = 4;
|
||||||
|
arcompact_fatal("arcompact_handle04_00_p10 (ADD)\n");
|
||||||
|
return m_pc + (size >> 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
ARCOMPACT_RETTYPE arcompact_device::arcompact_handle04_00_p11_m0(OPS_32)
|
||||||
|
{
|
||||||
|
int size = 4;
|
||||||
|
arcompact_fatal("arcompact_handle04_00_p11_m0 (ADD)\n");
|
||||||
|
return m_pc + (size >> 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
ARCOMPACT_RETTYPE arcompact_device::arcompact_handle04_00_p11_m1(OPS_32)
|
||||||
|
{
|
||||||
|
int size = 4;
|
||||||
|
arcompact_fatal("arcompact_handle04_00_p11_m1 (ADD)\n");
|
||||||
|
return m_pc + (size >> 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
ARCOMPACT_RETTYPE arcompact_device::arcompact_handle04_01(OPS_32)
|
ARCOMPACT_RETTYPE arcompact_device::arcompact_handle04_01(OPS_32)
|
||||||
{
|
{
|
||||||
return arcompact_handle04_helper(PARAMS, opcodes_04[0x01], /*"ADC"*/ 0,0);
|
return arcompact_handle04_helper(PARAMS, opcodes_04[0x01], /*"ADC"*/ 0,0);
|
||||||
|
@ -404,24 +404,11 @@ int arcompact_handle04_p00_helper_dasm(DASM_OPS_32, const char* optext, int igno
|
|||||||
// output += sprintf( output, " p(%d)", p);
|
// output += sprintf( output, " p(%d)", p);
|
||||||
|
|
||||||
|
|
||||||
if (!b_reserved)
|
if ((!b_reserved) && (breg == LIMM_REG))
|
||||||
{
|
{
|
||||||
if (breg == LIMM_REG)
|
GET_LIMM_32;
|
||||||
{
|
size = 8;
|
||||||
GET_LIMM_32;
|
got_limm = 1;
|
||||||
size = 8;
|
|
||||||
got_limm = 1;
|
|
||||||
output += sprintf(output, " 0x%08x ", limm);
|
|
||||||
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
output += sprintf(output, " %s, ", regnames[breg]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
if (breg) output += sprintf(output, "reserved(%s), ", regnames[breg]);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (creg == LIMM_REG)
|
if (creg == LIMM_REG)
|
||||||
@ -431,42 +418,42 @@ int arcompact_handle04_p00_helper_dasm(DASM_OPS_32, const char* optext, int igno
|
|||||||
GET_LIMM_32;
|
GET_LIMM_32;
|
||||||
size = 8;
|
size = 8;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
output += sprintf(output, " 0x%08x ", limm);
|
// areg can be LIMM too, but in that case LIMM indicates 'no destination' rather than an actual LIMM value following
|
||||||
if (ignore_dst == 0)
|
|
||||||
{
|
if (ignore_dst == 0)
|
||||||
if (areg != LIMM_REG) output += sprintf(output, "DST(%s)", regnames[areg]);
|
{
|
||||||
else output += sprintf(output, "<no dst>");
|
if (areg != LIMM_REG) output += sprintf(output, " %s <-", regnames[areg]);
|
||||||
}
|
else output += sprintf(output, " <no dst> <-");
|
||||||
|
}
|
||||||
|
else if (ignore_dst == 1) // certain opcode types ignore the 'a' field entirely, it should be set to 0.
|
||||||
|
{
|
||||||
|
if (areg) output += sprintf(output, " <reserved %d> <-", areg);
|
||||||
|
}
|
||||||
|
else if (ignore_dst == 2) // for multiply operations areg should always be set to LIMM
|
||||||
|
{
|
||||||
|
if (areg != LIMM_REG) output += sprintf(output, " <invalid %d> <-", areg);
|
||||||
|
else output += sprintf(output, " <mulres> <-");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!b_reserved)
|
||||||
|
{
|
||||||
|
if (breg == LIMM_REG)
|
||||||
|
output += sprintf(output, " 0x%08x,", limm);
|
||||||
else
|
else
|
||||||
{
|
output += sprintf(output, " %s,", regnames[breg]);
|
||||||
if (ignore_dst == 1) { if (areg) output += sprintf(output, "unused(%s)", regnames[areg]); }
|
|
||||||
else
|
|
||||||
{
|
|
||||||
if (areg != LIMM_REG) output += sprintf(output, "invalid(%s)", regnames[areg]);
|
|
||||||
else output += sprintf(output, "<mulres>");
|
|
||||||
} // mul operations expect A to be set to LIMM (no output)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
output += sprintf(output, "C(%s) ", regnames[creg]);
|
if (breg) output += sprintf(output, "<reserved %d>,", breg);
|
||||||
if (ignore_dst == 0)
|
|
||||||
{
|
|
||||||
if (areg != LIMM_REG) output += sprintf(output, "DST(%s)", regnames[areg]);
|
|
||||||
else output += sprintf(output, "<no dst>");
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
if (ignore_dst == 1) { if (areg) output += sprintf(output, "unused(%s)", regnames[areg]); }
|
|
||||||
else
|
|
||||||
{
|
|
||||||
if (areg != LIMM_REG) output += sprintf(output, "invalid(%s)", regnames[areg]);
|
|
||||||
else output += sprintf(output, "<mulres>");
|
|
||||||
} // mul operations expect A to be set to LIMM (no output)
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (creg == LIMM_REG)
|
||||||
|
output += sprintf(output, " 0x%08x", limm);
|
||||||
|
else
|
||||||
|
output += sprintf(output, " %s", regnames[creg]);
|
||||||
|
|
||||||
return size;
|
return size;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user