tiny_tracker: work on visualization

This commit is contained in:
Vince Weaver 2022-01-21 15:35:53 -05:00
parent f3a6076def
commit 7cb21acf65
6 changed files with 167 additions and 28 deletions

View File

@ -42,7 +42,7 @@ D2: d2.o
d2.o: d2.s \
zp.inc hardware.inc \
mA2E_2.s \
mA2E_2.s visual.s \
mockingboard_init.s play_frame.s \
ay3_write_regs.s
ca65 -o d2.o d2.s -l d2.lst

View File

@ -39,7 +39,7 @@
.zeropage
;.globalzp frequencies_low
;.globalzp frequencies_high
.globalzp colors
music_split:
@ -86,29 +86,30 @@ game_loop:
.include "play_frame.s"
;=================
;=================
; visualization?
viz_smc:
ldx #$00 ; 2
lda AY_REGS+4 ; 2 ; C channel low freq
sta $400,X ; 3
lda AY_REGS+2 ; 2 ; B channel low freq
sta $500,X ; 3
lda AY_REGS+0 ; 2 ; A channel low freq
sta $600,X ; 3
inc viz_smc+1 ; 2
nop ; 1
nop ; 1
;==============
; 21 bytes for visualization
;=================
;=================
.include "visual.s"
;==================
;==================
; write music to AY registers
;==================
;==================
.include "ay3_write_regs.s"
;==================
;==================
; delay to ~20Hz
;==================
;==================
; X is in theory $ff when we get here
; delay 20Hz, or 1/20s = 50ms
@ -128,15 +129,10 @@ inner_wait:
beq game_loop
colors:
.byte 0,9,13,15
; pad so starts at $80
; use this for visualization
;.byte $00,$00
;.byte $00,$00
;.byte $00,$00,$00,$00,$00
;.byte $00
;.byte $00,$00
;.byte $00,$00,$00,$00
; this needs to start at $80
; music
.include "mA2E_2.s"

View File

@ -3,4 +3,4 @@
20 PRINT CHR$(4);"CATALOG"
25 PRINT:PRINT "AUTOMATICALLY STARTING"
30 PRINT "]BRUN D2"
40 PRINT CHR$(4);"BRUN D2"
40 REM PRINT CHR$(4);"BRUN D2"

View File

@ -57,6 +57,10 @@ not_end:
sta AY_REGS,X ; set proper register value
; visualization
star_smc:
sta $500 ; 3
;blah_urgh:
; sta $400,Y
; inc blah_urgh+1

View File

@ -0,0 +1,36 @@
;XX = $FE
;YY = $FC
visual:
; 4 ; colors
ldx #3 ; 2
comet_loop:
lda colors,X ; 2
comet_smc:
sta $403,X ; 3
dex ; 1
bpl comet_loop ; 2
inc comet_smc+1 ; 2
;==============
; 16
; nop
; nop
; nop
; nop
; nop
; lda AY_REGS+4 ; 2
;star_smc:
; sta $500 ; 3
inc star_smc+1 ; 2

103
demos/l/music_256/viz.s Normal file
View File

@ -0,0 +1,103 @@
; Need tiny demo
.include "hardware.inc"
;.zeropage
;.globalzp frequencies_low
;.globalzp frequencies_high
XX = $FE
YY = $FC
viz:
jsr SETGR ; enable lo-res graphics
; A=$D0, Z=1
bit FULLGR
maine:
; ldx XX ; 2
; lda #13 ; 2
; sta $402,X ; 3
; lda #9 ; 2
; sta $401,X ; 3
; lda #0 ; 2
; sta $400,X ; 3
; inc XX ; 2
;==============
; 19
; 4
ldx #3 ; 2
comet_loop:
lda colors,X ; 2
comet_smc:
sta $403,X ; 3
dex ; 1
bpl comet_loop ; 2
inc comet_smc+1 ; 2
;==============
; 16
lda star_smc+1
and #$f
tax
lda frequencies_high,X ; 3
; beq skip ; 2
star_smc:
sta $500 ; 3
skip:
inc star_smc+1 ; 2
inc XX ; 2
.if 0
ldx XX ; 2
txa
asl
and XX
tay
eor COSTBL,Y
blurgh:
sta $400,X ; 3
inc XX ; 2
bne skip
inc blurgh+2
skip:
.endif
.if 0
ldx XX ; 2
txa
asl
and XX
blurgh:
sta $400,X ; 3
inc XX ; 2
bne skip
inc blurgh+2
skip:
.endif
lda #140
jsr WAIT
jmp maine
colors:
.byte 0,9,13,15
frequencies_high:
.byte $02,$00,$01,$01,$00,$01,$01,$00,$00,$00,$03,$00,$01,$01,$03,$01