trunk/src/mess/drivers/pc88va.c
| r19106 | r19107 | |
| 15 | 15 | - What is exactly supposed to be a "bus slot"? |
| 16 | 16 | - fdc "intelligent mode" has 0x7f as irq vector ... 0x7f is ld a,a and it IS NOT correctly |
| 17 | 17 | hooked up by the current z80 core |
| 18 | | - PC-88VA has two bogus opcodes. One is at 0xf0b15, another at 0xf0b31. Making a patch |
| 19 | | for the latter makes the system to jump into a "DIP-Switch" display. |
| 18 | - PC-88VA stock version has two bogus opcodes. One is at 0xf0b15, another at 0xf0b31. |
| 19 | Making a patch for the latter makes the system to jump into a "DIP-Switch" display. |
| 20 | - unemulated upd71071 demand mode. |
| 20 | 21 | |
| 21 | 22 | ********************************************************************************************/ |
| 22 | 23 | |
| r19106 | r19107 | |
| 59 | 60 | public: |
| 60 | 61 | pc88va_state(const machine_config &mconfig, device_type type, const char *tag) |
| 61 | 62 | : driver_device(mconfig, type, tag) , |
| 63 | m_fdc(*this, "upd765"), |
| 62 | 64 | m_dmac(*this, "dmac"), |
| 63 | 65 | m_palram(*this, "palram"){ } |
| 64 | 66 | |
| 67 | required_device<upd765a_device> m_fdc; |
| 65 | 68 | required_device<upd71071_device> m_dmac; |
| 66 | 69 | required_shared_ptr<UINT16> m_palram; |
| 67 | 70 | UINT16 m_bank_reg; |
| r19106 | r19107 | |
| 132 | 135 | DECLARE_WRITE_LINE_MEMBER(pc88va_pic_irq); |
| 133 | 136 | DECLARE_READ8_MEMBER(get_slave_ack); |
| 134 | 137 | DECLARE_WRITE_LINE_MEMBER(pc88va_pit_out0_changed); |
| 135 | | DECLARE_WRITE_LINE_MEMBER(pc88va_upd765_interrupt); |
| 138 | // DECLARE_WRITE_LINE_MEMBER(pc88va_upd765_interrupt); |
| 136 | 139 | UINT8 m_fdc_ctrl_2; |
| 137 | 140 | TIMER_CALLBACK_MEMBER(pc88va_fdc_timer); |
| 141 | // UINT16 m_fdc_dma_r(running_machine &machine); |
| 142 | // void m_fdc_dma_w(running_machine &machine, UINT16 data); |
| 138 | 143 | |
| 139 | | void upd765_interrupt(bool state); |
| 144 | void fdc_irq(bool state); |
| 145 | void fdc_drq(bool state); |
| 140 | 146 | }; |
| 141 | 147 | |
| 142 | 148 | |
| r19106 | r19107 | |
| 1024 | 1030 | ---- --xx RV1/RV0: Drive 1/0 mode selection (0) 2D and 2DD mode (1) 2HD mode |
| 1025 | 1031 | */ |
| 1026 | 1032 | case 0x02: // FDC control port 0 |
| 1033 | machine().device<floppy_connector>("upd765:0")->get_device()->set_rpm(data & 0x01 ? 360 : 300); |
| 1034 | machine().device<floppy_connector>("upd765:1")->get_device()->set_rpm(data & 0x02 ? 360 : 300); |
| 1035 | |
| 1036 | machine().device<upd765a_device>("upd765")->set_rate(data & 0x20 ? 500000 : 250000); |
| 1027 | 1037 | break; |
| 1028 | 1038 | /* |
| 1029 | 1039 | ---- x--- PCM: ? |
| r19106 | r19107 | |
| 1039 | 1049 | */ |
| 1040 | 1050 | case 0x06: |
| 1041 | 1051 | //printf("%02x\n",data); |
| 1042 | | m_fdc_ctrl_2 = data; |
| 1043 | | |
| 1044 | 1052 | if(data & 1) |
| 1045 | 1053 | machine().scheduler().timer_set(attotime::from_msec(100), timer_expired_delegate(FUNC(pc88va_state::pc88va_fdc_timer),this)); |
| 1046 | 1054 | |
| 1055 | if((m_fdc_ctrl_2 & 0x10) != (data & 0x10)) |
| 1056 | upd71071_dmarq(m_dmac,1,2); |
| 1057 | |
| 1047 | 1058 | if(data & 0x80) // correct? |
| 1048 | 1059 | machine().device<upd765a_device>("upd765")->reset(); |
| 1049 | 1060 | |
| 1061 | m_fdc_ctrl_2 = data; |
| 1062 | |
| 1050 | 1063 | break; // FDC control port 2 |
| 1051 | 1064 | } |
| 1052 | 1065 | } |
| r19106 | r19107 | |
| 1584 | 1597 | |
| 1585 | 1598 | m_t3_mouse_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(pc88va_state::t3_mouse_callback),this)); |
| 1586 | 1599 | m_t3_mouse_timer->adjust(attotime::never); |
| 1587 | | machine().device<upd765a_device>("upd765")->setup_intrq_cb(upd765a_device::line_cb(FUNC(pc88va_state::upd765_interrupt), this)); |
| 1600 | m_fdc->setup_drq_cb(upd765a_device::line_cb(FUNC(pc88va_state::fdc_drq), this)); |
| 1601 | m_fdc->setup_intrq_cb(upd765a_device::line_cb(FUNC(pc88va_state::fdc_irq), this)); |
| 1588 | 1602 | |
| 1589 | 1603 | machine().device<floppy_connector>("upd765:0")->get_device()->set_rpm(300); |
| 1590 | 1604 | machine().device<floppy_connector>("upd765:1")->get_device()->set_rpm(300); |
| r19106 | r19107 | |
| 1659 | 1673 | }; |
| 1660 | 1674 | |
| 1661 | 1675 | |
| 1662 | | void pc88va_state::upd765_interrupt(bool state) |
| 1676 | void pc88va_state::fdc_drq(bool state) |
| 1663 | 1677 | { |
| 1678 | printf("%02x DRQ\n",state); |
| 1679 | upd71071_dmarq(m_dmac,state,2); |
| 1680 | } |
| 1681 | |
| 1682 | void pc88va_state::fdc_irq(bool state) |
| 1683 | { |
| 1664 | 1684 | if(m_fdc_mode && state) |
| 1665 | 1685 | { |
| 1666 | 1686 | //printf("%d\n",state); |
| r19106 | r19107 | |
| 1687 | 1707 | DEVCB_NULL |
| 1688 | 1708 | }; |
| 1689 | 1709 | |
| 1710 | static UINT16 m_fdc_dma_r(running_machine &machine) |
| 1711 | { |
| 1712 | pc88va_state *state = machine.driver_data<pc88va_state>(); |
| 1713 | printf("R DMA\n"); |
| 1714 | return state->m_fdc->dma_r(); |
| 1715 | } |
| 1716 | |
| 1717 | static void m_fdc_dma_w(running_machine &machine, UINT16 data) |
| 1718 | { |
| 1719 | pc88va_state *state = machine.driver_data<pc88va_state>(); |
| 1720 | printf("W DMA %08x\n",data); |
| 1721 | state->m_fdc->dma_w(data); |
| 1722 | } |
| 1723 | |
| 1724 | |
| 1690 | 1725 | /* ch2 is FDC, ch0/3 are "user". ch1 is unused */ |
| 1691 | 1726 | static const upd71071_intf pc88va_dma_config = |
| 1692 | 1727 | { |
| 1693 | 1728 | "maincpu", |
| 1694 | 1729 | 8000000, |
| 1695 | | { 0, 0, 0, 0 }, |
| 1696 | | { 0, 0, 0, 0 } |
| 1730 | { 0, 0, m_fdc_dma_r, 0 }, |
| 1731 | { 0, 0, m_fdc_dma_w, 0 } |
| 1697 | 1732 | }; |
| 1698 | 1733 | |
| 1699 | 1734 | static const floppy_format_type pc88va_floppy_formats[] = { |