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

Re: Tape input to speaker



Simon Williams replied:

>On 23 Sep 2002 02:48:11 GMT mjmahon@aol.com (Michael J. Mahon) wrote:
>
>> loop      lda cassin   ;Read the cassette input
>>           eor oldcass   ;Compare with previous state (hi bit)
>>           bpl nochange  ;Hi-bit off if no change
>>           sta oldcass   ;Save the new state
>>           sta spkr      ;Flip the speaker
>>           bmi loop      ;Branch always.
>> 
>> nochange  pha     ;Kill 7 cycles
>>           pla
>>           jmp loop
>
>Well, I basically understand how that works (minor miracle), but I'm at a
>loss with
>line 2... does *oldcass* refer to a specific location in memory?

Yes.  Later in the post I mentioned that my timing assumptions
were based on "oldcass" being a page zero address.  Any free
page zero byte will do fine--like $0006, for example.


>I understand that 
>the condition of bit 7 of $C060 is what is important, but I'm not sure how
>that
>information is arrived at or where it might be found... 

Uhh...you don't have to do anything to make $C060's value change
except apply a speaker-level signal to the cassette input port.  The
instantaneous polarity of the cassette input is read as the hi-bit
of $C060 when the "lda" is done.  All other bits read are meaningless.

The built-in Apple II I/O locations are described in the Reference
Manual (and in numerous other places).

-michael

Check out 8-bit Apple sound that will amaze you on my
Home page:  http://members.aol.com/MJMahon/