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

Re: Steal RAM -- Question



mmphosis wrote:
> I'm going to move my discussion about the "6502 store instruction
> performing a read and write" to a new topic in
> comp.sys.apple2.programmer
>
> I don't think I can answer the original posters questions.

I'm sure regular readers here are well used to posts going off topic,
this being such a low volume group.

All I can do is say that I once thought the same as you but now believe
differently. In fact this morning before your post I did a quick test
on my //c, and there was no difference between LDA and STA.

Now, you will say there's a 65C02 in there, which is fair enough even
though I'm sure there is no difference on that account. I would be more
suspicious of differences in the integrated logic chips, and perhaps a
different amplifier circuit for the speaker.

An more likely factor is something Linards Ticmanis brought up in a
fascinating previous discussion on Apple II speaker emulation. On his
Apple II the initial state of the speaker made a difference in how game
intro music etc sounded. His suggestion was to access $C030 before
running Ultima III, I think.

Also, googling this group I found that Andy McFadden had found what I
found in an even earlier Apple manual. In the thread titled "Does an
enhanced //e _ALWAYS_ have 80 col. support?" he quotes:

> Apple II reference manual (1981 edition), page 20:
>
>   A program can "reference" the address of the special location for the
>   speaker by performing a "read" or "write" operation to that address.
>   The data which are read or written are irrelevant, as it is the
>   _address_ which throws the switch.  Note that a "write" operation on the
>   Apple's 6502 microprocessor actually performs a "read" before the
>   "write", so that if you use a "write" operation to flip any soft
>   switch, you will actually throw that switch _twice_.  For toggle-type
>   soft switches, such as the speaker switch, this means that a "write"
>   operation to the special location controlling the switch will leave
>   the switch in the same state it was in before the operation was
>   performed.

Anyway, it seems this is one of those topics that comes up again and
again. There should be a technical FAQ for this one.

Cheers,
Nick.