diff options
Diffstat (limited to 'src/devices/machine/ataintf.cpp')
-rw-r--r-- | src/devices/machine/ataintf.cpp | 50 |
1 files changed, 25 insertions, 25 deletions
diff --git a/src/devices/machine/ataintf.cpp b/src/devices/machine/ataintf.cpp index 56c2031bd56..b9c51351e71 100644 --- a/src/devices/machine/ataintf.cpp +++ b/src/devices/machine/ataintf.cpp @@ -72,7 +72,7 @@ WRITE_LINE_MEMBER( ata_interface_device::dasp1_write_line ) m_dasp[1] = state; ata_device_interface *dev = m_slot[0]->dev(); - if (dev != NULL) + if (dev != nullptr) dev->write_dasp(state); set_dasp(m_dasp[0] == ASSERT_LINE || m_dasp[1] == ASSERT_LINE); @@ -111,7 +111,7 @@ WRITE_LINE_MEMBER( ata_interface_device::pdiag1_write_line ) m_pdiag[1] = state; ata_device_interface *dev = m_slot[0]->dev(); - if (dev != NULL) + if (dev != nullptr) dev->write_pdiag(state); } } @@ -125,9 +125,9 @@ WRITE_LINE_MEMBER( ata_interface_device::pdiag1_write_line ) UINT16 ata_interface_device::read_dma() { UINT16 result = 0xffff; - for (int i = 0; i < 2; i++) - if (m_slot[i]->dev() != NULL) - result &= m_slot[i]->dev()->read_dma(); + for (auto & elem : m_slot) + if (elem->dev() != nullptr) + result &= elem->dev()->read_dma(); // printf( "%s: read_dma %04x\n", machine().describe_context(), result ); return result; @@ -136,9 +136,9 @@ UINT16 ata_interface_device::read_dma() READ16_MEMBER( ata_interface_device::read_cs0 ) { UINT16 result = mem_mask; - for (int i = 0; i < 2; i++) - if (m_slot[i]->dev() != NULL) - result &= m_slot[i]->dev()->read_cs0(space, offset, mem_mask); + for (auto & elem : m_slot) + if (elem->dev() != nullptr) + result &= elem->dev()->read_cs0(space, offset, mem_mask); // { static int last_status = -1; if (offset == 7 ) { if( result == last_status ) return last_status; last_status = result; } else last_status = -1; } @@ -150,9 +150,9 @@ READ16_MEMBER( ata_interface_device::read_cs0 ) READ16_MEMBER( ata_interface_device::read_cs1 ) { UINT16 result = mem_mask; - for (int i = 0; i < 2; i++) - if (m_slot[i]->dev() != NULL) - result &= m_slot[i]->dev()->read_cs1(space, offset, mem_mask); + for (auto & elem : m_slot) + if (elem->dev() != nullptr) + result &= elem->dev()->read_cs1(space, offset, mem_mask); // printf( "%s: read cs1 %04x %04x %04x\n", machine().describe_context(), offset, result, mem_mask ); @@ -170,36 +170,36 @@ void ata_interface_device::write_dma( UINT16 data ) { // printf( "%s: write_dma %04x\n", machine().describe_context(), data ); - for (int i = 0; i < 2; i++) - if (m_slot[i]->dev() != NULL) - m_slot[i]->dev()->write_dma(data); + for (auto & elem : m_slot) + if (elem->dev() != nullptr) + elem->dev()->write_dma(data); } WRITE16_MEMBER( ata_interface_device::write_cs0 ) { // printf( "%s: write cs0 %04x %04x %04x\n", machine().describe_context(), offset, data, mem_mask ); - for (int i = 0; i < 2; i++) - if (m_slot[i]->dev() != NULL) - m_slot[i]->dev()->write_cs0(space, offset, data, mem_mask); + for (auto & elem : m_slot) + if (elem->dev() != nullptr) + elem->dev()->write_cs0(space, offset, data, mem_mask); } WRITE16_MEMBER( ata_interface_device::write_cs1 ) { // printf( "%s: write cs1 %04x %04x %04x\n", machine().describe_context(), offset, data, mem_mask ); - for (int i = 0; i < 2; i++) - if (m_slot[i]->dev() != NULL) - m_slot[i]->dev()->write_cs1(space, offset, data, mem_mask); + for (auto & elem : m_slot) + if (elem->dev() != nullptr) + elem->dev()->write_cs1(space, offset, data, mem_mask); } WRITE_LINE_MEMBER( ata_interface_device::write_dmack ) { // printf( "%s: write_dmack %04x\n", machine().describe_context(), state ); - for (int i = 0; i < 2; i++) - if (m_slot[i]->dev() != NULL) - m_slot[i]->dev()->write_dmack(state); + for (auto & elem : m_slot) + if (elem->dev() != nullptr) + elem->dev()->write_dmack(state); } SLOT_INTERFACE_START(ata_devices) @@ -247,7 +247,7 @@ void ata_interface_device::device_start() m_pdiag[i] = 0; ata_device_interface *dev = m_slot[i]->dev(); - if (dev != NULL) + if (dev != nullptr) { if (i == 0) { @@ -299,7 +299,7 @@ const device_type ATA_SLOT = &device_creator<ata_slot_device>; ata_slot_device::ata_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : device_t(mconfig, ATA_SLOT, "ATA Connector", tag, owner, clock, "ata_slot", __FILE__), device_slot_interface(mconfig, *this), - m_dev(NULL) + m_dev(nullptr) { } |