Previous 199869 Revisions Next

r20673 Saturday 2nd February, 2013 at 17:20:28 UTC by Curt Coder
z80dart: Added modern register accessors. (nw)
[src/emu/machine]z80dart.c z80dart.h
[src/mess/drivers]abc80x.c
[src/mess/includes]abc80x.h

trunk/src/emu/machine/z80dart.c
r20672r20673
14801480   else
14811481      z80dart_d_w(device, space, channel, data);
14821482}
1483
1484READ8_MEMBER( z80dart_device::cd_ba_r )
1485{
1486   return (offset & 2) ? control_read(offset & 1) : data_read(offset & 1);
1487}
1488
1489WRITE8_MEMBER( z80dart_device::cd_ba_w )
1490{
1491   if (offset & 2)
1492      control_write(offset & 1, data);
1493   else
1494      data_write(offset & 1, data);
1495}
1496
1497READ8_MEMBER( z80dart_device::ba_cd_r )
1498{
1499   int channel = BIT(offset, 1);
1500
1501   return (offset & 1) ? control_read(channel) : data_read(channel);
1502}
1503
1504WRITE8_MEMBER( z80dart_device::ba_cd_w )
1505{
1506   int channel = BIT(offset, 1);
1507
1508   if (offset & 1)
1509      control_write(channel, data);
1510   else
1511      data_write(channel, data);
1512}
trunk/src/emu/machine/z80dart.h
r20672r20673
184184   // construction/destruction
185185   z80dart_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
186186
187   DECLARE_READ8_MEMBER( cd_ba_r );
188   DECLARE_WRITE8_MEMBER( cd_ba_w );
189   DECLARE_READ8_MEMBER( ba_cd_r );
190   DECLARE_WRITE8_MEMBER( ba_cd_w );
191
187192   // control register access
188193   UINT8 control_read(int which) { return m_channel[which].control_read(); }
189194   void control_write(int which, UINT8 data) { return m_channel[which].control_write(data); }
trunk/src/mess/includes/abc80x.h
r20672r20673
9191         m_tape_ctr(4)
9292   { }
9393
94   required_device<cpu_device> m_maincpu;
94   required_device<legacy_cpu_device> m_maincpu;
9595   required_device<z80ctc_device> m_ctc;
9696   required_device<z80dart_device> m_dart;
9797   required_device<z80dart_device> m_sio;
trunk/src/mess/drivers/abc80x.c
r20672r20673
439439   AM_RANGE(0x05, 0x05) AM_MIRROR(0x18) AM_READ(pling_r)
440440   AM_RANGE(0x06, 0x06) AM_MIRROR(0x18) AM_WRITE(hrs_w)
441441   AM_RANGE(0x07, 0x07) AM_MIRROR(0x18) AM_DEVREAD(ABCBUS_TAG, abcbus_slot_device, rst_r) AM_WRITE(hrc_w)
442   AM_RANGE(0x20, 0x23) AM_MIRROR(0x0c) AM_DEVREADWRITE_LEGACY(Z80DART_TAG, z80dart_ba_cd_r, z80dart_ba_cd_w)
443   AM_RANGE(0x40, 0x43) AM_MIRROR(0x1c) AM_DEVREADWRITE_LEGACY(Z80SIO_TAG, z80dart_ba_cd_r, z80dart_ba_cd_w)
442   AM_RANGE(0x20, 0x23) AM_MIRROR(0x0c) AM_DEVREADWRITE(Z80DART_TAG, z80dart_device, ba_cd_r, ba_cd_w)
443   AM_RANGE(0x40, 0x43) AM_MIRROR(0x1c) AM_DEVREADWRITE(Z80SIO_TAG, z80dart_device, ba_cd_r, ba_cd_w)
444444   AM_RANGE(0x60, 0x63) AM_MIRROR(0x1c) AM_DEVREADWRITE(Z80CTC_TAG, z80ctc_device, read, write)
445445ADDRESS_MAP_END
446446
r20672r20673
497497   AM_RANGE(0x05, 0x05) AM_MIRROR(0x18) AM_DEVWRITE(ABCBUS_TAG, abcbus_slot_device, c4_w)
498498   AM_RANGE(0x05, 0x05) AM_MIRROR(0x08) AM_READ(pling_r)
499499   AM_RANGE(0x07, 0x07) AM_MIRROR(0x18) AM_DEVREAD(ABCBUS_TAG, abcbus_slot_device, rst_r)
500   AM_RANGE(0x20, 0x23) AM_MIRROR(0x0c) AM_DEVREADWRITE_LEGACY(Z80DART_TAG, z80dart_ba_cd_r, z80dart_ba_cd_w)
500   AM_RANGE(0x20, 0x23) AM_MIRROR(0x0c) AM_DEVREADWRITE(Z80DART_TAG, z80dart_device, ba_cd_r, ba_cd_w)
501501   AM_RANGE(0x31, 0x31) AM_MIRROR(0x06) AM_DEVREAD(MC6845_TAG, mc6845_device, register_r)
502502   AM_RANGE(0x38, 0x38) AM_MIRROR(0x06) AM_DEVWRITE(MC6845_TAG, mc6845_device, address_w)
503503   AM_RANGE(0x39, 0x39) AM_MIRROR(0x06) AM_DEVWRITE(MC6845_TAG, mc6845_device, register_w)
504   AM_RANGE(0x40, 0x43) AM_MIRROR(0x1c) AM_DEVREADWRITE_LEGACY(Z80SIO_TAG, z80dart_ba_cd_r, z80dart_ba_cd_w)
504   AM_RANGE(0x40, 0x43) AM_MIRROR(0x1c) AM_DEVREADWRITE(Z80SIO_TAG, z80dart_device, ba_cd_r, ba_cd_w)
505505   AM_RANGE(0x60, 0x63) AM_MIRROR(0x1c) AM_DEVREADWRITE(Z80CTC_TAG, z80ctc_device, read, write)
506506ADDRESS_MAP_END
507507
r20672r20673
545545   AM_RANGE(0x05, 0x05) AM_MIRROR(0xff18) AM_DEVWRITE(ABCBUS_TAG, abcbus_slot_device, c4_w)
546546   AM_RANGE(0x06, 0x06) AM_MIRROR(0xff18) AM_WRITE(hrs_w)
547547   AM_RANGE(0x07, 0x07) AM_MIRROR(0xff18) AM_DEVREAD(ABCBUS_TAG, abcbus_slot_device, rst_r) AM_WRITE(hrc_w)
548   AM_RANGE(0x20, 0x23) AM_MIRROR(0xff0c) AM_DEVREADWRITE_LEGACY(Z80DART_TAG, z80dart_ba_cd_r, z80dart_ba_cd_w)
548   AM_RANGE(0x20, 0x23) AM_MIRROR(0xff0c) AM_DEVREADWRITE(Z80DART_TAG, z80dart_device, ba_cd_r, ba_cd_w)
549549   AM_RANGE(0x31, 0x31) AM_MIRROR(0xff00) AM_DEVREAD(MC6845_TAG, mc6845_device, register_r)
550550   AM_RANGE(0x34, 0x34) AM_MIRROR(0xff00) AM_MASK(0xff00) AM_READWRITE(mai_r, mao_w)
551551   AM_RANGE(0x35, 0x35) AM_MIRROR(0xff00) AM_READWRITE(ami_r, amo_w)
r20672r20673
553553   AM_RANGE(0x37, 0x37) AM_MIRROR(0xff00) AM_MASK(0xff00) AM_READWRITE(cli_r, sso_w)
554554   AM_RANGE(0x38, 0x38) AM_MIRROR(0xff00) AM_DEVWRITE(MC6845_TAG, mc6845_device, address_w)
555555   AM_RANGE(0x39, 0x39) AM_MIRROR(0xff00) AM_DEVWRITE(MC6845_TAG, mc6845_device, register_w)
556   AM_RANGE(0x40, 0x43) AM_MIRROR(0xff1c) AM_DEVREADWRITE_LEGACY(Z80SIO_TAG, z80dart_ba_cd_r, z80dart_ba_cd_w)
556   AM_RANGE(0x40, 0x43) AM_MIRROR(0xff1c) AM_DEVREADWRITE(Z80SIO_TAG, z80dart_device, ba_cd_r, ba_cd_w)
557557   AM_RANGE(0x60, 0x63) AM_MIRROR(0xff1c) AM_DEVREADWRITE(Z80CTC_TAG, z80ctc_device, read, write)
558558ADDRESS_MAP_END
559559

Previous 199869 Revisions Next


© 1997-2024 The MAME Team