mirror of
https://github.com/holub/mame
synced 2025-10-08 09:30:17 +03:00
(MESS) amiga: Cleaned up CIA access a bit. (nw)
This commit is contained in:
parent
74dbffb0ba
commit
e5644c2735
@ -1043,28 +1043,23 @@ static void blitter_setup(address_space &space)
|
|||||||
|
|
||||||
READ16_MEMBER( amiga_state::amiga_cia_r )
|
READ16_MEMBER( amiga_state::amiga_cia_r )
|
||||||
{
|
{
|
||||||
amiga_state *state = space.machine().driver_data<amiga_state>();
|
|
||||||
UINT8 data;
|
UINT8 data;
|
||||||
int shift;
|
int shift;
|
||||||
legacy_mos6526_device *cia;
|
|
||||||
|
|
||||||
/* offsets 0000-07ff reference CIA B, and are accessed via the MSB */
|
/* offsets 0000-07ff reference CIA B, and are accessed via the MSB */
|
||||||
if ((offset & 0x0800) == 0)
|
if ((offset & 0x0800) == 0)
|
||||||
{
|
{
|
||||||
cia = state->m_cia_1;
|
data = m_cia_1->read(space, offset >> 7);
|
||||||
shift = 8;
|
shift = 8;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* offsets 0800-0fff reference CIA A, and are accessed via the LSB */
|
/* offsets 0800-0fff reference CIA A, and are accessed via the LSB */
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
cia = state->m_cia_0;
|
data = m_cia_0->read(space, offset >> 7);
|
||||||
shift = 0;
|
shift = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* handle the reads */
|
|
||||||
data = cia->read(space, offset >> 7);
|
|
||||||
|
|
||||||
if (LOG_CIA)
|
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);
|
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 )
|
WRITE16_MEMBER( amiga_state::amiga_cia_w )
|
||||||
{
|
{
|
||||||
amiga_state *state = space.machine().driver_data<amiga_state>();
|
|
||||||
legacy_mos6526_device *cia;
|
|
||||||
|
|
||||||
if (LOG_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);
|
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)
|
if (!ACCESSING_BITS_8_15)
|
||||||
return;
|
return;
|
||||||
cia = state->m_cia_1;
|
m_cia_1->write(space, offset >> 7, (UINT8) data);
|
||||||
data >>= 8;
|
data >>= 8;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1101,12 +1093,9 @@ WRITE16_MEMBER( amiga_state::amiga_cia_w )
|
|||||||
{
|
{
|
||||||
if (!ACCESSING_BITS_0_7)
|
if (!ACCESSING_BITS_0_7)
|
||||||
return;
|
return;
|
||||||
cia = state->m_cia_0;
|
m_cia_0->write(space, offset >> 7, (UINT8) data);
|
||||||
data &= 0xff;
|
data &= 0xff;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* handle the writes */
|
|
||||||
cia->write(space, offset >> 7, (UINT8) data);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user