Previous 15994 Revisions Next

r9019 Thursday 2nd September, 2010 at 14:24:22 UTC by Angelo Salese
[PASOPIA7]: improved z80pio, but still not yet working
[src/mess/drivers]pasopia.c

src/mess/drivers/pasopia.c
r9018r9019
525525
526526   io_port = offset & 0xff; //trim down to 8-bit bus
527527
528   if(io_port >= 0x30 && io_port <= 0x33)
529      printf("[%02x]\n",offset & 3);
530
528531   if(io_port >= 0x08 && io_port <= 0x0b)      { return i8255a_r(space->machine->device("ppi8255_0"), (io_port-0x08) & 3); }
529532   else if(io_port >= 0x0c && io_port <= 0x0f) { return i8255a_r(space->machine->device("ppi8255_1"), (io_port-0x0c) & 3); }
530533//  else if(io_port == 0x10 || io_port == 0x11) { M6845 read }
531534   else if(io_port >= 0x18 && io_port <= 0x1b) { return pac2_r(space, (io_port-0x18) & 3);  }
532535   else if(io_port >= 0x20 && io_port <= 0x23) { return i8255a_r(space->machine->device("ppi8255_2"), (io_port-0x20) & 3); }
533536   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); }
535539//  else if(io_port == 0x3a)                    { SN1 }
536540//  else if(io_port == 0x3b)                    { SN2 }
537541//  else if(io_port == 0x3c)                    { bankswitch }
r9018r9019
540544   {
541545      logerror("(PC=%06x) Read i/o address %02x\n",cpu_get_pc(space->cpu),io_port);
542546   }
547
543548   return 0xff;
544549}
545550
r9018r9019
557562
558563   io_port = offset & 0xff; //trim down to 8-bit bus
559564
565   if(io_port >= 0x30 && io_port <= 0x33)
566      printf("[%02x] <- %02x\n",offset & 3,data);
567
560568   if(io_port >= 0x08 && io_port <= 0x0b)      { i8255a_w(space->machine->device("ppi8255_0"), (io_port-0x08) & 3, data); }
561569   else if(io_port >= 0x0c && io_port <= 0x0f) { i8255a_w(space->machine->device("ppi8255_1"), (io_port-0x0c) & 3, data); }
562570   else if(io_port >= 0x10 && io_port <= 0x11) { pasopia7_6845_w(space, io_port-0x10, data); }
563571   else if(io_port >= 0x18 && io_port <= 0x1b) { pac2_w(space, (io_port-0x18) & 3, data);  }
564572   else if(io_port >= 0x20 && io_port <= 0x23) { i8255a_w(space->machine->device("ppi8255_2"), (io_port-0x20) & 3, data); }
565573   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); }
567576   else if(io_port == 0x3a)               { sn76496_w(space->machine->device("sn1"), 0, data); }
568577   else if(io_port == 0x3b)               { sn76496_w(space->machine->device("sn2"), 0, data); }
569578   else if(io_port == 0x3c)               { pasopia7_memory_ctrl_w(space,0, data); }
r9018r9019
642651   0,               // timer disables
643652   DEVCB_CPU_INPUT_LINE("maincpu", INPUT_LINE_IRQ0),      // interrupt handler
644653   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
646655   DEVCB_LINE(z80ctc_trg3_w)      // ZC/TO2 callback
647656};
648657
658static READ8_DEVICE_HANDLER( test_r )
659{
660   return mame_rand(device->machine);
661}
662
663static WRITE_LINE_DEVICE_HANDLER( testa_w )
664{
665   printf("A %02x\n",state);
666}
667
668static WRITE_LINE_DEVICE_HANDLER( testb_w )
669{
670   printf("B %02x\n",state);
671}
672
649673static Z80PIO_INTERFACE( z80pio_intf )
650674{
651675   DEVCB_CPU_INPUT_LINE("maincpu", INPUT_LINE_IRQ0), //doesn't work?
676   DEVCB_HANDLER(test_r),
652677   DEVCB_NULL,
678   DEVCB_LINE(testa_w),
679   DEVCB_HANDLER(test_r),
653680   DEVCB_NULL,
654   DEVCB_NULL,
655   DEVCB_NULL,
656   DEVCB_NULL,
657   DEVCB_NULL
681   DEVCB_LINE(testb_w)
658682};
659683
660684static const z80_daisy_config p7_daisy[] =

Previous 15994 Revisions Next


© 1998-2018 The MESS Team