src/mess/machine/coco.c
| r4340 | r4341 | |
| 1221 | 1221 | |
| 1222 | 1222 | WRITE8_HANDLER ( dgnalpha_psg_porta_write ) |
| 1223 | 1223 | { |
| 1224 | | const device_config *fdc = devtag_get_device(space->machine, WD179X, "wd179x"); |
| 1224 | const device_config *fdc = devtag_get_device(space->machine, WD179X, "wd2797"); |
| 1225 | 1225 | /* Bits 0..3 are the drive select lines for the internal floppy interface */ |
| 1226 | 1226 | /* Bit 4 is the motor on, in the real hardware these are inverted on their way to the drive */ |
| 1227 | 1227 | /* Bits 5,6,7 are connected to /DDEN, ENP and 5/8 on the WD2797 */ |
| r4340 | r4341 | |
| 1588 | 1588 | |
| 1589 | 1589 | static WRITE8_HANDLER( dgnalpha_pia2_pa_w ) |
| 1590 | 1590 | { |
| 1591 | | const device_config *ay8910 = devtag_get_device(space->machine, SOUND, "ay8910"); |
| 1591 | const device_config *ay8912 = devtag_get_device(space->machine, SOUND, "ay8912"); |
| 1592 | 1592 | int bc_flags; /* BCDDIR/BC1, as connected to PIA2 port a bits 0 and 1 */ |
| 1593 | 1593 | |
| 1594 | 1594 | /* If bit 2 of the pia2 ddra is 1 then this pin is an output so use it */ |
| r4340 | r4341 | |
| 1609 | 1609 | case 0x00 : /* Inactive, do nothing */ |
| 1610 | 1610 | break; |
| 1611 | 1611 | case 0x01 : /* Write to selected port */ |
| 1612 | | ay8910_data_w(ay8910, 0, pia_get_output_b(2)); |
| 1612 | ay8910_data_w(ay8912, 0, pia_get_output_b(2)); |
| 1613 | 1613 | break; |
| 1614 | 1614 | case 0x02 : /* Read from selected port */ |
| 1615 | | pia_set_input_b(2, ay8910_r(ay8910, 0)); |
| 1615 | pia_set_input_b(2, ay8910_r(ay8912, 0)); |
| 1616 | 1616 | break; |
| 1617 | 1617 | case 0x03 : /* Select port to write to */ |
| 1618 | | ay8910_address_w(ay8910, 0, pia_get_output_b(2)); |
| 1618 | ay8910_address_w(ay8912, 0, pia_get_output_b(2)); |
| 1619 | 1619 | break; |
| 1620 | 1620 | } |
| 1621 | 1621 | } |
| r4340 | r4341 | |
| 1642 | 1642 | /* Dragon Alpha onboard FDC */ |
| 1643 | 1643 | /********************************************************************************************/ |
| 1644 | 1644 | |
| 1645 | | static WD17XX_CALLBACK( dgnalpha_fdc_callback ) |
| 1645 | //static |
| 1646 | WD17XX_CALLBACK( dgnalpha_fdc_callback ) |
| 1646 | 1647 | { |
| 1647 | 1648 | /* The NMI line on the alphaAlpha is gated through IC16 (early PLD), and is gated by pia2 CA2 */ |
| 1648 | 1649 | /* The DRQ line goes through pia2 cb1, in exactly the same way as DRQ from DragonDos does */ |
| r4340 | r4341 | |
| 1678 | 1679 | /* The Dragon Alpha hardware reverses the order of the WD2797 registers */ |
| 1679 | 1680 | READ8_HANDLER(wd2797_r) |
| 1680 | 1681 | { |
| 1681 | | const device_config *fdc = devtag_get_device(space->machine, WD179X, "wd179x"); |
| 1682 | const device_config *fdc = devtag_get_device(space->machine, WD179X, "wd2797"); |
| 1682 | 1683 | int result = 0; |
| 1683 | 1684 | |
| 1684 | 1685 | switch(offset & 0x03) |
| r4340 | r4341 | |
| 1704 | 1705 | |
| 1705 | 1706 | WRITE8_HANDLER(wd2797_w) |
| 1706 | 1707 | { |
| 1707 | | const device_config *fdc = devtag_get_device(space->machine, WD179X, "wd179x"); |
| 1708 | const device_config *fdc = devtag_get_device(space->machine, WD179X, "wd2797"); |
| 1708 | 1709 | switch(offset & 0x3) |
| 1709 | 1710 | { |
| 1710 | 1711 | case 0: |
| r4340 | r4341 | |
| 2818 | 2819 | dgnalpha_just_reset=1; |
| 2819 | 2820 | } |
| 2820 | 2821 | |
| 2821 | | static const wd17xx_interface dgnalpha_wd17xx_interface = { |
| 2822 | const wd17xx_interface dgnalpha_wd17xx_interface = { |
| 2822 | 2823 | dgnalpha_fdc_callback, |
| 2823 | 2824 | NULL |
| 2824 | 2825 | }; |
src/mess/drivers/coco.c
| r4340 | r4341 | |
| 809 | 809 | MDRV_SOUND_CONFIG(ay8912_interface) |
| 810 | 810 | MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.75) |
| 811 | 811 | |
| 812 | /* onboard fdc */ |
| 813 | MDRV_WD179X_ADD("wd2797", dgnalpha_wd17xx_interface) |
| 814 | |
| 812 | 815 | /* printer */ |
| 813 | 816 | MDRV_PRINTER_ADD("printer") |
| 814 | 817 | |
| r4340 | r4341 | |
| 1100 | 1103 | ROM_LOAD( "alpha_bt.rom", 0x2000, 0x2000, CRC(c3dab585) SHA1(4a5851aa66eb426e9bb0bba196f1e02d48156068)) |
| 1101 | 1104 | ROM_LOAD( "alpha_ba.rom", 0x8000, 0x4000, CRC(84f68bf9) SHA1(1983b4fb398e3dd9668d424c666c5a0b3f1e2b69)) |
| 1102 | 1105 | |
| 1103 | | ROM_REGION(0x4000,"coco_cartslot:cart",0) |
| 1106 | //ROM_REGION(0x4000,"coco_cartslot:cart",0) |
| 1107 | ROM_REGION(0x4000,"cart",0) |
| 1104 | 1108 | ROM_FILL( 0x0000, 0x4000, 0x00 ) |
| 1109 | ROM_CART_LOAD("coco_cartslot:cart", 0x0000, 0x4000, ROM_OPTIONAL | ROM_MIRROR) |
| 1105 | 1110 | ROM_END |
| 1106 | 1111 | |
| 1107 | 1112 | ROM_START(coco) |