trunk/src/mame/drivers/pcxt.c
r22866 | r22867 | |
58 | 58 | #include "cpu/i86/i86.h" |
59 | 59 | #include "machine/pit8253.h" |
60 | 60 | #include "machine/i8255.h" |
61 | | #include "machine/8237dma.h" |
| 61 | #include "machine/am9517a.h" |
62 | 62 | #include "machine/pic8259.h" |
63 | | #include "machine/mc146818.h" |
64 | 63 | #include "sound/hc55516.h" |
65 | 64 | #include "sound/speaker.h" |
66 | 65 | #include "video/pc_cga.h" |
r22866 | r22867 | |
95 | 94 | required_device<pit8253_device> m_pit8253; |
96 | 95 | required_device<pic8259_device> m_pic8259_1; |
97 | 96 | required_device<pic8259_device> m_pic8259_2; |
98 | | required_device<i8237_device> m_dma8237_1; |
| 97 | required_device<am9517a_device> m_dma8237_1; |
99 | 98 | |
100 | 99 | DECLARE_READ8_MEMBER(disk_iobank_r); |
101 | 100 | DECLARE_WRITE8_MEMBER(disk_iobank_w); |
102 | 101 | DECLARE_READ8_MEMBER(fdc765_status_r); |
103 | 102 | DECLARE_READ8_MEMBER(fdc765_data_r); |
104 | 103 | DECLARE_WRITE8_MEMBER(fdc765_data_w); |
105 | | DECLARE_WRITE8_MEMBER(drive_selection_w); |
| 104 | DECLARE_WRITE8_MEMBER(fdc_dor_w); |
106 | 105 | DECLARE_READ8_MEMBER(pc_dma_read_byte); |
107 | 106 | DECLARE_WRITE8_MEMBER(pc_dma_write_byte); |
108 | 107 | DECLARE_READ8_MEMBER(dma_page_select_r); |
r22866 | r22867 | |
403 | 402 | READ8_MEMBER(pcxt_state::fdc765_data_r) |
404 | 403 | { |
405 | 404 | m_status = (FDC_READ); |
| 405 | machine().device<pic8259_device>("pic8259_1")->ir6_w(0); |
406 | 406 | return 0xc0; |
407 | 407 | } |
408 | 408 | |
r22866 | r22867 | |
412 | 412 | } |
413 | 413 | |
414 | 414 | |
415 | | WRITE8_MEMBER(pcxt_state::drive_selection_w) |
| 415 | WRITE8_MEMBER(pcxt_state::fdc_dor_w) |
416 | 416 | { |
417 | 417 | /* TODO: properly hook-up upd765 FDC there */ |
418 | 418 | machine().device<pic8259_device>("pic8259_1")->ir6_w(1); |
r22866 | r22867 | |
428 | 428 | m_maincpu->set_input_line(INPUT_LINE_HALT, state ? ASSERT_LINE : CLEAR_LINE); |
429 | 429 | |
430 | 430 | /* Assert HLDA */ |
431 | | m_dma8237_1->i8237_hlda_w( state ); |
| 431 | m_dma8237_1->hack_w( state ); |
432 | 432 | } |
433 | 433 | |
434 | 434 | |
r22866 | r22867 | |
545 | 545 | |
546 | 546 | static ADDRESS_MAP_START( pcxt_io_common, AS_IO, 8, pcxt_state ) |
547 | 547 | ADDRESS_MAP_GLOBAL_MASK(0x3ff) |
548 | | AM_RANGE(0x0000, 0x000f) AM_DEVREADWRITE("dma8237_1", i8237_device, i8237_r, i8237_w ) //8237 DMA Controller |
| 548 | AM_RANGE(0x0000, 0x000f) AM_DEVREADWRITE("dma8237_1", am9517a_device, read, write ) //8237 DMA Controller |
549 | 549 | AM_RANGE(0x0020, 0x002f) AM_DEVREADWRITE("pic8259_1", pic8259_device, read, write ) //8259 Interrupt control |
550 | 550 | AM_RANGE(0x0040, 0x0043) AM_DEVREADWRITE_LEGACY("pit8253", pit8253_r, pit8253_w) //8253 PIT |
551 | 551 | AM_RANGE(0x0060, 0x0063) AM_DEVREADWRITE("ppi8255_0", i8255_device, read, write) //PPI 8255 |
552 | 552 | AM_RANGE(0x0064, 0x0066) AM_DEVREADWRITE("ppi8255_1", i8255_device, read, write) //PPI 8255 |
553 | | AM_RANGE(0x0070, 0x007f) AM_DEVREADWRITE("rtc", mc146818_device, read, write) |
554 | 553 | AM_RANGE(0x0080, 0x0087) AM_READWRITE(dma_page_select_r,dma_page_select_w) |
555 | 554 | AM_RANGE(0x00a0, 0x00af) AM_DEVREADWRITE("pic8259_2", pic8259_device, read, write ) |
556 | 555 | AM_RANGE(0x0278, 0x027f) AM_RAM //printer (parallel) port latch |
557 | 556 | AM_RANGE(0x02f8, 0x02ff) AM_RAM //Modem port |
558 | 557 | AM_RANGE(0x0378, 0x037f) AM_RAM //printer (parallel) port |
559 | 558 | AM_RANGE(0x03bc, 0x03bf) AM_RAM //printer port |
560 | | AM_RANGE(0x03f2, 0x03f2) AM_WRITE(drive_selection_w) |
| 559 | AM_RANGE(0x03f2, 0x03f2) AM_WRITE(fdc_dor_w) |
561 | 560 | AM_RANGE(0x03f4, 0x03f4) AM_READ(fdc765_status_r) //765 Floppy Disk Controller (FDC) Status |
562 | 561 | AM_RANGE(0x03f5, 0x03f5) AM_READWRITE(fdc765_data_r,fdc765_data_w)//FDC Data |
563 | 562 | AM_RANGE(0x03f8, 0x03ff) AM_RAM //rs232c (serial) port |
r22866 | r22867 | |
728 | 727 | |
729 | 728 | MCFG_PIC8259_ADD( "pic8259_2", DEVWRITELINE("pic8259_1", pic8259_device, ir2_w), GND, NULL ) |
730 | 729 | |
731 | | MCFG_MC146818_ADD( "rtc", MC146818_STANDARD ) |
732 | | |
733 | 730 | MCFG_FRAGMENT_ADD( pcvideo_cga ) |
734 | 731 | MCFG_GFXDECODE(pcxt) |
735 | 732 | |