[A83] Sound
[Prev][Next][Index][Thread]
[A83] Sound
I am trying to output sound. I am using this code for the TI-86:
PlayBlah2: ;Plays a short Blah
ld hl,Blah2
ld c,%111100 ;value to toggle link port values with
jp PlayIt
PlayBlah1: ;Plays a long Blah
ld hl,Blah1
ld c,%111100 ;value to toggle link port values with
jp PlayIt
Space: ;Plays a space(a silent short Blah)
ld hl,Blah2
ld c,%000000 ;value to toggle link port values with
jp PlayIt
;General Sound Algorithm
;Dux Gregis
;Modified by Rgdtad
PlayIt: ;Plays a sound
ld ix,main ;jp (ix) is the fastest way to jp
main:
ld a,(hl)
or a
ret z
ld e,a
cpl
ld d,a ;near even duration
ld a,i ;to prevent background noise, don't use im 2
loop2:
ld b,e
loop1:
djnz loop1 ;frequency loop
xor c
out (7),a
dec d
jp nz,loop2 ;duration loop
ld i,a
inc hl
jp (ix)
and I already have a sound file in this format:
Blah1: ;zero terminated wav file with a second inside
.db 250,250,250,250,250
.....
.db 250,250,250,250,250
Blah2: ;zero terminated wav file inside another
.db 250,250,250,250,250
.....
.db 250,250,250,250,250,0
Anyway, how would I go about converting this to 83+ format without needing to
rewrite my whole prog?