5

The original Apple IIc had a 27128 16 KB ROM mapped into the $C100-$FFFF range (the $C000 page was decoded for I/O). According to the Apple IIc Technical Reference Manual the ROMEN1* and ROMEN2* signals from the MMU chip enabled the ROM.¹ (Those two signals are tied together through diodes; ROMEN1* is documented as enabling $C100-$DFFF, and ROMEN2* is undocumented.)

When using a 27256 32 KB ROM, the additional ROM address pin A14 is conected to CASSO (pin 7) on the IOU ("I/O Unit") chip. The manual says merely that this pin is "Reserved," and seems to have no other information on how the upper half of the 32 KB ROM is accessed.

So how does one switch between the two banks of ROM, and to where is the second bank mapped? Did Apple document any of the ROM code related to switching between the two banks for use by developers?


¹The schematic in that version of the manual is for newer versions of the Apple IIc that had the 32 KB ROM; this schematic shows the original A2S4000 model with a trace to be cut and pad to be bridged to use a 32K instead of a 16K ROM.

7
  • 1
    Look at the firmware source code in Appendix I. The table there lists the contents of both banks. The ROMBANK soft-switch at $C028 is used to toggle between banks. See the $C700 page for code that was identical in both ROM banks so that switching between banks here would work. (The same technique was often used to switch between main and aux RAM.) Commented May 29, 2020 at 12:09
  • @NickWestgate Thanks, that's informative. The locations $C780-$C7FF (listed on page 416 of the Technical Reference Manual I linked), contain routines used for switching back and forth between the two banks, and I've checked an image and confirmed that they are indeed the same in both banks.
    – cjs
    Commented May 29, 2020 at 12:44
  • Nitpick: The 27128 isn't a ROM but an (E)PROM - and thus wasn't used with any Apple.
    – Raffzahn
    Commented May 29, 2020 at 12:55
  • @Raffzahn 1) an EEPROM is a type of ROM; it's right in the name. 2) If you believe that it's incorrect for engineers to use "27128" or "27256" (in the case of the schematic I referenced) to refer to the pinout, rather than a specific part, even when any part with that pinout will work, you need to take it up with Apple. It's their engineers that did this. But personally I think it would be really stupid to go around writing "27128-compatible" on your schematics and in your documentation just because someone might use a part with a different number.
    – cjs
    Commented May 30, 2020 at 10:32
  • @cjs You're quite funny, but words can not redefine technology, to start with, a 27xx isn't an EEPROM, but an EPROM, as EEPROM it would be a 29xx and carry a different pinout - yes, these numbers do have a meaning to an engineer. Second, it's not a ROM, as it's a writable device, no matter how used. Next, did you consider that these plans are maybe for a prototype unit? So, unless your question is very specific about IIc+ prototypes (which used EPROMs, I own a IIc prototype), using a generic term as in 32 KiB ROM,sparing the type, is more approptiate. Leving of wrong details helps clarity.
    – Raffzahn
    Commented May 30, 2020 at 12:43

1 Answer 1

7

So how does one switch between the two banks of ROM, and to where is the second bank mapped?

They used $C028, one of the 'reserved' $C02x region (*1). With the IIc ROM "1" it became "Toggle between main and auxiliary ROM". Access per STA flips between both ROM 'halves'.

The 32 KiB Apple IIc ROM contains two images, each covering the Area $C100..$FFFF. The 'main' ROM is located in the first 16 KiB of the TOM chip, while the 'auxiliary' occupies the second half. There is no way to read the setting, it's all done by the code 'knowing' where it is. This includes several stubs on the 'auxiliary' side to flip back to 'normal' configuration, like when a reset occurs and so on.

The switch is only used within the ROM and as a kind of virtual jump. So whenever there was no space left in the original ROM to squeeze in new functionality, an STA $C028 was performed flipping over to the 'auxiliary' side and continuing there. Here most of the time a JSR was used to jump to the extended code. At the end (usually) a common stub in the $C7xx region was called returning to original ROM and returning to the original location.

Did Apple document any of the ROM code related to switching between the two banks for use by developers?

Not that I know of. It's considered strictly internal, as they wanted to keep the ability to be free for future changes. Only the Soft Switch was mentioned.

The Apple IIgs later filled the whole area (and essentially every other address left unused) and redefined the $C028 switch as well. Now it only switched $D000...$FFFF, as again, slot management worked differently in the IIgs. Still, it was only flipping each time.

The IIe card finally made it a one way street with $C028 switching to main (!) ROM and $C029 to 'auxiliary' (*2).


*1 - Marked so in the first version of the IIc Technical Reference. The second edition (Covering ROM "1") marks all of $C02x as "Toggle between main and auxiliary ROM". Still, code only used (AFAIK) $C028.

*2 - Which was unused on the IIc, but controlled video on the IIgs.

2
  • Note that the Apple IIGS $C028 bank switch only works on the ROM 01.
    – Ian Brumby
    Commented Apr 4, 2022 at 4:22
  • @IanBrumby True, a IIgs is not a IIc :))
    – Raffzahn
    Commented Apr 4, 2022 at 9:21

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .