mirror of
https://github.com/deater/dos33fsprogs.git
synced 2024-09-10 08:54:51 +00:00
mockingboard: got ksp theme playing
This commit is contained in:
parent
54690d0f94
commit
4d54f1f1a7
Binary file not shown.
@ -9,7 +9,7 @@
|
|||||||
.include "zp.inc"
|
.include "zp.inc"
|
||||||
|
|
||||||
;=============================
|
;=============================
|
||||||
; set low-res graphics, page 0
|
; Print message
|
||||||
;=============================
|
;=============================
|
||||||
jsr HOME
|
jsr HOME
|
||||||
jsr TEXT
|
jsr TEXT
|
||||||
@ -31,6 +31,9 @@
|
|||||||
jsr mockingboard_init
|
jsr mockingboard_init
|
||||||
jsr reset_ay_left
|
jsr reset_ay_left
|
||||||
jsr reset_ay_right
|
jsr reset_ay_right
|
||||||
|
jsr clear_ay_left
|
||||||
|
jsr clear_ay_right
|
||||||
|
|
||||||
|
|
||||||
;===========================
|
;===========================
|
||||||
; load pointer to the music
|
; load pointer to the music
|
||||||
@ -39,9 +42,48 @@
|
|||||||
lda #<ksptheme
|
lda #<ksptheme
|
||||||
sta INL
|
sta INL
|
||||||
lda #>ksptheme
|
lda #>ksptheme
|
||||||
sta OUTL
|
sta INH
|
||||||
|
|
||||||
|
ldx #0
|
||||||
|
frame_loop:
|
||||||
|
ldy #0
|
||||||
play_loop:
|
play_loop:
|
||||||
|
lda (INL),Y
|
||||||
|
tax
|
||||||
|
jsr write_ay_left ; assume 3 channel (not six)
|
||||||
|
jsr write_ay_right ; so write same to both left/write
|
||||||
|
|
||||||
|
iny
|
||||||
|
cpy #13
|
||||||
|
bne play_loop
|
||||||
|
|
||||||
|
; special case, if reg 13 = ff don't write it
|
||||||
|
|
||||||
|
lda (INL),Y
|
||||||
|
cmp #$ff
|
||||||
|
beq was_ff
|
||||||
|
|
||||||
|
jsr write_ay_left ; assume 3 channel (not six)
|
||||||
|
jsr write_ay_right ; so write same to both left/write
|
||||||
|
|
||||||
|
was_ff:
|
||||||
|
; see if at end
|
||||||
|
iny
|
||||||
|
iny
|
||||||
|
lda (INL),Y
|
||||||
|
cmp #$ff
|
||||||
|
beq done_play
|
||||||
|
|
||||||
|
; increment INL:INH by 13
|
||||||
|
|
||||||
|
clc
|
||||||
|
lda INL
|
||||||
|
adc #14
|
||||||
|
sta INL
|
||||||
|
|
||||||
|
lda INH
|
||||||
|
adc #0
|
||||||
|
sta INH
|
||||||
|
|
||||||
|
|
||||||
delay_a_bit:
|
delay_a_bit:
|
||||||
@ -52,7 +94,14 @@ delay_a_bit:
|
|||||||
; 40000 = 26+27A+5A^2
|
; 40000 = 26+27A+5A^2
|
||||||
; 5a^2+27a-39974 = 0
|
; 5a^2+27a-39974 = 0
|
||||||
; A = 86.75
|
; A = 86.75
|
||||||
|
|
||||||
|
jmp frame_loop
|
||||||
done_play:
|
done_play:
|
||||||
|
|
||||||
|
jsr clear_ay_left
|
||||||
|
jsr clear_ay_right
|
||||||
|
|
||||||
|
|
||||||
lda #0
|
lda #0
|
||||||
sta CH
|
sta CH
|
||||||
lda #2
|
lda #2
|
||||||
@ -139,19 +188,19 @@ reset_ay_right:
|
|||||||
;=======================
|
;=======================
|
||||||
; Write Right AY-3-8910
|
; Write Right AY-3-8910
|
||||||
;=======================
|
;=======================
|
||||||
; register in X
|
; register in Y
|
||||||
; value in Y
|
; value in X
|
||||||
|
|
||||||
write_right_ay:
|
write_ay_right:
|
||||||
; address
|
; address
|
||||||
stx MOCK_6522_ORA1 ; put address on PA
|
sty MOCK_6522_ORA1 ; put address on PA
|
||||||
lda #MOCK_AY_LATCH_ADDR ; latch_address on PB
|
lda #MOCK_AY_LATCH_ADDR ; latch_address on PB
|
||||||
sta MOCK_6522_ORB1
|
sta MOCK_6522_ORB1
|
||||||
lda #MOCK_AY_INACTIVE ; go inactive
|
lda #MOCK_AY_INACTIVE ; go inactive
|
||||||
sta MOCK_6522_ORB1
|
sta MOCK_6522_ORB1
|
||||||
|
|
||||||
; value
|
; value
|
||||||
sty MOCK_6522_ORA1 ; put value on PA
|
stx MOCK_6522_ORA1 ; put value on PA
|
||||||
lda #MOCK_AY_WRITE ; write on PB
|
lda #MOCK_AY_WRITE ; write on PB
|
||||||
sta MOCK_6522_ORB1
|
sta MOCK_6522_ORB1
|
||||||
lda #MOCK_AY_INACTIVE ; go inactive
|
lda #MOCK_AY_INACTIVE ; go inactive
|
||||||
@ -165,16 +214,16 @@ write_right_ay:
|
|||||||
; register in X
|
; register in X
|
||||||
; value in Y
|
; value in Y
|
||||||
|
|
||||||
write_left_ay:
|
write_ay_left:
|
||||||
; address
|
; address
|
||||||
stx MOCK_6522_ORA2 ; put address on PA
|
sty MOCK_6522_ORA2 ; put address on PA
|
||||||
lda #MOCK_AY_LATCH_ADDR ; latch_address on PB
|
lda #MOCK_AY_LATCH_ADDR ; latch_address on PB
|
||||||
sta MOCK_6522_ORB2
|
sta MOCK_6522_ORB2
|
||||||
lda #MOCK_AY_INACTIVE ; go inactive
|
lda #MOCK_AY_INACTIVE ; go inactive
|
||||||
sta MOCK_6522_ORB2
|
sta MOCK_6522_ORB2
|
||||||
|
|
||||||
; value
|
; value
|
||||||
sty MOCK_6522_ORA2 ; put value on PA
|
stx MOCK_6522_ORA2 ; put value on PA
|
||||||
lda #MOCK_AY_WRITE ; write on PB
|
lda #MOCK_AY_WRITE ; write on PB
|
||||||
sta MOCK_6522_ORB2
|
sta MOCK_6522_ORB2
|
||||||
lda #MOCK_AY_INACTIVE ; go inactive
|
lda #MOCK_AY_INACTIVE ; go inactive
|
||||||
@ -182,6 +231,32 @@ write_left_ay:
|
|||||||
|
|
||||||
rts
|
rts
|
||||||
|
|
||||||
|
;=======================================
|
||||||
|
; clear ay -- clear all 14 AY registers
|
||||||
|
; should silence the card
|
||||||
|
;=======================================
|
||||||
|
clear_ay_left:
|
||||||
|
ldy #14
|
||||||
|
ldx #0
|
||||||
|
clear_ay_left_loop:
|
||||||
|
jsr write_ay_left
|
||||||
|
dey
|
||||||
|
bpl clear_ay_left_loop
|
||||||
|
rts
|
||||||
|
|
||||||
|
;=======================================
|
||||||
|
; clear ay -- clear all 14 AY registers
|
||||||
|
; should silence the card
|
||||||
|
;=======================================
|
||||||
|
clear_ay_right:
|
||||||
|
|
||||||
|
ldy #14
|
||||||
|
ldx #0
|
||||||
|
clear_ay_right_loop:
|
||||||
|
jsr write_ay_right
|
||||||
|
dey
|
||||||
|
bpl clear_ay_right_loop
|
||||||
|
rts
|
||||||
|
|
||||||
;routines
|
;routines
|
||||||
.include "../asm_routines/gr_offsets.s"
|
.include "../asm_routines/gr_offsets.s"
|
||||||
|
Loading…
Reference in New Issue
Block a user