Apple II Bank Switching

2 posts / 0 new
Last post
Offline
Last seen: 3 days 5 hours ago
Joined: Feb 14 2021 - 19:22
Posts: 11
Apple II Bank Switching

I am trying to implement bank switching in my drop-in 6502 emulator, the MCL65+, to allow both the RAM and ROM to be implemented in the microcontroller's emulated 6502's rather than use the memories on the Apple II+ motherboard... and I seem to be missing something... The MCL65+ is a C emulation of the 6502 running on a microcontroller on a board which can replace the physical 6502 on the motherboard.  I have implemented the three memory blocks: ROM, Bank1(12K), and Bank2(4K) and I snoop 6502 read accesses to the 0xC080-0xC08B addresses to switch between them. I can run a memory testing program which recognizes all three ranges and tests them successfully, however programs that require 64K like ProDOS just hang. Without the bank switching emulation ProDOS, and the other programs will say 64KB is required... but with the bank switching emulation they now hang...Im wondering if there is something simple which I have left out which needs to also be implement for this to work... I am basically emulating the Language Card so I need the RAM and also the soft switches which I believe I have implemented correctly... But is there something more I need? Maybe I need to emulate the ROM on this card as well, even though I do have the ROM F8 populated on my II+ ?One other question: How do registers 0xC011 and 0xC012 know which bank is currently being accesses? I believe these registers are implemented on the motherboard and not the Language Card, so when the user performs bank switching by reading the 0xC08x registers which are on the Language Card in Slot-0, how is this also reflected in the 0xC011/C012 registers? I did add some code to try implementing these two registers but it did not make a difference.Thanks,-Ted

Offline
Last seen: 3 days 5 hours ago
Joined: Feb 14 2021 - 19:22
Posts: 11
I believe I found the answer

I believe I found the answer to this:  The soft switch addresses which require two reads to enable writing to the banked RAM and also switch between RAM/ROM reading  just need s *single* read to switch between RAM and ROM while two accesses are needed to enable write access.   This is not very clear in the Apple documentation and some programs like ProDOS and Oregon Trail will just make a single access to swich which bank they read and only perform the double reads when they need to perform writes.

Log in or register to post comments