[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Steal RAM -- Question



Bryan Parkoff wrote:
> I would like to discuss two topics -- 16KB RAM and 48KB RAM for Apple
> //e.
>
>     We know that 16KB RAM has even switch on $C08X to set zero to WRTCOUNT
> (PREWRITE) and odd switch on $C08X to add 1 or 2 to WRTCOUNT.  If WRTCOUNT
> is set to 2 then HIGH RAM for writing is enabled.  My question is why do odd
> switch on $C08X set zero to WRTCOUNT if STA instruction (Write Only) is used
> unlikely to disable HIGH RAM for writing.  Only even switch on $C08X is used
> to disable HIGH RAM for writing.  Please explain what STA instruction is
> used for?
>     If we are going to build peripheral card using RAM like AE RAMFactor
> card, we have an ability to force INHIBIT' to be low to disable CASEN',
> EN80', CD ROM, and EF ROM so they can steal $D000-$FFFF by using RAM card on
> periperhal slot rather than motherboard RAM or auxiliary RAM.  Will
> $0000-$01FF and $0200-$BFFF work to be used in peripheral slot?  I am
> curious.

The behaviour of the INHIBIT' line is markedly different on the IIe vs.
the II/II+. On the earlier machines, INHIBIT' is only active for the
ROM area $D000-$FFFF. In fact, this is how the language card and
firmwire card to their tricks, by INHIBIT'ing ROM access on either a
read or write, or both.

On the IIe this functionality is built into the MMU and the INHIBIT'
line is repurposed. When it's pulled low, ALL system memory is
disabled, leaving it up to a peripheral card to process any bus access
by the processor or an active DMA device.

Of course, such a card can sniff the address bus, and only assert
INHIBIT for address ranges it wishes to override, meaning any other bus
access will fall to the MMU to process.

To answer your previous question regarding the now controversial STA (
:-) ). Write enable is not affected by writes to odd addresses,
although as you point out, WRITECOUNT will be reset. The main use for
this 'trick' is to switch between bank 1 and bank 2 in the language
card without disabling writes.

It does seem somewhat confusing, I know, but the obscure behavior of
write-enabling in the language card is necessary to ensure that
programs written for the earlier firmware card won't inadvertantly
switch the language card into a state that could potentially corrupt
the data in the language card.

Hope this answers your questions...

Matt