IIRC, you have a playroutine for AY muzak, it was used to play the Trust music. Can you give us the code and how to use it

Regards
Kamel
Code: Select all
VIA_1 equ $30f
VIA_2 equ $30c
_MusicVolA BYTE 0
_MusicVolB BYTE 0
_MusicVolC BYTE 0
_MusicAdress WORD 0
_MusicPosition BYTE 0
_MusicPattern BYTE 0
_MusicLenght BYTE 60
;
; 48*7=336
;
_InitMusic
lda #LOW(_TrustMusic)
sta _MusicAdress
lda #HIGH(_TrustMusic)
sta _MusicAdress+1
lda #0
sta _MusicPattern
sta _MusicPosition
rts
_PlayMusic
lda _MusicAdress
sta tmp
lda _MusicAdress+1
sta tmp+1
playnote_loop
ldy #0
lda (tmp),y
tax
lda #0
jsr VIA_select
ldy #1
lda (tmp),y
tax
lda #2
jsr VIA_select
ldy #2
lda (tmp),y
tax
lda #4
jsr VIA_select
ldy #3
lda (tmp),y
tay
and #31
tax
lda #6
jsr VIA_select
tya
lsr a
lsr a
lsr a
lsr a
lsr a
tay
eor #7
asl a
asl a
asl a
sta add_value+1
tya
clc
add_value
adc #0
ora #64
tax
lda #7
jsr VIA_select
ldy #4
lda (tmp),y
tay
and #$0f
tax
lda #1
jsr VIA_select
tya
lsr a
lsr a
lsr a
lsr a
tax
lda #3
jsr VIA_select
ldy #5
lda (tmp),y
tay
and #$0f
tax
lda #5
jsr VIA_select
tya
lsr a
lsr a
lsr a
lsr a
tax
stx _MusicVolA
lda #8
jsr VIA_select
ldy #6
lda (tmp),y
tay
and #$0f
tax
stx _MusicVolB
lda #9
jsr VIA_select
tya
lsr a
lsr a
lsr a
lsr a
tax
stx _MusicVolC
lda #10
jsr VIA_select
clc
lda tmp
adc #7
sta tmp
lda tmp+1
adc #0
sta tmp+1
lda tmp
sta _MusicAdress
lda tmp+1
sta _MusicAdress+1
ldx _MusicPosition
inx
cpx #48
bne continue_pattern
next_pattern
ldx #0
ldy _MusicPattern
iny
cpy #60
bne continue_music
ldy #0
lda #LOW(_TrustMusic)
sta _MusicAdress
lda #HIGH(_TrustMusic)
sta _MusicAdress+1
continue_music
sty _MusicPattern
continue_pattern
stx _MusicPosition
rts
;
; A -> Soundchip register number (0-13)
; X -> Value to write
;
VIA_select
sta VIA_1
txa
pha
lda VIA_2
ora #$EE ; $EE 238 11101110
sta VIA_2
and #$11 ; $11 17 00010001
ora #$CC ; $CC 204 11001100
sta VIA_2
tax
pla
sta VIA_1
txa
ora #$EC ; $EC 236 11101100
sta VIA_2
and #$11 ; $11 17 00010001
ora #$CC ; $CC 204 11001100
sta VIA_2
rts
_TrustMusic
BYTE $30,$ee,$de,$57,$e2,$fe,$0f
BYTE $28,$ee,$de,$5f,$e2,$fe,$0f
BYTE $20,$ee,$ee,$57,$e2,$fe,$0e
BYTE $20,$ee,$fe,$5f,$e2,$fe,$0d
BYTE $28,$ee,$fe,$57,$e2,$fe,$0c
BYTE $30,$ee,$ee,$5f,$e2,$fe,$0b
; Some more data
I never edited this music. It's only a rip from some other musician play routine.Basicaly what I did was to replay Thrust music on my Atari ST, replacing the YM output by a write in memory in a big buffer, then I saved the buffer, and transformed it a bit to something more compact and usable on the Oric.
So this routine is just a 'AY register dump replayer' that loops after one minute or so.