(MESS) amiga: Cleaned up CIA access a bit. (nw)

This commit is contained in:
Curt Coder 2014-03-25 11:43:17 +00:00
parent 74dbffb0ba
commit e5644c2735

View File

@ -1043,28 +1043,23 @@ static void blitter_setup(address_space &space)
READ16_MEMBER( amiga_state::amiga_cia_r )
{
amiga_state *state = space.machine().driver_data<amiga_state>();
UINT8 data;
int shift;
legacy_mos6526_device *cia;
/* offsets 0000-07ff reference CIA B, and are accessed via the MSB */
if ((offset & 0x0800) == 0)
{
cia = state->m_cia_1;
data = m_cia_1->read(space, offset >> 7);
shift = 8;
}
/* offsets 0800-0fff reference CIA A, and are accessed via the LSB */
else
{
cia = state->m_cia_0;
data = m_cia_0->read(space, offset >> 7);
shift = 0;
}
/* handle the reads */
data = cia->read(space, offset >> 7);
if (LOG_CIA)
logerror("%06x:cia_%c_read(%03x) = %04x & %04x\n", space.device().safe_pc(), 'A' + ((~offset & 0x0800) >> 11), offset * 2, data << shift, mem_mask);
@ -1081,9 +1076,6 @@ READ16_MEMBER( amiga_state::amiga_cia_r )
WRITE16_MEMBER( amiga_state::amiga_cia_w )
{
amiga_state *state = space.machine().driver_data<amiga_state>();
legacy_mos6526_device *cia;
if (LOG_CIA)
logerror("%06x:cia_%c_write(%03x) = %04x & %04x\n", space.device().safe_pc(), 'A' + ((~offset & 0x0800) >> 11), offset * 2, data, mem_mask);
@ -1092,7 +1084,7 @@ WRITE16_MEMBER( amiga_state::amiga_cia_w )
{
if (!ACCESSING_BITS_8_15)
return;
cia = state->m_cia_1;
m_cia_1->write(space, offset >> 7, (UINT8) data);
data >>= 8;
}
@ -1101,12 +1093,9 @@ WRITE16_MEMBER( amiga_state::amiga_cia_w )
{
if (!ACCESSING_BITS_0_7)
return;
cia = state->m_cia_0;
m_cia_0->write(space, offset >> 7, (UINT8) data);
data &= 0xff;
}
/* handle the writes */
cia->write(space, offset >> 7, (UINT8) data);
}