trunk/src/mess/drivers/itt3030.c
| r32285 | r32286 | |
| 275 | 275 | DECLARE_READ8_MEMBER(kbd_fifo_r); |
| 276 | 276 | DECLARE_READ8_MEMBER(kbd_matrix_r); |
| 277 | 277 | DECLARE_WRITE8_MEMBER(kbd_matrix_w); |
| 278 | DECLARE_READ8_MEMBER(fdc_r); |
| 279 | DECLARE_WRITE8_MEMBER(fdc_w); |
| 278 | 280 | DECLARE_READ8_MEMBER(fdc_stat_r); |
| 279 | 281 | DECLARE_WRITE8_MEMBER(fdc_cmd_w); |
| 280 | 282 | DECLARE_FLOPPY_FORMATS(itt3030_floppy_formats); |
| r32285 | r32286 | |
| 418 | 420 | m_fdc_irq = state; |
| 419 | 421 | } |
| 420 | 422 | |
| 423 | #include "debugger.h" |
| 424 | |
| 421 | 425 | WRITE_LINE_MEMBER(itt3030_state::fdcdrq_w) |
| 422 | 426 | { |
| 423 | 427 | m_fdc_drq = state; |
| r32285 | r32286 | |
| 429 | 433 | } |
| 430 | 434 | |
| 431 | 435 | /* |
| 432 | | 7 Data Request (IRQ - inverted 1791-Signal) |
| 436 | 7 Data Request (DRQ - inverted 1791-Signal) |
| 433 | 437 | 6 Interrupt Request (INTRQ - 1791-Signal) |
| 434 | 438 | 5 Head Load (HLD - inverted 1791-Signal) |
| 435 | 439 | 4 Ready 3 (Drive 3 ready) |
| r32285 | r32286 | |
| 445 | 449 | floppy_image_device *floppy2 = m_con2 ? m_con2->get_device() : 0; |
| 446 | 450 | floppy_image_device *floppy3 = m_con3 ? m_con3->get_device() : 0; |
| 447 | 451 | |
| 448 | | res = m_fdc_drq ? 0x00 : 0x80; |
| 449 | | res = m_fdc_irq ? 0x40 : 0x00; |
| 450 | | res = m_fdc_hld ? 0x00 : 0x20; |
| 452 | res = m_fdc_drq ? 0x80 : 0x00; |
| 453 | res |= m_fdc_irq ? 0x40 : 0x00; |
| 454 | res |= m_fdc_hld ? 0x00 : 0x20; |
| 451 | 455 | if (floppy3) res |= floppy3->ready_r() ? 0x10 : 0; |
| 452 | 456 | if (floppy2) res |= floppy2->ready_r() ? 0x08 : 0; |
| 453 | 457 | if (floppy1) res |= floppy1->ready_r() ? 0x04 : 0; |
| r32285 | r32286 | |
| 456 | 460 | return res; |
| 457 | 461 | } |
| 458 | 462 | |
| 463 | /* As far as we can tell, the mess of ttl de-inverts the bus */ |
| 464 | READ8_MEMBER(itt3030_state::fdc_r) |
| 465 | { |
| 466 | return m_fdc->gen_r(offset) ^ 0xff; |
| 467 | } |
| 468 | |
| 469 | WRITE8_MEMBER(itt3030_state::fdc_w) |
| 470 | { |
| 471 | m_fdc->gen_w(offset, data ^ 0xff); |
| 472 | } |
| 473 | |
| 459 | 474 | /* |
| 460 | 475 | 7 SEL1 - Select drive 1 |
| 461 | 476 | 6 SEL2 - Select drive 2 |
| r32285 | r32286 | |
| 527 | 542 | AM_RANGE(0x32, 0x32) AM_WRITE(beep_w) |
| 528 | 543 | AM_RANGE(0x35, 0x35) AM_READ(vsync_r) |
| 529 | 544 | AM_RANGE(0x40, 0x40) AM_READ(kbd_fifo_r) |
| 530 | | AM_RANGE(0x50, 0x53) AM_DEVREADWRITE("fdc", fd1791_t, read, write) |
| 545 | AM_RANGE(0x50, 0x53) AM_READWRITE(fdc_r, fdc_w) |
| 531 | 546 | AM_RANGE(0x54, 0x54) AM_READWRITE(fdc_stat_r, fdc_cmd_w) |
| 532 | 547 | AM_RANGE(0xf6, 0xf6) AM_WRITE(bank_w) |
| 533 | 548 | ADDRESS_MAP_END |