Previous 15994 Revisions Next

r14988 Saturday 21st April, 2012 at 15:59:17 UTC by R. Belmont
Apple IIgs: writes to card CnXX and C800 space now honored. CFFA2 settings changes work. [R. Belmont]
[src/mess/machine]apple2gs.c

src/mess/machine/apple2gs.c
r14987r14988
15781578         else
15791579         {
15801580            // 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
15871581            if (slotdevice != NULL)
15881582            {
1583               if (slotdevice->take_c800())
1584               {
1585                  state->m_a2_cnxx_slot = slot;
1586                  apple2_update_memory(space.machine());
1587               }
15891588               result = slotdevice->read_cnxx(space, address&0xff);
15901589            }
15911590            else
r14987r14988
16471646   }
16481647   else
16491648   {
1649      device_a2bus_card_interface *slotdevice;
1650
16501651      slot = (address & 0x000F00) / 0x100;
16511652
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      }
16541705   }
16551706}
16561707

Previous 15994 Revisions Next


© 1998-2018 The MESS Team