mirror of
https://github.com/holub/mame
synced 2025-06-05 20:33:45 +03:00
z80dart: Added modern register accessors. (nw)
This commit is contained in:
parent
f12ca5dc6a
commit
fba6bce6c6
@ -1480,3 +1480,33 @@ WRITE8_DEVICE_HANDLER( z80dart_ba_cd_w )
|
||||
else
|
||||
z80dart_d_w(device, space, channel, data);
|
||||
}
|
||||
|
||||
READ8_MEMBER( z80dart_device::cd_ba_r )
|
||||
{
|
||||
return (offset & 2) ? control_read(offset & 1) : data_read(offset & 1);
|
||||
}
|
||||
|
||||
WRITE8_MEMBER( z80dart_device::cd_ba_w )
|
||||
{
|
||||
if (offset & 2)
|
||||
control_write(offset & 1, data);
|
||||
else
|
||||
data_write(offset & 1, data);
|
||||
}
|
||||
|
||||
READ8_MEMBER( z80dart_device::ba_cd_r )
|
||||
{
|
||||
int channel = BIT(offset, 1);
|
||||
|
||||
return (offset & 1) ? control_read(channel) : data_read(channel);
|
||||
}
|
||||
|
||||
WRITE8_MEMBER( z80dart_device::ba_cd_w )
|
||||
{
|
||||
int channel = BIT(offset, 1);
|
||||
|
||||
if (offset & 1)
|
||||
control_write(channel, data);
|
||||
else
|
||||
data_write(channel, data);
|
||||
}
|
||||
|
@ -184,6 +184,11 @@ public:
|
||||
// construction/destruction
|
||||
z80dart_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
|
||||
|
||||
DECLARE_READ8_MEMBER( cd_ba_r );
|
||||
DECLARE_WRITE8_MEMBER( cd_ba_w );
|
||||
DECLARE_READ8_MEMBER( ba_cd_r );
|
||||
DECLARE_WRITE8_MEMBER( ba_cd_w );
|
||||
|
||||
// control register access
|
||||
UINT8 control_read(int which) { return m_channel[which].control_read(); }
|
||||
void control_write(int which, UINT8 data) { return m_channel[which].control_write(data); }
|
||||
|
@ -439,8 +439,8 @@ static ADDRESS_MAP_START( abc800c_io, AS_IO, 8, abc800_state )
|
||||
AM_RANGE(0x05, 0x05) AM_MIRROR(0x18) AM_READ(pling_r)
|
||||
AM_RANGE(0x06, 0x06) AM_MIRROR(0x18) AM_WRITE(hrs_w)
|
||||
AM_RANGE(0x07, 0x07) AM_MIRROR(0x18) AM_DEVREAD(ABCBUS_TAG, abcbus_slot_device, rst_r) AM_WRITE(hrc_w)
|
||||
AM_RANGE(0x20, 0x23) AM_MIRROR(0x0c) AM_DEVREADWRITE_LEGACY(Z80DART_TAG, z80dart_ba_cd_r, z80dart_ba_cd_w)
|
||||
AM_RANGE(0x40, 0x43) AM_MIRROR(0x1c) AM_DEVREADWRITE_LEGACY(Z80SIO_TAG, z80dart_ba_cd_r, z80dart_ba_cd_w)
|
||||
AM_RANGE(0x20, 0x23) AM_MIRROR(0x0c) AM_DEVREADWRITE(Z80DART_TAG, z80dart_device, ba_cd_r, ba_cd_w)
|
||||
AM_RANGE(0x40, 0x43) AM_MIRROR(0x1c) AM_DEVREADWRITE(Z80SIO_TAG, z80dart_device, ba_cd_r, ba_cd_w)
|
||||
AM_RANGE(0x60, 0x63) AM_MIRROR(0x1c) AM_DEVREADWRITE(Z80CTC_TAG, z80ctc_device, read, write)
|
||||
ADDRESS_MAP_END
|
||||
|
||||
@ -497,11 +497,11 @@ static ADDRESS_MAP_START( abc802_io, AS_IO, 8, abc802_state )
|
||||
AM_RANGE(0x05, 0x05) AM_MIRROR(0x18) AM_DEVWRITE(ABCBUS_TAG, abcbus_slot_device, c4_w)
|
||||
AM_RANGE(0x05, 0x05) AM_MIRROR(0x08) AM_READ(pling_r)
|
||||
AM_RANGE(0x07, 0x07) AM_MIRROR(0x18) AM_DEVREAD(ABCBUS_TAG, abcbus_slot_device, rst_r)
|
||||
AM_RANGE(0x20, 0x23) AM_MIRROR(0x0c) AM_DEVREADWRITE_LEGACY(Z80DART_TAG, z80dart_ba_cd_r, z80dart_ba_cd_w)
|
||||
AM_RANGE(0x20, 0x23) AM_MIRROR(0x0c) AM_DEVREADWRITE(Z80DART_TAG, z80dart_device, ba_cd_r, ba_cd_w)
|
||||
AM_RANGE(0x31, 0x31) AM_MIRROR(0x06) AM_DEVREAD(MC6845_TAG, mc6845_device, register_r)
|
||||
AM_RANGE(0x38, 0x38) AM_MIRROR(0x06) AM_DEVWRITE(MC6845_TAG, mc6845_device, address_w)
|
||||
AM_RANGE(0x39, 0x39) AM_MIRROR(0x06) AM_DEVWRITE(MC6845_TAG, mc6845_device, register_w)
|
||||
AM_RANGE(0x40, 0x43) AM_MIRROR(0x1c) AM_DEVREADWRITE_LEGACY(Z80SIO_TAG, z80dart_ba_cd_r, z80dart_ba_cd_w)
|
||||
AM_RANGE(0x40, 0x43) AM_MIRROR(0x1c) AM_DEVREADWRITE(Z80SIO_TAG, z80dart_device, ba_cd_r, ba_cd_w)
|
||||
AM_RANGE(0x60, 0x63) AM_MIRROR(0x1c) AM_DEVREADWRITE(Z80CTC_TAG, z80ctc_device, read, write)
|
||||
ADDRESS_MAP_END
|
||||
|
||||
@ -545,7 +545,7 @@ static ADDRESS_MAP_START( abc806_io, AS_IO, 8, abc806_state )
|
||||
AM_RANGE(0x05, 0x05) AM_MIRROR(0xff18) AM_DEVWRITE(ABCBUS_TAG, abcbus_slot_device, c4_w)
|
||||
AM_RANGE(0x06, 0x06) AM_MIRROR(0xff18) AM_WRITE(hrs_w)
|
||||
AM_RANGE(0x07, 0x07) AM_MIRROR(0xff18) AM_DEVREAD(ABCBUS_TAG, abcbus_slot_device, rst_r) AM_WRITE(hrc_w)
|
||||
AM_RANGE(0x20, 0x23) AM_MIRROR(0xff0c) AM_DEVREADWRITE_LEGACY(Z80DART_TAG, z80dart_ba_cd_r, z80dart_ba_cd_w)
|
||||
AM_RANGE(0x20, 0x23) AM_MIRROR(0xff0c) AM_DEVREADWRITE(Z80DART_TAG, z80dart_device, ba_cd_r, ba_cd_w)
|
||||
AM_RANGE(0x31, 0x31) AM_MIRROR(0xff00) AM_DEVREAD(MC6845_TAG, mc6845_device, register_r)
|
||||
AM_RANGE(0x34, 0x34) AM_MIRROR(0xff00) AM_MASK(0xff00) AM_READWRITE(mai_r, mao_w)
|
||||
AM_RANGE(0x35, 0x35) AM_MIRROR(0xff00) AM_READWRITE(ami_r, amo_w)
|
||||
@ -553,7 +553,7 @@ static ADDRESS_MAP_START( abc806_io, AS_IO, 8, abc806_state )
|
||||
AM_RANGE(0x37, 0x37) AM_MIRROR(0xff00) AM_MASK(0xff00) AM_READWRITE(cli_r, sso_w)
|
||||
AM_RANGE(0x38, 0x38) AM_MIRROR(0xff00) AM_DEVWRITE(MC6845_TAG, mc6845_device, address_w)
|
||||
AM_RANGE(0x39, 0x39) AM_MIRROR(0xff00) AM_DEVWRITE(MC6845_TAG, mc6845_device, register_w)
|
||||
AM_RANGE(0x40, 0x43) AM_MIRROR(0xff1c) AM_DEVREADWRITE_LEGACY(Z80SIO_TAG, z80dart_ba_cd_r, z80dart_ba_cd_w)
|
||||
AM_RANGE(0x40, 0x43) AM_MIRROR(0xff1c) AM_DEVREADWRITE(Z80SIO_TAG, z80dart_device, ba_cd_r, ba_cd_w)
|
||||
AM_RANGE(0x60, 0x63) AM_MIRROR(0xff1c) AM_DEVREADWRITE(Z80CTC_TAG, z80ctc_device, read, write)
|
||||
ADDRESS_MAP_END
|
||||
|
||||
|
@ -91,7 +91,7 @@ public:
|
||||
m_tape_ctr(4)
|
||||
{ }
|
||||
|
||||
required_device<cpu_device> m_maincpu;
|
||||
required_device<legacy_cpu_device> m_maincpu;
|
||||
required_device<z80ctc_device> m_ctc;
|
||||
required_device<z80dart_device> m_dart;
|
||||
required_device<z80dart_device> m_sio;
|
||||
|
Loading…
Reference in New Issue
Block a user