src/mess/machine/mac.c
| r3099 | r3100 | |
| 1506 | 1506 | |
| 1507 | 1507 | static READ8_HANDLER(mac_via_in_a) |
| 1508 | 1508 | { |
| 1509 | if (mac_model == MODEL_MAC_CLASSIC) |
| 1510 | { |
| 1511 | return 0x81; // bit 0 must be set to avoid attempting to boot from AppleTalk |
| 1512 | } |
| 1513 | |
| 1509 | 1514 | return 0x80; |
| 1510 | 1515 | } |
| 1511 | 1516 | |
| r3099 | r3100 | |
| 1620 | 1625 | * Main |
| 1621 | 1626 | * *************************************************************************/ |
| 1622 | 1627 | |
| 1623 | | static TIMER_CALLBACK(set_memory_overlay_callback) |
| 1624 | | { |
| 1625 | | set_memory_overlay(machine, param); |
| 1626 | | } |
| 1627 | | |
| 1628 | 1628 | MACHINE_RESET(mac) |
| 1629 | 1629 | { |
| 1630 | 1630 | /* initialize real-time clock */ |
| r3099 | r3100 | |
| 1650 | 1650 | timer_adjust_oneshot(mac_adb_timer, attotime_never, 0); |
| 1651 | 1651 | } |
| 1652 | 1652 | |
| 1653 | | if (mac_model == MODEL_MAC_SE) |
| 1653 | if ((mac_model == MODEL_MAC_SE) || (mac_model == MODEL_MAC_CLASSIC)) |
| 1654 | 1654 | { |
| 1655 | | timer_set(attotime_zero, NULL, 0, set_memory_overlay_callback); |
| 1656 | 1655 | mac_set_sound_buffer(1); |
| 1656 | |
| 1657 | // classic will fail RAM test and try to boot appletalk if RAM is not all zero |
| 1658 | memset(mess_ram, 0, mess_ram_size); |
| 1657 | 1659 | } |
| 1658 | 1660 | |
| 1659 | 1661 | mac_scanline_timer = timer_alloc(mac_scanline_tick, NULL); |
| r3099 | r3100 | |
| 1670 | 1672 | } |
| 1671 | 1673 | |
| 1672 | 1674 | |
| 1675 | static OPBASE_HANDLER (overlay_opbaseoverride) |
| 1676 | { |
| 1677 | if (mac_overlay != -1) |
| 1678 | { |
| 1679 | if ((address >= 0x400000) && (address <= 0x4fffff)) |
| 1680 | { |
| 1681 | set_memory_overlay(machine, 0); // kill the overlay |
| 1682 | mac_overlay = -1; |
| 1683 | } |
| 1684 | } |
| 1673 | 1685 | |
| 1686 | return address; |
| 1687 | } |
| 1688 | |
| 1674 | 1689 | static void mac_driver_init(running_machine *machine, mac_model_t model) |
| 1675 | 1690 | { |
| 1676 | 1691 | mac_overlay = -1; |
| r3099 | r3100 | |
| 1685 | 1700 | |
| 1686 | 1701 | set_memory_overlay(machine, 1); |
| 1687 | 1702 | |
| 1703 | if ((model == MODEL_MAC_SE) || (model == MODEL_MAC_CLASSIC)) |
| 1704 | { |
| 1705 | // classic will fail RAM test and try to boot appletalk if RAM is not all zero |
| 1706 | memset(mess_ram, 0, mess_ram_size); |
| 1707 | |
| 1708 | memory_set_opbase_handler(0, overlay_opbaseoverride); |
| 1709 | mac_overlay = 1; |
| 1710 | } |
| 1711 | |
| 1688 | 1712 | /* configure via */ |
| 1689 | 1713 | if (has_adb()) |
| 1690 | 1714 | { |