tiny_tracker: more or less works

This commit is contained in:
Vince Weaver 2021-11-04 20:42:36 -04:00
parent 8d5f156498
commit 31bce00c05
4 changed files with 23 additions and 24 deletions

View File

@ -20,14 +20,8 @@ HELLO: hello.bas
#### ####
YANKEE: yankee.o peasant_music.s: peasant.txt text_to_tiny
ld65 -o YANKEE yankee.o -C $(LINKER_SCRIPTS)/apple2_2000.inc ./text_to_tiny peasant.txt > peasant_music.s
yankee.o: yankee.s \
zp.inc hardware.inc \
yankee_music.s \
interrupt_handler.s mockingboard_setup.s
ca65 -o yankee.o yankee.s -l yankee.lst
#### ####
@ -59,4 +53,5 @@ frequency.o: frequency.c
#### ####
clean: clean:
rm -f *~ *.o *.lst YANKEE PEASANT HELLO text_to_tiny frequency rm -f *~ *.o *.lst YANKEE PEASANT HELLO text_to_tiny frequency peasant_music.s

View File

@ -72,6 +72,7 @@ note_only:
lsr lsr
lsr lsr
lsr lsr
sta octave_smc+1
lsr lsr
and #$FE and #$FE
sta out_smc+1 sta out_smc+1
@ -79,9 +80,8 @@ note_only:
txa txa
and #$3F and #$3F
tax tax
lda frequency_lookup_high,X
sta out_smc2+1
lda frequency_lookup_low,X lda frequency_lookup_low,X
sty y_smc+1 sty y_smc+1
out_smc: out_smc:
@ -93,8 +93,18 @@ out_smc:
; else coarse=0 ; else coarse=0
inx inx
out_smc2: octave_smc:
lda #$dd lda #$dd
and #$3 ; if 0 then 1
; if 1,2,3 then 0
bne blah0
blah1:
lda #1
bne blah_blah
blah0:
lda #0
blah_blah:
jsr ay3_write_reg ; trashes A/Y jsr ay3_write_reg ; trashes A/Y
y_smc: y_smc:

View File

@ -178,7 +178,7 @@ init_smc:
no_oflo: no_oflo:
; create Frequency Table ; create Frequency Table
ldx #12 ldx #11
make_freq_loop: make_freq_loop:
sec sec
lda frequency_lookup_low,X lda frequency_lookup_low,X
@ -189,16 +189,12 @@ make_freq_loop:
lsr lsr
sta frequency_lookup_low+48,X sta frequency_lookup_low+48,X
lda #1
sta frequency_lookup_high,X
lda #0
sta frequency_lookup_high+16,X
sta frequency_lookup_high+32,X
sta frequency_lookup_high+48,X
dex dex
bpl make_freq_loop bpl make_freq_loop
inx
stx frequency_lookup_low+28
rts rts
@ -247,11 +243,9 @@ ay3_write_reg:
; starts at C4 ; starts at C4
frequency_lookup_low: frequency_lookup_low:
.byte $E8,$CD,$B3,$9B,$83,$6E,$59,$46,$33,$22,$12,$02,$00 .byte $E8,$CD,$B3,$9B,$83,$6E,$59,$46,$33,$22,$12,$02
;$1E8,$1CD,$1B3,$19B,$183,$16E,$159,$146,$133,$122,$112,$102, ;$1E8,$1CD,$1B3,$19B,$183,$16E,$159,$146,$133,$122,$112,$102,
;.byte $F4,$E6,$D9,$CD,$C1,$B7,$AC,$A3,$99,$91,$89,$81,$00,$00,$00,$00 ;.byte $F4,$E6,$D9,$CD,$C1,$B7,$AC,$A3,$99,$91,$89,$81,$00,$00,$00,$00
;.byte $7A,$73,$6C,$66,$60,$5B,$56,$51,$4C,$48,$44,$40,$00,$00,$00,$00 ;.byte $7A,$73,$6C,$66,$60,$5B,$56,$51,$4C,$48,$44,$40,$00,$00,$00,$00
;.byte $3D,$39,$36,$33,$30,$2D,$2B,$28,$26,$24,$22,$20,$00,$00,$00,$00 ;.byte $3D,$39,$36,$33,$30,$2D,$2B,$28,$26,$24,$22,$20,$00,$00,$00,$00
frequency_lookup_high = frequency_lookup_low+64

View File

@ -30,7 +30,7 @@ int note_to_ed(char note, int flat, int sharp, int octave) {
case 'A': offset=9; break; case 'A': offset=9; break;
case 'B': offset=11; break; case 'B': offset=11; break;
case 'R': offset=12; flat=0; sharp=0; octave=0; break; case 'R': offset=12; flat=0; sharp=0; octave=3; break;
default: default:
fprintf(stderr,"Unknown note %c\n",note); fprintf(stderr,"Unknown note %c\n",note);