trunk/src/mess/drivers/pc88va.c
| r19097 | r19098 | |
| 17 | 17 | hooked up by the current z80 core |
| 18 | 18 | - PC-88VA has two bogus opcodes. One is at 0xf0b15, another at 0xf0b31. Making a patch |
| 19 | 19 | for the latter makes the system to jump into a "DIP-Switch" display. |
| 20 | | - DMA almost certainly ISN'T i8237. What is it? |
| 21 | 20 | |
| 22 | 21 | ********************************************************************************************/ |
| 23 | 22 | |
| r19097 | r19098 | |
| 33 | 32 | #include "formats/mfi_dsk.h" |
| 34 | 33 | #include "formats/xdf_dsk.h" |
| 35 | 34 | #include "formats/d88_dsk.h" |
| 35 | #include "machine/upd71071.h" |
| 36 | 36 | |
| 37 | 37 | /* Note: for the time being, just disable FDC CPU, it's for PC-8801 compatibility mode anyway ... */ |
| 38 | 38 | #define TEST_SUBFDC 0 |
| r19097 | r19098 | |
| 59 | 59 | public: |
| 60 | 60 | pc88va_state(const machine_config &mconfig, device_type type, const char *tag) |
| 61 | 61 | : driver_device(mconfig, type, tag) , |
| 62 | m_dmac(*this, "dmac"), |
| 62 | 63 | m_palram(*this, "palram"){ } |
| 63 | 64 | |
| 65 | required_device<upd71071_device> m_dmac; |
| 64 | 66 | required_shared_ptr<UINT16> m_palram; |
| 65 | 67 | UINT16 m_bank_reg; |
| 66 | 68 | UINT16 m_screen_ctrl_reg; |
| r19097 | r19098 | |
| 129 | 131 | DECLARE_WRITE8_MEMBER(r232_ctrl_portc_w); |
| 130 | 132 | DECLARE_WRITE_LINE_MEMBER(pc88va_pic_irq); |
| 131 | 133 | DECLARE_READ8_MEMBER(get_slave_ack); |
| 132 | | DECLARE_READ8_MEMBER(pc88va_dma_r); |
| 133 | | DECLARE_WRITE8_MEMBER(pc88va_dma_w); |
| 134 | 134 | DECLARE_WRITE_LINE_MEMBER(pc88va_pit_out0_changed); |
| 135 | 135 | DECLARE_WRITE_LINE_MEMBER(pc88va_upd765_interrupt); |
| 136 | 136 | UINT8 m_fdc_ctrl_2; |
| r19097 | r19098 | |
| 946 | 946 | |
| 947 | 947 | READ8_MEMBER(pc88va_state::key_r) |
| 948 | 948 | { |
| 949 | | // note row C bit 2 does something at POST ... some kind of test mode? |
| 949 | // note row D bit 2 does something at POST ... some kind of test mode? |
| 950 | 950 | static const char *const keynames[] = { "KEY0", "KEY1", "KEY2", "KEY3", |
| 951 | 951 | "KEY4", "KEY5", "KEY6", "KEY7", |
| 952 | 952 | "KEY8", "KEY9", "KEYA", "KEYB", |
| r19097 | r19098 | |
| 1125 | 1125 | } |
| 1126 | 1126 | #endif |
| 1127 | 1127 | |
| 1128 | | /* TODO: identify or emulate this DMAC */ |
| 1129 | | READ8_MEMBER(pc88va_state::pc88va_dma_r) |
| 1130 | | { |
| 1131 | | /* |
| 1132 | | 0: undefined |
| 1133 | | 1: ---x ---- mode |
| 1134 | | ---- xxxx select channel (bit-wise) |
| 1135 | | 2/3: xxxx xxxx count |
| 1136 | | 4/5: xxxx xxxx address |
| 1137 | | 6: ---- xxxx address |
| 1138 | | 8: ???? ???? Device control Register |
| 1139 | | A: ???? ???? Mode control Register |
| 1140 | | B: ???? ???? Status Register (r/o) |
| 1141 | | F: xxxx xxxx Mask Register |
| 1142 | | */ |
| 1143 | | |
| 1144 | | return 0; |
| 1145 | | } |
| 1146 | | |
| 1147 | | WRITE8_MEMBER(pc88va_state::pc88va_dma_w) |
| 1148 | | { |
| 1149 | | switch(offset) |
| 1150 | | { |
| 1151 | | case 0x00: printf("DMA reset %02x\n",data & 1); break; |
| 1152 | | case 0x01: printf("DMA select channel %02x mode channel %02x\n",data & 3,(data & 4) >> 2); break; |
| 1153 | | case 0x02: printf("DMA count 7-0 %02x\n",data); break; |
| 1154 | | case 0x03: printf("DMA count 15-8 %02x\n",data); break; |
| 1155 | | case 0x04: printf("DMA address 7-0 %02x\n",data); break; |
| 1156 | | case 0x05: printf("DMA address 15-8 %02x\n",data); break; |
| 1157 | | case 0x06: printf("DMA address 19-16 %02x\n",data); break; |
| 1158 | | case 0x08: printf("DMA Device control register %02x\n",data); break; |
| 1159 | | case 0x0a: printf("DMA Mode control register %02x\n",data); break; |
| 1160 | | case 0x0f: printf("DMA Mask register %02x\n",data); break; |
| 1161 | | } |
| 1162 | | } |
| 1163 | | |
| 1164 | 1128 | static ADDRESS_MAP_START( pc88va_io_map, AS_IO, 16, pc88va_state ) |
| 1165 | 1129 | AM_RANGE(0x0000, 0x000f) AM_READ8(key_r,0xffff) // Keyboard ROW reading |
| 1166 | 1130 | // AM_RANGE(0x0010, 0x0010) Printer / Calendar Clock Interface |
| r19097 | r19098 | |
| 1211 | 1175 | AM_RANGE(0x0156, 0x0157) AM_READ8(rom_bank_r,0x00ff) // ROM bank status |
| 1212 | 1176 | // AM_RANGE(0x0158, 0x0159) Interruption Mode Modification |
| 1213 | 1177 | // AM_RANGE(0x015c, 0x015f) NMI mask port (strobe port) |
| 1214 | | AM_RANGE(0x0160, 0x016f) AM_READWRITE8(pc88va_dma_r,pc88va_dma_w,0xffff) // DMA Controller |
| 1178 | AM_RANGE(0x0160, 0x016f) AM_DEVREADWRITE8_LEGACY("dmac", upd71071_r, upd71071_w,0xffff) // DMA Controller |
| 1215 | 1179 | AM_RANGE(0x0184, 0x0187) AM_DEVREADWRITE8_LEGACY("pic8259_slave", pic8259_r, pic8259_w, 0x00ff) |
| 1216 | 1180 | AM_RANGE(0x0188, 0x018b) AM_DEVREADWRITE8_LEGACY("pic8259_master", pic8259_r, pic8259_w, 0x00ff) // ICU, also controls 8214 emulation |
| 1217 | 1181 | // AM_RANGE(0x0190, 0x0191) System Port 5 |
| r19097 | r19098 | |
| 1456 | 1420 | PORT_START("SYSOP_SW") |
| 1457 | 1421 | PORT_DIPNAME( 0x03, 0x01, "System Operational Mode" ) |
| 1458 | 1422 | // PORT_DIPSETTING( 0x00, "Reserved" ) |
| 1459 | | PORT_DIPSETTING( 0x02, "N88 V1 Mode" ) |
| 1460 | 1423 | PORT_DIPSETTING( 0x01, "N88 V2 Mode" ) |
| 1424 | PORT_DIPSETTING( 0x02, "N88 V1 Mode" ) |
| 1461 | 1425 | // PORT_DIPSETTING( 0x03, "???" ) |
| 1462 | 1426 | INPUT_PORTS_END |
| 1463 | 1427 | |
| r19097 | r19098 | |
| 1723 | 1687 | DEVCB_NULL |
| 1724 | 1688 | }; |
| 1725 | 1689 | |
| 1690 | /* ch2 is FDC, ch0/3 are "user". ch1 is unused */ |
| 1691 | static const upd71071_intf pc88va_dma_config = |
| 1692 | { |
| 1693 | "maincpu", |
| 1694 | 8000000, |
| 1695 | { 0, 0, 0, 0 }, |
| 1696 | { 0, 0, 0, 0 } |
| 1697 | }; |
| 1698 | |
| 1726 | 1699 | static const floppy_format_type pc88va_floppy_formats[] = { |
| 1727 | 1700 | FLOPPY_XDF_FORMAT, |
| 1728 | 1701 | FLOPPY_MFI_FORMAT, |
| r19097 | r19098 | |
| 1767 | 1740 | MCFG_PIC8259_ADD( "pic8259_master", pc88va_pic8259_master_config ) |
| 1768 | 1741 | MCFG_PIC8259_ADD( "pic8259_slave", pc88va_pic8259_slave_config ) |
| 1769 | 1742 | |
| 1743 | MCFG_UPD71071_ADD("dmac",pc88va_dma_config) |
| 1744 | |
| 1770 | 1745 | MCFG_UPD765A_ADD("upd765", false, true) |
| 1771 | 1746 | MCFG_FLOPPY_DRIVE_ADD("upd765:0", pc88va_floppies, "525hd", 0, pc88va_floppy_formats) |
| 1772 | 1747 | MCFG_FLOPPY_DRIVE_ADD("upd765:1", pc88va_floppies, "525hd", 0, pc88va_floppy_formats) |