i960: added scanbyte and IP-relative lda opcodes, masked low bits of branch targets [R. Belmont]

This commit is contained in:
arbee 2016-12-10 10:15:57 -05:00
parent 595d7e2cc8
commit f66261b713
2 changed files with 28 additions and 1 deletions

View File

@ -105,6 +105,13 @@ uint32_t i960_cpu_device::get_ea(uint32_t opcode)
switch(mode) {
case 0x4:
return m_r[abase];
case 0x5: // address of this instruction + the offset dword + 8
// which in reality is "address of next instruction + the offset dword"
ret = m_direct->read_dword(m_IP);
m_IP += 4;
ret += m_IP;
return ret;
case 0x7:
return m_r[abase] + (m_r[index] << scale);
@ -357,6 +364,7 @@ void i960_cpu_device::bxx(uint32_t opcode, int mask)
{
if(m_AC & mask) {
m_IP += get_disp(opcode);
m_IP &= ~3;
}
}
@ -364,6 +372,7 @@ void i960_cpu_device::bxx_s(uint32_t opcode, int mask)
{
if(m_AC & mask) {
m_IP += get_disp_s(opcode);
m_IP &= ~3;
}
}
@ -1068,6 +1077,21 @@ void i960_cpu_device::execute_op(uint32_t opcode)
cmp_s(t1, t2);
set_ri(opcode, t2-1);
break;
case 0xc: // scanbyte
m_icount -= 2;
m_AC &= ~7; // clear CC
t1 = get_1_ri(opcode);
t2 = get_2_ri(opcode);
printf("t1 %08x t2 %08x\n", t1, t2);
if ((t1 & 0xff000000) == (t2 & 0xff000000) ||
(t1 & 0x00ff0000) == (t2 & 0x00ff0000) ||
(t1 & 0x0000ff00) == (t2 & 0x0000ff00) ||
(t1 & 0x000000ff) == (t2 & 0x000000ff))
{
m_AC |= 2;
}
break;
case 0xe: // chkbit
m_icount -= 2;

View File

@ -143,11 +143,14 @@ static ADDRESS_MAP_START( igt_gameking_mem, AS_PROGRAM, 32, igt_gameking_state )
AM_RANGE(0x10000000, 0x1000001f) AM_RAM
AM_RANGE(0x10000020, 0x1000021f) AM_RAM // strange range to test, correct or CPU issue?
AM_RANGE(0x10000220, 0x1003ffff) AM_RAM
AM_RANGE(0x1807d000, 0x1807dfff) AM_RAM // used by MS3 for the restart IAC and afterwards
AM_RANGE(0x28010008, 0x2801000b) AM_READ(igt_gk_28010008_r)
AM_RANGE(0x28020000, 0x280205ff) AM_RAM
AM_RANGE(0x28030000, 0x28030003) AM_READ(igt_gk_28030000_r)
AM_RANGE(0xa1000000, 0xa1011fff) AM_RAM // used by gkkey for restart IAC
ADDRESS_MAP_END