trunk/src/emu/machine/ncr539x.c
| r30683 | r30684 | |
| 57 | 57 | "Command", // 3 |
| 58 | 58 | "Status", // 4 |
| 59 | 59 | "Interrupt Status", // 5 |
| 60 | | "Internal State", |
| 61 | | "Current FIFO/Internal State", |
| 62 | | "Control Register 1", |
| 60 | "Internal State", // 6 |
| 61 | "Current FIFO/Internal State", // 7 |
| 62 | "Control Register 1", // 8 |
| 63 | 63 | "0x9", |
| 64 | 64 | "0xA", |
| 65 | 65 | "Control Register 2", |
| r30683 | r30684 | |
| 143 | 143 | void ncr539x_device::device_reset() |
| 144 | 144 | { |
| 145 | 145 | m_fifo_ptr = 0; |
| 146 | m_fifo_read_ptr = 0; |
| 146 | 147 | m_irq_status = 0; |
| 147 | 148 | m_status = SCSI_PHASE_STATUS; |
| 148 | 149 | m_internal_state = 0; |
| r30683 | r30684 | |
| 318 | 319 | } |
| 319 | 320 | else |
| 320 | 321 | { |
| 321 | | rv = m_fifo[m_fifo_ptr++]; |
| 322 | rv = m_fifo[m_fifo_read_ptr++]; |
| 323 | m_fifo_read_ptr &= (m_fifo_size-1); |
| 322 | 324 | |
| 323 | 325 | fifo_bytes--; |
| 324 | 326 | m_xfer_count--; |
| 325 | 327 | update_fifo_internal_state(fifo_bytes); |
| 326 | 328 | |
| 327 | 329 | #if VERBOSE |
| 328 | | printf("Read %02x from FIFO[%d], FIFO now contains %d bytes (PC=%x, m_buffer_remaining %x)\n", rv, m_fifo_ptr-1, fifo_bytes, space.device().safe_pc(), m_buffer_remaining); |
| 330 | printf("Read %02x from FIFO[%d], FIFO now contains %d bytes (PC=%x, m_buffer_remaining %x)\n", rv, m_fifo_read_ptr-1, fifo_bytes, space.device().safe_pc(), m_buffer_remaining); |
| 329 | 331 | #endif |
| 330 | 332 | |
| 331 | 333 | if (fifo_bytes == 0) |
| r30683 | r30684 | |
| 432 | 434 | WRITE8_MEMBER( ncr539x_device::write ) |
| 433 | 435 | { |
| 434 | 436 | #if VERBOSE |
| 435 | | if (offset != 2) printf("539x: Write %02x @ %s (%02x) (PC=%x)\n", data, wrregs[offset], offset, space.device().safe_pc()); |
| 437 | //if (offset != 2) |
| 438 | printf("539x: Write %02x @ %s (%02x) (PC=%x)\n", data, wrregs[offset], offset, space.device().safe_pc()); |
| 436 | 439 | #endif |
| 437 | 440 | |
| 438 | 441 | switch (offset) |
| r30683 | r30684 | |
| 757 | 760 | printf("539x: Write %02x @ FIFO[%x]\n", data, m_fifo_ptr); |
| 758 | 761 | #endif |
| 759 | 762 | m_fifo[m_fifo_ptr++] = data; |
| 763 | update_fifo_internal_state(m_fifo_ptr); |
| 760 | 764 | |
| 761 | 765 | if (m_selected) |
| 762 | 766 | { |