diff options
Diffstat (limited to 'src/devices/machine/z80dma.cpp')
-rw-r--r-- | src/devices/machine/z80dma.cpp | 80 |
1 files changed, 40 insertions, 40 deletions
diff --git a/src/devices/machine/z80dma.cpp b/src/devices/machine/z80dma.cpp index 9513774eef2..c1f3162bebd 100644 --- a/src/devices/machine/z80dma.cpp +++ b/src/devices/machine/z80dma.cpp @@ -146,7 +146,7 @@ const device_type Z80DMA = &device_creator<z80dma_device>; // z80dma_device - constructor //------------------------------------------------- -z80dma_device::z80dma_device(const machine_config &mconfig, std::string tag, device_t *owner, UINT32 clock) +z80dma_device::z80dma_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : device_t(mconfig, Z80DMA, "Z80 DMA", tag, owner, clock, "z80dma", __FILE__), device_z80daisy_interface(mconfig, *this), m_out_busreq_cb(*this), @@ -251,7 +251,7 @@ int z80dma_device::z80daisy_irq_state() state = Z80_DAISY_IEO; } - if (LOG) logerror("Z80DMA '%s' Interrupt State: %u\n", tag().c_str(), state); + if (LOG) logerror("Z80DMA '%s' Interrupt State: %u\n", tag(), state); return state; } @@ -266,7 +266,7 @@ int z80dma_device::z80daisy_irq_ack() { if (m_ip) { - if (LOG) logerror("Z80DMA '%s' Interrupt Acknowledge\n", tag().c_str()); + if (LOG) logerror("Z80DMA '%s' Interrupt Acknowledge\n", tag()); // clear interrupt pending flag m_ip = 0; @@ -293,7 +293,7 @@ void z80dma_device::z80daisy_irq_reti() { if (m_ius) { - if (LOG) logerror("Z80DMA '%s' Return from Interrupt\n", tag().c_str()); + if (LOG) logerror("Z80DMA '%s' Return from Interrupt\n", tag()); // clear interrupt under service flag m_ius = 0; @@ -354,7 +354,7 @@ void z80dma_device::trigger_interrupt(int level) m_status &= ~0x08; - if (LOG) logerror("Z80DMA '%s' Interrupt Pending\n", tag().c_str()); + if (LOG) logerror("Z80DMA '%s' Interrupt Pending\n", tag()); interrupt_check(); } @@ -381,7 +381,7 @@ void z80dma_device::do_read() else m_latch = m_in_iorq_cb(m_addressA); - if (DMA_LOG) logerror("Z80DMA '%s' A src: %04x %s -> data: %02x\n", tag().c_str(), m_addressA, PORTA_MEMORY ? "mem" : "i/o", m_latch); + if (DMA_LOG) logerror("Z80DMA '%s' A src: %04x %s -> data: %02x\n", tag(), m_addressA, PORTA_MEMORY ? "mem" : "i/o", m_latch); } else { @@ -390,7 +390,7 @@ void z80dma_device::do_read() else m_latch = m_in_iorq_cb(m_addressB); - if (DMA_LOG) logerror("Z80DMA '%s' B src: %04x %s -> data: %02x\n", tag().c_str(), m_addressB, PORTB_MEMORY ? "mem" : "i/o", m_latch); + if (DMA_LOG) logerror("Z80DMA '%s' B src: %04x %s -> data: %02x\n", tag(), m_addressB, PORTB_MEMORY ? "mem" : "i/o", m_latch); } break; default: @@ -413,7 +413,7 @@ void z80dma_device::do_transfer_write() else m_out_iorq_cb((offs_t)m_addressB, m_latch); - if (DMA_LOG) logerror("Z80DMA '%s' B dst: %04x %s\n", tag().c_str(), m_addressB, PORTB_MEMORY ? "mem" : "i/o"); + if (DMA_LOG) logerror("Z80DMA '%s' B dst: %04x %s\n", tag(), m_addressB, PORTB_MEMORY ? "mem" : "i/o"); } else { @@ -422,7 +422,7 @@ void z80dma_device::do_transfer_write() else m_out_iorq_cb((offs_t)m_addressA, m_latch); - if (DMA_LOG) logerror("Z80DMA '%s' A dst: %04x %s\n", tag().c_str(), m_addressA, PORTA_MEMORY ? "mem" : "i/o"); + if (DMA_LOG) logerror("Z80DMA '%s' A dst: %04x %s\n", tag(), m_addressA, PORTA_MEMORY ? "mem" : "i/o"); } } @@ -524,7 +524,7 @@ void z80dma_device::timerproc() if(TRANSFER_MODE == TM_TRANSFER) m_status |= 0x10; // no match found update_status(); - if (LOG) logerror("Z80DMA '%s' End of Block\n", tag().c_str()); + if (LOG) logerror("Z80DMA '%s' End of Block\n", tag()); if (INT_ON_END_OF_BLOCK) { @@ -533,7 +533,7 @@ void z80dma_device::timerproc() if (AUTO_RESTART) { - if (LOG) logerror("Z80DMA '%s' Auto Restart\n", tag().c_str()); + if (LOG) logerror("Z80DMA '%s' Auto Restart\n", tag()); m_dma_enabled = 1; m_addressA = PORTA_ADDRESS; @@ -606,7 +606,7 @@ UINT8 z80dma_device::read() if(m_read_cur_follow >= m_read_num_follow) m_read_cur_follow = 0; - if (LOG) logerror("Z80DMA '%s' Read %02x\n", tag().c_str(), res); + if (LOG) logerror("Z80DMA '%s' Read %02x\n", tag(), res); return res; } @@ -624,21 +624,21 @@ void z80dma_device::write(UINT8 data) if ((data & 0x87) == 0) // WR2 { - if (LOG) logerror("Z80DMA '%s' WR2 %02x\n", tag().c_str(), data); + if (LOG) logerror("Z80DMA '%s' WR2 %02x\n", tag(), data); WR2 = data; if (data & 0x40) m_regs_follow[m_num_follow++] = GET_REGNUM(PORTB_TIMING); } else if ((data & 0x87) == 0x04) // WR1 { - if (LOG) logerror("Z80DMA '%s' WR1 %02x\n", tag().c_str(), data); + if (LOG) logerror("Z80DMA '%s' WR1 %02x\n", tag(), data); WR1 = data; if (data & 0x40) m_regs_follow[m_num_follow++] = GET_REGNUM(PORTA_TIMING); } else if ((data & 0x80) == 0) // WR0 { - if (LOG) logerror("Z80DMA '%s' WR0 %02x\n", tag().c_str(), data); + if (LOG) logerror("Z80DMA '%s' WR0 %02x\n", tag(), data); WR0 = data; if (data & 0x08) m_regs_follow[m_num_follow++] = GET_REGNUM(PORTA_ADDRESS_L); @@ -651,7 +651,7 @@ void z80dma_device::write(UINT8 data) } else if ((data & 0x83) == 0x80) // WR3 { - if (LOG) logerror("Z80DMA '%s' WR3 %02x\n", tag().c_str(), data); + if (LOG) logerror("Z80DMA '%s' WR3 %02x\n", tag(), data); WR3 = data; if (data & 0x08) m_regs_follow[m_num_follow++] = GET_REGNUM(MASK_BYTE); @@ -660,7 +660,7 @@ void z80dma_device::write(UINT8 data) } else if ((data & 0x83) == 0x81) // WR4 { - if (LOG) logerror("Z80DMA '%s' WR4 %02x\n", tag().c_str(), data); + if (LOG) logerror("Z80DMA '%s' WR4 %02x\n", tag(), data); WR4 = data; if (data & 0x04) m_regs_follow[m_num_follow++] = GET_REGNUM(PORTB_ADDRESS_L); @@ -671,12 +671,12 @@ void z80dma_device::write(UINT8 data) } else if ((data & 0xC7) == 0x82) // WR5 { - if (LOG) logerror("Z80DMA '%s' WR5 %02x\n", tag().c_str(), data); + if (LOG) logerror("Z80DMA '%s' WR5 %02x\n", tag(), data); WR5 = data; } else if ((data & 0x83) == 0x83) // WR6 { - if (LOG) logerror("Z80DMA '%s' WR6 %02x\n", tag().c_str(), data); + if (LOG) logerror("Z80DMA '%s' WR6 %02x\n", tag(), data); m_dma_enabled = 0; WR6 = data; @@ -684,9 +684,9 @@ void z80dma_device::write(UINT8 data) switch (data) { case COMMAND_ENABLE_AFTER_RETI: - fatalerror("Z80DMA '%s' Unimplemented WR6 command %02x\n", tag().c_str(), data); + fatalerror("Z80DMA '%s' Unimplemented WR6 command %02x\n", tag(), data); case COMMAND_READ_STATUS_BYTE: - if (LOG) logerror("Z80DMA '%s' CMD Read status Byte\n", tag().c_str()); + if (LOG) logerror("Z80DMA '%s' CMD Read status Byte\n", tag()); READ_MASK = 1; m_read_regs_follow[0] = m_status; break; @@ -698,7 +698,7 @@ void z80dma_device::write(UINT8 data) m_status |= 0x08; break; case COMMAND_INITIATE_READ_SEQUENCE: - if (LOG) logerror("Z80DMA '%s' Initiate Read Sequence\n", tag().c_str()); + if (LOG) logerror("Z80DMA '%s' Initiate Read Sequence\n", tag()); m_read_cur_follow = m_read_num_follow = 0; if(READ_MASK & 0x01) { m_read_regs_follow[m_read_num_follow++] = m_status; } if(READ_MASK & 0x02) { m_read_regs_follow[m_read_num_follow++] = m_count & 0xff; } //byte counter (low) @@ -709,7 +709,7 @@ void z80dma_device::write(UINT8 data) if(READ_MASK & 0x40) { m_read_regs_follow[m_read_num_follow++] = m_addressB >> 8; } //port B address (high) break; case COMMAND_RESET: - if (LOG) logerror("Z80DMA '%s' Reset\n", tag().c_str()); + if (LOG) logerror("Z80DMA '%s' Reset\n", tag()); m_dma_enabled = 0; m_force_ready = 0; m_ip = 0; @@ -734,71 +734,71 @@ void z80dma_device::write(UINT8 data) m_count = BLOCKLEN; m_status |= 0x30; - if (LOG) logerror("Z80DMA '%s' Load A: %x B: %x N: %x\n", tag().c_str(), m_addressA, m_addressB, m_count); + if (LOG) logerror("Z80DMA '%s' Load A: %x B: %x N: %x\n", tag(), m_addressA, m_addressB, m_count); break; case COMMAND_DISABLE_DMA: - if (LOG) logerror("Z80DMA '%s' Disable DMA\n", tag().c_str()); + if (LOG) logerror("Z80DMA '%s' Disable DMA\n", tag()); m_dma_enabled = 0; break; case COMMAND_ENABLE_DMA: - if (LOG) logerror("Z80DMA '%s' Enable DMA\n", tag().c_str()); + if (LOG) logerror("Z80DMA '%s' Enable DMA\n", tag()); m_dma_enabled = 1; update_status(); break; case COMMAND_READ_MASK_FOLLOWS: - if (LOG) logerror("Z80DMA '%s' Set Read Mask\n", tag().c_str()); + if (LOG) logerror("Z80DMA '%s' Set Read Mask\n", tag()); m_regs_follow[m_num_follow++] = GET_REGNUM(READ_MASK); break; case COMMAND_CONTINUE: - if (LOG) logerror("Z80DMA '%s' Continue\n", tag().c_str()); + if (LOG) logerror("Z80DMA '%s' Continue\n", tag()); m_count = BLOCKLEN; m_dma_enabled = 1; //"match not found" & "end of block" status flags zeroed here m_status |= 0x30; break; case COMMAND_RESET_PORT_A_TIMING: - if (LOG) logerror("Z80DMA '%s' Reset Port A Timing\n", tag().c_str()); + if (LOG) logerror("Z80DMA '%s' Reset Port A Timing\n", tag()); PORTA_TIMING = 0; break; case COMMAND_RESET_PORT_B_TIMING: - if (LOG) logerror("Z80DMA '%s' Reset Port B Timing\n", tag().c_str()); + if (LOG) logerror("Z80DMA '%s' Reset Port B Timing\n", tag()); PORTB_TIMING = 0; break; case COMMAND_FORCE_READY: - if (LOG) logerror("Z80DMA '%s' Force Ready\n", tag().c_str()); + if (LOG) logerror("Z80DMA '%s' Force Ready\n", tag()); m_force_ready = 1; update_status(); break; case COMMAND_ENABLE_INTERRUPTS: - if (LOG) logerror("Z80DMA '%s' Enable IRQ\n", tag().c_str()); + if (LOG) logerror("Z80DMA '%s' Enable IRQ\n", tag()); WR3 |= 0x20; break; case COMMAND_DISABLE_INTERRUPTS: - if (LOG) logerror("Z80DMA '%s' Disable IRQ\n", tag().c_str()); + if (LOG) logerror("Z80DMA '%s' Disable IRQ\n", tag()); WR3 &= ~0x20; break; case COMMAND_REINITIALIZE_STATUS_BYTE: - if (LOG) logerror("Z80DMA '%s' Reinitialize status byte\n", tag().c_str()); + if (LOG) logerror("Z80DMA '%s' Reinitialize status byte\n", tag()); m_status |= 0x30; m_ip = 0; break; case 0xFB: case 0xFF: // TODO: p8k triggers this, it probably crashed. - if (LOG) logerror("Z80DMA '%s' undocumented command triggered 0x%02X!\n", tag().c_str(), data); + if (LOG) logerror("Z80DMA '%s' undocumented command triggered 0x%02X!\n", tag(), data); break; default: - printf("Z80DMA '%s' Unknown WR6 command %02x\n", tag().c_str(), data); + printf("Z80DMA '%s' Unknown WR6 command %02x\n", tag(), data); } } else if(data == 0x8e) //newtype on Sharp X1, unknown purpose - printf("Z80DMA '%s' Unknown base register %02x\n", tag().c_str(), data); + printf("Z80DMA '%s' Unknown base register %02x\n", tag(), data); else - fatalerror("Z80DMA '%s' Unknown base register %02x\n", tag().c_str(), data); + fatalerror("Z80DMA '%s' Unknown base register %02x\n", tag(), data); m_cur_follow = 0; } else { - if (LOG) logerror("Z80DMA '%s' Write %02x\n", tag().c_str(), data); + if (LOG) logerror("Z80DMA '%s' Write %02x\n", tag(), data); int nreg = m_regs_follow[m_cur_follow]; m_regs[nreg] = data; @@ -858,7 +858,7 @@ void z80dma_device::rdy_write_callback(int state) WRITE_LINE_MEMBER(z80dma_device::rdy_w) { - if (LOG) logerror("Z80DMA '%s' RDY: %d Active High: %d\n", tag().c_str(), state, READY_ACTIVE_HIGH); + if (LOG) logerror("Z80DMA '%s' RDY: %d Active High: %d\n", tag(), state, READY_ACTIVE_HIGH); machine().scheduler().synchronize(FUNC(static_rdy_write_callback), state, (void *)this); } |