src/mess/machine/apple2gs.c
| r14987 | r14988 | |
| 1578 | 1578 | else |
| 1579 | 1579 | { |
| 1580 | 1580 | // accessing a slot mapped to "Your Card", C800 should belong to that card |
| 1581 | | if (1) //state->m_a2_cnxx_slot == -1) |
| 1582 | | { |
| 1583 | | state->m_a2_cnxx_slot = slot; |
| 1584 | | apple2_update_memory(space.machine()); |
| 1585 | | } |
| 1586 | | |
| 1587 | 1581 | if (slotdevice != NULL) |
| 1588 | 1582 | { |
| 1583 | if (slotdevice->take_c800()) |
| 1584 | { |
| 1585 | state->m_a2_cnxx_slot = slot; |
| 1586 | apple2_update_memory(space.machine()); |
| 1587 | } |
| 1589 | 1588 | result = slotdevice->read_cnxx(space, address&0xff); |
| 1590 | 1589 | } |
| 1591 | 1590 | else |
| r14987 | r14988 | |
| 1647 | 1646 | } |
| 1648 | 1647 | else |
| 1649 | 1648 | { |
| 1649 | device_a2bus_card_interface *slotdevice; |
| 1650 | |
| 1650 | 1651 | slot = (address & 0x000F00) / 0x100; |
| 1651 | 1652 | |
| 1652 | | if ((slot > 7) || ((state->m_sltromsel & (1 << slot)) == 0)) |
| 1653 | | *apple2gs_getslotmem(machine, address) = data; |
| 1653 | if (slot <= 7) // slots 1-7, it's the slot |
| 1654 | { |
| 1655 | slotdevice = state->m_a2bus->get_a2bus_card(slot); |
| 1656 | |
| 1657 | // is this slot internal or "Your Card"? |
| 1658 | if ((state->m_sltromsel & (1 << slot)) == 0) |
| 1659 | { |
| 1660 | // accessing a slot mapped to internal, let's put back the internal ROM |
| 1661 | state->m_a2_cnxx_slot = -1; |
| 1662 | apple2_update_memory(space.machine()); |
| 1663 | *apple2gs_getslotmem(machine, address) = data; |
| 1664 | } |
| 1665 | else |
| 1666 | { |
| 1667 | // accessing a slot mapped to "Your Card", C800 should belong to that card if it can take it |
| 1668 | if (slotdevice != NULL) |
| 1669 | { |
| 1670 | if (slotdevice->take_c800()) |
| 1671 | { |
| 1672 | state->m_a2_cnxx_slot = slot; |
| 1673 | apple2_update_memory(space.machine()); |
| 1674 | } |
| 1675 | slotdevice->write_cnxx(space, address&0xff, data); |
| 1676 | } |
| 1677 | // (else slot is your card but there's no card inserted so the write goes nowhere) |
| 1678 | } |
| 1679 | } |
| 1680 | else // C800-CFFF, not cards |
| 1681 | { |
| 1682 | slotdevice = NULL; |
| 1683 | |
| 1684 | // if CFFF accessed, reset C800 area to internal ROM |
| 1685 | if ((address & 0xfff) == 0xfff) |
| 1686 | { |
| 1687 | state->m_a2_cnxx_slot = -1; |
| 1688 | apple2_update_memory(space.machine()); |
| 1689 | } |
| 1690 | |
| 1691 | if ( state->m_a2_cnxx_slot >= 0 && state->m_a2_cnxx_slot <= 7 ) |
| 1692 | { |
| 1693 | slotdevice = state->m_a2bus->get_a2bus_card(state->m_a2_cnxx_slot); |
| 1694 | } |
| 1695 | |
| 1696 | if (slotdevice) |
| 1697 | { |
| 1698 | slotdevice->write_c800(space, address&0x7ff, data); |
| 1699 | } |
| 1700 | else |
| 1701 | { |
| 1702 | *apple2gs_getslotmem(machine, address) = data; |
| 1703 | } |
| 1704 | } |
| 1654 | 1705 | } |
| 1655 | 1706 | } |
| 1656 | 1707 | |