This is an old revision of the document!
The //e Card is able to replace the standard Apple II beep with a Macintosh sound. The means by which this is accomplished is quite interesting.
The routine at $fbdd (BELL1) is
.org $fbdd ; this code replaces the .1 second delay .byte $02 ; two byte NOP in 65C02 .byte $01 ; should be ignored by CPU rts nop nop ; remaining code matches the original //e code and calling $fbe2 ; will produce a beep, at the wrong pitch if the card is in fast mode.
$02 is a two-byte NOP on the 65C02. Interestingly enough, when the processor on the Card executes the sequence $02 $01, it produces the configured beep sound.
Try this in the monitor:
*300:02 01 02 01 02 01 60 *300G
Three beep sounds!
So this must be part of the magic that interfaces the card to the host Macintosh. How very very interesting.
The preceding find led me to search through the monitor ROM to look for other unusual instruction sequences.
Here is what I found:
In Routine | Address | Code | Function |
---|---|---|---|
RESET | $FAB4 | $02 $02 | ? |
RESET | $FAC0 | $02 $03 | ? |
APPLEII | $FB63 | $02 $04 | Display copyright message on screen, disappears if screen scrolls. |
BELL1 | $FBDD | $02 $01 | Play system bell sound. |
GETLN1 | $FD78 | $02 $06 | Key translation called right after rdchar. Converts A reg from DELETE to ←. |
Get to the monitor in your //e Card and try this:
*! !300:jsr fd35 ! nop ! nop ! jmp fdda ! *300G
FD35 is the RDCHAR routine, FDDA is the print byte routine. This routine reads a keypress and outputs its hex code. Run it a few times to convince yourself there is no funny business. Run it a final time and press the delete key.
*300G FF (appears after pressing delete) *
Now want to see something interesting? Change the NOPs to $02 $06 and run it again. Press delete.
*303:02 06 *300G 88 (appears after pressing delete) *
That's some serious magic.