src/mess/drivers/pasopia.c
| r9018 | r9019 | |
| 525 | 525 | |
| 526 | 526 | io_port = offset & 0xff; //trim down to 8-bit bus |
| 527 | 527 | |
| 528 | if(io_port >= 0x30 && io_port <= 0x33) |
| 529 | printf("[%02x]\n",offset & 3); |
| 530 | |
| 528 | 531 | if(io_port >= 0x08 && io_port <= 0x0b) { return i8255a_r(space->machine->device("ppi8255_0"), (io_port-0x08) & 3); } |
| 529 | 532 | else if(io_port >= 0x0c && io_port <= 0x0f) { return i8255a_r(space->machine->device("ppi8255_1"), (io_port-0x0c) & 3); } |
| 530 | 533 | // else if(io_port == 0x10 || io_port == 0x11) { M6845 read } |
| 531 | 534 | else if(io_port >= 0x18 && io_port <= 0x1b) { return pac2_r(space, (io_port-0x18) & 3); } |
| 532 | 535 | else if(io_port >= 0x20 && io_port <= 0x23) { return i8255a_r(space->machine->device("ppi8255_2"), (io_port-0x20) & 3); } |
| 533 | 536 | else if(io_port >= 0x28 && io_port <= 0x2b) { return z80ctc_r(space->machine->device("ctc"), (io_port-0x28) & 3); } |
| 534 | | else if(io_port >= 0x30 && io_port <= 0x33) { return z80pio_ba_cd_r(space->machine->device("z80pio_0"), (io_port-0x30) & 3); } |
| 537 | else if(io_port == 0x30) { return z80pio_d_r(space->machine->device("z80pio_0"), (io_port-0x30) & 1); } |
| 538 | else if(io_port == 0x31) { return z80pio_c_r(space->machine->device("z80pio_0"), (io_port-0x31) & 1); } |
| 535 | 539 | // else if(io_port == 0x3a) { SN1 } |
| 536 | 540 | // else if(io_port == 0x3b) { SN2 } |
| 537 | 541 | // else if(io_port == 0x3c) { bankswitch } |
| r9018 | r9019 | |
| 540 | 544 | { |
| 541 | 545 | logerror("(PC=%06x) Read i/o address %02x\n",cpu_get_pc(space->cpu),io_port); |
| 542 | 546 | } |
| 547 | |
| 543 | 548 | return 0xff; |
| 544 | 549 | } |
| 545 | 550 | |
| r9018 | r9019 | |
| 557 | 562 | |
| 558 | 563 | io_port = offset & 0xff; //trim down to 8-bit bus |
| 559 | 564 | |
| 565 | if(io_port >= 0x30 && io_port <= 0x33) |
| 566 | printf("[%02x] <- %02x\n",offset & 3,data); |
| 567 | |
| 560 | 568 | if(io_port >= 0x08 && io_port <= 0x0b) { i8255a_w(space->machine->device("ppi8255_0"), (io_port-0x08) & 3, data); } |
| 561 | 569 | else if(io_port >= 0x0c && io_port <= 0x0f) { i8255a_w(space->machine->device("ppi8255_1"), (io_port-0x0c) & 3, data); } |
| 562 | 570 | else if(io_port >= 0x10 && io_port <= 0x11) { pasopia7_6845_w(space, io_port-0x10, data); } |
| 563 | 571 | else if(io_port >= 0x18 && io_port <= 0x1b) { pac2_w(space, (io_port-0x18) & 3, data); } |
| 564 | 572 | else if(io_port >= 0x20 && io_port <= 0x23) { i8255a_w(space->machine->device("ppi8255_2"), (io_port-0x20) & 3, data); } |
| 565 | 573 | else if(io_port >= 0x28 && io_port <= 0x2b) { z80ctc_w(space->machine->device("ctc"), (io_port-0x28) & 3,data); } |
| 566 | | else if(io_port >= 0x30 && io_port <= 0x33) { z80pio_ba_cd_w(space->machine->device("z80pio_0"), (io_port-0x30) & 3, data); } |
| 574 | else if(io_port >= 0x30 && io_port <= 0x31) { z80pio_d_w(space->machine->device("z80pio_0"), (io_port-0x30) & 1, data); } |
| 575 | else if(io_port >= 0x32 && io_port <= 0x33) { z80pio_c_w(space->machine->device("z80pio_0"), (io_port-0x32) & 1, data); } |
| 567 | 576 | else if(io_port == 0x3a) { sn76496_w(space->machine->device("sn1"), 0, data); } |
| 568 | 577 | else if(io_port == 0x3b) { sn76496_w(space->machine->device("sn2"), 0, data); } |
| 569 | 578 | else if(io_port == 0x3c) { pasopia7_memory_ctrl_w(space,0, data); } |
| r9018 | r9019 | |
| 642 | 651 | 0, // timer disables |
| 643 | 652 | DEVCB_CPU_INPUT_LINE("maincpu", INPUT_LINE_IRQ0), // interrupt handler |
| 644 | 653 | DEVCB_LINE(z80ctc_trg1_w), // ZC/TO0 callback |
| 645 | | DEVCB_LINE(z80ctc_trg2_w), // ZC/TO1 callback, beep interface |
| 654 | DEVCB_LINE(z80ctc_trg2_w), // ZC/TO1 callback, beep interface |
| 646 | 655 | DEVCB_LINE(z80ctc_trg3_w) // ZC/TO2 callback |
| 647 | 656 | }; |
| 648 | 657 | |
| 658 | static READ8_DEVICE_HANDLER( test_r ) |
| 659 | { |
| 660 | return mame_rand(device->machine); |
| 661 | } |
| 662 | |
| 663 | static WRITE_LINE_DEVICE_HANDLER( testa_w ) |
| 664 | { |
| 665 | printf("A %02x\n",state); |
| 666 | } |
| 667 | |
| 668 | static WRITE_LINE_DEVICE_HANDLER( testb_w ) |
| 669 | { |
| 670 | printf("B %02x\n",state); |
| 671 | } |
| 672 | |
| 649 | 673 | static Z80PIO_INTERFACE( z80pio_intf ) |
| 650 | 674 | { |
| 651 | 675 | DEVCB_CPU_INPUT_LINE("maincpu", INPUT_LINE_IRQ0), //doesn't work? |
| 676 | DEVCB_HANDLER(test_r), |
| 652 | 677 | DEVCB_NULL, |
| 678 | DEVCB_LINE(testa_w), |
| 679 | DEVCB_HANDLER(test_r), |
| 653 | 680 | DEVCB_NULL, |
| 654 | | DEVCB_NULL, |
| 655 | | DEVCB_NULL, |
| 656 | | DEVCB_NULL, |
| 657 | | DEVCB_NULL |
| 681 | DEVCB_LINE(testb_w) |
| 658 | 682 | }; |
| 659 | 683 | |
| 660 | 684 | static const z80_daisy_config p7_daisy[] = |