diff options
Diffstat (limited to 'src/devices/bus/amiga/zorro/buddha.cpp')
-rw-r--r-- | src/devices/bus/amiga/zorro/buddha.cpp | 78 |
1 files changed, 39 insertions, 39 deletions
diff --git a/src/devices/bus/amiga/zorro/buddha.cpp b/src/devices/bus/amiga/zorro/buddha.cpp index 3cc14d9d1d0..c515096a28a 100644 --- a/src/devices/bus/amiga/zorro/buddha.cpp +++ b/src/devices/bus/amiga/zorro/buddha.cpp @@ -33,10 +33,10 @@ // DEVICE DEFINITIONS //************************************************************************** -DEFINE_DEVICE_TYPE_NS(ZORRO_BUDDHA, bus::amiga::zorro, buddha_device, "zorro_buddha", "Buddha IDE controller") +DEFINE_DEVICE_TYPE(ZORRO_BUDDHA, bus::amiga::zorro::buddha_device, "zorro_buddha", "Buddha IDE controller") -namespace bus { namespace amiga { namespace zorro { +namespace bus::amiga::zorro { //------------------------------------------------- // mmio_map - device-specific memory mapped I/O @@ -155,7 +155,7 @@ void buddha_device::autoconfig_base_address(offs_t address) m_slot->cfgout_w(0); } -WRITE_LINE_MEMBER( buddha_device::cfgin_w ) +void buddha_device::cfgin_w(int state) { LOG("configin_w (%d)\n", state); @@ -181,7 +181,7 @@ WRITE_LINE_MEMBER( buddha_device::cfgin_w ) } } -READ16_MEMBER( buddha_device::speed_r ) +uint16_t buddha_device::speed_r(offs_t offset, uint16_t mem_mask) { uint16_t data = 0xffff; @@ -191,12 +191,12 @@ READ16_MEMBER( buddha_device::speed_r ) return data; } -WRITE16_MEMBER( buddha_device::speed_w ) +void buddha_device::speed_w(offs_t offset, uint16_t data, uint16_t mem_mask) { LOG("speed_w %04x [mask = %04x]\n", data, mem_mask); } -WRITE_LINE_MEMBER( buddha_device::ide_0_interrupt_w ) +void buddha_device::ide_0_interrupt_w(int state) { LOG("ide_0_interrupt_w (%d)\n", state); @@ -206,7 +206,7 @@ WRITE_LINE_MEMBER( buddha_device::ide_0_interrupt_w ) m_slot->int2_w(state); } -WRITE_LINE_MEMBER( buddha_device::ide_1_interrupt_w ) +void buddha_device::ide_1_interrupt_w(int state) { LOG("ide_1_interrupt_w (%d)\n", state); @@ -216,7 +216,7 @@ WRITE_LINE_MEMBER( buddha_device::ide_1_interrupt_w ) m_slot->int2_w(state); } -READ16_MEMBER( buddha_device::ide_0_interrupt_r ) +uint16_t buddha_device::ide_0_interrupt_r(offs_t offset, uint16_t mem_mask) { uint16_t data; @@ -227,7 +227,7 @@ READ16_MEMBER( buddha_device::ide_0_interrupt_r ) return data; } -READ16_MEMBER( buddha_device::ide_1_interrupt_r ) +uint16_t buddha_device::ide_1_interrupt_r(offs_t offset, uint16_t mem_mask) { uint16_t data; @@ -238,7 +238,7 @@ READ16_MEMBER( buddha_device::ide_1_interrupt_r ) return data; } -WRITE16_MEMBER( buddha_device::ide_interrupt_enable_w ) +void buddha_device::ide_interrupt_enable_w(offs_t offset, uint16_t data, uint16_t mem_mask) { LOG("ide_interrupt_enable_w %04x [mask = %04x]\n", data, mem_mask); @@ -246,84 +246,84 @@ WRITE16_MEMBER( buddha_device::ide_interrupt_enable_w ) m_ide_interrupts_enabled = true; } -READ16_MEMBER( buddha_device::ide_0_cs0_r ) +uint16_t buddha_device::ide_0_cs0_r(offs_t offset, uint16_t mem_mask) { - uint16_t data = m_ata_0->read_cs0((offset >> 1) & 0x07, (mem_mask << 8) | (mem_mask >> 8)); - data = (data << 8) | (data >> 8); + uint16_t data = m_ata_0->cs0_r((offset >> 1) & 0x07, swapendian_int16(mem_mask)); + data = swapendian_int16(data); LOG("ide_0_cs0_r(%04x) %04x [mask = %04x]\n", offset, data, mem_mask); return data; } -WRITE16_MEMBER( buddha_device::ide_0_cs0_w ) +void buddha_device::ide_0_cs0_w(offs_t offset, uint16_t data, uint16_t mem_mask) { LOG("ide_0_cs0_w(%04x) %04x [mask = %04x]\n", offset, data, mem_mask); - mem_mask = (mem_mask << 8) | (mem_mask >> 8); - data = (data << 8) | (data >> 8); + mem_mask = swapendian_int16(mem_mask); + data = swapendian_int16(data); - m_ata_0->write_cs0((offset >> 1) & 0x07, data, mem_mask); + m_ata_0->cs0_w((offset >> 1) & 0x07, data, mem_mask); } -READ16_MEMBER( buddha_device::ide_0_cs1_r ) +uint16_t buddha_device::ide_0_cs1_r(offs_t offset, uint16_t mem_mask) { - uint16_t data = m_ata_0->read_cs1((offset >> 1) & 0x07, (mem_mask << 8) | (mem_mask >> 8)); - data = (data << 8) | (data >> 8); + uint16_t data = m_ata_0->cs1_r((offset >> 1) & 0x07, swapendian_int16(mem_mask)); + data = swapendian_int16(data); LOG("ide_0_cs1_r(%04x) %04x [mask = %04x]\n", offset, data, mem_mask); return data; } -WRITE16_MEMBER( buddha_device::ide_0_cs1_w ) +void buddha_device::ide_0_cs1_w(offs_t offset, uint16_t data, uint16_t mem_mask) { LOG("ide_0_cs1_w(%04x) %04x [mask = %04x]\n", offset, data, mem_mask); - mem_mask = (mem_mask << 8) | (mem_mask >> 8); - data = (data << 8) | (data >> 8); + mem_mask = swapendian_int16(mem_mask); + data = swapendian_int16(data); - m_ata_0->write_cs1((offset >> 1) & 0x07, data, mem_mask); + m_ata_0->cs1_w((offset >> 1) & 0x07, data, mem_mask); } -READ16_MEMBER( buddha_device::ide_1_cs0_r ) +uint16_t buddha_device::ide_1_cs0_r(offs_t offset, uint16_t mem_mask) { - uint16_t data = m_ata_1->read_cs0((offset >> 1) & 0x07, (mem_mask << 8) | (mem_mask >> 8)); - data = (data << 8) | (data >> 8); + uint16_t data = m_ata_1->cs0_r((offset >> 1) & 0x07, swapendian_int16(mem_mask)); + data = swapendian_int16(data); LOG("ide_1_cs0_r(%04x) %04x [mask = %04x]\n", offset, data, mem_mask); return data; } -WRITE16_MEMBER( buddha_device::ide_1_cs0_w ) +void buddha_device::ide_1_cs0_w(offs_t offset, uint16_t data, uint16_t mem_mask) { LOG("ide_1_cs0_w(%04x) %04x [mask = %04x]\n", offset, data, mem_mask); - mem_mask = (mem_mask << 8) | (mem_mask >> 8); - data = (data << 8) | (data >> 8); + mem_mask = swapendian_int16(mem_mask); + data = swapendian_int16(data); - m_ata_1->write_cs0((offset >> 1) & 0x07, data, mem_mask); + m_ata_1->cs0_w((offset >> 1) & 0x07, data, mem_mask); } -READ16_MEMBER( buddha_device::ide_1_cs1_r ) +uint16_t buddha_device::ide_1_cs1_r(offs_t offset, uint16_t mem_mask) { - uint16_t data = m_ata_1->read_cs1((offset >> 1) & 0x07, (mem_mask << 8) | (mem_mask >> 8)); - data = (data << 8) | (data >> 8); + uint16_t data = m_ata_1->cs1_r((offset >> 1) & 0x07, swapendian_int16(mem_mask)); + data = swapendian_int16(data); LOG("ide_1_cs1_r(%04x) %04x [mask = %04x]\n", offset, data, mem_mask); return data; } -WRITE16_MEMBER( buddha_device::ide_1_cs1_w ) +void buddha_device::ide_1_cs1_w(offs_t offset, uint16_t data, uint16_t mem_mask) { LOG("ide_1_cs1_w(%04x) %04x [mask = %04x]\n", offset, data, mem_mask); - mem_mask = (mem_mask << 8) | (mem_mask >> 8); - data = (data << 8) | (data >> 8); + mem_mask = swapendian_int16(mem_mask); + data = swapendian_int16(data); - m_ata_1->write_cs1((offset >> 1) & 0x07, data, mem_mask); + m_ata_1->cs1_w((offset >> 1) & 0x07, data, mem_mask); } -} } } // namespace bus::amiga::zorro +} // namespace bus::amiga::zorro |