src/mess/drivers/x1.c
| r10979 | r10980 | |
| 209 | 209 | #include "cpu/z80/z80.h" |
| 210 | 210 | #include "cpu/z80/z80daisy.h" |
| 211 | 211 | #include "machine/z80ctc.h" |
| 212 | | #include "machine/z80sio.h" |
| 212 | //#include "machine/z80sio.h" |
| 213 | #include "machine/z80dart.h" |
| 213 | 214 | #include "machine/i8255a.h" |
| 214 | 215 | #include "machine/z80dma.h" |
| 215 | 216 | #include "sound/ay8910.h" |
| r10979 | r10980 | |
| 225 | 226 | #include "formats/x1_tap.h" |
| 226 | 227 | #include "imagedev/cartslot.h" |
| 227 | 228 | #include "includes/x1.h" |
| 228 | | //#include <ctype.h> |
| 229 | 229 | |
| 230 | 230 | #define MAIN_CLOCK XTAL_16MHz |
| 231 | 231 | #define VDP_CLOCK XTAL_42_9545MHz |
| r10979 | r10980 | |
| 1768 | 1768 | else if(offset >= 0x1a00 && offset <= 0x1aff) { return i8255a_r(space->machine->device("ppi8255_0"), (offset-0x1a00) & 3); } |
| 1769 | 1769 | else if(offset >= 0x1b00 && offset <= 0x1bff) { return ay8910_r(space->machine->device("ay"), 0); } |
| 1770 | 1770 | else if(offset >= 0x1f80 && offset <= 0x1f8f) { return z80dma_r(space->machine->device("dma"), 0); } |
| 1771 | | else if(offset >= 0x1f90 && offset <= 0x1f91) { return z80sio_c_r(space->machine->device("sio"), (offset-0x1f90) & 1); } |
| 1772 | | else if(offset >= 0x1f92 && offset <= 0x1f93) { return z80sio_d_r(space->machine->device("sio"), (offset-0x1f92) & 1); } |
| 1771 | else if(offset >= 0x1f90 && offset <= 0x1f93) { return z80dart_ba_cd_r(space->machine->device("sio"), (offset-0x1f90) & 3); } |
| 1773 | 1772 | else if(offset >= 0x1f98 && offset <= 0x1f9f) { printf("Extended SIO/CTC read %04x\n",offset); return 0xff; } |
| 1774 | 1773 | else if(offset >= 0x1fa0 && offset <= 0x1fa3) { return z80ctc_r(space->machine->device("ctc"), offset-0x1fa0); } |
| 1775 | 1774 | else if(offset >= 0x1fa8 && offset <= 0x1fab) { return z80ctc_r(space->machine->device("ctc"), offset-0x1fa8); } |
| r10979 | r10980 | |
| 1824 | 1823 | else if(offset >= 0x1d00 && offset <= 0x1dff) { rom_bank_1_w(space,0,data); } |
| 1825 | 1824 | else if(offset >= 0x1e00 && offset <= 0x1eff) { rom_bank_0_w(space,0,data); } |
| 1826 | 1825 | else if(offset >= 0x1f80 && offset <= 0x1f8f) { z80dma_w(space->machine->device("dma"), 0,data); } |
| 1827 | | else if(offset >= 0x1f90 && offset <= 0x1f91) { z80sio_c_w(space->machine->device("sio"), (offset-0x1f90) & 1,data); } |
| 1828 | | else if(offset >= 0x1f92 && offset <= 0x1f93) { z80sio_d_w(space->machine->device("sio"), (offset-0x1f92) & 1,data); } |
| 1826 | else if(offset >= 0x1f90 && offset <= 0x1f93) { z80dart_ba_cd_w(space->machine->device("sio"), (offset-0x1f90) & 3,data); } |
| 1829 | 1827 | else if(offset >= 0x1f98 && offset <= 0x1f9f) { printf("Extended SIO/CTC write %04x %02x\n",offset,data); } |
| 1830 | 1828 | else if(offset >= 0x1fa0 && offset <= 0x1fa3) { z80ctc_w(space->machine->device("ctc"), offset-0x1fa0,data); } |
| 1831 | 1829 | else if(offset >= 0x1fa8 && offset <= 0x1fab) { z80ctc_w(space->machine->device("ctc"), offset-0x1fa8,data); } |
| r10979 | r10980 | |
| 2364 | 2362 | DEVCB_LINE(z80ctc_trg2_w), // ZC/TO2 callback |
| 2365 | 2363 | }; |
| 2366 | 2364 | |
| 2365 | #if 0 |
| 2367 | 2366 | static const z80sio_interface sio_intf = |
| 2368 | 2367 | { |
| 2369 | 2368 | 0, /* interrupt handler */ |
| r10979 | r10980 | |
| 2373 | 2372 | 0, /* transmit handler */ |
| 2374 | 2373 | 0 /* receive handler */ |
| 2375 | 2374 | }; |
| 2375 | #endif |
| 2376 | 2376 | |
| 2377 | |
| 2378 | static Z80DART_INTERFACE( sio_intf ) |
| 2379 | { |
| 2380 | 0, 0, 0, 0, |
| 2381 | |
| 2382 | DEVCB_NULL, |
| 2383 | DEVCB_NULL, |
| 2384 | DEVCB_NULL, |
| 2385 | DEVCB_NULL, |
| 2386 | DEVCB_NULL, |
| 2387 | DEVCB_NULL, |
| 2388 | |
| 2389 | DEVCB_NULL, |
| 2390 | DEVCB_NULL, |
| 2391 | DEVCB_NULL, |
| 2392 | DEVCB_NULL, |
| 2393 | DEVCB_NULL, |
| 2394 | DEVCB_NULL, |
| 2395 | |
| 2396 | DEVCB_CPU_INPUT_LINE("maincpu", INPUT_LINE_IRQ0) |
| 2397 | }; |
| 2398 | |
| 2377 | 2399 | static const z80_daisy_config x1_daisy[] = |
| 2378 | 2400 | { |
| 2379 | 2401 | { "x1kb" }, |
| r10979 | r10980 | |
| 2386 | 2408 | { "x1kb" }, |
| 2387 | 2409 | { "ctc" }, |
| 2388 | 2410 | { "dma" }, |
| 2389 | | // { "sio" }, |
| 2411 | { "sio" }, |
| 2390 | 2412 | { NULL } |
| 2391 | 2413 | }; |
| 2392 | 2414 | |
| r10979 | r10980 | |
| 2682 | 2704 | |
| 2683 | 2705 | MCFG_MACHINE_RESET(x1turbo) |
| 2684 | 2706 | |
| 2685 | | MCFG_Z80SIO_ADD( "sio", MAIN_CLOCK/4 , sio_intf ) |
| 2707 | // MCFG_Z80SIO_ADD( "sio", MAIN_CLOCK/4 , sio_intf ) |
| 2708 | MCFG_Z80SIO0_ADD("sio", MAIN_CLOCK/4 , sio_intf ) |
| 2686 | 2709 | MCFG_Z80DMA_ADD( "dma", MAIN_CLOCK/4 , x1_dma ) |
| 2687 | 2710 | |
| 2688 | 2711 | MCFG_DEVICE_REMOVE("fdc") |