src/mess/machine/ncr5380.c
| r3100 | r3101 | |
| 302 | 302 | switch( reg ) |
| 303 | 303 | { |
| 304 | 304 | case R5380_CURDATA: |
| 305 | case R5380_INPUTDATA: |
| 305 | 306 | rv = n5380_Registers[reg]; |
| 306 | 307 | |
| 307 | | // if we're in the data transfer phase, readback device data instead |
| 308 | | if ((n5380_Registers[R5380_BUSSTATUS] & 0x1c) == 0x04) |
| 308 | // if we're in the data transfer phase or DMA, readback device data instead |
| 309 | if (((n5380_Registers[R5380_BUSSTATUS] & 0x1c) == 0x04) || (n5380_Registers[R5380_BUSSTATUS] & 0x40)) |
| 309 | 310 | { |
| 310 | 311 | rv = n5380_Data[d_ptr]; |
| 311 | 312 | |
| r3100 | r3101 | |
| 333 | 334 | { |
| 334 | 335 | ncr5380_read_data((d_limit < 512) ? d_limit : 512, n5380_Data); |
| 335 | 336 | } |
| 337 | else |
| 338 | { |
| 339 | // if this is DMA, signal DMA end |
| 340 | if (n5380_Registers[R5380_BUSSTATUS] & 0x40) |
| 341 | { |
| 342 | n5380_Registers[R5380_BUSSTATUS] |= 0x80; |
| 343 | } |
| 344 | } |
| 336 | 345 | } |
| 337 | 346 | } |
| 338 | 347 | |
src/mess/machine/mac.c
| r3100 | r3101 | |
| 151 | 151 | static UINT32 mac_overlay = 0; |
| 152 | 152 | static mac_model_t mac_model; |
| 153 | 153 | static int mac_drive_select = 0; |
| 154 | static int mac_scsiirq_enable = 0; |
| 154 | 155 | |
| 155 | 156 | // returns non-zero if this Mac has ADB |
| 156 | 157 | static int has_adb(void) |
| r3100 | r3101 | |
| 211 | 212 | Interrupt handling |
| 212 | 213 | */ |
| 213 | 214 | |
| 214 | | static int scc_interrupt, via_interrupt; |
| 215 | static int scc_interrupt, via_interrupt, scsi_interrupt; |
| 215 | 216 | |
| 216 | 217 | static void mac_field_interrupts(running_machine *machine) |
| 217 | 218 | { |
| 218 | | if (scc_interrupt) |
| 219 | | /* SCC interrupt */ |
| 219 | if ((scc_interrupt) || (scsi_interrupt)) |
| 220 | /* SCC interrupt, SCSI on SE and Classic */ |
| 220 | 221 | cpunum_set_input_line(machine, 0, 2, ASSERT_LINE); |
| 221 | 222 | else if (via_interrupt) |
| 222 | 223 | /* VIA interrupt */ |
| r3100 | r3101 | |
| 784 | 785 | ncr5380_w(machine, reg, data); |
| 785 | 786 | } |
| 786 | 787 | |
| 788 | static void mac_scsi_irq(running_machine *machine, int state) |
| 789 | { |
| 790 | if ((mac_scsiirq_enable) && ((mac_model == MODEL_MAC_SE) || (mac_model == MODEL_MAC_CLASSIC))) |
| 791 | { |
| 792 | scsi_interrupt = state; |
| 793 | mac_field_interrupts(machine); |
| 794 | } |
| 795 | } |
| 796 | |
| 787 | 797 | /* ************************************************************************* |
| 788 | 798 | * SCC |
| 789 | 799 | * |
| r3100 | r3101 | |
| 1574 | 1584 | int new_rtc_rTCClk; |
| 1575 | 1585 | |
| 1576 | 1586 | mac_enable_sound((data & 0x80) == 0); |
| 1587 | |
| 1588 | // SE and Classic have SCSI enable/disable here |
| 1589 | if (mac_model >= MODEL_MAC_SE) |
| 1590 | { |
| 1591 | mac_scsiirq_enable = (data & 0x40) ? 1 : 0; |
| 1592 | } |
| 1593 | |
| 1577 | 1594 | rtc_write_rTCEnb(data & 0x04); |
| 1578 | 1595 | new_rtc_rTCClk = (data >> 1) & 0x01; |
| 1579 | 1596 | if ((! new_rtc_rTCClk) && (rtc_rTCClk)) |
| r3100 | r3101 | |
| 1658 | 1675 | memset(mess_ram, 0, mess_ram_size); |
| 1659 | 1676 | } |
| 1660 | 1677 | |
| 1678 | scsi_interrupt = 0; |
| 1679 | |
| 1661 | 1680 | mac_scanline_timer = timer_alloc(mac_scanline_tick, NULL); |
| 1662 | 1681 | timer_adjust_oneshot(mac_scanline_timer, video_screen_get_time_until_pos(machine->primary_screen, 0, 0), 0); |
| 1663 | 1682 | } |
| r3100 | r3101 | |
| 1689 | 1708 | static void mac_driver_init(running_machine *machine, mac_model_t model) |
| 1690 | 1709 | { |
| 1691 | 1710 | mac_overlay = -1; |
| 1711 | scsi_interrupt = 0; |
| 1692 | 1712 | mac_model = model; |
| 1693 | 1713 | |
| 1694 | 1714 | /* set up RAM mirror at 0x600000-0x6fffff (0x7fffff ???) */ |
| r3100 | r3101 | |
| 1746 | 1766 | |
| 1747 | 1767 | static const SCSIConfigTable dev_table = |
| 1748 | 1768 | { |
| 1749 | | 1, /* 2 SCSI devices */ |
| 1769 | 2, /* 2 SCSI devices */ |
| 1750 | 1770 | { |
| 1751 | 1771 | { SCSI_ID_5, "harddisk1", SCSI_DEVICE_HARDDISK }, /* SCSI ID 5, using CHD 1, and it's a harddisk */ |
| 1752 | 1772 | { SCSI_ID_6, "harddisk2", SCSI_DEVICE_HARDDISK } /* SCSI ID 6, using CHD 0, and it's a harddisk */ |
| 1753 | 1773 | } |
| 1754 | 1774 | }; |
| 1755 | | |
| 1775 | // 41a868 41a5ac = data copy |
| 1756 | 1776 | static const struct NCR5380interface macplus_5380intf = |
| 1757 | 1777 | { |
| 1758 | 1778 | &dev_table, // SCSI device table |
| 1759 | | NULL // IRQ (unconnected on the Mac Plus) |
| 1779 | mac_scsi_irq // IRQ (unconnected on the Mac Plus) |
| 1760 | 1780 | }; |
| 1761 | 1781 | |
| 1762 | 1782 | static void macscsi_exit(running_machine *machine) |