Wednesday, April 11, 2012

The terrarium ][+ and its RAM of many card slots

Upon brief reflection, I realized that, indeed there was a problem with the terrarium ][+'s RAM. Here's the picture from before.

Terraiiplus ram problem wide

Zooming way in on the circles, you may see what the problem with the RAM is. It's not there.

Terraiiplus ram problem zoom

Of course, this is because the terrarium ][+ originally had two different RAM expansion cards installed (which I'd removed for the cleanup), and those empty RAM sockets are where the cards plugged into the motherboard. So, I put the RAM cards back in, along with the Disk ][ controller.

Terraiiplus ram cards in

Having done that, it was now possible to boot a disk. I tried a diagnostic program.

Terraiiplus first ram test

For the most part, everything checked out ok. The screen above was supposed to be testing the language card, and it doesn't look like it's quite passing. Never seems good to have something labeled "state status" come up as "bad". Because this is the first time I've ever seen or used this diagnostic program, I don't know what to make of this. For one thing, I'm not sure if it is really testing the cards correctly or not. The two RAM expansion cards are these: A Microsoft card in slot 7...

Terraiiplus microsoft ram

...and a Saturn 32k expansion card in slot 0, with a little red switch on the back of it.

Terraiiplus saturn 32k Terraiiplus saturn 32k switch

One thing that I found a little bit surprising is how these cards were plugged into the motherboard RAM banks. The usual procedure for the Apple 16K language card is to put it in slot 0 and connect the ribbon cable to the upper left RAM socket. Here, though, the connection is made between the Saturn 32K board in slot 0 and the left RAM socket in the middle bank. After some investigation detailed below, my conclusion is that this is probably just a matter of convenience—I suspect that it really doesn't matter what socket it is plugged into, but the length of the Saturn card puts the ribbon cable most easily accessible to the second bank of RAM chips on the motherboard. A note in the manual for the Microsoft 16K card mentions that the reason it has to be plugged into this socket is so that it can get a timing signal that it doesn't have access to through normal slot edge-connector. So, what the Microsoft card does is takes that timing signal over the ribbon cable, and otherwise just routes the signal to a particular stand-in RAM chip on the card, as if the chip just were very, very tall. Given that it is just taking a timing signal, it probably doesn't matter where it comes from. There may or may not have been a strategy involved in connecting the ribbon cable to two different motherboard RAM banks, perhaps there is some signal degradation for every ribbon cable. Or maybe the shorter Microsoft card just lends itself more naturally to plugging it into the top bank..

The manual for the Apple 16K language card, incidentally, does contain a discussion of how the language card works in some detail (also, it kind of cutely observes, on p. 4, that the slots are "green outside (on most Apples), with gold-plated contacts inside." This of course is no longer true, those are the characteristics that one finds on only the oldest of Apples). The 6502 is only capable of addressing 64K (65536) different spots in memory. In a basic 48K Apple ][ (all RAM sockets filled), the lower 48K is RAM and the upper 16K is ROM. What the language card does is provides RAM with addresses in the upper 16K that you can refer to as RAM when the language card is activated. That is, normally you can't write a value to, say, $EF00, because that's ROM. When the language card is active, you can, although this also means that you can't read what is in $EF00 in ROM, since when you access $EF00, you get what's in the RAM. So, if you need both to store things in RAM and to access subroutines in ROM, you need to do a bit of a dance to turn the card on and off. It's even a little bit more complicated than that, because the upper 16K is not all available. The 4K area from $C000-CFFF is reserved for I/O. This is where the ROM on extension cards can be accessed, and it also has a number of "magic" addresses ("soft switches") which, when accessed, do things like click the speaker, change the graphics mode, activate and deactivate the language card, and so forth. So, there's really only 12K ($D000-FFFF) available for this sort of RAM overlay. What the language card actually does is allows for overlaying the upper 12K when it is active, but the lower 4K of that can be one of two different RAM banks. The reason for calling this the "language card" is that BASIC is stored in the upper 12K of ROM, but one can put, say, a different version of BASIC in the RAM of the language card and then activate it, so that now (while the language card is activated) the machine operates for all intents and purposes like it has that other version of BASIC in ROM. This was used to switch between the earlier Integer BASIC and later Applesoft (floating-point) BASIC.

I am having a lot of trouble finding any sort of proof that the 32K Saturn RAM card ever existed (apart from the fact that I can hold it in my hand), let alone find any kind of documentation for it. Google just keeps giving me links to my own pages here. But looking at the manual for the 64K and 128K Saturn cards, I surmise that the Saturn card placed in slot 0 will generally just present itself like a 16K language card to any program that doesn't know about the additional banks it has available. One difference, it seems, between the 64K/128K version of the Saturn card and the 32K version I have is that there's no mention in the documentation for the 64K/128K cards of plugging the card into the motherboard RAM banks. It seems as if it is simply a standalone card that does what it needs to do without that external connection (so either they ultimately found the necessary timing signal in the edge connector, or the timing signal wasn't crucial after all?). Regardless, the 64K/128K card's documentation is of no use to me in trying to determine the validity of connecting it to the second bank of RAM. Also lacking any mention is the switch at the back of the Saturn card, which probably works sort of like the switch at the back of the original firmware cards (which as I understand it is basically a bypass mechanism, a physical way to deactivate the card so only the motherboard ROM is addressable).

The manual for the Microsoft card only refers to the procedure for installing it in slot 0 and replacing the upper left RAM chip, although there is some information at the end of the manual that indicates why it is plugged in this way. The bit about the timing signal is on page 27. I don't quite understand the implications of it being in slot 7 rather than in slot 0. Does that mean that the soft switches that activate it are not from $C080-C08F but rather in $C0F0-C0FF? I really don't understand how these two RAM cards interact. I suspect that both RAM cards do all of their paging in $D000-FFFF, and that the choice of what RAM socket to plug it into is primarily just about convention and how long the ribbon cables are. I don't know what happens if both cards try to activate their onboard $D000-FFFF at the same time—whose RAM bank is actually exposed in this situation? Does slot 0 take priority? This seems like a very complicated setup, and I wonder if there is any software out there that can make use of this.

Of course, it's also true that I have a bunch of Apple ][+es, and not all of them have RAM expansion cards. There's no reason I'd really need to leave the terrarium ][+ set up the way the original owner had it set up. I could just put one of the RAM cards in a different ][+, allowing all RAM cards to occupy slot 0 in their respective machines, and things would be less complicated. Perhaps that's what I'll ultimately end up doing, but it's still kind of intriguing to try to figure out what this original owner was trying to (or able to?) accomplish with this setup.

No comments: