src/mess/drivers/x1.c
| r5651 | r5652 | |
| 139 | 139 | #include "driver.h" |
| 140 | 140 | #include "cpu/z80/z80.h" |
| 141 | 141 | #include "machine/z80ctc.h" |
| 142 | #include "machine/z80sio.h" |
| 142 | 143 | #include "machine/8255ppi.h" |
| 143 | 144 | #include "sound/ay8910.h" |
| 144 | 145 | #include "video/mc6845.h" |
| r5651 | r5652 | |
| 1040 | 1041 | else if(offset >= 0x1900 && offset <= 0x19ff) { return sub_io_r(space, 0); } |
| 1041 | 1042 | else if(offset >= 0x1a00 && offset <= 0x1aff) { return ppi8255_r(devtag_get_device(space->machine, "ppi8255_0"), (offset-0x1a00) & 3); } |
| 1042 | 1043 | else if(offset >= 0x1b00 && offset <= 0x1bff) { return ay8910_r(devtag_get_device(space->machine, "ay"), 0); } |
| 1043 | | // else if(offset >= 0x1f90 && offset <= 0x1f93) { return x1_sio_r(space,(offset-0x1f90) & 3); } |
| 1044 | | else if(offset >= 0x1fa0 && offset <= 0x1fa3) { return z80ctc_r(devtag_get_device(space->machine, "ctc"), offset-0x1fa3); } |
| 1044 | else if(offset >= 0x1f90 && offset <= 0x1f91) { return z80sio_c_r(devtag_get_device(space->machine, "sio"), (offset-0x1f90) & 1); } |
| 1045 | else if(offset >= 0x1f92 && offset <= 0x1f93) { return z80sio_d_r(devtag_get_device(space->machine, "sio"), (offset-0x1f92) & 1); } |
| 1046 | else if(offset >= 0x1fa0 && offset <= 0x1fa3) { return z80ctc_r(devtag_get_device(space->machine, "ctc"), offset-0x1fa0); } |
| 1045 | 1047 | else if(offset >= 0x1fa8 && offset <= 0x1fab) { return z80ctc_r(devtag_get_device(space->machine, "ctc"), offset-0x1fa8); } |
| 1046 | 1048 | // else if(offset >= 0x1fd0 && offset <= 0x1fdf) { return x1_scrn_r(space,offset-0x1fd0); } |
| 1047 | 1049 | else if(offset == 0x1fe0) { return x1_blackclip_r(space,0); } |
| r5651 | r5652 | |
| 1076 | 1078 | else if(offset >= 0x1d00 && offset <= 0x1dff) { rom_bank_1_w(space,0,data); } |
| 1077 | 1079 | else if(offset >= 0x1e00 && offset <= 0x1eff) { rom_bank_0_w(space,0,data); } |
| 1078 | 1080 | else if(offset >= 0x1f80 && offset <= 0x1f8f) { x1_dma_w(space,offset-0x1f80,data); } |
| 1079 | | // else if(offset >= 0x1f90 && offset <= 0x1f93) { x1_sio_w(space->machine,(offset-0x1f90) & 3),data; } |
| 1080 | | else if(offset >= 0x1fa0 && offset <= 0x1fa3) { z80ctc_w(devtag_get_device(space->machine, "ctc"), offset-0x1fa3,data); } |
| 1081 | else if(offset >= 0x1f90 && offset <= 0x1f91) { z80sio_c_w(devtag_get_device(space->machine, "sio"), (offset-0x1f90) & 1,data); } |
| 1082 | else if(offset >= 0x1f92 && offset <= 0x1f93) { z80sio_d_w(devtag_get_device(space->machine, "sio"), (offset-0x1f92) & 1,data); } |
| 1083 | else if(offset >= 0x1fa0 && offset <= 0x1fa3) { z80ctc_w(devtag_get_device(space->machine, "ctc"), offset-0x1fa0,data); } |
| 1081 | 1084 | else if(offset >= 0x1fa8 && offset <= 0x1fab) { z80ctc_w(devtag_get_device(space->machine, "ctc"), offset-0x1fa8,data); } |
| 1082 | 1085 | else if(offset == 0x1fb0) { x1turbo_pal_w(space,0,data); } |
| 1083 | 1086 | else if(offset >= 0x1fb9 && offset <= 0x1fbf) { x1turbo_txpal_w(space,offset-0x1fb9,data); } |
| r5651 | r5652 | |
| 1106 | 1109 | else if(offset >= 0x1900 && offset <= 0x19ff) { return sub_io_r(space, 0); } |
| 1107 | 1110 | else if(offset >= 0x1a00 && offset <= 0x1aff) { return ppi8255_r(devtag_get_device(space->machine, "ppi8255_0"), (offset-0x1a00) & 3); } |
| 1108 | 1111 | else if(offset >= 0x1b00 && offset <= 0x1bff) { return ay8910_r(devtag_get_device(space->machine, "ay"), 0); } |
| 1109 | | // else if(offset >= 0x1f90 && offset <= 0x1f93) { return x1_sio_r(space,(offset-0x1f90) & 3); } |
| 1110 | | else if(offset >= 0x1fa0 && offset <= 0x1fa3) { return z80ctc_r(devtag_get_device(space->machine, "ctc"), offset-0x1fa3); } |
| 1112 | else if(offset >= 0x1f90 && offset <= 0x1f91) { return z80sio_c_r(devtag_get_device(space->machine, "sio"), (offset-0x1f90) & 1); } |
| 1113 | else if(offset >= 0x1f92 && offset <= 0x1f93) { return z80sio_d_r(devtag_get_device(space->machine, "sio"), (offset-0x1f92) & 1); } |
| 1114 | else if(offset >= 0x1fa0 && offset <= 0x1fa3) { return z80ctc_r(devtag_get_device(space->machine, "ctc"), offset-0x1fa0); } |
| 1111 | 1115 | else if(offset >= 0x1fa8 && offset <= 0x1fab) { return z80ctc_r(devtag_get_device(space->machine, "ctc"), offset-0x1fa8); } |
| 1112 | 1116 | // else if(offset >= 0x1fd0 && offset <= 0x1fdf) { return x1_scrn_r(space,offset-0x1fd0); } |
| 1113 | 1117 | else if(offset == 0x1fe0) { return x1_blackclip_r(space,0); } |
| r5651 | r5652 | |
| 1143 | 1147 | else if(offset >= 0x1d00 && offset <= 0x1dff) { rom_bank_1_w(space,0,data); } |
| 1144 | 1148 | else if(offset >= 0x1e00 && offset <= 0x1eff) { rom_bank_0_w(space,0,data); } |
| 1145 | 1149 | else if(offset >= 0x1f80 && offset <= 0x1f8f) { x1_dma_w(space,offset-0x1f80,data); } |
| 1146 | | // else if(offset >= 0x1f90 && offset <= 0x1f93) { x1_sio_w(space->machine,(offset-0x1f90) & 3),data; } |
| 1147 | | else if(offset >= 0x1fa0 && offset <= 0x1fa3) { z80ctc_w(devtag_get_device(space->machine, "ctc"), offset-0x1fa3,data); } |
| 1150 | else if(offset >= 0x1f90 && offset <= 0x1f91) { z80sio_c_w(devtag_get_device(space->machine, "sio"), (offset-0x1f90) & 1,data); } |
| 1151 | else if(offset >= 0x1f92 && offset <= 0x1f93) { z80sio_d_w(devtag_get_device(space->machine, "sio"), (offset-0x1f92) & 1,data); } |
| 1152 | else if(offset >= 0x1fa0 && offset <= 0x1fa3) { z80ctc_w(devtag_get_device(space->machine, "ctc"), offset-0x1fa0,data); } |
| 1148 | 1153 | else if(offset >= 0x1fa8 && offset <= 0x1fab) { z80ctc_w(devtag_get_device(space->machine, "ctc"), offset-0x1fa8,data); } |
| 1149 | 1154 | else if(offset == 0x1fb0) { x1turbo_pal_w(space,0,data); } |
| 1150 | 1155 | else if(offset >= 0x1fb9 && offset <= 0x1fbf) { x1turbo_txpal_w(space,offset-0x1fb9,data); } |
| r5651 | r5652 | |
| 1665 | 1670 | |
| 1666 | 1671 | static void ctc0_interrupt(const device_config *device, int state) |
| 1667 | 1672 | { |
| 1668 | | x1_irq_vector = 0x5e; |
| 1669 | | cputag_set_input_line(device->machine, "maincpu", 0, state); |
| 1673 | //x1_irq_vector = 0x5e; |
| 1674 | //cputag_set_input_line(device->machine, "maincpu", 0, state); |
| 1670 | 1675 | } |
| 1671 | 1676 | |
| 1672 | 1677 | |
| r5651 | r5652 | |
| 1679 | 1684 | z80ctc_trg2_w, // ZC/TO2 callback |
| 1680 | 1685 | }; |
| 1681 | 1686 | |
| 1687 | static const z80sio_interface sio_intf = |
| 1688 | { |
| 1689 | 0, /* interrupt handler */ |
| 1690 | 0, /* DTR changed handler */ |
| 1691 | 0, /* RTS changed handler */ |
| 1692 | 0, /* BREAK changed handler */ |
| 1693 | 0, /* transmit handler */ |
| 1694 | 0 /* receive handler */ |
| 1695 | }; |
| 1696 | |
| 1697 | |
| 1682 | 1698 | /************************************* |
| 1683 | 1699 | * |
| 1684 | 1700 | * Sound HW Config |
| r5651 | r5652 | |
| 1816 | 1832 | MDRV_CPU_VBLANK_INT("screen", x1_vbl) |
| 1817 | 1833 | |
| 1818 | 1834 | MDRV_Z80CTC_ADD( "ctc", XTAL_4MHz , ctc_intf ) |
| 1835 | MDRV_Z80SIO_ADD( "sio", XTAL_4MHz , sio_intf ) |
| 1819 | 1836 | |
| 1837 | MDRV_PPI8255_ADD( "ppi8255_0", ppi8255_intf ) |
| 1838 | |
| 1820 | 1839 | MDRV_MACHINE_RESET(x1) |
| 1821 | 1840 | |
| 1822 | | MDRV_PPI8255_ADD( "ppi8255_0", ppi8255_intf ) |
| 1823 | | |
| 1824 | 1841 | /* video hardware */ |
| 1825 | 1842 | MDRV_SCREEN_ADD("screen", RASTER) |
| 1826 | 1843 | MDRV_SCREEN_REFRESH_RATE(60) |