
Apple II Computer Info
00 A Freq. fine (0-7)
01 A Freq. coarse (0-3)
02 B Freq. fine (0-7)
03 B Freq. coarse (0-3)
04 C Freq. fine (0-7)
05 C Freq. coarse (0-3)
06 NG Freq. (0-4)
07 Enable =0/ Disable =1
NG on A (5) on B (4) on C (3)
Tone on A (2) on B (1) on C (0)
Ex: Writing $F0 to Reg 07 plays tones A, B, C plus noise on C
08 A Level (0-3) and
Envelope Control (4): 1 = Use Env; 0 = Use Level value
09 B Level (0-3) and ...
0A C Level (0-3) and ...
0B Envelope Period Fine (0-7)
0C Envelope Period Coarse (0-7)
0D Envelope Shape (four bits)
Continue (3) 0= do 1 cycle and set Level to zero
Attack (2) 1= count up 0= count down
Alternate (1) 1= reverse count direction each cycle
Hold (0) 1= do 1 cycle and hold count
To program the MB you write to the board's 6522 I/O chip(s). All
addresses reference here are for a MB Sound II (2 Output channels) in Slot
4.
$C400 ORB1 function to perform, OUT 1
$C480 ORB2 function to perform, OUT 2
$C401 ORA1 data, OUT 1
$C481 ORA2 data, OUT 2
$C402 DDRB1 data direction, OUT 1
$C482 DDRB2 data direction, OUT 2
$C403 DDRA1 data direction, OUT 1
$C483 DDRA2 data direction, OUT 2
Before sending music, etc. data to the MB you must Initialize the board's
I/O. To Initialize the 6522's: Store $FF at $C402 and the other three
DDRxx addresses. This needs to be done by your program just once.
Your program gets access to a PSG via the 6522 by using a few basic
Function codes which set the PSG's I/O control lines:
Set Inactive = $04 Set PSG Reg# = $07 Write Data = $06 Reset = $00
To Write to a PSG register: Tell the PSG which Register you wish to access
(i.e. Set the "current register" #) and Write the data. This is easiest to
do with subroutines to handle the basic Functions.
Example Subroutines (for Output Channel 1):
Set Reg # 1000: A9 07 8D 00 C4 A9 04 8D 00 C4 60
Write Data 100B: A9 06 8D 00 C4 A9 04 8D 00 C4 60
Apple II Computer Technical Information : Apple II Family Hardware Info
ftp://ground.ecn.uiowa.edu/2/apple2/miscinfo/hardware : May 2001 : 291 of 572
Comentários a estes Manuais