====== SIX BIT SOUND ====== ===== EXAMPLE CODE ===== Note: The following public domain code does not contain the *waveform* or *music note* data. Many examples of these are available in various Rainbow Magazine articles as well as in the Musica example song files. ;********************************************************************* ;* Title: PLAY.s (c) 1984 Speech Systems. Released to Public Domain. ;********************************************************************* ;* Author: Speech Systems ;* ;* Description: 4-voice player ;* ;* Documentation: See the MUSICA manual ;* pg. 15 for usage and license ;* pg. 19 for memory map and note format ;* pp. 20-22 for source ;* ;* Include Files: none ;* ;* Assembler: lwasm 1.4.2 ;* ;* Revision History: ;* Rev # Date Who Comments ;* ----- ----------- ------ --------------------------------------- ;* 1.0 1984 SS Original Source From Manual ;********************************************************************* PIA0AC equ $ff01 PIA0BC equ $ff03 PIA1AD equ $ff20 PIA1BC equ $ff23 ; org $3f40 ; ($3540 in tape version) PLAY: lda #$3f ; set DP register ($35 in tape version) tfr A,DP setdp $3f ; ($35 in tape version) lda $ff01 ; turn on TV sound port anda #$f7 sta $ff01 lda $ff03 anda #$f7 sta $ff03 lda #$3c sta $ff23 pshs CC ; save condition register orcc #$50 ; disable interrupts ldx #$4400 ; x=note pointer ($3a00 in tape version) lda ,X+ ; load tempo from music sta TEMPO ldd ,X++ ; load tone table high addresses sta $7F, not a note beq PLAY2 ; duration=0 if end of music PLAY1: sta ===== RTS ===== Return to [[:Tandy Color Computer:]]