mirror of
https://github.com/deater/dos33fsprogs.git
synced 2024-09-28 02:55:03 +00:00
tiny_music: optimize some more
This commit is contained in:
parent
902e1cdcbe
commit
da37bbf9a1
@ -26,7 +26,7 @@ MUSIC: music.o
|
|||||||
ld65 -o MUSIC music.o -C $(LINKER_SCRIPTS)/apple2_2000.inc
|
ld65 -o MUSIC music.o -C $(LINKER_SCRIPTS)/apple2_2000.inc
|
||||||
|
|
||||||
music.o: music.s \
|
music.o: music.s \
|
||||||
zp.inc hardware.inc nozp.inc \
|
zp.inc hardware.inc \
|
||||||
yankee_music.s \
|
yankee_music.s \
|
||||||
interrupt_handler.s mockingboard_setup.s
|
interrupt_handler.s mockingboard_setup.s
|
||||||
ca65 -o music.o music.s -l music.lst
|
ca65 -o music.o music.s -l music.lst
|
||||||
|
@ -151,45 +151,33 @@ mockingboard_setup_interrupt:
|
|||||||
sta MOCK_6522_ORB2
|
sta MOCK_6522_ORB2
|
||||||
|
|
||||||
init_registers:
|
init_registers:
|
||||||
|
|
||||||
|
; init song data
|
||||||
|
|
||||||
lda #0
|
lda #0
|
||||||
sta SONG_OFFSET
|
sta SONG_OFFSET
|
||||||
sta SONG_COUNTDOWN
|
sta SONG_COUNTDOWN
|
||||||
|
|
||||||
; set fine note A
|
; read 14 bytes from beginning of song to init
|
||||||
|
|
||||||
ldx #$00
|
ldx #13
|
||||||
lda #$00
|
init_loop:
|
||||||
|
init_smc:
|
||||||
|
txa
|
||||||
|
tay
|
||||||
|
lda (SONG_L),Y
|
||||||
jsr ay3_write_reg
|
jsr ay3_write_reg
|
||||||
|
dex
|
||||||
|
bne init_loop
|
||||||
|
|
||||||
; set coarse note A
|
; update SONG_L to point to beginning
|
||||||
|
lda SONG_L
|
||||||
ldx #$01
|
clc
|
||||||
lda #$00
|
adc #14
|
||||||
jsr ay3_write_reg
|
sta SONG_L
|
||||||
|
bcc no_oflo
|
||||||
; set mixer ABC enabled
|
inc SONG_H
|
||||||
|
no_oflo:
|
||||||
ldx #$07
|
|
||||||
lda #$38
|
|
||||||
jsr ay3_write_reg
|
|
||||||
|
|
||||||
; A volume 14
|
|
||||||
|
|
||||||
ldx #$08
|
|
||||||
lda #$E
|
|
||||||
jsr ay3_write_reg
|
|
||||||
|
|
||||||
; B volume 12
|
|
||||||
|
|
||||||
ldx #$09
|
|
||||||
lda #$C
|
|
||||||
jsr ay3_write_reg
|
|
||||||
|
|
||||||
; C volume 12
|
|
||||||
|
|
||||||
ldx #$0A
|
|
||||||
lda #$C
|
|
||||||
jsr ay3_write_reg
|
|
||||||
|
|
||||||
rts
|
rts
|
||||||
|
|
||||||
|
@ -2,14 +2,13 @@
|
|||||||
|
|
||||||
; 514B -- Initial implementation
|
; 514B -- Initial implementation
|
||||||
; 423B -- inline everything
|
; 423B -- inline everything
|
||||||
|
; 400B -- put register init at end of song
|
||||||
|
|
||||||
SONG_L = $70
|
SONG_L = $70
|
||||||
SONG_H = $71
|
SONG_H = $71
|
||||||
SONG_OFFSET = $72
|
SONG_OFFSET = $72
|
||||||
SONG_COUNTDOWN = $73
|
SONG_COUNTDOWN = $73
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
; proposed format
|
; proposed format
|
||||||
; CCOONNNN -- c=channel, o=octave, n=note
|
; CCOONNNN -- c=channel, o=octave, n=note
|
||||||
; 11LLLLLL -- L=length
|
; 11LLLLLL -- L=length
|
||||||
@ -51,6 +50,4 @@ forever:
|
|||||||
.include "mockingboard_setup.s"
|
.include "mockingboard_setup.s"
|
||||||
.include "interrupt_handler.s"
|
.include "interrupt_handler.s"
|
||||||
|
|
||||||
.include "nozp.inc"
|
|
||||||
|
|
||||||
.include "yankee_music.s"
|
.include "yankee_music.s"
|
||||||
|
@ -1,27 +0,0 @@
|
|||||||
;; Things that normally would go in the zero page
|
|
||||||
|
|
||||||
|
|
||||||
AY_REGISTERS:
|
|
||||||
A_FINE_TONE: .byte $00
|
|
||||||
A_COARSE_TONE: .byte $00
|
|
||||||
B_FINE_TONE: .byte $00
|
|
||||||
B_COARSE_TONE: .byte $00
|
|
||||||
C_FINE_TONE: .byte $00
|
|
||||||
C_COARSE_TONE: .byte $00
|
|
||||||
NOISE: .byte $00
|
|
||||||
ENABLE:
|
|
||||||
PT3_MIXER_VAL: .byte $00
|
|
||||||
A_VOLUME: .byte $00
|
|
||||||
B_VOLUME: .byte $00
|
|
||||||
C_VOLUME: .byte $00
|
|
||||||
ENVELOPE_FINE: .byte $00
|
|
||||||
ENVELOPE_COARSE:.byte $00
|
|
||||||
ENVELOPE_SHAPE: .byte $00
|
|
||||||
|
|
||||||
LOOP: .byte $00
|
|
||||||
MB_VALUE: .byte $00
|
|
||||||
DONE_PLAYING: .byte $00
|
|
||||||
DONE_SONG: .byte $00
|
|
||||||
PT3_TEMP: .byte $00
|
|
||||||
|
|
||||||
|
|
@ -6,6 +6,14 @@
|
|||||||
; 11LLLLLL -- L=length 1/32=1, 1/16=2, 1/8=4, 1/4=8 1/2=16 1=32
|
; 11LLLLLL -- L=length 1/32=1, 1/16=2, 1/8=4, 1/4=8 1/2=16 1=32
|
||||||
|
|
||||||
yankee_doodle_song:
|
yankee_doodle_song:
|
||||||
|
|
||||||
|
; register init
|
||||||
|
.byte $00,$00,$00,$00,$00,$00 ; $00: A/B/C fine/coarse
|
||||||
|
.byte $00 ; $06
|
||||||
|
.byte $38 ; $07 mixer (ABC on)
|
||||||
|
.byte $0E,$0C,$0C ; $08 volume A/B/C
|
||||||
|
.byte $00,$00,$00,$00 ; $09
|
||||||
|
; music
|
||||||
.byte $17 ;00 01 0111 G3 1/4
|
.byte $17 ;00 01 0111 G3 1/4
|
||||||
.byte $4B ;01 00 1011 B2 1
|
.byte $4B ;01 00 1011 B2 1
|
||||||
.byte $87 ;10 00 0111 G2 1
|
.byte $87 ;10 00 0111 G2 1
|
||||||
|
Loading…
Reference in New Issue
Block a user