src/mess/drivers/x1.c
| r5649 | r5650 | |
| 536 | 536 | return ret; |
| 537 | 537 | } |
| 538 | 538 | |
| 539 | static UINT8 x1_irq_vector; |
| 540 | //static UINT8 ctc_irq_vector; //always 0x5e? |
| 539 | 541 | static UINT8 key_irq_vector; |
| 540 | 542 | static UINT8 cmt_current_cmd; |
| 541 | 543 | static UINT8 cmt_test; |
| r5649 | r5650 | |
| 1031 | 1033 | { |
| 1032 | 1034 | io_bank_mode = 0; //any read disables the extended mode. |
| 1033 | 1035 | |
| 1034 | | if(offset >= 0x0704 && offset <= 0x0707) { return z80ctc_r(devtag_get_device(space->machine, "ctc"), offset-0x0704); } |
| 1035 | | else if(offset == 0x0e03) { return x1_rom_r(space, 0); } |
| 1036 | //if(offset >= 0x0704 && offset <= 0x0707) { return z80ctc_r(devtag_get_device(space->machine, "ctc"), offset-0x0704); } |
| 1037 | if(offset == 0x0e03) { return x1_rom_r(space, 0); } |
| 1036 | 1038 | else if(offset >= 0x0ff8 && offset <= 0x0fff) { return x1_fdc_r(space, offset-0xff8); } |
| 1037 | 1039 | else if(offset >= 0x1400 && offset <= 0x17ff) { return x1_pcg_r(space, offset-0x1400); } |
| 1038 | 1040 | else if(offset >= 0x1900 && offset <= 0x19ff) { return sub_io_r(space, 0); } |
| r5649 | r5650 | |
| 1056 | 1058 | static WRITE8_HANDLER( x1_io_w ) |
| 1057 | 1059 | { |
| 1058 | 1060 | if(io_bank_mode == 1) { x1_ex_gfxram_w(space, offset, data); } |
| 1059 | | else if(offset >= 0x0704 && offset <= 0x0707) { z80ctc_w(devtag_get_device(space->machine, "ctc"), offset-0x0704,data); } |
| 1061 | // else if(offset >= 0x0704 && offset <= 0x0707) { z80ctc_w(devtag_get_device(space->machine, "ctc"), offset-0x0704,data); } |
| 1060 | 1062 | // else if(offset >= 0x0c00 && offset <= 0x0cff) { x1_rs232c_w(space->machine, 0, data); } |
| 1061 | 1063 | else if(offset >= 0x0e00 && offset <= 0x0e02) { x1_rom_w(space, offset-0xe00,data); } |
| 1062 | 1064 | // else if(offset >= 0x0e80 && offset <= 0x0e82) { x1_kanji_w(space->machine, offset-0xe80,data); } |
| r5649 | r5650 | |
| 1213 | 1215 | |
| 1214 | 1216 | // if(cassette_get_state(devtag_get_device(device->machine,"cass")) & CASSETTE_MOTOR_DISABLED) |
| 1215 | 1217 | // dat &= ~0x02; // is zero if not playing |
| 1216 | | |
| 1218 | |
| 1217 | 1219 | if(cmt_test != 0) |
| 1218 | 1220 | { |
| 1219 | 1221 | dat |= 0x01; |
| r5649 | r5650 | |
| 1663 | 1665 | |
| 1664 | 1666 | static void ctc0_interrupt(const device_config *device, int state) |
| 1665 | 1667 | { |
| 1666 | | //cputag_set_input_line(device->machine, "maincpu", 0, state); |
| 1668 | x1_irq_vector = 0x5e; |
| 1669 | cputag_set_input_line(device->machine, "maincpu", 0, state); |
| 1667 | 1670 | } |
| 1668 | 1671 | |
| 1669 | 1672 | |
| r5649 | r5650 | |
| 1671 | 1674 | { |
| 1672 | 1675 | 0, // timer disables |
| 1673 | 1676 | ctc0_interrupt, // interrupt handler |
| 1674 | | 0, // ZC/TO0 callback |
| 1675 | | 0, // ZC/TO1 callback |
| 1676 | | 0, // ZC/TO2 callback |
| 1677 | z80ctc_trg0_w, // ZC/TO0 callback |
| 1678 | z80ctc_trg1_w, // ZC/TO1 callback |
| 1679 | z80ctc_trg2_w, // ZC/TO2 callback |
| 1677 | 1680 | }; |
| 1678 | 1681 | |
| 1679 | 1682 | /************************************* |
| r5649 | r5650 | |
| 1702 | 1705 | |
| 1703 | 1706 | static INTERRUPT_GEN( x1_vbl ) |
| 1704 | 1707 | { |
| 1705 | | // pcg_reset = 1; |
| 1708 | //... |
| 1706 | 1709 | } |
| 1707 | 1710 | |
| 1708 | 1711 | static IRQ_CALLBACK(x1_irq_callback) |
| 1709 | 1712 | { |
| 1710 | 1713 | cpu_set_input_line(device, 0, CLEAR_LINE); |
| 1711 | | return key_irq_vector; |
| 1714 | return x1_irq_vector; |
| 1712 | 1715 | } |
| 1713 | 1716 | |
| 1714 | 1717 | static TIMER_CALLBACK(keyboard_callback) |
| r5649 | r5650 | |
| 1726 | 1729 | { |
| 1727 | 1730 | // generate keyboard IRQ |
| 1728 | 1731 | sub_io_w(space,0,0xe6); |
| 1732 | x1_irq_vector = key_irq_vector; |
| 1729 | 1733 | cputag_set_input_line(machine,"maincpu",0,ASSERT_LINE); |
| 1730 | 1734 | old_key1 = key1; |
| 1731 | 1735 | old_key2 = key2; |
| r5649 | r5650 | |
| 1854 | 1858 | MDRV_CPU_MODIFY("maincpu") |
| 1855 | 1859 | MDRV_CPU_IO_MAP(x1turbo_io) |
| 1856 | 1860 | |
| 1857 | | MDRV_SOUND_ADD("ym", YM2151, XTAL_4MHz/4) //unknown clock / divider |
| 1861 | MDRV_SOUND_ADD("ym", YM2151, XTAL_4MHz) //unknown clock / divider |
| 1858 | 1862 | // MDRV_SOUND_CONFIG(ay8910_config) |
| 1859 | 1863 | MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50) |
| 1860 | 1864 | MACHINE_DRIVER_END |
| r5649 | r5650 | |
| 1871 | 1875 | TRACKS([40]) |
| 1872 | 1876 | SECTORS([16]) |
| 1873 | 1877 | SECTOR_LENGTH([256]) |
| 1874 | | FIRST_SECTOR_ID([1])) |
| 1878 | FIRST_SECTOR_ID([1])) |
| 1875 | 1879 | FLOPPY_OPTIONS_END |
| 1876 | 1880 | |
| 1877 | 1881 | |