trunk/src/mess/machine/isa_ide.c
| r21435 | r21436 | |
| 9 | 9 | #include "machine/idectrl.h" |
| 10 | 10 | #include "imagedev/harddriv.h" |
| 11 | 11 | |
| 12 | | static READ16_DEVICE_HANDLER( ide16_r ) |
| 12 | READ16_MEMBER(isa16_ide_device::ide16_r) |
| 13 | 13 | { |
| 14 | | return ide_controller16_r(device, space, 0x1f0/2 + offset, mem_mask); |
| 14 | return ide_controller16_r(m_ide, space, 0x1f0/2 + offset, mem_mask); |
| 15 | 15 | } |
| 16 | 16 | |
| 17 | | static WRITE16_DEVICE_HANDLER( ide16_w ) |
| 17 | WRITE16_MEMBER(isa16_ide_device::ide16_w) |
| 18 | 18 | { |
| 19 | | ide_controller16_w(device, space, 0x1f0/2 + offset, data, mem_mask); |
| 19 | ide_controller16_w(m_ide, space, 0x1f0/2 + offset, data, mem_mask); |
| 20 | 20 | } |
| 21 | 21 | |
| 22 | | |
| 23 | | static READ16_DEVICE_HANDLER( ide16_alt_r ) |
| 22 | READ8_MEMBER(isa16_ide_device::ide16_alt_r ) |
| 24 | 23 | { |
| 25 | | return ide_controller16_r(device, space, 0x3f6/2 + offset, 0x00ff); |
| 24 | return ide_controller16_r(m_ide, space, 0x3f6/2, 0x00ff); |
| 26 | 25 | } |
| 27 | 26 | |
| 28 | | static WRITE16_DEVICE_HANDLER( ide16_alt_w ) |
| 27 | WRITE8_MEMBER(isa16_ide_device::ide16_alt_w ) |
| 29 | 28 | { |
| 30 | | ide_controller16_w(device, space, 0x3f6/2 + offset, data, 0x00ff); |
| 29 | ide_controller16_w(m_ide, space, 0x3f6/2, data, 0x00ff); |
| 31 | 30 | } |
| 32 | 31 | |
| 32 | DEVICE_ADDRESS_MAP_START(map, 16, isa16_ide_device) |
| 33 | AM_RANGE(0x0, 0x7) AM_READWRITE(ide16_r, ide16_w) |
| 34 | ADDRESS_MAP_END |
| 35 | |
| 36 | DEVICE_ADDRESS_MAP_START(alt_map, 8, isa16_ide_device) |
| 37 | AM_RANGE(0x6, 0x6) AM_READWRITE(ide16_alt_r, ide16_alt_w) |
| 38 | ADDRESS_MAP_END |
| 39 | |
| 33 | 40 | WRITE_LINE_MEMBER(isa16_ide_device::ide_interrupt) |
| 34 | 41 | { |
| 35 | 42 | if (is_primary()) |
| r21435 | r21436 | |
| 90 | 97 | isa16_ide_device::isa16_ide_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) |
| 91 | 98 | : device_t(mconfig, ISA16_IDE, "IDE Fixed Drive Adapter", tag, owner, clock), |
| 92 | 99 | device_isa16_card_interface( mconfig, *this ), |
| 93 | | m_is_primary(true) |
| 100 | m_is_primary(true), |
| 101 | m_ide(*this, "ide") |
| 94 | 102 | { |
| 95 | 103 | } |
| 96 | 104 | |
| r21435 | r21436 | |
| 111 | 119 | { |
| 112 | 120 | m_is_primary = (ioport("DSW")->read() & 1) ? false : true; |
| 113 | 121 | if (m_is_primary) { |
| 114 | | m_isa->install16_device(subdevice("ide"), 0x01f0, 0x01f7, 0, 0, FUNC(ide16_r), FUNC(ide16_w) ); |
| 115 | | //m_isa->install16_device(subdevice("ide"), 0x03f6, 0x03f7, 0, 0, FUNC(ide16_alt_r), FUNC(ide16_alt_w) ); |
| 122 | m_isa->install_device(0x01f0, 0x01f7, *this, &isa16_ide_device::map, 16); |
| 123 | m_isa->install_device(0x03f0, 0x03f7, *this, &isa16_ide_device::alt_map); |
| 116 | 124 | } else { |
| 117 | | m_isa->install16_device(subdevice("ide"), 0x0170, 0x0177, 0, 0, FUNC(ide16_r), FUNC(ide16_w) ); |
| 118 | | m_isa->install16_device(subdevice("ide"), 0x0376, 0x0377, 0, 0, FUNC(ide16_alt_r), FUNC(ide16_alt_w) ); |
| 125 | m_isa->install_device(0x0170, 0x0177, *this, &isa16_ide_device::map, 16); |
| 126 | m_isa->install_device(0x0370, 0x0377, *this, &isa16_ide_device::alt_map); |
| 119 | 127 | } |
| 120 | 128 | } |