Previous 15994 Revisions Next

r14875 Sunday 8th April, 2012 at 20:32:38 UTC by R. Belmont
Apple II: Fixed C800 banking with INTCXROM and implemented RamFactor card ROM banking. RamFactor diagnostic (g Cn0a in the Monitor) now works.
[src/mess/machine]a2bus.c a2memexp.c apple2.c

src/mess/machine/a2bus.c
r14874r14875
197197
198198device_a2bus_card_interface *a2bus_device::get_a2bus_card(int slot)
199199{
200    if (slot < 0)
201    {
202        return NULL;
203    }
204
200205    return m_device_list[slot];
201206}
202207
src/mess/machine/a2memexp.c
r14874r14875
131131        m_regs[2] = ((m_liveptr>>16) & 0xff) | 0xf0;
132132    }
133133
134//    printf("Read c0n%x (PC=%x) = %02x\n", offset, cpu_get_pc(&space.device()), retval);
134//    if (offset > 3) printf("Read c0n%x (PC=%x) = %02x\n", offset, cpu_get_pc(&space.device()), retval);
135135
136136   return retval;
137137}
r14874r14875
143143
144144void a2bus_memexp_device::write_c0nx(address_space &space, UINT8 offset, UINT8 data)
145145{
146//    printf("Write %02x to c0n%x (PC=%x)\n", data, offset, cpu_get_pc(&space.device()));
146//    if (offset > 3) printf("Write %02x to c0n%x (PC=%x)\n", data, offset, cpu_get_pc(&space.device()));
147147
148148    switch (offset)
149149    {
r14874r14875
198198    int slotimg = m_slot * 0x100;
199199
200200    // first 0x400 of ROM contains a CnXX image for each of slots 1-7, last 0x400 is c800 image
201    if ((m_isramfactor) && (m_regs[0xf] & 0x01))
202    {
203        return m_rom[offset+slotimg+0x1000];
204    }                               
205
201206    return m_rom[offset+slotimg];
202207}
203208
r14874r14875
207212
208213UINT8 a2bus_memexp_device::read_c800(address_space &space, UINT16 offset)
209214{
215    // c70a diags confirm: bit 1 of cn0F banks in the second half of the ROM
216    if ((m_isramfactor) && (m_regs[0xf] & 0x01))
217    {
218        return m_rom[offset+0x1800];
219    }     
220
210221    return m_rom[offset+0x800];
211222}
src/mess/machine/apple2.c
r14874r14875
760760static void apple2_mem_C800(running_machine &machine, offs_t begin, offs_t end, apple2_meminfo *meminfo)
761761{
762762   apple2_state *state = machine.driver_data<apple2_state>();
763   if (state->m_a2_cnxx_slot == -1)
763   if (state->m_flags & VAR_INTCXROM)
764764   {
765765      meminfo->read_mem         = (begin & 0x0FFF) | (state->m_flags & VAR_ROMSWITCH ? 0x4000 : 0x0000) | APPLE2_MEM_ROM;
766766      meminfo->write_mem         = APPLE2_MEM_FLOATING;
r14874r14875
782782   }
783783   else
784784   {
785      if (state->m_a2_cnxx_slot == -1)
785      if (state->m_flags & VAR_INTCXROM)
786786      {
787787         meminfo->read_mem      = (begin & 0x0FFF) | (state->m_flags & VAR_ROMSWITCH ? 0x4000 : 0x0000) | APPLE2_MEM_ROM;
788788         meminfo->write_mem      = APPLE2_MEM_FLOATING;
r14874r14875
887887   state->m_flags &= ~mask;
888888   state->m_flags |= val;
889889
890   if (state->m_flags & VAR_INTCXROM)
891    {
892        state->m_a2_cnxx_slot = -1;
893    }
894
895890   apple2_update_memory(machine);
896891}
897892

Previous 15994 Revisions Next


© 1998-2018 The MESS Team