Previous 199869 Revisions Next

r32286 Monday 22nd September, 2014 at 15:36:56 UTC by O. Galibert
itt3030: Fix the floppy (nw)
[src/mess/drivers]itt3030.c

trunk/src/mess/drivers/itt3030.c
r32285r32286
275275   DECLARE_READ8_MEMBER(kbd_fifo_r);
276276   DECLARE_READ8_MEMBER(kbd_matrix_r);
277277   DECLARE_WRITE8_MEMBER(kbd_matrix_w);
278   DECLARE_READ8_MEMBER(fdc_r);
279   DECLARE_WRITE8_MEMBER(fdc_w);
278280   DECLARE_READ8_MEMBER(fdc_stat_r);
279281   DECLARE_WRITE8_MEMBER(fdc_cmd_w);
280282   DECLARE_FLOPPY_FORMATS(itt3030_floppy_formats);
r32285r32286
418420   m_fdc_irq = state;
419421}
420422
423#include "debugger.h"
424
421425WRITE_LINE_MEMBER(itt3030_state::fdcdrq_w)
422426{
423427   m_fdc_drq = state;
r32285r32286
429433}
430434
431435/*
432   7 Data Request (IRQ - inverted 1791-Signal)
436   7 Data Request (DRQ - inverted 1791-Signal)
433437   6 Interrupt Request (INTRQ - 1791-Signal)
434438   5 Head Load (HLD - inverted 1791-Signal)
435439   4 Ready 3 (Drive 3 ready)
r32285r32286
445449   floppy_image_device *floppy2 = m_con2 ? m_con2->get_device() : 0;
446450   floppy_image_device *floppy3 = m_con3 ? m_con3->get_device() : 0;
447451
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;
451455   if (floppy3) res |= floppy3->ready_r() ? 0x10 : 0;
452456   if (floppy2) res |= floppy2->ready_r() ? 0x08 : 0;
453457   if (floppy1) res |= floppy1->ready_r() ? 0x04 : 0;
r32285r32286
456460   return res;
457461}
458462
463/* As far as we can tell, the mess of ttl de-inverts the bus */
464READ8_MEMBER(itt3030_state::fdc_r)
465{
466   return m_fdc->gen_r(offset) ^ 0xff;
467}
468
469WRITE8_MEMBER(itt3030_state::fdc_w)
470{
471   m_fdc->gen_w(offset, data ^ 0xff);
472}
473
459474/*
460475   7 SEL1 - Select drive 1
461476   6 SEL2 - Select drive 2
r32285r32286
527542   AM_RANGE(0x32, 0x32) AM_WRITE(beep_w)
528543   AM_RANGE(0x35, 0x35) AM_READ(vsync_r)
529544   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)
531546   AM_RANGE(0x54, 0x54) AM_READWRITE(fdc_stat_r, fdc_cmd_w)
532547   AM_RANGE(0xf6, 0xf6) AM_WRITE(bank_w)
533548ADDRESS_MAP_END

Previous 199869 Revisions Next


© 1997-2024 The MAME Team