tiny_tracker: push the ay values to the start of the program

This commit is contained in:
Vince Weaver 2022-01-19 11:37:07 -05:00
parent 087d22d390
commit 681189eff0
5 changed files with 56 additions and 20 deletions

View File

@ -12,10 +12,11 @@ submit: hgr_d2_1k.zip
#### ####
hgr_d2.dsk: HELLO D2 hgr_d2.dsk: HELLO D2 VIZ
cp $(EMPTY_DISK)/empty.dsk ./hgr_d2.dsk cp $(EMPTY_DISK)/empty.dsk ./hgr_d2.dsk
$(DOS33) -y hgr_d2.dsk SAVE A HELLO $(DOS33) -y hgr_d2.dsk SAVE A HELLO
$(DOS33) -y hgr_d2.dsk -t BIN -a 0x80 BSAVE D2 $(DOS33) -y hgr_d2.dsk -t BIN -a 0x80 BSAVE D2
$(DOS33) -y hgr_d2.dsk -t BIN -a 0xc00 BSAVE VIZ
#### ####
@ -48,6 +49,16 @@ d2.o: d2.s \
#### ####
VIZ: viz.o
ld65 -o VIZ viz.o -C $(LINKER_SCRIPTS)/apple2_c00.inc
viz.o: viz.s \
zp.inc hardware.inc
ca65 -o viz.o viz.s -l viz.lst
####
text_to_tiny: text_to_tiny.o text_to_tiny: text_to_tiny.o
$(CC) -o text_to_tiny text_to_tiny.o -lm $(CC) -o text_to_tiny text_to_tiny.o -lm
@ -57,4 +68,4 @@ text_to_tiny.o: text_to_tiny.c
#### ####
clean: clean:
rm -f *~ *.o *.lst D2 HELLO text_to_tiny mA2E_2.s rm -f *~ *.o *.lst D2 VIZ HELLO text_to_tiny mA2E_2.s

View File

@ -40,7 +40,15 @@
;.globalzp frequencies_high ;.globalzp frequencies_high
d2: music_split:
; we can execute these... (as qkumba noticed)
; it's SEC, ASL $0E0E
.byte $38,$e,$e,$e ; mixer, A, B, C volume
; want to start at AY_REGS+7
; this is also the start of AY_REGS ; this is also the start of AY_REGS
; we count on A/B/C being played first note ; we count on A/B/C being played first note
; so the code gets over-written ; so the code gets over-written
@ -50,18 +58,12 @@ d2:
jsr SETGR ; enable lo-res graphics jsr SETGR ; enable lo-res graphics
; A=$D0, Z=1 ; A=$D0, Z=1
bit FULLGR ; make graphcs full screen
ldx #$FF ; set stack offset ldx #$FF ; set stack offset
; bmi skip_const
txs ; write 0 to stack pointer txs ; write 0 to stack pointer
nop
; we can execute these... (as qkumba noticed)
; it's SEC, ASL $0E0E
.byte $38,$e,$e,$e ; mixer, A, B, C volume
;=================== ;===================
; music Player Setup ; music Player Setup
@ -82,6 +84,27 @@ game_loop:
; play a frame of music ; play a frame of music
.include "play_frame.s" .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 ; C channel low freq
sta $500,X ; 3
lda AY_REGS+0 ; 2 ; C channel low freq
sta $600,X ; 3
inc viz_smc+1 ; 2
; nop
; nop
.include "ay3_write_regs.s" .include "ay3_write_regs.s"
; X is in theory $ff when we get here ; X is in theory $ff when we get here
@ -106,10 +129,12 @@ inner_wait:
; pad so starts at $80 ; pad so starts at $80
; use this for visualization ; use this for visualization
.byte $00,$00,$00,$00 ;.byte $00,$00
.byte $00,$00,$00,$00,$00 ;.byte $00,$00
.byte $00,$00,$00 ;.byte $00,$00,$00,$00,$00
.byte $00,$00,$00,$00 ;.byte $00
;.byte $00,$00
;.byte $00,$00,$00,$00
; music ; music
.include "mA2E_2.s" .include "mA2E_2.s"

View File

@ -29,6 +29,7 @@ NORMAL = $F273
HGR2 = $F3D8 HGR2 = $F3D8
HCLR = $F3F2 HCLR = $F3F2
HPOSN = $F411 ; (Y,X),(A) (values stores in HGRX,XH,Y) HPOSN = $F411 ; (Y,X),(A) (values stores in HGRX,XH,Y)
COSTBL = $F5BA
XDRAW0 = $F65D XDRAW0 = $F65D

View File

@ -52,15 +52,14 @@ not_end:
lda frequencies_high,Y lda frequencies_high,Y
sta AY_REGS+1,X sta AY_REGS+1,X
; sta $500,X
lda frequencies_low,Y lda frequencies_low,Y
sta AY_REGS,X ; set proper register value sta AY_REGS,X ; set proper register value
; visualization ; visualization
blah_urgh: ;blah_urgh:
sta $400,Y ; sta $400,Y
inc blah_urgh+1 ; inc blah_urgh+1
;============================ ;============================

View File

@ -9,7 +9,7 @@ GBASH = $27
BASL = $28 BASL = $28
BASH = $29 BASH = $29
AY_REGS = $80 AY_REGS = $80-$7
HGR_Y = $E2 HGR_Y = $E2
HGR_COLOR = $E4 HGR_COLOR = $E4